PureBasic Forum https://www.purebasic.fr/english/ |
|
6 bitplane chunky2planar engine https://www.purebasic.fr/english/viewtopic.php?f=10&t=62488 |
Page 1 of 1 |
Author: | xperience2003 [ Thu Jun 25, 2015 1:45 am ] |
Post subject: | 6 bitplane chunky2planar engine |
hi, i put a very small c2p engine from sp^contraz into a pb userlib it running fine with normal pb-screens and hardwarelib copperlist screens sample prog: Code: ; Chunky example new c2p 6bpl screen ; *********************************** #Width = 320 #Height = 200 initmemorybank(1) InitPalette(1) InitBitMap(1) initScreen(0) WbStartup() programpriority(20) bm0.l=AllocateLinearBitMap(0,#Width,#Height,6) *cb0.l=AllocateMemoryBank(0,#Width*#Height,#memf_clear) If OpenScreen(0,320,200,6,0) ;we create the palette from our data CreatePalette(0,64) For i=0 To 31 palettergb(i,i*8,i*8,255) PaletteRgb(i+32,255-(i*8),0,255-(i*8)) Next DisplayPalette(0,ScreenID()) showbitmap(0,ScreenID(),0,0) UseBitMap(0) ;chunky bitmap *bmappointer=BitMapID() *planepointer=PeekL(*bmappointer+8) db=1 Repeat ; ;VWait() db=1-db w.l=w+1 :If w>359:w=0:EndIf sini.l = PeekL(?sintable+(w*4)) cosi.l = PeekL(?costable+(w*4)) For x = 20 To 240 Step 2 For y = 20 To 180 Step 2 dx=x-110 dy=y-90 z=800+(y<<3) u.w=(dx*cosi-dy*sini)/z v.w=(dx*sini+dy*cosi)/z u&127: v&127 colo.w=Xor(u,v);Peekb(?color+((u*128)+v)) ypos=y+db *addy=*cb0+(x+(ypos*320)) C2Pset2plot(*addy,colo) Next Next c2p6bpl(*cb0,*planepointer) Until Joy1Button() CloseScreen(0) endif End sintable: IncludeBinary "Work:codes/pbchunkylib/dat/sintable" costable: IncludeBinary "Work:codes/pbchunkylib/dat/costable" screeny ![]() download userlib, datas and example at the moment just 2 comands plot and render maybe more will come later HAVE FUN =) |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |