diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-19 13:47:27 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-09-19 13:47:27 +0000 |
commit | 7ea4704bee262bd2dfd7c1eb240806e3911140cf (patch) | |
tree | 706d64b4e7f1680e2f7a7ed2bef947218830b70d /Game/Code/Classes/UTexture.pas | |
parent | 75279f0cdfb62b2fe3fb8043c40ed04a1ea594a7 (diff) | |
download | usdx-7ea4704bee262bd2dfd7c1eb240806e3911140cf.tar.gz usdx-7ea4704bee262bd2dfd7c1eb240806e3911140cf.tar.xz usdx-7ea4704bee262bd2dfd7c1eb240806e3911140cf.zip |
minor changes..
links to information on lazarus scanlines.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@402 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UTexture.pas | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index 6895a250..7f0b85c0 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -321,6 +321,10 @@ var begin
{$IFNDEF FPC} // TODO : JB eeeew this is a nasty one...
// but lazarus implementation scanlines is different :(
+ // need to implement as per
+ // http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&p=18512
+ // http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&p=10797
+ // http://wiki.lazarus.freepascal.org/Developing_with_Graphics
Log.BenchmarkStart(4);
Mipmapping := true;
@@ -344,36 +348,46 @@ begin if FromRegistry or ((not FromRegistry) and FileExists(Identifier)) then begin
TextureB := TBitmap.Create;
- if Format = 'BMP' then begin
- if FromRegistry then TextureB.LoadFromStream(Res)
- else TextureB.LoadFromFile(Identifier);
+ if Format = 'BMP' then
+ begin
+ if FromRegistry then
+ TextureB.LoadFromStream(Res)
+ else
+ TextureB.LoadFromFile(Identifier);
end
-
- else if Format = 'JPG' then begin
+ else
+ if Format = 'JPG' then
+ begin
TextureJ := TJPEGImage.Create;
- if FromRegistry then TextureJ.LoadFromStream(Res)
- else begin
+
+ if FromRegistry then
+ TextureJ.LoadFromStream(Res)
+ else
+ begin
if FileExists(Identifier) then
TextureJ.LoadFromFile(Identifier)
else
Exit;
end;
+
TextureB.Assign(TextureJ);
TextureJ.Free;
end
-
else if Format = 'PNG' then
begin
{$IFNDEF FPC}
// TODO : JB - fix this for lazarus..
TexturePNG := TPNGObject.Create;
- if FromRegistry then TexturePNG.LoadFromStream(Res)
- else begin
+ if FromRegistry then
+ TexturePNG.LoadFromStream(Res)
+ else
+ begin
if FileExists(Identifier) then
TexturePNG.LoadFromFile(Identifier)
else
Exit;
end;
+
TextureB.Assign(TexturePNG);
// transparent png hack start (part 1 of 2)
if ((Typ = 'Transparent') or (Typ = 'Colorized')) and (TexturePNG.TransparencyMode = ptmPartial) then
|