CompilerIf Subsystem("Directx9")
;Thanks to Fluid Byte and other english forum people
;I found this structure on clipsprite3D function on the forum
Structure D3DTLVERTEX
x.f
y.f
z.f
rhw.f
Color.l
tu.f
tv.f
EndStructure
Structure PB_Sprite3D
TexRes.l ; TexRes
Vertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
TmpVertice.D3DTLVERTEX[4] ; The 4 vertices for the rectangle sprite
Width.l ; width set with ZoomSprite3D()
Height.l ; height set with ZoomSprite3D()
RealWidth.l
RealHeight.l
Angle.f
Transformed.l
EndStructure
CompilerElse ;Directx7
;Thanks Cpl.Bator !!!
Structure vertex
sx.f
sy.f
sz.f
rhw.f
Color.l
specular.l
tu.f
tv.f
EndStructure
Structure PB_Sprite3D
Texture.l
Vertice.vertex[4]
Width.w
Height.w
EndStructure
CompilerEndIf
Macro RGBA(r,g,b,a)
a << 24 + b << 16 +g << 8 + r
EndMacro
Procedure SetSpriteLuminosityEx(spriteid.l,lum.c)
Protected RGB_LUM.l,*S.PB_Sprite3D
;Must be between Start3D and stop3D
; 255 = full Luminosity 0 = Black
RGB_LUM = RGBA(Lum,Lum,Lum,255)
*S=IsSprite3D(spriteid)
*S\Vertice[0]\Color = RGB_LUM
*S\Vertice[1]\Color = RGB_LUM
*S\Vertice[3]\Color = RGB_LUM
*S\Vertice[2]\Color = RGB_LUM
EndProcedure