fix: fix issues

- fix BMapBindings generator due to the rename of LIBCMO_EXPORT -> BMAP_EXPORT.
- fix relative path issue in Python scripts within CodeGen.
- remove all references to LIBCMO_PANIC. use exception instead to tell user they are fool.
- basically finish universal encoding tables. add lost encoding name.
This commit is contained in:
2024-08-17 23:29:08 +08:00
parent e682a87d25
commit 9903b61cac
12 changed files with 49 additions and 29 deletions

View File

@ -323,12 +323,12 @@ namespace LibCmo::CK2 {
CKFileVisitor::CKFileVisitor(CKFileReader* reader) :
m_IsReader(true), m_Reader(reader), m_Writer(nullptr), m_Ctx(reader->m_Ctx) {
if (reader == nullptr) LIBCMO_PANIC("Reader is nullptr.");
if (reader == nullptr) throw LogicException("Reader is nullptr.");
}
CKFileVisitor::CKFileVisitor(CKFileWriter* writer) :
m_IsReader(false), m_Reader(nullptr), m_Writer(writer), m_Ctx(writer->m_Ctx) {
if (writer == nullptr) LIBCMO_PANIC("Writer is nullptr.");
if (writer == nullptr) throw LogicException("Writer is nullptr.");
}
CKFileVisitor::CKFileVisitor(const CKFileVisitor& rhs) :

View File

@ -56,7 +56,7 @@ namespace LibCmo::CK2 {
m_Host(host), m_ConsumedSize(init_size) {}
YYCC_DEF_CLS_COPY_MOVE(LockedReadBufferDeleter);
void operator()(LIBCMO_UNUSED const void* buf);
void operator()(const void* /*buf*/);
void SetConsumedSize(CKDWORD newsize);
private:
CKStateChunk* m_Host;
@ -70,7 +70,7 @@ namespace LibCmo::CK2 {
m_Host(host), m_ConsumedSize(init_size) {}
YYCC_DEF_CLS_COPY_MOVE(LockedWriteBufferDeleter);
void operator()(LIBCMO_UNUSED const void* buf);
void operator()(const void* /*buf*/);
void SetConsumedSize(CKDWORD newsize);
private:
CKStateChunk* m_Host;

View File

@ -101,7 +101,7 @@ namespace LibCmo::CK2 {
#pragma region Self Used Data Struct
void CKStateChunk::LockedReadBufferDeleter::operator()(LIBCMO_UNUSED const void* buf) {
void CKStateChunk::LockedReadBufferDeleter::operator()(const void* /*buf*/) {
if (m_Host == nullptr) return;
m_Host->UnLockReadBuffer(m_ConsumedSize);
}
@ -110,7 +110,7 @@ namespace LibCmo::CK2 {
m_ConsumedSize = newsize;
}
void CKStateChunk::LockedWriteBufferDeleter::operator()(LIBCMO_UNUSED const void* buf) {
void CKStateChunk::LockedWriteBufferDeleter::operator()(const void* /*buf*/) {
if (m_Host == nullptr) return;
m_Host->UnLockWriteBuffer(m_ConsumedSize);
}

View File

@ -90,7 +90,7 @@ namespace LibCmo::CK2::MgrImpls {
data for your manager.
@see CKStateChunk, LoadData
*/
virtual bool SaveData(LIBCMO_UNUSED CKStateChunk* chunk, LIBCMO_UNUSED CKFileVisitor* SavedFile) {
virtual bool SaveData([[maybe_unused]] CKStateChunk* chunk, [[maybe_unused]] CKFileVisitor* SavedFile) {
return false; // default value is false to indicate this manager do not need save any data.
}
/**
@ -102,7 +102,7 @@ namespace LibCmo::CK2::MgrImpls {
+ During a load operation, each manager is automatically called if there was a chunk saved in the file with SaveData.
@see CKStateChunk, SaveData
*/
virtual CKERROR LoadData(LIBCMO_UNUSED CKStateChunk* chunk, LIBCMO_UNUSED CKFileVisitor* LoadedFile) {
virtual CKERROR LoadData([[maybe_unused]] CKStateChunk* chunk, [[maybe_unused]] CKFileVisitor* LoadedFile) {
return CKERROR::CKERR_OK;
}
@ -138,7 +138,7 @@ namespace LibCmo::CK2::MgrImpls {
CKMANAGER_FUNC_OnSequenceToBeDeleted for this function to get called.
@see Main Virtools Events, CKContext::DestroyObjects, SequenceDeleted
*/
virtual CKERROR SequenceToBeDeleted(LIBCMO_UNUSED const CK_ID* objids, LIBCMO_UNUSED CKDWORD count) { return CKERROR::CKERR_OK; }
virtual CKERROR SequenceToBeDeleted([[maybe_unused]] const CK_ID* objids, [[maybe_unused]] CKDWORD count) { return CKERROR::CKERR_OK; }
/**
@brief Called after objects have been deleted.
@return CK_OK if successful or an error code otherwise.
@ -150,7 +150,7 @@ namespace LibCmo::CK2::MgrImpls {
CKMANAGER_FUNC_OnSequenceDeleted for this function to get called.
@see Main Virtools Events, CKContext::DestroyObjects, SequenceToBeDeleted
*/
virtual CKERROR SequenceDeleted(LIBCMO_UNUSED const CK_ID* objids, LIBCMO_UNUSED CKDWORD count) { return CKERROR::CKERR_OK; }
virtual CKERROR SequenceDeleted([[maybe_unused]] const CK_ID* objids, [[maybe_unused]] CKDWORD count) { return CKERROR::CKERR_OK; }
protected: