libcmo21/LibCmo/CK2/ObjImpls/CKObject.cpp

123 lines
3.5 KiB
C++
Raw Normal View History

2023-08-23 16:04:58 +08:00
#include "CKObject.hpp"
2023-02-28 14:04:38 +08:00
#include "../CKStateChunk.hpp"
2023-02-26 21:48:03 +08:00
namespace LibCmo::CK2::ObjImpls {
2023-02-26 21:48:03 +08:00
2023-08-25 21:57:22 +08:00
void CKObject::PreSave(CKFileVisitor* file, CKDWORD flags) {}
2023-02-26 21:48:03 +08:00
2023-08-25 21:57:22 +08:00
CKStateChunk* CKObject::Save(CKFileVisitor* file, CKDWORD flags) {
2023-08-23 16:04:58 +08:00
return nullptr;
2023-02-26 21:48:03 +08:00
}
2023-08-25 21:57:22 +08:00
bool CKObject::Load(CKStateChunk* chunk, CKFileVisitor* file) {
2023-08-23 16:04:58 +08:00
if (chunk->SeekIdentifier(CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIDDEN)) {
EnumsHelper::Rm(this->m_ObjectFlags,
EnumsHelper::Merge({ CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE, CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE }));
2023-02-28 14:04:38 +08:00
} else {
2023-08-23 16:04:58 +08:00
if (chunk->SeekIdentifier(CK_STATESAVEFLAGS_OBJECT::CK_STATESAVE_OBJECTHIERAHIDDEN)) {
2023-02-28 14:04:38 +08:00
// != 0
2023-08-23 16:04:58 +08:00
EnumsHelper::Rm(this->m_ObjectFlags, CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE);
EnumsHelper::Add(this->m_ObjectFlags, CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE);
2023-02-28 14:04:38 +08:00
} else {
// == 0
2023-08-23 16:04:58 +08:00
EnumsHelper::Add(this->m_ObjectFlags, CK_OBJECT_FLAGS::CK_OBJECT_VISIBLE);
EnumsHelper::Rm(this->m_ObjectFlags, CK_OBJECT_FLAGS::CK_OBJECT_HIERACHICALHIDE);
2023-02-28 14:04:38 +08:00
}
}
2023-03-05 22:31:11 +08:00
return true;
2023-02-28 11:35:54 +08:00
}
2023-03-08 21:36:13 +08:00
2023-08-23 16:04:58 +08:00
void CKObject::PostLoad() {}
//CKSceneObject::CKSceneObject(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKSceneObject::~CKSceneObject() {
//}
//CKBeObject::CKBeObject(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKSceneObject(ctx, ckid, name) {
//}
//CKBeObject::~CKBeObject() {
//}
//CKGroup::CKGroup(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
//}
//CKGroup::~CKGroup() {
//}
//CKMesh::CKMesh(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
//}
//CKMesh::~CKMesh() {
//}
//CKTexture::CKTexture(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
//}
//CKTexture::~CKTexture() {
//}
//CKMaterial::CKMaterial(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
//}
//CKMaterial::~CKMaterial() {
//}
//CKRenderObject::CKRenderObject(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKBeObject(ctx, ckid, name) {
//}
//CKRenderObject::~CKRenderObject() {
//}
//CK3dEntity::CK3dEntity(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKRenderObject(ctx, ckid, name) {
//}
//CK3dEntity::~CK3dEntity() {
//}
//CK3dObject::CK3dObject(CKContext* ctx, CK_ID ckid, CKSTRING name) : CK3dEntity(ctx, ckid, name) {
//}
//CK3dObject::~CK3dObject() {
//}
//CKParameterIn::CKParameterIn(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKParameterIn::~CKParameterIn() {
//}
//CKParameter::CKParameter(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKParameter::~CKParameter() {
//}
//CKParameterOut::CKParameterOut(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKParameter(ctx, ckid, name) {
//}
//CKParameterOut::~CKParameterOut() {
//}
//CKParameterLocal::CKParameterLocal(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKParameter(ctx, ckid, name) {
//}
//CKParameterLocal::~CKParameterLocal() {
//}
//CKParameterOperation::CKParameterOperation(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKParameterOperation::~CKParameterOperation() {
//}
//CKBehaviorLink::CKBehaviorLink(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKBehaviorLink::~CKBehaviorLink() {
//}
//CKBehaviorIO::CKBehaviorIO(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKObject(ctx, ckid, name) {
//}
//CKBehaviorIO::~CKBehaviorIO() {
//}
//CKBehavior::CKBehavior(CKContext* ctx, CK_ID ckid, CKSTRING name) : CKSceneObject(ctx, ckid, name) {
//}
//CKBehavior::~CKBehavior() {
//}
2023-03-08 21:36:13 +08:00
2023-02-26 21:48:03 +08:00
}