I made this small program to test the behavior of the SpriteQuality() command.
Code: Select all
InitSprite()
InitKeyboard()
UsePNGImageDecoder()
UsePNGImageEncoder()
flag.b = #False
flag_rot.b = #True
flag_sprite.b = #False
If (OpenScreen(640, 480, 32, "Test Bug", #PB_Screen_SmartSynchronization , 60))
SetFrameRate(60)
If (CreateSprite(2001, 256, 256,#PB_Sprite_AlphaBlending))
StartDrawing(SpriteOutput(2001))
DrawingMode(#PB_2DDrawing_AlphaBlend)
Box(2,2,254,254,RGBA(1,1,1,255))
StopDrawing()
SaveSprite(2001,"Test.png", #PB_ImagePlugin_PNG)
EndIf
LoadSprite(2002,"Test.png")
rotation = 0
Repeat
ClearScreen(RGBA(255,255,255,255))
ExamineKeyboard()
If flag_sprite
RotateSprite(2002, rotation, #PB_Absolute)
DisplayTransparentSprite(2002,640 / 2 - SpriteWidth(2002) / 2,480 / 2 - SpriteHeight(2002) / 2,255)
Else
RotateSprite(2001, rotation, #PB_Absolute)
DisplayTransparentSprite(2001,640 / 2 - SpriteWidth(2001) / 2,480 / 2 - SpriteHeight(2001) / 2,255)
EndIf
If flag_rot
rotation + 1
EndIf
StartDrawing(ScreenOutput())
If (flag_sprite)
DrawText(0,0,"Sprite from PNG file On (Press 1 to change)",RGB(0,0,0),RGB(255,255,255))
Else
DrawText(0,0,"Sprite from PNG file Off (Press 1 to change)",RGB(0,0,0),RGB(255,255,255))
EndIf
If (flag)
DrawText(0,20,"SpriteQuality On (Press 2 to change)",RGB(0,0,0),RGB(255,255,255))
Else
DrawText(0,20,"SpriteQuality Off (Press 2 to change)",RGB(0,0,0),RGB(255,255,255))
EndIf
If (flag_rot)
DrawText(0,40,"Sprite rotation On (Press 3 to change)",RGB(0,0,0),RGB(255,255,255))
Else
DrawText(0,40,"Sprite Rotation Off (Press 3 to change)",RGB(0,0,0),RGB(255,255,255))
EndIf
StopDrawing()
FlipBuffers()
If KeyboardReleased(#PB_Key_1)
If flag_sprite = #False
flag_sprite = #True
Else
flag_sprite = #False
EndIf
EndIf
If KeyboardReleased(#PB_Key_2)
If flag = #False
SpriteQuality(#PB_Sprite_BilinearFiltering)
flag = #True
Else
SpriteQuality(#PB_Sprite_NoFiltering)
flag = #False
EndIf
EndIf
If KeyboardReleased(#PB_Key_3)
If flag_rot = #False
flag_rot = #True
Else
flag_rot = #False
EndIf
EndIf
If KeyboardReleased(#PB_Key_Escape) ;se abbiamo premuto escape chiudiamo il gioco
CloseScreen()
End
EndIf
ForEver
EndIf
I compiled it with Purebasic 5.51 64 bit and tested it on two machines:
1) PC, Windows 10 64 bit, 16 Gb of RAM, Ati Radeon RX-470 8192 MB
2) iMac, Mac Os Sierra 10.12.2, 32 Gb di RAM, Nvidia GeForce GTX 680MX 2048 MB
Test on the PC:
If the sprite used is the one generated directly with the Drawing commands of Purebasic there isn't any difference between the one with the SpriteQuality enabled and all the two sprites aren't anti-aliased. If the sprite used is the one loaded from the autogenerated PNG file, without the SpriteQuality enabled the sprite is displayed correctly jagged but if you enable the SpriteQuality some artifacts are showed around the sides of the box.
https://www.flickr.com/photos/lamponero ... ed-public/
https://www.flickr.com/photos/lamponero ... ed-public/
Test on the Mac:
No artifacts here but only two sides of the box are anti-aliased
https://www.flickr.com/photos/lamponero ... ed-public/
https://www.flickr.com/photos/lamponero ... ed-public/
--------------------------------------------------------------------------------------------------------------
----- Resolved in PB 5.60 -----
This is the example "CarPhysic.pb" on the PC:
https://www.flickr.com/photos/lamponero ... ed-public/
And this is the same example but on the Mac:
https://www.flickr.com/photos/lamponero ... ed-public/
As you can see the PC version doesn't have any textures...
--------------------------------------------------------------------------------------------------------------
People with new Ati Radeon videocards please test your PC and post here your results.