aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UTexture.pas
diff options
context:
space:
mode:
authoreddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-03 08:47:56 +0000
committereddie-0815 <eddie-0815@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-11-03 08:47:56 +0000
commit84a799853df75973fe4560576d9257f20b5bef85 (patch)
treeb897c118fd265def2d988f9d9f0fb07b579fae3d /Game/Code/Classes/UTexture.pas
parent8d021ba9197cc31408c4a9da1948422bcb7a3d43 (diff)
downloadusdx-84a799853df75973fe4560576d9257f20b5bef85.tar.gz
usdx-84a799853df75973fe4560576d9257f20b5bef85.tar.xz
usdx-84a799853df75973fe4560576d9257f20b5bef85.zip
Changed DELPHI define to IFDEF LAZARUS ... ELSE ... ENDIF. This should work on all Platforms now (I hope).
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@564 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UTexture.pas68
1 files changed, 32 insertions, 36 deletions
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas
index ac3aa7d6..c3ab0d41 100644
--- a/Game/Code/Classes/UTexture.pas
+++ b/Game/Code/Classes/UTexture.pas
@@ -277,7 +277,38 @@ begin
Log.LogStatus( 'IS Resource, because file does not exist.('+Identifier+')', ' LoadImage' );
// load from resource stream
- {$IFDEF DELPHI}
+ {$IFDEF LAZARUS}
+ lLazRes := LazFindResource( Identifier, 'TEX' );
+ if lLazRes <> nil then
+ begin
+ lResData := TStringStream.create( lLazRes.value );
+ try
+ lResData.position := 0;
+ try
+ TexRWops := SDL_AllocRW;
+ TexRWops.unknown := TUnknown( lResData );
+ TexRWops.seek := SDLStreamSeek;
+ TexRWops.read := SDLStreamRead;
+ TexRWops.write := nil;
+ TexRWops.close := SDLStreamClose;
+ TexRWops.type_ := 2;
+ except
+ Log.LogStatus( 'ERROR Could not assign resource ('+Identifier+')' , Identifier);
+ beep;
+ Exit;
+ end;
+
+ Result := IMG_Load_RW(TexRWops,0);
+ SDL_FreeRW(TexRWops);
+ finally
+ freeandnil( lResData );
+ end;
+ end
+ else
+ begin
+ Log.LogStatus( 'NOT found in Resource ('+Identifier+')', ' LoadImage' );
+ end;
+ {$ELSE}
dHandle := FindResource(hInstance, Identifier, 'TEX');
if dHandle=0 then
begin
@@ -320,42 +351,7 @@ begin
if assigned( TexStream ) then
freeandnil( TexStream );
end;
-
-
- {$ELSE}
- lLazRes := LazFindResource( Identifier, 'TEX' );
- if lLazRes <> nil then
- begin
- lResData := TStringStream.create( lLazRes.value );
- try
- lResData.position := 0;
- try
- TexRWops := SDL_AllocRW;
- TexRWops.unknown := TUnknown( lResData );
- TexRWops.seek := SDLStreamSeek;
- TexRWops.read := SDLStreamRead;
- TexRWops.write := nil;
- TexRWops.close := SDLStreamClose;
- TexRWops.type_ := 2;
- except
- Log.LogStatus( 'ERROR Could not assign resource ('+Identifier+')' , Identifier);
- beep;
- Exit;
- end;
-
- Result := IMG_Load_RW(TexRWops,0);
- SDL_FreeRW(TexRWops);
- finally
- freeandnil( lResData );
- end;
- end
- else
- begin
- Log.LogStatus( 'NOT found in Resource ('+Identifier+')', ' LoadImage' );
- end;
{$ENDIF}
-
-
end;
end;