From fd5f18250e6da98c47f23f49b7c4663c9a8bf7d3 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Sep 2007 12:37:24 +0000 Subject: Adding new Resource compiler for lazarus projects.. (other one did not name resources correctly) this resource compiler could be expanded by someone to Parse Ultrastar.rc and compile the lrs file, rather than having it hardcoded in USDXResCompiler other changes, include ability to read the Resource String properly in code generated by lazarus. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@422 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/USDXResCompiler.lpi | 71 ++++++++++++++++++++++++++++++++++++++ Tools/USDXResCompiler.lpr | 88 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 Tools/USDXResCompiler.lpi create mode 100644 Tools/USDXResCompiler.lpr (limited to 'Tools') diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi new file mode 100644 index 00000000..b7c068be --- /dev/null +++ b/Tools/USDXResCompiler.lpi @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/USDXResCompiler.lpr b/Tools/USDXResCompiler.lpr new file mode 100644 index 00000000..b6d0ef7d --- /dev/null +++ b/Tools/USDXResCompiler.lpr @@ -0,0 +1,88 @@ +program USDXResCompiler; + +{$mode objfpc}{$H+} + +uses + Classes, + SysUtils, + LResources; + +var + lResourceFile : TMemoryStream; + +procedure AddFile( aResName, aResTye, aFile : string ); +var + lTmpStream : TmemoryStream; +begin + writeln(); + writeln( aFile ); + if not fileexists( aFile ) then + begin + writeln( 'NOT FOUND' ); + exit; + end; + + lTmpStream := TmemoryStream.create(); + try + lTmpStream.loadfromfile( aFile ); + lTmpStream.position := 0; + + BinaryToLazarusResourceCode(lTmpStream, lResourceFile, aResName, aResTye); + writeln( 'Added' ); + finally + freeandnil( lTmpStream ); + end; +end; + + +begin + + lResourceFile := TMemoryStream.create(); + try + AddFile( 'Font', 'PNG', '..\Fonts\Normal\eurostar_regular.png' ); + AddFile( 'Font', 'FNT', '.\Fonts\Normal\eurostar_regular.dat' ); + + AddFile( 'FontB', 'PNG', '..\Fonts\Bold\eurostar_regular_bold.png' ); + AddFile( 'FontB', 'FNT', '..\Fonts\Bold\eurostar_regular_bold.dat' ); + + AddFile( 'FontO', 'PNG', '..\Fonts\Outline 1\Outline 1.PNG' ); + AddFile( 'FontO', 'FNT', '..\Fonts\Outline 1\Outline 1.dat' ); + + AddFile( 'FontO2', 'PNG', '..\Fonts\Outline 2\Outline 2.PNG' ); + AddFile( 'FontO2', 'FNT', '..\Fonts\Outline 2\Outline 2.dat' ); + + AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); + + AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); + + AddFile( 'CRDTS_BG', 'PNG', '..\Graphics\credits_v5_bg.png' ); + AddFile( 'CRDTS_OVL', 'PNG', '..\Graphics\credits_v5_overlay.png"' ); + AddFile( 'CRDTS_blindguard', 'PNG', '..\Graphics\names_blindguard.png' ); + AddFile( 'CRDTS_blindy', 'PNG', '..\Graphics\names_blindy.png' ); + AddFile( 'CRDTS_canni', 'PNG', '..\Graphics\names_canni.png' ); + AddFile( 'CRDTS_commandio', 'PNG', '..\Graphics\names_commandio.png' ); + AddFile( 'CRDTS_lazyjoker', 'PNG', '..\Graphics\names_lazyjoker.png' ); + AddFile( 'CRDTS_mog', 'PNG', '..\Graphics\names_mog.png' ); + AddFile( 'CRDTS_mota', 'PNG', '..\Graphics\names_mota.png' ); + AddFile( 'CRDTS_skillmaste', 'PNG', '..\Graphics\names_skillmaster.png' ); + AddFile( 'CRDTS_whiteshark', 'PNG', '..\Graphics\names_whiteshark.png' ); + AddFile( 'INTRO_L01', 'PNG', '..\Graphics\intro-l-01.png' ); + AddFile( 'INTRO_L02', 'PNG', '..\Graphics\intro-l-02.png' ); + AddFile( 'INTRO_L03', 'PNG', '..\Graphics\intro-l-03.png' ); + AddFile( 'INTRO_L04', 'PNG', '..\Graphics\intro-l-04.png' ); + AddFile( 'INTRO_L05', 'PNG', '..\Graphics\intro-l-05.png' ); + AddFile( 'INTRO_L06', 'PNG', '..\Graphics\intro-l-06.png' ); + AddFile( 'INTRO_L07', 'PNG', '..\Graphics\intro-l-07.png' ); + AddFile( 'INTRO_L08', 'PNG', '..\Graphics\intro-l-08.png' ); + AddFile( 'INTRO_L09', 'PNG', '..\Graphics\intro-l-09.png' ); + AddFile( 'OUTRO_BG', 'PNG', '..\Graphics\outro-bg.png' ); + AddFile( 'OUTRO_ESC', 'PNG', '..\Graphics\outro-esc.png' ); + AddFile( 'OUTRO_EXD', 'PNG', '..\Graphics\outro-exit-dark.png' ); + + + finally + lResourceFile.SaveToFile( 'UltraStar.lrs' ); + freeandnil( lResourceFile ); + end; +end. + -- cgit v1.2.3 From cf1102dac69a569279ae05dd95426d9e1c544ffc Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sat, 22 Sep 2007 08:15:59 +0000 Subject: minor bug fixes to have lazarus build load resources into SDL_Image correctly... ( lazarus Resources are weak compared to delphi :( ) also Laz build will now run, and main loop works properly. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@429 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/USDXResCompiler.lpi | 53 ++++++++++++++++++++++++++++++++++++++++------- Tools/USDXResCompiler.lpr | 21 ++++++++----------- 2 files changed, 54 insertions(+), 20 deletions(-) (limited to 'Tools') diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi index b7c068be..bf6f0a54 100644 --- a/Tools/USDXResCompiler.lpi +++ b/Tools/USDXResCompiler.lpi @@ -7,7 +7,7 @@ - + @@ -31,23 +31,56 @@ - + - - + + - + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,11 +94,15 @@ - + + + + + diff --git a/Tools/USDXResCompiler.lpr b/Tools/USDXResCompiler.lpr index b6d0ef7d..5acdd8d9 100644 --- a/Tools/USDXResCompiler.lpr +++ b/Tools/USDXResCompiler.lpr @@ -10,15 +10,13 @@ uses var lResourceFile : TMemoryStream; -procedure AddFile( aResName, aResTye, aFile : string ); +procedure AddFile( aResName, aResType, aFile : string ); var lTmpStream : TmemoryStream; begin - writeln(); - writeln( aFile ); if not fileexists( aFile ) then begin - writeln( 'NOT FOUND' ); + writeln( 'SKIPED' + ' ( '+aFile+' ) File not found' ); exit; end; @@ -27,8 +25,8 @@ begin lTmpStream.loadfromfile( aFile ); lTmpStream.position := 0; - BinaryToLazarusResourceCode(lTmpStream, lResourceFile, aResName, aResTye); - writeln( 'Added' ); + BinaryToLazarusResourceCode(lTmpStream, lResourceFile, aResName, aResType); + writeln( 'ADDED - ' + aResType + ' : ' + aResName + ' ( '+aFile+' )' ); finally freeandnil( lTmpStream ); end; @@ -39,21 +37,20 @@ begin lResourceFile := TMemoryStream.create(); try - AddFile( 'Font', 'PNG', '..\Fonts\Normal\eurostar_regular.png' ); - AddFile( 'Font', 'FNT', '.\Fonts\Normal\eurostar_regular.dat' ); + AddFile( 'Font', 'TEX', '..\Fonts\Normal\eurostar_regular.png' ); + AddFile( 'Font', 'FNT', '..\Fonts\Normal\eurostar_regular.dat' ); - AddFile( 'FontB', 'PNG', '..\Fonts\Bold\eurostar_regular_bold.png' ); + AddFile( 'FontB', 'TEX', '..\Fonts\Bold\eurostar_regular_bold.png' ); AddFile( 'FontB', 'FNT', '..\Fonts\Bold\eurostar_regular_bold.dat' ); - AddFile( 'FontO', 'PNG', '..\Fonts\Outline 1\Outline 1.PNG' ); + AddFile( 'FontO', 'TEX', '..\Fonts\Outline 1\Outline 1.PNG' ); AddFile( 'FontO', 'FNT', '..\Fonts\Outline 1\Outline 1.dat' ); - AddFile( 'FontO2', 'PNG', '..\Fonts\Outline 2\Outline 2.PNG' ); + AddFile( 'FontO2', 'TEX', '..\Fonts\Outline 2\Outline 2.PNG' ); AddFile( 'FontO2', 'FNT', '..\Fonts\Outline 2\Outline 2.dat' ); AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); - AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); AddFile( 'CRDTS_BG', 'PNG', '..\Graphics\credits_v5_bg.png' ); AddFile( 'CRDTS_OVL', 'PNG', '..\Graphics\credits_v5_overlay.png"' ); -- cgit v1.2.3 From 82621bfeb1ccbda7425b5d11b8315a9cb91509c2 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sun, 30 Sep 2007 04:54:03 +0000 Subject: fixed credits screen in lazarus build. ( now looks and operates the same as delphi build ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@450 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/USDXResCompiler.lpi | 37 ++++--------------------------------- Tools/USDXResCompiler.lpr | 46 +++++++++++++++++++++++----------------------- 2 files changed, 27 insertions(+), 56 deletions(-) (limited to 'Tools') diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi index bf6f0a54..942073ad 100644 --- a/Tools/USDXResCompiler.lpi +++ b/Tools/USDXResCompiler.lpi @@ -7,7 +7,7 @@ - + @@ -36,8 +36,8 @@ - - + + @@ -52,36 +52,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/Tools/USDXResCompiler.lpr b/Tools/USDXResCompiler.lpr index 5acdd8d9..38f4a1e5 100644 --- a/Tools/USDXResCompiler.lpr +++ b/Tools/USDXResCompiler.lpr @@ -52,29 +52,29 @@ begin AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); - AddFile( 'CRDTS_BG', 'PNG', '..\Graphics\credits_v5_bg.png' ); - AddFile( 'CRDTS_OVL', 'PNG', '..\Graphics\credits_v5_overlay.png"' ); - AddFile( 'CRDTS_blindguard', 'PNG', '..\Graphics\names_blindguard.png' ); - AddFile( 'CRDTS_blindy', 'PNG', '..\Graphics\names_blindy.png' ); - AddFile( 'CRDTS_canni', 'PNG', '..\Graphics\names_canni.png' ); - AddFile( 'CRDTS_commandio', 'PNG', '..\Graphics\names_commandio.png' ); - AddFile( 'CRDTS_lazyjoker', 'PNG', '..\Graphics\names_lazyjoker.png' ); - AddFile( 'CRDTS_mog', 'PNG', '..\Graphics\names_mog.png' ); - AddFile( 'CRDTS_mota', 'PNG', '..\Graphics\names_mota.png' ); - AddFile( 'CRDTS_skillmaste', 'PNG', '..\Graphics\names_skillmaster.png' ); - AddFile( 'CRDTS_whiteshark', 'PNG', '..\Graphics\names_whiteshark.png' ); - AddFile( 'INTRO_L01', 'PNG', '..\Graphics\intro-l-01.png' ); - AddFile( 'INTRO_L02', 'PNG', '..\Graphics\intro-l-02.png' ); - AddFile( 'INTRO_L03', 'PNG', '..\Graphics\intro-l-03.png' ); - AddFile( 'INTRO_L04', 'PNG', '..\Graphics\intro-l-04.png' ); - AddFile( 'INTRO_L05', 'PNG', '..\Graphics\intro-l-05.png' ); - AddFile( 'INTRO_L06', 'PNG', '..\Graphics\intro-l-06.png' ); - AddFile( 'INTRO_L07', 'PNG', '..\Graphics\intro-l-07.png' ); - AddFile( 'INTRO_L08', 'PNG', '..\Graphics\intro-l-08.png' ); - AddFile( 'INTRO_L09', 'PNG', '..\Graphics\intro-l-09.png' ); - AddFile( 'OUTRO_BG', 'PNG', '..\Graphics\outro-bg.png' ); - AddFile( 'OUTRO_ESC', 'PNG', '..\Graphics\outro-esc.png' ); - AddFile( 'OUTRO_EXD', 'PNG', '..\Graphics\outro-exit-dark.png' ); + AddFile( 'CRDTS_BG', 'TEX', '..\Graphics\credits_v5_bg.png' ); + AddFile( 'CRDTS_OVL', 'TEX', '..\Graphics\credits_v5_overlay.png' ); + AddFile( 'CRDTS_blindguard', 'TEX', '..\Graphics\names_blindguard.png' ); + AddFile( 'CRDTS_blindy', 'TEX', '..\Graphics\names_blindy.png' ); + AddFile( 'CRDTS_canni', 'TEX', '..\Graphics\names_canni.png' ); + AddFile( 'CRDTS_commandio', 'TEX', '..\Graphics\names_commandio.png' ); + AddFile( 'CRDTS_lazyjoker', 'TEX', '..\Graphics\names_lazyjoker.png' ); + AddFile( 'CRDTS_mog', 'TEX', '..\Graphics\names_mog.png' ); + AddFile( 'CRDTS_mota', 'TEX', '..\Graphics\names_mota.png' ); + AddFile( 'CRDTS_skillmaste', 'TEX', '..\Graphics\names_skillmaster.png' ); + AddFile( 'CRDTS_whiteshark', 'TEX', '..\Graphics\names_whiteshark.png' ); + AddFile( 'INTRO_L01', 'TEX', '..\Graphics\intro-l-01.png' ); + AddFile( 'INTRO_L02', 'TEX', '..\Graphics\intro-l-02.png' ); + AddFile( 'INTRO_L03', 'TEX', '..\Graphics\intro-l-03.png' ); + AddFile( 'INTRO_L04', 'TEX', '..\Graphics\intro-l-04.png' ); + AddFile( 'INTRO_L05', 'TEX', '..\Graphics\intro-l-05.png' ); + AddFile( 'INTRO_L06', 'TEX', '..\Graphics\intro-l-06.png' ); + AddFile( 'INTRO_L07', 'TEX', '..\Graphics\intro-l-07.png' ); + AddFile( 'INTRO_L08', 'TEX', '..\Graphics\intro-l-08.png' ); + AddFile( 'INTRO_L09', 'TEX', '..\Graphics\intro-l-09.png' ); + 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 -- cgit v1.2.3 From 1df4ec21cdf891aa4302b2fda620069d8d765a70 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sun, 30 Sep 2007 06:35:59 +0000 Subject: 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 --- Tools/USDXResCompiler.lpi | 53 ++++++++++++++++++++++++++++++--- Tools/USDXResCompiler.lpr | 76 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 123 insertions(+), 6 deletions(-) (limited to 'Tools') 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 @@ - - + + - + @@ -52,7 +52,52 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. -- cgit v1.2.3 From bcf55203a81aef383d0a7123996e872fa3a297dc Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 2 Oct 2007 04:37:08 +0000 Subject: Fixed resource compiler to work fine with linux paths. :) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@459 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/USDXResCompiler.lpi | 200 +++++++++++------------------ Tools/USDXResCompiler.lpr | 316 +++++++++++++++++++++++----------------------- 2 files changed, 235 insertions(+), 281 deletions(-) (limited to 'Tools') diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi index ef82c2c4..c48a0e88 100644 --- a/Tools/USDXResCompiler.lpi +++ b/Tools/USDXResCompiler.lpi @@ -1,124 +1,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/USDXResCompiler.lpr b/Tools/USDXResCompiler.lpr index 6fc98efc..8e6e7921 100644 --- a/Tools/USDXResCompiler.lpr +++ b/Tools/USDXResCompiler.lpr @@ -1,157 +1,159 @@ -program USDXResCompiler; - -{$mode objfpc}{$H+} - -uses - Classes, - SysUtils, - LResources; - -var - lResourceFile : TMemoryStream; - -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' ); - exit; - end; - - lTmpStream := TmemoryStream.create(); - try - lTmpStream.loadfromfile( aFile ); - lTmpStream.position := 0; - - BinaryToLazarusResourceCode(lTmpStream, lResourceFile, aResName, aResType); - writeln( 'ADDED - ' + aResType + ' : ' + aResName + ' ( '+aFile+' )' ); - finally - 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' ); - - AddFile( 'FontB', 'TEX', '..\Fonts\Bold\eurostar_regular_bold.png' ); - AddFile( 'FontB', 'FNT', '..\Fonts\Bold\eurostar_regular_bold.dat' ); - - AddFile( 'FontO', 'TEX', '..\Fonts\Outline 1\Outline 1.PNG' ); - AddFile( 'FontO', 'FNT', '..\Fonts\Outline 1\Outline 1.dat' ); - - AddFile( 'FontO2', 'TEX', '..\Fonts\Outline 2\Outline 2.PNG' ); - AddFile( 'FontO2', 'FNT', '..\Fonts\Outline 2\Outline 2.dat' ); - - AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); - - - AddFile( 'CRDTS_BG', 'TEX', '..\Graphics\credits_v5_bg.png' ); - AddFile( 'CRDTS_OVL', 'TEX', '..\Graphics\credits_v5_overlay.png' ); - AddFile( 'CRDTS_blindguard', 'TEX', '..\Graphics\names_blindguard.png' ); - AddFile( 'CRDTS_blindy', 'TEX', '..\Graphics\names_blindy.png' ); - AddFile( 'CRDTS_canni', 'TEX', '..\Graphics\names_canni.png' ); - AddFile( 'CRDTS_commandio', 'TEX', '..\Graphics\names_commandio.png' ); - AddFile( 'CRDTS_lazyjoker', 'TEX', '..\Graphics\names_lazyjoker.png' ); - AddFile( 'CRDTS_mog', 'TEX', '..\Graphics\names_mog.png' ); - AddFile( 'CRDTS_mota', 'TEX', '..\Graphics\names_mota.png' ); - AddFile( 'CRDTS_skillmaste', 'TEX', '..\Graphics\names_skillmaster.png' ); - AddFile( 'CRDTS_whiteshark', 'TEX', '..\Graphics\names_whiteshark.png' ); - AddFile( 'INTRO_L01', 'TEX', '..\Graphics\intro-l-01.png' ); - AddFile( 'INTRO_L02', 'TEX', '..\Graphics\intro-l-02.png' ); - AddFile( 'INTRO_L03', 'TEX', '..\Graphics\intro-l-03.png' ); - AddFile( 'INTRO_L04', 'TEX', '..\Graphics\intro-l-04.png' ); - AddFile( 'INTRO_L05', 'TEX', '..\Graphics\intro-l-05.png' ); - AddFile( 'INTRO_L06', 'TEX', '..\Graphics\intro-l-06.png' ); - AddFile( 'INTRO_L07', 'TEX', '..\Graphics\intro-l-07.png' ); - AddFile( 'INTRO_L08', 'TEX', '..\Graphics\intro-l-08.png' ); - AddFile( 'INTRO_L09', 'TEX', '..\Graphics\intro-l-09.png' ); - 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. - +program USDXResCompiler; + +{$mode objfpc}{$H+} + +uses + Classes, + SysUtils, + LResources; + +var + lResourceFile : TMemoryStream; + +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' ); + exit; + end; + + lTmpStream := TmemoryStream.create(); + try + lTmpStream.loadfromfile( aFile ); + lTmpStream.position := 0; + + BinaryToLazarusResourceCode(lTmpStream, lResourceFile, aResName, aResType); + writeln( 'ADDED - ' + aResType + ' : ' + aResName + ' ( '+aFile+' )' ); + finally + 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 ) ); + + lFile := StringReplace( lFile, '\', PathDelim ,[rfReplaceAll] ); + +(* + 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' ); + + AddFile( 'FontB', 'TEX', '..\Fonts\Bold\eurostar_regular_bold.png' ); + AddFile( 'FontB', 'FNT', '..\Fonts\Bold\eurostar_regular_bold.dat' ); + + AddFile( 'FontO', 'TEX', '..\Fonts\Outline 1\Outline 1.PNG' ); + AddFile( 'FontO', 'FNT', '..\Fonts\Outline 1\Outline 1.dat' ); + + AddFile( 'FontO2', 'TEX', '..\Fonts\Outline 2\Outline 2.PNG' ); + AddFile( 'FontO2', 'FNT', '..\Fonts\Outline 2\Outline 2.dat' ); + + AddFile( 'MAINICON', 'ICON', '..\Graphics\ustar-icon_v01.ico' ); + + + AddFile( 'CRDTS_BG', 'TEX', '..\Graphics\credits_v5_bg.png' ); + AddFile( 'CRDTS_OVL', 'TEX', '..\Graphics\credits_v5_overlay.png' ); + AddFile( 'CRDTS_blindguard', 'TEX', '..\Graphics\names_blindguard.png' ); + AddFile( 'CRDTS_blindy', 'TEX', '..\Graphics\names_blindy.png' ); + AddFile( 'CRDTS_canni', 'TEX', '..\Graphics\names_canni.png' ); + AddFile( 'CRDTS_commandio', 'TEX', '..\Graphics\names_commandio.png' ); + AddFile( 'CRDTS_lazyjoker', 'TEX', '..\Graphics\names_lazyjoker.png' ); + AddFile( 'CRDTS_mog', 'TEX', '..\Graphics\names_mog.png' ); + AddFile( 'CRDTS_mota', 'TEX', '..\Graphics\names_mota.png' ); + AddFile( 'CRDTS_skillmaste', 'TEX', '..\Graphics\names_skillmaster.png' ); + AddFile( 'CRDTS_whiteshark', 'TEX', '..\Graphics\names_whiteshark.png' ); + AddFile( 'INTRO_L01', 'TEX', '..\Graphics\intro-l-01.png' ); + AddFile( 'INTRO_L02', 'TEX', '..\Graphics\intro-l-02.png' ); + AddFile( 'INTRO_L03', 'TEX', '..\Graphics\intro-l-03.png' ); + AddFile( 'INTRO_L04', 'TEX', '..\Graphics\intro-l-04.png' ); + AddFile( 'INTRO_L05', 'TEX', '..\Graphics\intro-l-05.png' ); + AddFile( 'INTRO_L06', 'TEX', '..\Graphics\intro-l-06.png' ); + AddFile( 'INTRO_L07', 'TEX', '..\Graphics\intro-l-07.png' ); + AddFile( 'INTRO_L08', 'TEX', '..\Graphics\intro-l-08.png' ); + AddFile( 'INTRO_L09', 'TEX', '..\Graphics\intro-l-09.png' ); + 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. + -- cgit v1.2.3 From 892b8dc2c37cf416827974dc8e4e4e3e6554ac3f Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 24 Oct 2007 11:43:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@523 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/linux-build.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 Tools/linux-build.sh (limited to 'Tools') diff --git a/Tools/linux-build.sh b/Tools/linux-build.sh new file mode 100755 index 00000000..fd1b28b6 --- /dev/null +++ b/Tools/linux-build.sh @@ -0,0 +1,3 @@ +clear +fpc -S2cgi -OG1 -gl -vewnhi -l -Filib/JEDI-SDLv1.0/SDL/Pas/ -Fu/usr/lib/lazarus/components/images/lib/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/ -Fu/usr/lib/lazarus/lcl/units/i386-linux/gtk2/ -Fu/usr/lib/lazarus/packager/units/i386-linux/ -Fu. -dLCL -dLCLgtk2 USDXResCompiler.lpr + -- cgit v1.2.3 From 85313ec4dcc1591dbf1ecf6fa76294080354ed2a Mon Sep 17 00:00:00 2001 From: jaybinks Date: Sat, 3 Nov 2007 03:13:44 +0000 Subject: another attempt.. ( me to lazy to boot my linux dev box .. ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@562 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Tools/USDXResCompiler.lpi | 154 +++++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 76 deletions(-) (limited to 'Tools') diff --git a/Tools/USDXResCompiler.lpi b/Tools/USDXResCompiler.lpi index c48a0e88..cf94486e 100644 --- a/Tools/USDXResCompiler.lpi +++ b/Tools/USDXResCompiler.lpi @@ -1,76 +1,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3