From a7d0970a2e7dec907fccbc2d63ffb5cb799a7505 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Sat, 30 Oct 2010 11:22:25 +0000 Subject: - correct drawing of short notes in 4/6-player mode on one screen - rimshot022b.mp3 + 15db - changed fonts: higher resolution esp. for medley countdown - some other bugfixes and corrections - update of installer files git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2699 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UTexture.pas | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'Game/Code/Classes/UTexture.pas') diff --git a/Game/Code/Classes/UTexture.pas b/Game/Code/Classes/UTexture.pas index d7d3e690..cd39dd2f 100644 --- a/Game/Code/Classes/UTexture.pas +++ b/Game/Code/Classes/UTexture.pas @@ -73,6 +73,9 @@ type procedure UnloadTexture(Name: string; FromCache: boolean); end; +const + max = 2048; + var Texture: TTextureUnit; TextureDatabase: TTextureDatabase; @@ -99,11 +102,11 @@ var TexFitW: integer; TexFitH: integer; // new for limit - TextureD8: array[1..1024*1024] of byte; // 1MB - TextureD16: array[1..1024*1024, 1..2] of byte; // luminance/alpha tex (2MB) - TextureD24: array[1..1024*1024, 1..3] of byte; // normal 24-bit tex (3MB) + TextureD8: array[1..max*max] of byte; // 1MB + TextureD16: array[1..max*max, 1..2] of byte; // luminance/alpha tex (2MB) + TextureD24: array[1..max*max, 1..3] of byte; // normal 24-bit tex (3MB) TextureD242: array[1..512*512, 1..3] of byte; // normal 24-bit tex (0,75MB) - TextureD32: array[1..1024*1024, 1..4] of byte; // transparent 32-bit tex (4MB) + TextureD32: array[1..max*max, 1..4] of byte; // transparent 32-bit tex (4MB) // total 40MB at 2048*2048 // total 10MB at 1024*1024 @@ -245,7 +248,8 @@ begin TextureJ.Free; end - else if Format = 'PNG' then begin + else if Format = 'PNG' then + begin TexturePNG := TPNGObject.Create; if FromRegistry then TexturePNG.LoadFromStream(Res) else begin @@ -281,7 +285,7 @@ begin if FromRegistry then Res.Free; - if (TextureB.Width > 1024) or (TextureB.Height > 1024) then begin // will be fixed in 0.5.1 and dynamically extended to 8192x8192 depending on the driver + if (TextureB.Width > max) or (TextureB.Height > max) then begin // will be fixed in 0.5.1 and dynamically extended to 8192x8192 depending on the driver Log.LogError('Image ' + Nazwa + ' is too big (' + IntToStr(TextureB.Width) + 'x' + IntToStr(TextureB.Height) + ')'); Result.TexNum := -1; end else begin @@ -452,7 +456,8 @@ begin end;} end; - if Typ = 'Font' then begin + if Typ = 'Font' then + begin // a patch from Linnex, that solves the font problem in wine which causes chrashes //TextureB.PixelFormat := pf24bit; @@ -469,6 +474,8 @@ begin PPix := TextureB.ScanLine[Pet]; for Pet2 := 0 to TextureB.Width-1 do begin Pix := PPix[Pet2 * 3]; + if Pix>0 then + Pix := Pix * 1; TextureD16[Pet*TextureB.Width + Pet2 + 1, 1] := 255; TextureD16[Pet*TextureB.Width + Pet2 + 1, 2] := Pix; end; -- cgit v1.2.3