diff options
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/USDXResCompiler.lpi | 53 | ||||
-rw-r--r-- | Tools/USDXResCompiler.lpr | 76 |
2 files changed, 123 insertions, 6 deletions
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.
|