⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmap.cls

📁 3ds文件浏览程序
💻 CLS
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CMap"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'*************************************************************************
'FUNCTION: holds the data for a map definition
'AUTHOR: edx - edx@hk.super.net, Oct 98 - all rights reserved
'HISTORY: -
'NOTES:
'*************************************************************************

Public ChunkID%
Public ID& 'gl list
Public TreeNode As Node
Public Parent As CMaterial
Public Fields As Collection
Public Filename$

'
Public Strength!
Public Tiling% ' - Control bit flags, where bit 0 (0x1) activates decaling,
               ' - bit 1 (0x2) activates mirroring,
               ' - bit 3 (0x8) activates negation,
               ' - bit 4 (0x10) deactivates tiling,
               ' - bit 5 (0x20) activates summed area sampling,
               ' - bit 6 (0x40) activates alpha sourcing,
               ' - bit 7 (0x80) activates tinting,
               ' - bit 8 (0x100) ignores alpha, and
               ' - bit 9 (0x200) activates RGB tinting.
               ' - Bits 7, 8, and 9 are only used with MAT_TEXMAP, MAT_TEX2MAP,
               '   and MAT_SPECMAP chunks.
               ' - Bit 6, when used with a MAT_TEXMAP, MAT_TEX2MAP, or MAT_SPECMAP
               '   chunk must be accompanied with a tinting bit, either 7 or 9.
               ' - Remaining bits are for internal use only.


Public UScale!
Public VScale!
Public UOffset!
Public VOffset!
Public Angle!
Public TexID&
Public Texture As CTexture

Private Sub Class_Initialize()
    Set Fields = New Collection
End Sub

Private Sub Class_Terminate()
    Set Texture = Nothing
End Sub

Public Function AddField(ChunkID%) As CField
Dim Field As CField
    Set Field = New CField
    Field.ChunkID = ChunkID
    Fields.Add Field
    Set Field.Parent = Me
    Set AddField = Field
End Function

Public Sub FillTree()
Dim ParentNode As Node, i&, s$, s1$
On Error GoTo ErrorHandler
    If Err Then Debug.Assert 0
    Debug.Print Filename
    s = Filename
    If Len(s) Then s = ": " & s
    s1 = ChunkName(ChunkID) & s
    With frmMain
        If Parent Is Nothing Then
            If .TV1.Nodes.Count Then Debug.Assert 0
            Set TreeNode = .TV1.Nodes.Add(, , , s1, ChunkImage(ChunkID))
        Else
            Set ParentNode = Parent.TreeNode
            Set TreeNode = .TV1.Nodes.Add(ParentNode, tvwChild, , s1, ChunkImage(ChunkID))
        End If
    '
    For i = 1 To Fields.Count
        Fields(i).FillTree
    Next
    End With
'----------------------------------------------------
    Exit Sub
ErrorHandler:
    Debug.Print Err.Description
    Debug.Assert 0
    Exit Sub
    Resume Next
End Sub

'----------------------------------------------------------------------------
Public Function LoadMap&(Path$)
    If Len(Filename) Then
        Set Texture = Textures.Add(Path & Filename)
    End If
End Function

'----------------------------------------------------------------------------
'nothing fancy, we just map the primary texture
'----------------------------------------------------------------------------
Public Sub SetTexture()
    If Not Texture Is Nothing Then
        Texture.Tex.SetTexture
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -