Private Declare Function GetTickCount Lib "kernel32" () As Long
'Billlboard stuff
Public BE_BILLBOARD_FACEX As Single
Public BE_BILLBOARD_FACEY As Single
Public BE_BILLBOARD_FACEZ As Single
Public BE_BILLBOARD_POSX As Single
Public BE_BILLBOARD_POSY As Single
Public BE_BILLBOARD_POSZ As Single
Private LastX As Single, LastX2 As Single
Private LastY As Single, LastY2 As Single
Private LastZ As Single, LastZ2 As Single
Private BBSize As Single
Public CurrentFrame As Integer
Public TotalFrames As Integer
Dim z(0 To 3) As Single, x(0 To 3) As Single, y(0 To 3) As Single
'Billboard frames
Private BBinterval As Integer
Private LastCheck As Long
'Billboarding angles
Private BBphi As Single
Private BBtheta As Single
'billboard texture
Private TexBillboard() As Direct3DTexture8
Public Function BE_BILLBOARD_INIT(TexturePath() As String, Interval As Integer, Width As Long, Height As Long, Depth As CONST_D3DFORMAT, Size As Integer) As Boolean
'initialize billboard
On Error GoTo Err
Dim i As Integer, t As Integer
'set number of frames
t = UBound(TexturePath)
'load all of the textures
For i = 0 To t
'resize variable
ReDim Preserve TexBillboard(0 To i) As Direct3DTexture8
'load texture
If D3D.CheckDeviceFormat(0, D3DDEVTYPE_HAL, Depth, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT1) = D3D_OK Then