Posted: Fri Oct 27, 2006 4:27 pm
Blooming impressive!
Zats bad >.< ...SuperSprite3D don't work with PB 4.01 or 4.02.
I use 4.02 and it works here perfectly.Cpl.Bator wrote:SuperSprite3D don't work with PB 4.01 or 4.02.
Code: Select all
Procedure FlipSuperSprite3D(*Sprite.SuperSprite3D,Mode.b)
StartDrawing(SpriteOutput(*Sprite\No))
Protected *DB.b=DrawingBuffer(),PF.b
Protected l.l,swf.l=DrawingBufferPitch(),rows.l=SpriteHeight(*Sprite\No)
Protected *row1.b=*DB.b,*row2.b=*DB.b+swf*(rows-1)
Select DrawingBufferPixelFormat()
Case #PB_PixelFormat_8Bits:PF=1 ; 1 bytes per pixel, palletized
Case #PB_PixelFormat_15Bits:PF=2 ; 2 bytes per pixel
Case #PB_PixelFormat_16Bits:PF=2 ; 2 bytes per pixel
Case #PB_PixelFormat_24Bits_RGB:PF=3 ; 3 bytes per pixel (RRGGBB)
Case #PB_PixelFormat_24Bits_BGR:PF=3 ; 3 bytes per pixel (BBGGRR)
Case #PB_PixelFormat_32Bits_RGB:PF=4 ; 4 bytes per pixel (RRGGBB)
Case #PB_PixelFormat_32Bits_BGR:PF=4 ; 4 bytes per pixel (BBGGRR)
EndSelect
Protected *s1.long=*DB.b,*s2.long=*DB.b+swf-PF
Select Mode
Case #Flip_Horizontally
For l=1 To rows
While *s1<*s2
Swap *s1\l,*s2\l
*s1+PF:*s2-PF
Wend
*s1=*DB.b+l*swf:*s2=*s1+swf-PF
Next
Case #Flip_Vertically
Protected *rowbuffer.b=AllocateMemory(swf)
While *row1.b<*row2.b
CopyMemory(*row1.b,*rowbuffer.b,swf):CopyMemory(*row2.b,*row1.b,swf):CopyMemory(*rowbuffer.b,*row2.b,swf); <- swap
*row1.b+swf:*row2.b-swf
Wend
FreeMemory(*rowbuffer.b)
Case #Flip_Vertically|#Flip_Horizontally
*s2+(rows-1)*swf
While *s1<*s2
Swap *s1\l,*s2\l
*s1+PF:*s2-PF
Wend
EndSelect
StopDrawing()
EndProcedure
Code: Select all
Macro CopyMatrice(Source,Target)
CopyMemory(Source#,Target#,SizeOf(MATRIX4x4))
EndMacro
Code: Select all
IncludeFile "Include\Supersprite3D.pbi"
InitSprite() :InitSprite3D() : InitSuperSprite3D() : InitKeyboard() : InitMouse()
OpenScreen(800,600,16,"")
SetPerspective(400,300)
TransparentSpriteColor(-1,0)
UsePNGImageDecoder()
LoadSprite(0,"Ground.png",#PB_Sprite_Texture)
CreateSprite3D(0,0)
LoadSprite(1,"Mask.png",#PB_Sprite_Texture)
CreateSprite3D(1,1)
LoadSprite(2,"Arch.png",#PB_Sprite_Texture)
CreateSprite3D(2,2)
LoadSprite(3,"Wall.png",#PB_Sprite_Texture)
CreateSprite3D(3,3)
LoadSprite(4,"fond.png",#PB_Sprite_Texture)
CreateSprite3D(4,4)
LoadSprite(5,"Ceil.png",#PB_Sprite_Texture)
CreateSprite3D(5,5)
MonSprite = CreateSuperSprite3D(0,512,512)
Arch = CreateSuperSprite3D(2,512,512)
Wall = CreateSuperSprite3D(3,512,512)
Ceil = CreateSuperSprite3D(5,512,512)
Structure Ground
z.f
x.f
y.f
Alpha.l
EndStructure
Global Sol.Ground
Repeat
ClearScreen(0) : ExamineKeyboard() : ExamineMouse()
If FPST.l<ElapsedMilliseconds()
FPST=ElapsedMilliseconds()+1000
fps.l = fpsc.l
fpsc = 0
EndIf
If FPST > ElapsedMilliseconds()
fpsc+1
EndIf
Delta.l - 30
If Delta<-1024 : Delta=0 : EndIf
dx-MouseDeltaX()
If dx>768 : dx=768 : EndIf
If dx<-768 : dx=-768 : EndIf
Start3D()
Sprite3DQuality(0)
;-AFFICHAGE DU SOL
For z = 50 To 0 Step -1
For x = -2 To 2
Sol\z = Delta + z*512
RotateSuperSprite3D(MonSprite,90,0,0)
SetSuperSpritePosition(MonSprite,dx+x*512,300,Sol\z)
DisplaySuperSprite3D(MonSprite)
RotateSuperSprite3D(Ceil,-90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300-512,Sol\z)
DisplaySuperSprite3D(Ceil)
Next
Next
; son masque
DisplaySprite3D(1,0,0,128)
Sprite3DBlendingMode(5,6)
;-Affichage des arches
For z = 50 To 1 Step -1
Sol\x =15360 - x*512
Sol\z = Delta + z*512
For x = -2 To 2
RotateSuperSprite3D(Ceil,90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300+512,Sol\z)
DisplaySuperSprite3D(Ceil,100)
Next
;Reflet mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
;Reflet Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
For ax = -1 To 1
;Reflet des arches
RotateSuperSprite3D(Arch,0,0,180)
SetSuperSpritePosition(Arch,dx+(ax*512),300+256,Sol\z)
DisplaySuperSprite3D(Arch,150)
;arch
RotateSuperSprite3D(Arch,0,0,0)
SetSuperSpritePosition(Arch,dx+(ax*512),300-256,Sol\z)
DisplaySuperSprite3D(Arch)
Next
;mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300-256,Sol\z)
DisplaySuperSprite3D(Wall)
;Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-(1024),300-256,Sol\z)
DisplaySuperSprite3D(Wall)
Next
Stop3D()
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(0,0,"SuperSprite3D DEMO - Infinite Ground 2D - BGAMES TEAM",RGB(0,255,255))
DrawText(0,20,"Frame rate : "+Str(fps),RGB(0,255,255))
StopDrawing()
FlipBuffers(2)
Until KeyboardPushed(#PB_Key_Escape)
Code: Select all
IncludeFile "Supersprite3D.pbi"
InitSprite() :InitSprite3D() : InitSuperSprite3D() : InitKeyboard() : InitMouse()
OpenScreen(800,600,16,"")
SetPerspective(400,300)
TransparentSpriteColor(-1,0)
UsePNGImageDecoder()
LoadSprite(0,"Ground.png",#PB_Sprite_Texture)
CreateSprite3D(0,0)
LoadSprite(1,"Mask.png",#PB_Sprite_Texture)
CreateSprite3D(1,1)
LoadSprite(2,"Arch.png",#PB_Sprite_Texture)
CreateSprite3D(2,2)
LoadSprite(3,"Wall.png",#PB_Sprite_Texture)
CreateSprite3D(3,3)
LoadSprite(4,"fond.png",#PB_Sprite_Texture)
CreateSprite3D(4,4)
LoadSprite(5,"Ceil.png",#PB_Sprite_Texture)
CreateSprite3D(5,5)
LoadFont(1, "Small Font", 10)
Global SpriteFont1 = ICE_CreateSpriteFont3D($FFFF, 0, 1)
Global SpriteFont2 = ICE_CreateSpriteFont3D($FF, 0, 1)
MonSprite = CreateSuperSprite3D(0,512,512)
Arch = CreateSuperSprite3D(2,512,512)
Wall = CreateSuperSprite3D(3,512,512)
Ceil = CreateSuperSprite3D(5,512,512)
Structure Ground
z.f
x.f
y.f
Alpha.l
EndStructure
Global Sol.Ground
puls =5
Repeat
angle +1
If angle > 360: angle = 0:EndIf
heartbeat +puls
If heartbeat > 360 Or heartbeat < 0: puls*(-1):EndIf
ExamineKeyboard() : ExamineMouse()
Delta.l - 30
If Delta<-1024 : Delta=0 : EndIf
dx-MouseDeltaX()
If dx>768 : dx=768 : EndIf
If dx<-768 : dx=-768 : EndIf
Start3D()
;-AFFICHAGE DU SOL
For z = 50 To 0 Step -1
For x = -2 To 2
Sol\z = Delta + z*512
RotateSuperSprite3D(MonSprite,90,0,0)
SetSuperSpritePosition(MonSprite,dx+x*512,300,Sol\z)
DisplaySuperSprite3D(MonSprite)
RotateSuperSprite3D(Ceil,-90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300-512,Sol\z)
DisplaySuperSprite3D(Ceil)
Next
Next
; son masque
DisplaySprite3D(1,0,0,128)
Sprite3DBlendingMode(5,6)
;-Affichage des arches
Sol\x =15360 - x*512
For z = 50 To 1 Step -1
Sol\z = Delta + z*512
For x = -2 To 2
RotateSuperSprite3D(Ceil,90,0,0)
SetSuperSpritePosition(Ceil,dx+x*512,300+512,Sol\z)
DisplaySuperSprite3D(Ceil,100)
Next
;Reflet mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
;Reflet Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-1024,300+256,Sol\z)
DisplaySuperSprite3D(Wall,100)
For ax = -1 To 1
;Reflet des arches
RotateSuperSprite3D(Arch,0,0,180)
SetSuperSpritePosition(Arch,dx+(ax*512),300+256,Sol\z)
DisplaySuperSprite3D(Arch,150)
;arch
RotateSuperSprite3D(Arch,0,0,0)
SetSuperSpritePosition(Arch,dx+(ax*512),300-256,Sol\z)
DisplaySuperSprite3D(Arch)
Next
;mur droit
RotateSuperSprite3D(Wall,270,-90,90)
SetSuperSpritePosition(Wall,dx+1024,300-256,Sol\z)
DisplaySuperSprite3D(Wall)
;Mur gauche
RotateSuperSprite3D(Wall,90,90,90)
SetSuperSpritePosition(Wall,dx-(1024),300-256,Sol\z)
DisplaySuperSprite3D(Wall)
Next
ICE_DrawingSpriteFont3D(SpriteFont1)
ICE_DisplayRotatedFadingSpriteFont3D(400, 300,angle ,"SuperSprite3D DEMO - Infinite Ground 2D - BGAMES TEAM",255)
ICE_DrawingSpriteFont3D(SpriteFont2)
ICE_ZoomSpriteFont3D(1, heartbeat/4, heartbeat/4)
ICE_DisplayRotatedFadingSpriteFont3D(400, 200,heartbeat, "FPS: "+ Str(ICE_GetFPS()),255)
ICE_ZoomSpriteFont3D(0, heartbeat/4, heartbeat/4)
Stop3D()
FlipBuffers(0)
Until KeyboardPushed(#PB_Key_Escape)
I have it.Fantoma wrote:All of the links seem to be dead. Anyone know where to find else to find any/all of the archives in this thread?