libcmo21/LibCmo/CKObjectImplements/CKObject.cpp
2023-02-28 14:04:38 +08:00

97 lines
2.6 KiB
C++

#include "../CKObjects.hpp"
#include "../CKStateChunk.hpp"
#include "../CKIdentifiers.hpp"
#include "../VTUtils.hpp"
namespace LibCmo::CK2::CKObjectImplements {
CKObject::CKObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) :
m_ID(ckid), m_Context(ctx),
m_Name(name == nullptr ? "" : name),
m_ObjectFlags(CK_OBJECT_FLAGS::CK_PARAMETERIN_DISABLED) {
;
}
CKObject::~CKObject() {
}
CKERROR CKObject::Load(CKStateChunk* chunk, const CKFileData::ShallowDocument* doc) {
if (chunk->SeekIdentifier(Identifiers::CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIDDEN)) {
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE,
CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE }
);
} else {
if (chunk->SeekIdentifier(Identifiers::CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIERAHIDDEN)) {
// != 0
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE, }
);
EnumsHelper::FlagEnumAdd(this->m_ObjectFlags,
{ CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE, }
);
} else {
// == 0
EnumsHelper::FlagEnumAdd(this->m_ObjectFlags,
{ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE, }
);
EnumsHelper::FlagEnumRm(this->m_ObjectFlags,
{ CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE, }
);
}
}
return CKERROR::CKERR_OK;
}
CKStateChunk* CKObject::Save(CKFileData::ShallowDocument* doc) {
return nullptr;
}
CKSceneObject::CKSceneObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
}
CKSceneObject::~CKSceneObject() {
}
CKBeObject::CKBeObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKSceneObject(ctx, ckid, name) {
}
CKBeObject::~CKBeObject() {
}
CKGroup::CKGroup(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
}
CKGroup::~CKGroup() {
}
CKMesh::CKMesh(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
}
CKMesh::~CKMesh() {
}
CKTexture::CKTexture(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
}
CKTexture::~CKTexture() {
}
CKMaterial::CKMaterial(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
}
CKMaterial::~CKMaterial() {
}
CKRenderObject::CKRenderObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
}
CKRenderObject::~CKRenderObject() {
}
CK3dEntity::CK3dEntity(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CKRenderObject(ctx, ckid, name) {
}
CK3dEntity::~CK3dEntity() {
}
CK3dObject::CK3dObject(CKMinContext* ctx, CK_ID ckid, CKSTRING name) : CK3dEntity(ctx, ckid, name) {
}
CK3dObject::~CK3dObject() {
}
}