aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code')
-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