diff --git a/hecl/driver/CMakeLists.txt b/hecl/driver/CMakeLists.txt index 4e3f116ef..6451b5f95 100644 --- a/hecl/driver/CMakeLists.txt +++ b/hecl/driver/CMakeLists.txt @@ -19,6 +19,7 @@ list(APPEND DATA_SPEC_LIBS DNAMP3) target_link_libraries(hecl + HECLDatabase "-Wl,-whole-archive" ${DATA_SPEC_LIBS} "-Wl,-no-whole-archive" - HECL HECLDatabase AthenaCore NOD LogVisor blowfish z lzo2 pthread + HECL AthenaCore NOD LogVisor blowfish z lzo2 pthread ) diff --git a/hecl/extern/Athena b/hecl/extern/Athena index 3ce206268..55adeec69 160000 --- a/hecl/extern/Athena +++ b/hecl/extern/Athena @@ -1 +1 @@ -Subproject commit 3ce20626864d396b45dc6345adbabe7c9873f614 +Subproject commit 55adeec69c97467c010b110d27373e02803f806f diff --git a/hecl/extern/RetroCommon b/hecl/extern/RetroCommon index 043af5558..c1f4f31e6 160000 --- a/hecl/extern/RetroCommon +++ b/hecl/extern/RetroCommon @@ -1 +1 @@ -Subproject commit 043af55580d26a8faab8007c73217c26c19c4cf8 +Subproject commit c1f4f31e6ff55889c8e32da17dd2ab500ba503cb diff --git a/hecl/include/HECL/HECL.hpp b/hecl/include/HECL/HECL.hpp index 760eec278..e7c3c668b 100644 --- a/hecl/include/HECL/HECL.hpp +++ b/hecl/include/HECL/HECL.hpp @@ -220,8 +220,9 @@ class ProjectRootPath; * This class also functions as a read/write Athena DNA type, * for easy initialization of FourCCs in DNA data records. */ -class FourCC final : public Athena::io::DNA +class FourCC { +protected: union { char fcc[4]; @@ -237,12 +238,6 @@ public: inline bool operator==(const char* other) const {return num == *(uint32_t*)other;} inline bool operator!=(const char* other) const {return num != *(uint32_t*)other;} inline std::string toString() const {return std::string(fcc, 4);} - - Delete expl; - inline void read(Athena::io::IStreamReader& reader) - {reader.readUBytesToBuf(fcc, 4);} - inline void write(Athena::io::IStreamWriter& writer) const - {writer.writeUBytes((atUint8*)fcc, 4);} }; /** diff --git a/hecl/lib/database/Project.cpp b/hecl/lib/database/Project.cpp index f78f635e6..c4bfcd0a5 100644 --- a/hecl/lib/database/Project.cpp +++ b/hecl/lib/database/Project.cpp @@ -207,19 +207,20 @@ Project::Project(const ProjectRootPath& rootPath) FILE* bf = HECL::Fopen((m_rootPath.getAbsolutePath() + _S("/.hecl/beacon")).c_str(), _S("a+b")); struct BeaconStruct { - uint32_t magic; + HECL::FourCC magic; uint32_t version; } beacon; #define DATA_VERSION 1 + static const HECL::FourCC HECLfcc("HECL"); if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon)) { fseek(bf, 0, SEEK_SET); - beacon.magic = SBig('HECL'); + beacon.magic = HECLfcc; beacon.version = SBig(DATA_VERSION); fwrite(&beacon, 1, sizeof(beacon), bf); } fclose(bf); - if (beacon.magic != SBig('HECL') || + if (beacon.magic != HECLfcc || SBig(beacon.version) != DATA_VERSION) { LogModule.report(LogVisor::FatalError, "incompatible project version");