Try this code and see FPS
Code: Select all
@SCREEN {Mode = "ask", Width = 640, Height = 400}
CreateBrush(1,32,32,#GREEN)
CreateBrush(2,32,32,#BLUE)
Dim Carte[26][15]
Carte[0]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[1]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[2]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[3]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[4]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[5]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[6]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[7]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[8]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[9]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[10]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[11]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[12]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[13]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[14]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[15]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[16]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[17]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[18]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[19]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[20]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[21]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[22]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[23]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
Carte[24]={1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2}
Carte[25]={2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}
CreateBrush(3,800,800)
SelectBrush(3)
For Y = 0 To 25
For X = 0 To 25
DisplayBrush (carte[Y][X],X*32,Y*32)
Next
Next
EndSelect
Y=0
Function Controle()
If IsKeyDown("Left")=True Then Gauche() ; Vers la gauche
If IsKeyDown("Right")=True Then Droite() ; Vers la droite
If IsKeyDown("a")=True Then Zoomin() ; Zoom in
If IsKeyDown("z")=True Then Zoomout() ; Zoom Out
EndFunction
Function Gauche()
Y=Y+1
If Y>359 Then Y=0
EndFunction
Function Droite()
Y=Y-1
If A<0 Then A=359
EndFunction
Function Zoomin()
Z=Z+10
If Z>600 Then Z=600
EndFunction
Function Zoomout()
Z=Z-10
If Z<150 Then Z=150
EndFunction
Function rotation()
StartTimer(1)
controle()
DisplayBrush(3,320,240,{rotate=Y,anchorx=0.5,anchory=0.5})
Local Temps=GetTimer(1)
TextOut (520,1,"FPS :",#BLUE)
If temps<>0 Then TextOut (586,1,Round((1/Temps)*1000))
EndFunction
SetInterval(1,rotation,1000/50)
Repeat
WaitEvent
Forever
Why is it too slow, it's just a rotation of picture, if i make the same thing with the rotation of multiple brush, the result is more slower
On Amos, i have make the same thing, but with scroll, and on amiga 1200 (in 320x256), Why my microAone PPC, (only the double of number of pixel) the same thing is more more slower?
Have you got a code to accelerate this?
Thanks