aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-20 11:45:24 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-20 11:45:24 +0000
commit707441e6eac0f628f9c61f0130df07c6768ba291 (patch)
tree46face105bdde202f0ca051903f710bc76d5fe97
parent333ec29a5275fb851f38f7be695930ea1dfe8340 (diff)
downloadusdx-707441e6eac0f628f9c61f0130df07c6768ba291.tar.gz
usdx-707441e6eac0f628f9c61f0130df07c6768ba291.tar.xz
usdx-707441e6eac0f628f9c61f0130df07c6768ba291.zip
tidy texture loading.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@421 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/TextGL.pas3
-rw-r--r--Game/Code/Classes/UGraphic.pas9
-rw-r--r--Game/Code/Classes/UTexture.pas17
-rw-r--r--Game/Code/UltraStar.lpi116
4 files changed, 82 insertions, 63 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas
index 1e4a9f6a..c228b40a 100644
--- a/Game/Code/Classes/TextGL.pas
+++ b/Game/Code/Classes/TextGL.pas
@@ -79,8 +79,7 @@ procedure BuildFont; // Build Our Bitmap Font
Rejestr: TResourceStream;
begin
{$IFNDEF FPC}
- Log.LogStatus( 'TextGL - BUILDFONT - load Font Resource - ' + inttostr( integer( aID ) ) , aType +' '+ aResourceName );
-
+
Rejestr := TResourceStream.Create(HInstance, aResourceName , pchar( aType ) );
try
Rejestr.Read(Fonts[ aID ].Width, 256);
diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas
index 7094c0f9..a8728fa7 100644
--- a/Game/Code/Classes/UGraphic.pas
+++ b/Game/Code/Classes/UGraphic.pas
@@ -383,8 +383,13 @@ begin
// Show the Loading Screen -------------
LoadLoadingScreen;
-
-
+ Log.LogStatus('Loading Screens', 'Initialize3D');
+
+
+// LoadTextures; // jb
+// Log.LogStatus(' Loading Textures', '');
+
+
// now that we have something to display while loading,
// start thread that loads the rest of ultrastar
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas
index 389dd0b0..f01cfd23 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -90,8 +90,8 @@ type
TTextureUnit = class
private
- function LoadBitmap( aSourceStream : TStream; aIMG : TBitMap ): boolean;
- function LoadJpeg( aSourceStream : TStream; aIMG : TBitMap ): boolean;
+ function LoadBitmap( const aSourceStream : TStream; const aIMG : TBitMap ): boolean;
+ function LoadJpeg( const aSourceStream : TStream; const aIMG : TBitMap ): boolean;
public
Limit: integer;
CreateCacheMipmap: boolean;
@@ -312,7 +312,7 @@ begin
end;
-function TTextureUnit.LoadBitmap( aSourceStream : TStream; aIMG : TBitMap ): boolean;
+function TTextureUnit.LoadBitmap( const aSourceStream : TStream; const aIMG : TBitMap ): boolean;
begin
result := false;
try
@@ -325,7 +325,7 @@ begin
end;
end;
-function TTextureUnit.LoadJpeg( aSourceStream : TStream; aIMG : TBitMap ): boolean;
+function TTextureUnit.LoadJpeg( const aSourceStream : TStream; const aIMG : TBitMap ): boolean;
var
TextureJ: TJPEGImage;
begin
@@ -396,7 +396,6 @@ begin
if FromRegistry then
begin
try
- // Res := TResourceStream.Create(HInstance, Identifier, Format);
lTextureStream := TResourceStream.Create(HInstance, Identifier, Format);
// TEmp, untill all code is moved to refactord way..
@@ -413,7 +412,9 @@ begin
begin
// Get the File Extension...
Format := PAnsichar(UpperCase(RightStr(ExtractFileExt(Identifier),3)));
- lTextureStream := TFileStream.create( Identifier , fmOpenRead or fmShareDenyNone );
+
+ lTextureStream := TMemoryStream.create();
+ TMemoryStream(lTextureStream).loadfromfile( Identifier );
end;
end;
@@ -990,7 +991,9 @@ begin
if Log.BenchmarkTimeLength[4] >= 1 then
Log.LogBenchmark('**********> Texture Load Time Warning - ' + Format + '/' + Identifier + '/' + Typ, 4);
- end; // logerror
+ end; // logerror
+
+// freeandnil( lTextureStream ); // TODO - jb - free this.. but we cant at the moment :(
// {$ENDIF}
end;
diff --git a/Game/Code/UltraStar.lpi b/Game/Code/UltraStar.lpi
index 947c694c..7dfeb7cc 100644
--- a/Game/Code/UltraStar.lpi
+++ b/Game/Code/UltraStar.lpi
@@ -41,10 +41,10 @@
<Unit0>
<Filename Value="UltraStar.lpr"/>
<IsPartOfProject Value="True"/>
- <CursorPos X="5" Y="415"/>
- <TopLine Value="375"/>
+ <CursorPos X="11" Y="92"/>
+ <TopLine Value="72"/>
<EditorIndex Value="0"/>
- <UsageCount Value="87"/>
+ <UsageCount Value="90"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
@@ -57,13 +57,13 @@
<Unit2>
<Filename Value="Classes\UTexture.pas"/>
<UnitName Value="UTexture"/>
- <CursorPos X="72" Y="338"/>
- <TopLine Value="318"/>
+ <CursorPos X="1" Y="1"/>
+ <TopLine Value="1"/>
<EditorIndex Value="3"/>
- <UsageCount Value="15"/>
+ <UsageCount Value="16"/>
<Bookmarks Count="2">
- <Item0 X="26" Y="339" ID="1"/>
- <Item1 X="3" Y="961" ID="2"/>
+ <Item0 X="87" Y="94" ID="1"/>
+ <Item1 X="7" Y="420" ID="2"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit2>
@@ -87,7 +87,7 @@
<CursorPos X="25" Y="219"/>
<TopLine Value="201"/>
<EditorIndex Value="1"/>
- <UsageCount Value="13"/>
+ <UsageCount Value="14"/>
<Loaded Value="True"/>
</Unit5>
<Unit6>
@@ -258,7 +258,7 @@
<CursorPos X="5" Y="5"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
- <UsageCount Value="31"/>
+ <UsageCount Value="32"/>
<Loaded Value="True"/>
</Unit29>
<Unit30>
@@ -569,115 +569,127 @@
<UsageCount Value="10"/>
</Unit73>
</Units>
- <JumpHistory Count="27" HistoryIndex="26">
+ <JumpHistory Count="30" HistoryIndex="29">
<Position1>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="24" Column="24" TopLine="1"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="1053" Column="18" TopLine="1019"/>
</Position1>
<Position2>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="380" Column="10" TopLine="363"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="1051" Column="22" TopLine="1019"/>
</Position2>
<Position3>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="1" Column="1" TopLine="1"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="754" Column="10" TopLine="717"/>
</Position3>
<Position4>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="84" Column="45" TopLine="166"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="843" Column="3" TopLine="822"/>
</Position4>
<Position5>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="1" Column="1" TopLine="1"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="845" Column="9" TopLine="814"/>
</Position5>
<Position6>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="415" Column="1" TopLine="375"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="880" Column="13" TopLine="852"/>
</Position6>
<Position7>
<Filename Value="UltraStar.lpr"/>
- <Caret Line="188" Column="1" TopLine="161"/>
+ <Caret Line="121" Column="41" TopLine="86"/>
</Position7>
<Position8>
<Filename Value="UltraStar.lpr"/>
- <Caret Line="198" Column="16" TopLine="208"/>
+ <Caret Line="406" Column="13" TopLine="375"/>
</Position8>
<Position9>
<Filename Value="UltraStar.lpr"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position9>
<Position10>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="104" Column="46" TopLine="84"/>
+ <Filename Value="Classes\ULog.pas"/>
+ <Caret Line="5" Column="5" TopLine="5"/>
</Position10>
<Position11>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="341" Column="8" TopLine="315"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="111" Column="43" TopLine="91"/>
</Position11>
<Position12>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="540" Column="9" TopLine="513"/>
+ <Caret Line="338" Column="54" TopLine="310"/>
</Position12>
<Position13>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="754" Column="12" TopLine="719"/>
+ <Caret Line="344" Column="31" TopLine="323"/>
</Position13>
<Position14>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="1059" Column="1" TopLine="1019"/>
+ <Caret Line="310" Column="16" TopLine="298"/>
</Position14>
<Position15>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="1053" Column="18" TopLine="1019"/>
+ <Caret Line="316" Column="86" TopLine="300"/>
</Position15>
<Position16>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="1051" Column="22" TopLine="1019"/>
+ <Caret Line="345" Column="26" TopLine="305"/>
</Position16>
<Position17>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="754" Column="10" TopLine="717"/>
+ <Caret Line="93" Column="20" TopLine="76"/>
</Position17>
<Position18>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="843" Column="3" TopLine="822"/>
+ <Caret Line="15" Column="5" TopLine="1"/>
</Position18>
<Position19>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="845" Column="9" TopLine="814"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="415" Column="5" TopLine="375"/>
</Position19>
<Position20>
- <Filename Value="Classes\UTexture.pas"/>
- <Caret Line="880" Column="13" TopLine="852"/>
+ <Filename Value="UltraStar.lpr"/>
+ <Caret Line="1" Column="1" TopLine="1"/>
</Position20>
<Position21>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="121" Column="41" TopLine="86"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="348" Column="20" TopLine="312"/>
</Position21>
<Position22>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="406" Column="13" TopLine="375"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="314" Column="64" TopLine="310"/>
</Position22>
<Position23>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="1" Column="1" TopLine="1"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="93" Column="79" TopLine="66"/>
</Position23>
<Position24>
- <Filename Value="Classes\ULog.pas"/>
- <Caret Line="5" Column="5" TopLine="5"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="319" Column="87" TopLine="305"/>
</Position24>
<Position25>
- <Filename Value="UltraStar.lpr"/>
- <Caret Line="111" Column="43" TopLine="91"/>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="419" Column="25" TopLine="394"/>
</Position25>
<Position26>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="338" Column="54" TopLine="310"/>
+ <Caret Line="319" Column="18" TopLine="299"/>
</Position26>
<Position27>
<Filename Value="Classes\UTexture.pas"/>
- <Caret Line="344" Column="31" TopLine="323"/>
+ <Caret Line="327" Column="29" TopLine="299"/>
</Position27>
+ <Position28>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="343" Column="7" TopLine="304"/>
+ </Position28>
+ <Position29>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="94" Column="16" TopLine="74"/>
+ </Position29>
+ <Position30>
+ <Filename Value="Classes\UTexture.pas"/>
+ <Caret Line="336" Column="48" TopLine="317"/>
+ </Position30>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>