📄 modpublicvars.bas
字号:
Attribute VB_Name = "Mod_PublicVars"
Option Explicit
'// DirectX8 Vars & constants
Public D3DX As New D3DX8
Public d3d As New Cls_DirectX3D8
Public MemMgr As New Cls_MemoryMgr
'// Custom vertex type representing a point on the screen
Public Type VERTEX
vecPos As D3DVECTOR
vecNorm As D3DVECTOR
tex As D3DVECTOR2
End Type
'The vertex size
Public Const MYVERTEX_SIZE As Long = 32
'// Describe the features in the flexible vertex format
Public Const D3DFVF_MYVERTEX As Long = (D3DFVF_XYZ Or D3DFVF_TEX1 Or D3DFVF_NORMAL)
'// Model header
Public Type udtModelHeader
Identity As String * 4 '// Identifies as Quake 3 MD3 header (IDP3)
Version As Long '// Should always be 15
filename As String * 68 '// The name of this file
NumOfBoneFrames As Long '// The number of bone frames
NumOfTags As Long '// The number of tag's
NumOfMeshes As Long '// The number of individual meshes
MaxSkins As Long '// Maximum number of unique skins
HeaderLength As Long '// The file size of this header
Tag_Start As Long '// Start position of tag structure
Tag_End As Long '// End position of tag structures
FileSize As Long '// The size of this file
End Type
'// Mesh header
Public Type udtMeshHeader
ID As String * 4 '// Identity must be 'IDP3'
MeshName As String * 68 '// Name of this mesh
NumOfMeshFrames As Long '// Number of mesh frames in this mesh
NumOfSkin As Long '// Number of skins in this mesh
NumOfVertex As Long '// Number of vertices this mesh
NumOfTriangle As Long '// Number of triangles this mesh
Triangle_Start As Long '// Start position of the triangle structures
HeaderSize As Long '// Size of the mesh header in bytes
TexVec_Start As Long '// Start position of the texvec structure, relative to start of mesh header
Vertex_Start As Long '// Start position of the vertex data, relative to mesh header
MeshSize As Long '// Size of this mesh in bytes
End Type
'// The Tag structure
Public Type udtTags
TagName As String * 64 '// Tag name ie TAG_TORSO
TagTranslation(2) As Single '// x,y & z translation matrix
TagRotation(2, 2) As Single '// x,y & z rotation matrix
End Type
'// The Bone Frame structure (Not used as far as we can ascertain.)
Public Type udtBoneFrames
Mins(2) As Single
Maxs(2) As Single
Position(2) As Single
Scale As Single
Creator(15) As Byte
End Type
'// The Triangles structure
Public Type udtTriangles
Triangles(2) As Long
End Type
'// The Vertices and Normal index structure
Public Type udtVertsNorms
Vertices(2) As Integer
Normal(1) As Byte
End Type
'// Reference type for the individual mesh frames
Public Type udtFrameVerts
Frame() As udtVertsNorms
VertCount As Long
End Type
'// The Texture cooridinate structure U & V values
Public Type udtTexCoords
Texture As D3DVECTOR2
End Type
'// For identifying Tag links between model parts
Public Type udtTag
TagName As String
TagIndex() As Integer '// Unlikely MD3 will have more than 32,000 tags
End Type
'//// Custom MD3 mesh type
Public Type udtMD3Mesh
MD3MeshHeader As udtMeshHeader
MD3SkinNames() As String
MD3Triangles() As udtTriangles
MD3Frames() As udtFrameVerts
MD3TexCoords() As D3DVECTOR2
MD3VertexBuffer() As Direct3DVertexBuffer8
End Type
Public Type udtDXVerts
MD3Verts() As VERTEX
End Type
Public Type udtFrameNo
MD3FrameVerts() As udtDXVerts
End Type
'//// Custom MD3 Model type
Public Type udtMD3Model
MD3Header As udtModelHeader
MD3BoneFrames() As udtBoneFrames
MD3Tags() As udtTags
MD3Meshes() As udtMD3Mesh
MD3Vertices() As udtFrameNo
MD3LinkTags() As udtTag
End Type
Public Const BOTH_DEATH1 = 0
Public Const BOTH_DEAD1 = 1
Public Const BOTH_DEATH2 = 2
Public Const BOTH_DEAD2 = 3
Public Const BOTH_DEATH3 = 4
Public Const BOTH_DEAD3 = 5
Public Const TORSO_GESTURE = 6
Public Const TORSO_ATTACK = 7
Public Const TORSO_ATTACK2 = 8
Public Const TORSO_DROP = 9
Public Const TORSO_RAISE = 10
Public Const TORSO_STAND = 11
Public Const TORSO_STAND2 = 12
Public Const LEGS_WALKCR = 13
Public Const LEGS_WALK = 14
Public Const LEGS_RUN = 15
Public Const LEGS_BACK = 16
Public Const LEGS_SWIM = 17
Public Const LEGS_JUMP = 18
Public Const LEGS_LAND = 19
Public Const LEGS_JUMPB = 20
Public Const LEGS_LANDB = 21
Public Const LEGS_IDLE = 22
Public Const LEGS_IDLECR = 23
Public Const LEGS_TURN = 24
Public Const MAX_ANIMATIONS = 25
'// define constants
Public Const PI As Single = 3.141592654
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -