Page 1 of 1

[5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Thu Jun 19, 2014 10:24 pm
by Alex777
The Help file says: "This function is clipped, so it's perfectly legal to display the sprite outside of the screen." However, in the code below, removing the '- 1' from the ScreenHeight() value to display the sprite partly below the screen creates a visual anomaly in the lower right corner. And, removing the '- 1' from the ScreenWidth() value to display the sprite partly to the right of the screen creates the same visual anomaly all down the right side. Can someone confirm this as a bug in PB 5.30 beta 4 (x86)?

Code: Select all


InitSprite()
InitKeyboard()
UsePNGImageDecoder()
UsePNGImageEncoder()
UseZipPacker()

ExamineDesktops()
OpenScreen(DesktopWidth(0), DesktopHeight(0), 32, "Bug")

*unpacked = AllocateMemory(252)
UncompressMemory(?PicPak, 251, *unpacked, 252)
img0 = CatchImage(#PB_Any, *unpacked, 252)
SaveImage(img0, GetCurrentDirectory() + "img0.png", #PB_ImagePlugin_PNG)

LoadSprite(1, GetCurrentDirectory() + "img0.png", #PB_Sprite_AlphaBlending)

Repeat
    ClearScreen(#Black)
    
    For y = 0 To ScreenHeight() - 1 Step 32   ; <-- removing '- 1' creates anomaly in lower right corner
        For x = 0 To ScreenWidth() - 1 Step 32   ; <-- removing '- 1' creates anomaly on right side                           
            DisplayTransparentSprite(1, x, y, 255)                     
        Next x
    Next y
    
    FlipBuffers()
    Delay(1)
    
    ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)

DataSection
  PicPak:
  Data.q $E5E773F00CEB9C78,$F4F5E0606062E292,$C1CC200AD2020970,$A40C5DBC48FF2404,$528B9C4A235C4A74,$324214F3F3324B13,
         $0C154A3242195373,$0C8C14F34ABC152D,$0D0CAC8D0C144D0C,$0D4C0D74158C0CAD,$B1F50085AEE34C0C,$1363DFB2BAFA7897,
         $1278F7B59B361416,$8198B223C0B38850,$ADDD2F1984085B81,$75F47749641403FB,$9127FDCFD8D86064,$A90C7174F60FC815,
         $E36B7C6367FC95B8,$456FEBDF87D686B4,$A1DA2A3EDDFFF87D,$0723AB260DC2FE58,$2EF84824E8B2B057,$C190A761983BCE63,
         $6C87E15BE3B9B678,$48CF5C1E9B82C593,$CDAF8AC176207F34,$F109C67349ECD7B1,$FD561B427A3F0CEB,$D5D3C19E340F7D91,
         $46001342539D65CF
  Data.b $1A,$53,$06
  PicPakend:
EndDataSection


Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Jun 21, 2014 10:39 am
by Fig
This bug can probably be assimilate to this one http://www.purebasic.fr/english/viewtop ... =4&t=59397

It has not been answered though, probably because the team can't find a solution... :?

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Jun 21, 2014 2:45 pm
by Alex777
Thanks. That other thread refers to version 5.22 LTS but the code I posted above runs fine under 5.22 LTS.

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Jun 21, 2014 4:04 pm
by Demivec
When running the code in Windows 8.1 x64 and compiling it as x86 I don't see any anomalies.

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sun Jun 22, 2014 1:21 pm
by Alex777
I have done a clean reinstall of my OS (Win7 x64) and a clean reinstall of ver. 5.30 b4 x86. Strangely enough, the anomaly is no longer apparent if just 1 column of pixels of an image is off-screen but if you increase the off-screen part to, say, 22 pixels, the anomaly is still there. Graphics card is an AMD Radeon HD 6620G.

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Aug 09, 2014 9:29 am
by dobro
no probleme With ThreadSafe ON

but problem With ThreadSafe OFF

;)

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Aug 09, 2014 2:47 pm
by Alex777
dobro wrote:no probleme With ThreadSafe ON

but problem With ThreadSafe OFF

;)
Thanks, dobro!

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Aug 09, 2014 4:51 pm
by Demivec
Alex777 do you have a screen shot showing the anomaly?

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sat Aug 09, 2014 10:48 pm
by Alex777
You can see the anomaly in the lower right corners of the horizontal bars in this snippet:

Image

If you need a full-screen image, I can upload one.

EDIT: I am seeing this anomaly only with the Debugger on and ThreadSafe off.

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Sun Aug 10, 2014 1:00 pm
by marc_256
No problems at all here,
with or without ThreadSafe ...

Win8.1 x64 - PB5.30F - laptop

marc,

Re: [5.30 b4 x86] bug in DisplayTransparentSprite()?

Posted: Thu Sep 18, 2014 1:30 pm
by Alex777
As of ver. 5.31 beta 1, in Windows x86, this problem / bug has disappeared.