aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UTexture.pas
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-24 13:31:43 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-24 13:31:43 +0000
commit739ad9a6dee57375f05dcd20dc59ba2d619f11fa (patch)
treefb82b095cd5dca1bb06aaca59e1936008fac3490 /Game/Code/Classes/UTexture.pas
parent1f9fd791bbe68741b8273a64eb5c0abe928e431c (diff)
downloadusdx-739ad9a6dee57375f05dcd20dc59ba2d619f11fa.tar.gz
usdx-739ad9a6dee57375f05dcd20dc59ba2d619f11fa.tar.xz
usdx-739ad9a6dee57375f05dcd20dc59ba2d619f11fa.zip
fixed song loading in Lazarus..
cant assume variables are initialized as 0 :) in UFile "Done: byte;" was no initialized on lazarus compiler. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@431 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UTexture.pas')
-rw-r--r--Game/Code/Classes/UTexture.pas11
1 files changed, 6 insertions, 5 deletions
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas
index 3d746813..40a3a30b 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -262,7 +262,7 @@ begin
if ( FileExists(Identifier) ) then
begin
// load from file
-// Log.LogStatus( 'Is File', ' LoadImage' );
+ Log.LogStatus( 'Is File', ' LoadImage' );
try
Result:=IMG_Load(Identifier);
except
@@ -273,7 +273,7 @@ begin
end
else
begin
-// Log.LogStatus( 'NOT File', ' LoadImage' );
+ Log.LogStatus( 'IS Resource', ' LoadImage' );
// load from resource stream
{$IFNDEF FPC}
@@ -296,6 +296,7 @@ begin
end;
try
+ TexStream.position := 0;
try
TexRWops := SDL_AllocRW;
TexRWops.unknown := TUnknown(TexStream);
@@ -309,7 +310,8 @@ begin
beep;
Exit;
end;
-
+
+ Log.LogStatus( 'resource Assigned....' , Identifier);
Result:=IMG_Load_RW(TexRWops,0);
SDL_FreeRW(TexRWops);
@@ -340,9 +342,8 @@ begin
Exit;
end;
- Result:=IMG_Load_RW(TexRWops,0);
+ Result := IMG_Load_RW(TexRWops,0);
SDL_FreeRW(TexRWops);
-
finally
freeandnil( lResData );
end;