From 7ea4704bee262bd2dfd7c1eb240806e3911140cf Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 19 Sep 2007 13:47:27 +0000 Subject: 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 --- Game/Code/Classes/UTexture.pas | 34 ++++++++++----- Game/Code/UltraStar.lpi | 96 +++++++++++++++++++++--------------------- 2 files changed, 72 insertions(+), 58 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 diff --git a/Game/Code/UltraStar.lpi b/Game/Code/UltraStar.lpi index c63877cb..a402e9a0 100644 --- a/Game/Code/UltraStar.lpi +++ b/Game/Code/UltraStar.lpi @@ -12,7 +12,7 @@ - + @@ -56,8 +56,8 @@ - - + + @@ -188,7 +188,7 @@ - + @@ -392,8 +392,8 @@ - - + + @@ -401,7 +401,7 @@ - + @@ -422,123 +422,123 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + -- cgit v1.2.3