diff options
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/TextGL.pas | 3 | ||||
-rw-r--r-- | Game/Code/Classes/UGraphic.pas | 9 | ||||
-rw-r--r-- | Game/Code/Classes/UTexture.pas | 17 |
3 files changed, 18 insertions, 11 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;
|