aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Game/Code/Classes/TextGL.pas51
-rw-r--r--Game/Code/Classes/UFiles.pas2
-rw-r--r--Game/Code/Classes/UTexture.pas5
-rw-r--r--Game/Code/Menu/UDisplay.pas2
-rw-r--r--Game/Code/UltraStar.lpi188
-rw-r--r--Game/Code/UltraStar.lpr7
6 files changed, 191 insertions, 64 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas
index aa5fa18b..12a9a8dc 100644
--- a/Game/Code/Classes/TextGL.pas
+++ b/Game/Code/Classes/TextGL.pas
@@ -59,13 +59,31 @@ var
implementation
-uses UMain, Windows, SysUtils, UGraphic;
+uses UMain,
+ Windows,
+ SysUtils,
+ {$IFDEF FPC}
+ LResources,
+ {$ENDIF}
+ UGraphic;
procedure BuildFont; // Build Our Bitmap Font
+
+ procedure loadfont( aID : integer; aType, aResourceName : String);
+ var
+ Rejestr: TResourceStream;
+ begin
+ Rejestr := TResourceStream.Create(HInstance, aResourceName , pchar( aType ) );
+ try
+ Rejestr.Read(Fonts[ aID ].Width, 256);
+ finally
+ Rejestr.Free;
+ end;
+ end;
+
var
font: HFONT; // Windows Font ID
h_dc: hdc;
- Rejestr: TResourceStream;
Pet: integer;
begin
ActFont := 0;
@@ -102,21 +120,21 @@ begin
Fonts[4].Outline := 5;}
- Rejestr := TResourceStream.Create(HInstance, 'Font', 'FNT');
- Rejestr.Read(Fonts[0].Width, 256);
- Rejestr.Free;
- Rejestr := TResourceStream.Create(HInstance, 'FontB', 'FNT');
- Rejestr.Read(Fonts[1].Width, 256);
- Rejestr.Free;
+ {$IFDEF FPC}
+ loadfont( 0, 'DAT', 'eurostar_regular' );
+ loadfont( 1, 'DAT', 'eurostar_regular_bold' );
+ loadfont( 2, 'DAT', 'Outline 1' );
+ loadfont( 3, 'DAT', 'Outline 2' );
+ {$ELSE}
+ loadfont( 0, 'FNT', 'Font' );
+ loadfont( 1, 'FNT', 'FontB' );
+ loadfont( 2, 'FNT', 'Font0' );
+ loadfont( 3, 'FNT', 'FontO2' );
+ {$ENDIF}
+
- Rejestr := TResourceStream.Create(HInstance, 'FontO', 'FNT');
- Rejestr.Read(Fonts[2].Width, 256);
- Rejestr.Free;
- Rejestr := TResourceStream.Create(HInstance, 'FontO2', 'FNT');
- Rejestr.Read(Fonts[3].Width, 256);
- Rejestr.Free;
{ Rejestr := TResourceStream.Create(HInstance, 'FontO', 'FNT');
Rejestr.Read(Fonts[4].Width, 256);
@@ -351,4 +369,9 @@ begin
Fonts[ActFont].AspectW := Aspect;
end;
+initialization
+ {$I UltraStar.lrs}
+
end.
+
+
diff --git a/Game/Code/Classes/UFiles.pas b/Game/Code/Classes/UFiles.pas
index bbb22136..34342e26 100644
--- a/Game/Code/Classes/UFiles.pas
+++ b/Game/Code/Classes/UFiles.pas
@@ -113,7 +113,7 @@ begin
//Required Information
Song.Mp3 := '';
{$IFDEF FPC}
- Song.BPM := NULL;
+ setlength( Song.BPM, 0 );
{$ELSE}
Song.BPM := 0;
{$ENDIF}
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas
index 4eb00b4b..c1862828 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -21,11 +21,10 @@ uses OpenGL12,
Math,
Classes,
SysUtils,
- Graphics,
-
{$IFDEF FPC}
- lazjpeg,
+ ulazjpeg,
{$ELSE}
+ Graphics,
JPEG,
PNGImage,
{$ENDIF}
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 160e8a73..ed65d62d 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -62,7 +62,7 @@ implementation
uses
{$IFDEF FPC}
- lazjpeg,
+ ulazjpeg,
{$ELSE}
JPEG,
{$ENDIF}
diff --git a/Game/Code/UltraStar.lpi b/Game/Code/UltraStar.lpi
index 95603bb6..77bd613c 100644
--- a/Game/Code/UltraStar.lpi
+++ b/Game/Code/UltraStar.lpi
@@ -31,14 +31,19 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
- <Units Count="50">
+ <RequiredPackages Count="1">
+ <Item1>
+ <PackageName Value="ImagesForLazarus"/>
+ </Item1>
+ </RequiredPackages>
+ <Units Count="52">
<Unit0>
<Filename Value="UltraStar.lpr"/>
<IsPartOfProject Value="True"/>
- <CursorPos X="27" Y="68"/>
- <TopLine Value="55"/>
+ <CursorPos X="23" Y="84"/>
+ <TopLine Value="64"/>
<EditorIndex Value="0"/>
- <UsageCount Value="68"/>
+ <UsageCount Value="70"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@@ -51,13 +56,10 @@
<Unit2>
<Filename Value="Classes\UTexture.pas"/>
<UnitName Value="UTexture"/>
- <CursorPos X="1" Y="27"/>
- <TopLine Value="7"/>
- <EditorIndex Value="2"/>
- <UsageCount Value="11"/>
- <Bookmarks Count="1">
- <Item0 X="29" Y="203" ID="1"/>
- </Bookmarks>
+ <CursorPos X="1" Y="28"/>
+ <TopLine Value="4"/>
+ <EditorIndex Value="6"/>
+ <UsageCount Value="12"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
@@ -84,9 +86,11 @@
<Unit6>
<Filename Value="Classes\UFiles.pas"/>
<UnitName Value="UFiles"/>
- <CursorPos X="1" Y="512"/>
- <TopLine Value="492"/>
+ <CursorPos X="8" Y="132"/>
+ <TopLine Value="96"/>
+ <EditorIndex Value="3"/>
<UsageCount Value="11"/>
+ <Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="Classes\USongs.pas"/>
@@ -134,7 +138,7 @@
<UnitName Value="UMusic"/>
<CursorPos X="46" Y="219"/>
<TopLine Value="198"/>
- <UsageCount Value="11"/>
+ <UsageCount Value="10"/>
</Unit13>
<Unit14>
<Filename Value="Classes\ULyrics.pas"/>
@@ -181,9 +185,11 @@
<Unit20>
<Filename Value="Menu\UDisplay.pas"/>
<UnitName Value="UDisplay"/>
- <CursorPos X="29" Y="410"/>
- <TopLine Value="390"/>
+ <CursorPos X="7" Y="65"/>
+ <TopLine Value="45"/>
+ <EditorIndex Value="5"/>
<UsageCount Value="11"/>
+ <Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="Classes\ULight.pas"/>
@@ -265,9 +271,7 @@
<Filename Value="lib\JEDI-SDLv1.0\SDL\Pas\jedi-sdl.inc"/>
<CursorPos X="4" Y="237"/>
<TopLine Value="217"/>
- <EditorIndex Value="3"/>
<UsageCount Value="11"/>
- <Loaded Value="True"/>
</Unit32>
<Unit33>
<Filename Value="..\..\Modis\SDK\ModiSDK.pas"/>
@@ -384,50 +388,154 @@
<Unit49>
<Filename Value="Classes\Ulazjpeg.pas"/>
<UnitName Value="Ulazjpeg"/>
- <CursorPos X="14" Y="17"/>
- <TopLine Value="1"/>
+ <CursorPos X="31" Y="24"/>
+ <TopLine Value="4"/>
+ <EditorIndex Value="4"/>
+ <UsageCount Value="11"/>
+ <Loaded Value="True"/>
+ </Unit49>
+ <Unit50>
+ <Filename Value="Classes\TextGL.pas"/>
+ <UnitName Value="TextGL"/>
+ <CursorPos X="80" Y="76"/>
+ <TopLine Value="56"/>
<EditorIndex Value="1"/>
+ <UsageCount Value="11"/>
+ <Bookmarks Count="1">
+ <Item0 X="1" Y="122" ID="1"/>
+ </Bookmarks>
+ <Loaded Value="True"/>
+ </Unit50>
+ <Unit51>
+ <Filename Value="UltraStar.lrs"/>
+ <CursorPos X="17" Y="1"/>
+ <TopLine Value="1"/>
+ <EditorIndex Value="2"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
- </Unit49>
+ </Unit51>
</Units>
- <JumpHistory Count="9" HistoryIndex="8">
+ <JumpHistory Count="30" HistoryIndex="29">
<Position1>
- <Filename Value="lib\JEDI-SDLv1.0\SDL\Pas\jedi-sdl.inc"/>
- <Caret Line="237" Column="4" TopLine="217"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="17" Column="1" TopLine="1"/>
+ <Filename Value="Classes\UFiles.pas"/>
+ <Caret Line="512" Column="1" TopLine="492"/>
</Position2>
<Position3>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="874" Column="52" TopLine="870"/>
+ <Filename Value="Classes\UFiles.pas"/>
+ <Caret Line="116" Column="19" TopLine="96"/>
</Position3>
<Position4>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="1" Column="1" TopLine="1"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="95" Column="24" TopLine="75"/>
</Position4>
<Position5>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="27" Column="11" TopLine="7"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
</Position5>
<Position6>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="25" Column="10" TopLine="7"/>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="14" Column="29" TopLine="1"/>
</Position6>
<Position7>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="27" Column="11" TopLine="5"/>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="104" Column="30" TopLine="85"/>
</Position7>
<Position8>
- <Filename Value="Classes\Ulazjpeg.pas"/>
- <Caret Line="24" Column="78" TopLine="1"/>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="303" Column="51" TopLine="283"/>
</Position8>
<Position9>
- <Filename Value="Classes\Ulazjpeg.pas"/>
- <Caret Line="126" Column="3" TopLine="87"/>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="133" Column="25" TopLine="105"/>
</Position9>
+ <Position10>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="376" Column="1" TopLine="141"/>
+ </Position10>
+ <Position11>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position11>
+ <Position12>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="362" Column="33" TopLine="339"/>
+ </Position12>
+ <Position13>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position13>
+ <Position14>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="68" Column="30" TopLine="47"/>
+ </Position14>
+ <Position15>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position15>
+ <Position16>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="68" Column="30" TopLine="48"/>
+ </Position16>
+ <Position17>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="70" Column="31" TopLine="50"/>
+ </Position17>
+ <Position18>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="78" Column="28" TopLine="58"/>
+ </Position18>
+ <Position19>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="116" Column="29" TopLine="96"/>
+ </Position19>
+ <Position20>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="120" Column="29" TopLine="100"/>
+ </Position20>
+ <Position21>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="124" Column="29" TopLine="104"/>
+ </Position21>
+ <Position22>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="128" Column="29" TopLine="108"/>
+ </Position22>
+ <Position23>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="78" Column="1" TopLine="68"/>
+ </Position23>
+ <Position24>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="368" Column="1" TopLine="328"/>
+ </Position24>
+ <Position25>
+ <Filename Value="UltraStar.lrs"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
+ </Position25>
+ <Position26>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="68" Column="31" TopLine="49"/>
+ </Position26>
+ <Position27>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="1" Column="1" TopLine="101"/>
+ </Position27>
+ <Position28>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="10" Column="5" TopLine="1"/>
+ </Position28>
+ <Position29>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="71" Column="52" TopLine="42"/>
+ </Position29>
+ <Position30>
+ <Filename Value="Classes\TextGL.pas"/>
+ <Caret Line="119" Column="34" TopLine="101"/>
+ </Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
diff --git a/Game/Code/UltraStar.lpr b/Game/Code/UltraStar.lpr
index 40fb582c..6aa8b53a 100644
--- a/Game/Code/UltraStar.lpr
+++ b/Game/Code/UltraStar.lpr
@@ -4,9 +4,7 @@ program UltraStar;
{$IFDEF FPC}
{$MODE DELPHI}
-{$ENDIF}
-
-{$IFNDEF FPC}
+{$ELSE}
{$R 'UltraStar.res' 'UltraStar.rc'}
{$ENDIF}
@@ -209,7 +207,6 @@ begin
Log.Enabled := Not Params.NoLog;
Log.BenchmarkStart(0);
-{*
// Language
Log.BenchmarkStart(1);
Log.LogStatus('Initialize Paths', 'Initialization'); InitializePaths;
@@ -384,6 +381,6 @@ begin
//------------------------------
if Ini.LPT = 1 then LCD.Clear;
if Ini.LPT = 2 then Light.TurnOff;
-*}
+
Log.Free;
end.