aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-20 11:20:20 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-20 11:20:20 +0000
commit7e01085a1981f28e538b06bff5cebf2b88c975af (patch)
treebfce55410157523e9c588ed0c45659763a34c710 /Game
parentefef73dfde7de1692afb9aa8a9d51dcafc59fbb2 (diff)
downloadusdx-7e01085a1981f28e538b06bff5cebf2b88c975af.tar.gz
usdx-7e01085a1981f28e538b06bff5cebf2b88c975af.tar.xz
usdx-7e01085a1981f28e538b06bff5cebf2b88c975af.zip
fixed nasty bug I introduced...
sorry.. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@419 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Classes/TextGL.pas2
-rw-r--r--Game/Code/Classes/UTexture.pas23
2 files changed, 20 insertions, 5 deletions
diff --git a/Game/Code/Classes/TextGL.pas b/Game/Code/Classes/TextGL.pas
index ee1a74f3..1e4a9f6a 100644
--- a/Game/Code/Classes/TextGL.pas
+++ b/Game/Code/Classes/TextGL.pas
@@ -79,6 +79,8 @@ 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/UTexture.pas b/Game/Code/Classes/UTexture.pas
index e7038e78..96c0ec28 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -316,6 +316,8 @@ function TTextureUnit.LoadBitmap( aSourceStream : TStream; aIMG : TBitMap ): boo
begin
result := false;
try
+ Log.LogStatus( ' TTextureUnit.LoadBitmap' , '' );
+
aSourceStream.position := 0;
aIMG.LoadFromStream( aSourceStream );
finally
@@ -329,6 +331,8 @@ var
begin
result := false;
try
+ Log.LogStatus( ' TTextureUnit.LoadJpeg' , '');
+
aSourceStream.position := 0;
TextureJ := TJPEGImage.Create;
@@ -375,6 +379,7 @@ var
lTextureStream : TStream;
begin
+ lTextureStream := nil;
Log.LogStatus( 'From Resource - ' + inttostr( integer( FromRegistry ) ) , Identifier +' '+ Format +' '+ Typ );
// {$IFNDEF FPC}
@@ -390,9 +395,13 @@ begin
if FromRegistry then
begin
try
-// Res := TResourceStream.Create(HInstance, Identifier, Format);
+
+ Log.LogStatus( ' A' , '');
+
+ // Res := TResourceStream.Create(HInstance, Identifier, Format);
lTextureStream := TResourceStream.Create(HInstance, Identifier, Format);
-
+ Log.LogStatus( ' B' , '');
+
// TODO : Where does the format come from
except
Log.LogStatus( 'ERROR Could not load from resource' , Identifier +' '+ Format +' '+ Typ );
@@ -406,13 +415,17 @@ begin
begin
// Get the File Extension...
Format := PAnsichar(UpperCase(RightStr(ExtractFileExt(Identifier),3)));
- lTextureStream := TFileStream.create( Identifier , fmOpenRead );
+ lTextureStream := TFileStream.create( Identifier , fmOpenRead or fmShareDenyNone );
end;
end;
-// if FromRegistry or
-// ((not FromRegistry) and FileExists(Identifier)) then
+ if assigned( lTextureStream ) then
begin
+ Log.LogStatus( ' C - '+Format , '');
+
+ // TEmp, untill all code is moved to refactord way..
+ Res := TResourceStream( lTextureStream );
+
TextureB := TBitmap.Create;
if Format = 'BMP' then