aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-30 06:35:59 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-30 06:35:59 +0000
commit1df4ec21cdf891aa4302b2fda620069d8d765a70 (patch)
tree785c5098d4bd7f02cdf8a85dcf1b0899394587bc
parentfac1634f48835f46249ec25d2758c81addd09d52 (diff)
downloadusdx-1df4ec21cdf891aa4302b2fda620069d8d765a70.tar.gz
usdx-1df4ec21cdf891aa4302b2fda620069d8d765a70.tar.xz
usdx-1df4ec21cdf891aa4302b2fda620069d8d765a70.zip
updated USDX-Lazaurs Resource compiler..
it now reads the Ultrastar.rc file and builds based on that. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@452 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Game/Code/USDXResCompiler.exebin0 -> 401920 bytes
-rw-r--r--Tools/USDXResCompiler.lpi53
-rw-r--r--Tools/USDXResCompiler.lpr76
3 files changed, 123 insertions, 6 deletions
diff --git a/Game/Code/USDXResCompiler.exe b/Game/Code/USDXResCompiler.exe
new file mode 100644
index 00000000..6b0137be
--- /dev/null
+++ b/Game/Code/USDXResCompiler.exe
Binary files differ
diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi
index 942073ad..ef82c2c4 100644
--- a/Tools/USDXResCompiler.lpi
+++ b/Tools/USDXResCompiler.lpi
@@ -36,10 +36,10 @@
<Filename Value="USDXResCompiler.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="USDXResCompiler"/>
- <CursorPos X="1" Y="56"/>
- <TopLine Value="45"/>
+ <CursorPos X="78" Y="36"/>
+ <TopLine Value="2"/>
<EditorIndex Value="0"/>
- <UsageCount Value="23"/>
+ <UsageCount Value="24"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@@ -52,7 +52,52 @@
<Loaded Value="True"/>
</Unit1>
</Units>
- <JumpHistory Count="0" HistoryIndex="-1"/>
+ <JumpHistory Count="11" HistoryIndex="10">
+ <Position1>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="39" Column="10" TopLine="15"/>
+ </Position1>
+ <Position2>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="86" Column="27" TopLine="47"/>
+ </Position2>
+ <Position3>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="47" Column="37" TopLine="20"/>
+ </Position3>
+ <Position4>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="43" Column="39" TopLine="23"/>
+ </Position4>
+ <Position5>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="45" Column="39" TopLine="25"/>
+ </Position5>
+ <Position6>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="47" Column="20" TopLine="30"/>
+ </Position6>
+ <Position7>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="35" Column="28" TopLine="11"/>
+ </Position7>
+ <Position8>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="47" Column="19" TopLine="27"/>
+ </Position8>
+ <Position9>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="37" Column="26" TopLine="7"/>
+ </Position9>
+ <Position10>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="63" Column="17" TopLine="29"/>
+ </Position10>
+ <Position11>
+ <Filename Value="USDXResCompiler.lpr"/>
+ <Caret Line="66" Column="29" TopLine="34"/>
+ </Position11>
+ </JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
diff --git a/Tools/USDXResCompiler.lpr b/Tools/USDXResCompiler.lpr
index 38f4a1e5..6fc98efc 100644
--- a/Tools/USDXResCompiler.lpr
+++ b/Tools/USDXResCompiler.lpr
@@ -14,6 +14,11 @@ procedure AddFile( aResName, aResType, aFile : string );
var
lTmpStream : TmemoryStream;
begin
+ if aFile[1] = '"' then
+ begin
+ aFile := copy( aFile, 2, length( aFile ) - 2 );
+ end;
+
if not fileexists( aFile ) then
begin
writeln( 'SKIPED' + ' ( '+aFile+' ) File not found' );
@@ -31,12 +36,77 @@ begin
freeandnil( lTmpStream );
end;
end;
+
+procedure addresourceline( aRCLine : String );
+var
+ lName : String;
+ lType : String;
+ lFile : String;
+ lTmp ,
+ lTmp2 : Integer;
+begin
+ if trim( aRCLine ) = '' then
+ exit;
+
+ if aRCLine[1] = '#' then
+ exit;
+
+ if ( aRCLine[1] = '/' ) AND
+ ( aRCLine[2] = '/' ) THEN
+ exit;
+
+ // find 2nd column... and put it in lTmp
+ lTmp := pos( ' ', aRcLine );
+ lTmp2 := pos( #9, aRcLine );
+ if lTmp2 < lTmp then
+ lTmp := lTmp2;
-
+ // Name = Start to lTmp
+ lName := trim( copy( aRcLine, 1, lTmp ) );
+
+ // Type = lTmp to first "
+ lTmp2 := pos( '"', aRcLine );
+ lType := trim( copy( aRcLine, lTmp, lTmp2-lTmp ) );
+
+ // File = " to end of line
+ lFile := trim( copy( aRcLine, lTmp2, maxint ) );
+
+(*
+ writeln( aRcLine );
+ writeln( lName );
+ writeln( lType );
+ writeln( lFile );
+ writeln( '' );
+*)
+ AddFile( lName , lType , lFile );
+
+end;
+
+
+var
+ lRCFile : TStringList;
+ iCount : Integer;
begin
+ if not fileexists( paramstr(1) ) then
+ begin
+ writeln( 'MUST Specify Delphi format RC File' );
+ exit;
+ end;
+ lRCFile := TStringList.create();
lResourceFile := TMemoryStream.create();
try
+ lRCFile.loadfromfile( paramstr(1) );
+
+ if trim( lRCFile.text ) = '' then
+ exit;
+
+ for iCount := 0 to lRCFile.count -1 do
+ begin
+ addresourceline( lRCFile[ iCount ] );
+ end;
+
+(*
AddFile( 'Font', 'TEX', '..\Fonts\Normal\eurostar_regular.png' );
AddFile( 'Font', 'FNT', '..\Fonts\Normal\eurostar_regular.dat' );
@@ -75,11 +145,13 @@ begin
AddFile( 'OUTRO_BG', 'TEX', '..\Graphics\outro-bg.png' );
AddFile( 'OUTRO_ESC', 'TEX', '..\Graphics\outro-esc.png' );
AddFile( 'OUTRO_EXD', 'TEX', '..\Graphics\outro-exit-dark.png' );
-
+*)
finally
lResourceFile.SaveToFile( 'UltraStar.lrs' );
freeandnil( lResourceFile );
+
+ freeandnil( lRCFile );
end;
end.