feat: add target camera in BMapInspector
This commit is contained in:
@@ -59,25 +59,29 @@ namespace BMapInspector::Map {
|
|||||||
auto ptr = fileobj.ObjPtr;
|
auto ptr = fileobj.ObjPtr;
|
||||||
if (ptr == nullptr) continue;
|
if (ptr == nullptr) continue;
|
||||||
|
|
||||||
|
using LibCmo::CK2::CK_CLASSID;
|
||||||
switch (fileobj.ObjectCid) {
|
switch (fileobj.ObjectCid) {
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_GROUP:
|
case CK_CLASSID::CKCID_GROUP:
|
||||||
m_ObjGroups.emplace_back(static_cast<O::CKGroup*>(ptr));
|
m_ObjGroups.emplace_back(static_cast<O::CKGroup*>(ptr));
|
||||||
break;
|
break;
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_3DOBJECT:
|
case CK_CLASSID::CKCID_3DOBJECT:
|
||||||
m_Obj3dObjects.emplace_back(static_cast<O::CK3dObject*>(ptr));
|
m_Obj3dObjects.emplace_back(static_cast<O::CK3dObject*>(ptr));
|
||||||
break;
|
break;
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_MESH:
|
case CK_CLASSID::CKCID_MESH:
|
||||||
m_ObjMeshes.emplace_back(static_cast<O::CKMesh*>(ptr));
|
m_ObjMeshes.emplace_back(static_cast<O::CKMesh*>(ptr));
|
||||||
break;
|
break;
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_MATERIAL:
|
case CK_CLASSID::CKCID_MATERIAL:
|
||||||
m_ObjMaterials.emplace_back(static_cast<O::CKMaterial*>(ptr));
|
m_ObjMaterials.emplace_back(static_cast<O::CKMaterial*>(ptr));
|
||||||
break;
|
break;
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_TEXTURE:
|
case CK_CLASSID::CKCID_TEXTURE:
|
||||||
m_ObjTextures.emplace_back(static_cast<O::CKTexture*>(ptr));
|
m_ObjTextures.emplace_back(static_cast<O::CKTexture*>(ptr));
|
||||||
break;
|
break;
|
||||||
case LibCmo::CK2::CK_CLASSID::CKCID_TARGETLIGHT:
|
case CK_CLASSID::CKCID_TARGETLIGHT:
|
||||||
m_ObjTargetLights.emplace_back(static_cast<O::CKTargetLight*>(ptr));
|
m_ObjTargetLights.emplace_back(static_cast<O::CKTargetLight*>(ptr));
|
||||||
break;
|
break;
|
||||||
|
case CK_CLASSID::CKCID_TARGETCAMERA:
|
||||||
|
m_ObjTargetCameras.emplace_back(static_cast<O::CKTargetCamera*>(ptr));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break; // skip unknow objects
|
break; // skip unknow objects
|
||||||
}
|
}
|
||||||
@@ -95,7 +99,7 @@ namespace BMapInspector::Map {
|
|||||||
YYCC_IMPL_MOVE_CTOR(Level, rhs) :
|
YYCC_IMPL_MOVE_CTOR(Level, rhs) :
|
||||||
m_Context(rhs.m_Context), m_ObjGroups(std::move(rhs.m_ObjGroups)), m_Obj3dObjects(std::move(rhs.m_Obj3dObjects)),
|
m_Context(rhs.m_Context), m_ObjGroups(std::move(rhs.m_ObjGroups)), m_Obj3dObjects(std::move(rhs.m_Obj3dObjects)),
|
||||||
m_ObjMeshes(std::move(rhs.m_ObjMeshes)), m_ObjMaterials(std::move(rhs.m_ObjMaterials)), m_ObjTextures(std::move(rhs.m_ObjTextures)),
|
m_ObjMeshes(std::move(rhs.m_ObjMeshes)), m_ObjMaterials(std::move(rhs.m_ObjMaterials)), m_ObjTextures(std::move(rhs.m_ObjTextures)),
|
||||||
m_ObjTargetLights(std::move(rhs.m_ObjTargetLights))
|
m_ObjTargetLights(std::move(rhs.m_ObjTargetLights)), m_ObjTargetCameras(std::move(rhs.m_ObjTargetCameras))
|
||||||
|
|
||||||
{
|
{
|
||||||
rhs.m_Context = nullptr;
|
rhs.m_Context = nullptr;
|
||||||
@@ -109,6 +113,7 @@ namespace BMapInspector::Map {
|
|||||||
this->m_ObjMaterials = std::move(rhs.m_ObjMaterials);
|
this->m_ObjMaterials = std::move(rhs.m_ObjMaterials);
|
||||||
this->m_ObjTextures = std::move(rhs.m_ObjTextures);
|
this->m_ObjTextures = std::move(rhs.m_ObjTextures);
|
||||||
this->m_ObjTargetLights = std::move(rhs.m_ObjTargetLights);
|
this->m_ObjTargetLights = std::move(rhs.m_ObjTargetLights);
|
||||||
|
this->m_ObjTargetCameras = std::move(rhs.m_ObjTargetCameras);
|
||||||
|
|
||||||
rhs.m_Context = nullptr;
|
rhs.m_Context = nullptr;
|
||||||
|
|
||||||
@@ -157,6 +162,11 @@ namespace BMapInspector::Map {
|
|||||||
return this->m_ObjTargetLights;
|
return this->m_ObjTargetLights;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::vector<O::CKTargetCamera*>& Level::GetTargetCameras() const {
|
||||||
|
CHECK_STATUS(this)
|
||||||
|
return this->m_ObjTargetCameras;
|
||||||
|
}
|
||||||
|
|
||||||
#undef CHECK_STATUS
|
#undef CHECK_STATUS
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Cli.hpp"
|
#include "Cli.hpp"
|
||||||
|
#include <VTAll.hpp>
|
||||||
#include <yycc.hpp>
|
#include <yycc.hpp>
|
||||||
#include <yycc/macro/class_copy_move.hpp>
|
#include <yycc/macro/class_copy_move.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -7,18 +8,6 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <expected>
|
#include <expected>
|
||||||
|
|
||||||
namespace LibCmo::CK2 {
|
|
||||||
class CKContext;
|
|
||||||
namespace ObjImpls {
|
|
||||||
class CKGroup;
|
|
||||||
class CK3dObject;
|
|
||||||
class CKMesh;
|
|
||||||
class CKMaterial;
|
|
||||||
class CKTexture;
|
|
||||||
class CKTargetLight;
|
|
||||||
} // namespace ObjImpls
|
|
||||||
} // namespace LibCmo::CK2
|
|
||||||
|
|
||||||
namespace BMapInspector::Map {
|
namespace BMapInspector::Map {
|
||||||
|
|
||||||
enum class Error {
|
enum class Error {
|
||||||
@@ -53,6 +42,7 @@ namespace BMapInspector::Map {
|
|||||||
const std::vector<LibCmo::CK2::ObjImpls::CKMaterial*>& GetMaterials() const;
|
const std::vector<LibCmo::CK2::ObjImpls::CKMaterial*>& GetMaterials() const;
|
||||||
const std::vector<LibCmo::CK2::ObjImpls::CKTexture*>& GetTextures() const;
|
const std::vector<LibCmo::CK2::ObjImpls::CKTexture*>& GetTextures() const;
|
||||||
const std::vector<LibCmo::CK2::ObjImpls::CKTargetLight*>& GetTargetLights() const;
|
const std::vector<LibCmo::CK2::ObjImpls::CKTargetLight*>& GetTargetLights() const;
|
||||||
|
const std::vector<LibCmo::CK2::ObjImpls::CKTargetCamera*>& GetTargetCameras() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<LibCmo::CK2::ObjImpls::CKGroup*> m_ObjGroups;
|
std::vector<LibCmo::CK2::ObjImpls::CKGroup*> m_ObjGroups;
|
||||||
@@ -61,6 +51,7 @@ namespace BMapInspector::Map {
|
|||||||
std::vector<LibCmo::CK2::ObjImpls::CKMaterial*> m_ObjMaterials;
|
std::vector<LibCmo::CK2::ObjImpls::CKMaterial*> m_ObjMaterials;
|
||||||
std::vector<LibCmo::CK2::ObjImpls::CKTexture*> m_ObjTextures;
|
std::vector<LibCmo::CK2::ObjImpls::CKTexture*> m_ObjTextures;
|
||||||
std::vector<LibCmo::CK2::ObjImpls::CKTargetLight*> m_ObjTargetLights;
|
std::vector<LibCmo::CK2::ObjImpls::CKTargetLight*> m_ObjTargetLights;
|
||||||
|
std::vector<LibCmo::CK2::ObjImpls::CKTargetCamera*> m_ObjTargetCameras;
|
||||||
};
|
};
|
||||||
|
|
||||||
Result<Level> load(const Cli::Args& args);
|
Result<Level> load(const Cli::Args& args);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "Utils.hpp"
|
#include "Utils.hpp"
|
||||||
#include "Reporter.hpp"
|
#include "Reporter.hpp"
|
||||||
#include "Map.hpp"
|
#include "Map.hpp"
|
||||||
#include <VTAll.hpp>
|
|
||||||
#include <yycc.hpp>
|
#include <yycc.hpp>
|
||||||
#include <yycc/macro/class_copy_move.hpp>
|
#include <yycc/macro/class_copy_move.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -437,13 +437,13 @@ namespace LibCmo::CK2 {
|
|||||||
|
|
||||||
constexpr CKGUID(CKDWORD gd1 = 0, CKDWORD gd2 = 0) : d1(gd1), d2(gd2) {}
|
constexpr CKGUID(CKDWORD gd1 = 0, CKDWORD gd2 = 0) : d1(gd1), d2(gd2) {}
|
||||||
CKGUID(const CKGUID& rhs) : d1(rhs.d1), d2(rhs.d2) {}
|
CKGUID(const CKGUID& rhs) : d1(rhs.d1), d2(rhs.d2) {}
|
||||||
CKGUID(CKGUID&& rhs) : d1(rhs.d1), d2(rhs.d2) {}
|
CKGUID(CKGUID&& rhs) noexcept : d1(rhs.d1), d2(rhs.d2) {}
|
||||||
CKGUID& operator=(const CKGUID& rhs) {
|
CKGUID& operator=(const CKGUID& rhs) {
|
||||||
this->d1 = rhs.d1;
|
this->d1 = rhs.d1;
|
||||||
this->d2 = rhs.d2;
|
this->d2 = rhs.d2;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
CKGUID& operator=(CKGUID&& rhs) {
|
CKGUID& operator=(CKGUID&& rhs) noexcept {
|
||||||
this->d1 = rhs.d1;
|
this->d1 = rhs.d1;
|
||||||
this->d2 = rhs.d2;
|
this->d2 = rhs.d2;
|
||||||
return *this;
|
return *this;
|
||||||
|
|||||||
Reference in New Issue
Block a user