refactor project

This commit is contained in:
2023-09-16 18:31:25 +08:00
parent 8f960604ca
commit 1ddeeb3b68
41 changed files with 725 additions and 749 deletions

View File

@ -26,7 +26,7 @@ namespace LibCmo::CK2::ObjImpls {
VxMath::VxColor m_Ambient;
VxMath::VxColor m_Specular;
VxMath::VxColor m_Emissive;
float m_SpecularPower;
CKFLOAT m_SpecularPower;
std::array<CKTexture*, 4> m_Textures;
CKDWORD m_TextureBorderColor;

View File

@ -141,7 +141,7 @@ namespace LibCmo::CK2::ObjImpls {
return m_VertexSpecularColor.data();
}
float* CKMesh::GetVertexWeights() {
CKFLOAT* CKMesh::GetVertexWeights() {
return m_VertexWeight.data();
}

View File

@ -36,7 +36,7 @@ namespace LibCmo::CK2::ObjImpls {
VxMath::VxVector2* GetVertexUVs();
CKDWORD* GetVertexColors();
CKDWORD* GetVertexSpecularColors();
float* GetVertexWeights();
CKFLOAT* GetVertexWeights();
// ===== Material Slot Section =====
public:
@ -77,10 +77,10 @@ namespace LibCmo::CK2::ObjImpls {
protected:
enum class VertexSaveFlags : CKDWORD {
SingleColor = 0x1u, /**< if not set, the VertexColor is a list<EFBFBD><EFBFBD> otherwise a single global CKDWORD.*/
SingleSpecularColor = 0x2u, /**< if not set, the VertexSpecularColor is a list<EFBFBD><EFBFBD> otherwise a single global CKDWORD. */
SingleColor = 0x1u, /**< if not set, the VertexColor is a list, otherwise a single global CKDWORD.*/
SingleSpecularColor = 0x2u, /**< if not set, the VertexSpecularColor is a list, otherwise a single global CKDWORD. */
NoNormal = 0x4u, /**< if set, there are no normal data for vertex. */
SingleUV = 0x8u, /**< if not set, the VertexUV is a list<EFBFBD><EFBFBD> otherwise a single global VxVertex2. */
SingleUV = 0x8u, /**< if not set, the VertexUV is a list, otherwise a single global VxVertex2. */
NoPos = 0x10u, /**< if set, there are no position data for vertex. */
};
struct FaceData_t {
@ -118,7 +118,7 @@ namespace LibCmo::CK2::ObjImpls {
XContainer::XArray<VxMath::VxVector2> m_VertexUV;
XContainer::XArray<CKDWORD> m_VertexColor;
XContainer::XArray<CKDWORD> m_VertexSpecularColor;
XContainer::XArray<float> m_VertexWeight;
XContainer::XArray<CKFLOAT> m_VertexWeight;
XContainer::XArray<CKMaterial*> m_MaterialSlot;

View File

@ -50,10 +50,10 @@ namespace LibCmo::CK2::ObjImpls {
return m_ID;
}
CKSTRING GetName(void) {
return m_Name.toCKSTRING();
return XContainer::NSXString::ToCKSTRING(m_Name);
}
void SetName(CKSTRING u8_name) {
m_Name = u8_name;
XContainer::NSXString::FromCKSTRING(m_Name, u8_name);
}
CK_OBJECT_FLAGS GetObjectFlags(void) {
return m_ObjectFlags;
@ -75,7 +75,7 @@ namespace LibCmo::CK2::ObjImpls {
protected:
CK_ID m_ID;
TypeHelper::MKString m_Name;
XContainer::XString m_Name;
CK_OBJECT_FLAGS m_ObjectFlags;
CKContext* m_Context;
};

View File

@ -25,38 +25,38 @@ namespace LibCmo::CK2::ObjImpls {
}m_Ext;
struct {
// fake VxImageDescEx
CK2::CKINT Size; ///< Size of the structure
CK2::CKDWORD Flags; ///< Reserved for special formats (such as compressed ) 0 otherwise
CKINT Size; ///< Size of the structure
CKDWORD Flags; ///< Reserved for special formats (such as compressed ) 0 otherwise
CK2::CKINT Width; ///< Width in pixel of the image
CK2::CKINT Height; ///< Height in pixel of the image
CKINT Width; ///< Width in pixel of the image
CKINT Height; ///< Height in pixel of the image
union {
CK2::CKINT BytesPerLine; ///< Pitch (width in bytes) of the image
CK2::CKINT TotalImageSize; ///< For compressed image (DXT1...) the total size of the image
CKINT BytesPerLine; ///< Pitch (width in bytes) of the image
CKINT TotalImageSize; ///< For compressed image (DXT1...) the total size of the image
};
CK2::CKINT BitsPerPixel; ///< Number of bits per pixel
CKINT BitsPerPixel; ///< Number of bits per pixel
union {
CK2::CKDWORD RedMask; ///< Mask for Red component
CK2::CKDWORD BumpDuMask; ///< Mask for Bump Du component
CKDWORD RedMask; ///< Mask for Red component
CKDWORD BumpDuMask; ///< Mask for Bump Du component
};
union {
CK2::CKDWORD GreenMask; ///< Mask for Green component
CK2::CKDWORD BumpDvMask; ///< Mask for Bump Dv component
CKDWORD GreenMask; ///< Mask for Green component
CKDWORD BumpDvMask; ///< Mask for Bump Dv component
};
union {
CK2::CKDWORD BlueMask; ///< Mask for Blue component
CK2::CKDWORD BumpLumMask; ///< Mask for Luminance component
CKDWORD BlueMask; ///< Mask for Blue component
CKDWORD BumpLumMask; ///< Mask for Luminance component
};
CK2::CKDWORD AlphaMask; ///< Mask for Alpha component
CKDWORD AlphaMask; ///< Mask for Alpha component
CK2::CKWORD BytesPerColorEntry; ///< ColorMap Stride
CK2::CKWORD ColorMapEntries; ///< If other than 0 image is palletized
CKWORD BytesPerColorEntry; ///< ColorMap Stride
CKWORD ColorMapEntries; ///< If other than 0 image is palletized
/*CK2::CKBYTE**/CK2::CKDWORD ColorMap; ///< Palette colors
/*CK2::CKBYTE**/CK2::CKDWORD Image; ///< Image
/*CKBYTE**/CKPTR ColorMap; ///< Palette colors
/*CKBYTE**/CKPTR Image; ///< Image
}m_Format;
/*void**/CK2::CKDWORD m_Data;
/*void**/CKPTR m_Data;
};
CKTexture::CKTexture(CKContext* ctx, CK_ID ckid, CKSTRING name) :