Sprite, Sprite3D...
Publié : ven. 04/nov./2005 10:19
J'ai été inspiré hier soir ^^
Dri 
Code : Tout sélectionner
Structure PB_Sprite
Sprite.l ; DirectDrawSurface7 pointer
Width.w ; Current width of the sprite (could change if ClipSprite() is used)
Height.w ; Current height of the sprite (could change if ClipSprite() is used)
Depth.w ; Sprite depth
Mode.w ; Sprite mode, as descripted in LoadSprite()
FileName.l ; Pointer on the filename, if any
RealWidth.w ; Original width of the sprite when it was loaded
RealHeight.w ; Original height of the sprite when it was loaded
ClipX.w ; X offset if ClipSprite()
ClipY.w ; Y offset if ClipSprite()
EndStructure
Procedure SpriteRealWidth(Sprite.l)
Protected RealWidth.l, *sprite.PB_Sprite
*sprite = IsSprite(Sprite)
If *sprite
RealWidth = *sprite\RealWidth
EndIf
ProcedureReturn RealWidth
EndProcedure
Procedure SpriteRealHeight(Sprite.l)
Protected RealHeight.l, *sprite.PB_Sprite
*sprite = IsSprite(Sprite)
If *sprite
RealHeight = *sprite\RealHeight
EndIf
ProcedureReturn RealHeight
EndProcedure
Procedure SpriteClipX(Sprite.l)
Protected ClipX.l, *sprite.PB_Sprite
*sprite = IsSprite(Sprite)
If *sprite
ClipX = *sprite\ClipX
EndIf
ProcedureReturn ClipX
EndProcedure
Procedure SpriteClipY(Sprite.l)
Protected ClipY.l, *sprite.PB_Sprite
*sprite = IsSprite(Sprite)
If *sprite
ClipY = *sprite\ClipY
EndIf
ProcedureReturn ClipY
EndProcedure
