[5.30 b4 x86] bug in DisplayTransparentSprite()?

Just starting out? Need help? Post your questions and find answers here.
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

[5.30 b4 x86] bug in DisplayTransparentSprite()?

Post 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

User avatar
Fig
Enthusiast
Enthusiast
Posts: 352
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

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

Post 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... :?
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

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

Post by Alex777 »

Thanks. That other thread refers to version 5.22 LTS but the code I posted above runs fine under 5.22 LTS.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post by Demivec »

When running the code in Windows 8.1 x64 and compiling it as x86 I don't see any anomalies.
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

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

Post 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.
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

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

Post by dobro »

no probleme With ThreadSafe ON

but problem With ThreadSafe OFF

;)
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

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

Post by Alex777 »

dobro wrote:no probleme With ThreadSafe ON

but problem With ThreadSafe OFF

;)
Thanks, dobro!
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

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

Post by Demivec »

Alex777 do you have a screen shot showing the anomaly?
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

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

Post 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.
Last edited by Alex777 on Sun Aug 10, 2014 4:57 pm, edited 1 time in total.
marc_256
Addict
Addict
Posts: 835
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

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

Post by marc_256 »

No problems at all here,
with or without ThreadSafe ...

Win8.1 x64 - PB5.30F - laptop

marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Alex777
User
User
Posts: 49
Joined: Sun Nov 16, 2008 12:47 am
Location: Cayman Is.
Contact:

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

Post by Alex777 »

As of ver. 5.31 beta 1, in Windows x86, this problem / bug has disappeared.
Post Reply