hi all
hello dear xp
as you agree me to touch to your code as a noob
i do change and put my gfx in to see what's up with
but i have problems with
pleaz help me dear members or others
because his code is goood
so the code with a palette prob
Code:
;**********************************************
;********** rotozoomer drawing cmds ***********
;**********************************************
#Width = 320
#Height = 256
InitBitMap(1)
InitPalette(0)
initScreen(0)
*TagList = InitTagList(100)
programpriority(10)
AllocateBitMap(1,#Width,#Height,4)
AllocateBitMap(0,#Width,#Height,4)
ResetTagList(#SA_Type, #CUSTOMSCREEN | #CUSTOMBITMAP )
AddTag(#SA_BitMap, BitMapID())
OpenScreen(0,#Width,#Height,4,*TagList)
CreatePalette(0,16)
For i=0 To 15 Step 1
r.w=PeekW(?pal+(i))
g.w=PeekW(?pal+(i+2))
b.w=PeekW(?pal+(i+4))
palrgb(coli,r,g,b)
coli+1
Next
DisplayPalette(0,ScreenID())
UseBitMap(0)
cb.w=1
Repeat
w=w+1 :If w>360:w=0:EndIf
sini = PeekL(?sintable+(w*4))
cosi = PeekL(?costable+(w*4))
z.l=800
VWait()
ShowBitMap(cb,ScreenID(),0,0)
cb.w=1-cb.w
UseBitMap(cb)
drawingoutput(bitmaprastport())
Cls(0)
For x = 1 To 180 Step 2
For y = 1 To 180 Step 2
u=(x*cosi-y*sini)/z
If u<0:u-u-u:EndIf
While u>128 ; Mod-befehl fake fuer amiga
u-128
Wend
v.w=(x*sini+y*cosi)/z
If v<0:v-v-v:EndIf
While v>128 ; Mod-befehl fake fuer amiga
v-128
Wend
colo=PeekW(?color+((u*129)+v)*2)
If colo>1
FrontColour(colo)
Plot(x,y) ;:Plot(x+1,y)
;BoxFill(x,y,5,5)
EndIf
Next
Next
;
mb.w=MouseButtons()
Until mb.w=2
CloseScreen(0)
End
DisableDebugger
sintable:
IncludeBinary "dat/sin500"
costable:
IncludeBinary "dat/cos1000"
color:
IncludeBinary "dat/pic.dat"
pal:
IncludeBinary "dat/pic.pal"
EnableDebugger
; IDE Options = PureBasic 4.xx amiga os
; CursorPosition = 97
; Folding = -
; MainProcessor=1
; Optimizations=1
; CommentedSource=0
; CreateIcon=0
; NoCliOutput=0
; Executable=purebasic:/chunky/rotozoom/ChunkyRotoZoom.exe
; Debugger=0
; EnableASM=0
and of course i come back with an archive of it in zip
regards to all
yog as steff
edit 1: here is the zip
http://yoursteff.lautre.net/PBrotozoom.zip