aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/USDXResCompiler.lpr
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 /Tools/USDXResCompiler.lpr
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
Diffstat (limited to '')
-rw-r--r--Tools/USDXResCompiler.lpr76
1 files changed, 74 insertions, 2 deletions
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.