mirror of https://github.com/AxioDL/metaforce.git
restored standalone FourCC class
This commit is contained in:
parent
45c593b596
commit
e1a37b53eb
|
@ -19,6 +19,7 @@ list(APPEND DATA_SPEC_LIBS
|
||||||
DNAMP3)
|
DNAMP3)
|
||||||
|
|
||||||
target_link_libraries(hecl
|
target_link_libraries(hecl
|
||||||
|
HECLDatabase
|
||||||
"-Wl,-whole-archive" ${DATA_SPEC_LIBS} "-Wl,-no-whole-archive"
|
"-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
|
||||||
)
|
)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3ce20626864d396b45dc6345adbabe7c9873f614
|
Subproject commit 55adeec69c97467c010b110d27373e02803f806f
|
|
@ -1 +1 @@
|
||||||
Subproject commit 043af55580d26a8faab8007c73217c26c19c4cf8
|
Subproject commit c1f4f31e6ff55889c8e32da17dd2ab500ba503cb
|
|
@ -220,8 +220,9 @@ class ProjectRootPath;
|
||||||
* This class also functions as a read/write Athena DNA type,
|
* This class also functions as a read/write Athena DNA type,
|
||||||
* for easy initialization of FourCCs in DNA data records.
|
* for easy initialization of FourCCs in DNA data records.
|
||||||
*/
|
*/
|
||||||
class FourCC final : public Athena::io::DNA<Athena::BigEndian>
|
class FourCC
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
char fcc[4];
|
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 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);}
|
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);}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -207,19 +207,20 @@ Project::Project(const ProjectRootPath& rootPath)
|
||||||
FILE* bf = HECL::Fopen((m_rootPath.getAbsolutePath() + _S("/.hecl/beacon")).c_str(), _S("a+b"));
|
FILE* bf = HECL::Fopen((m_rootPath.getAbsolutePath() + _S("/.hecl/beacon")).c_str(), _S("a+b"));
|
||||||
struct BeaconStruct
|
struct BeaconStruct
|
||||||
{
|
{
|
||||||
uint32_t magic;
|
HECL::FourCC magic;
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
} beacon;
|
} beacon;
|
||||||
#define DATA_VERSION 1
|
#define DATA_VERSION 1
|
||||||
|
static const HECL::FourCC HECLfcc("HECL");
|
||||||
if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon))
|
if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon))
|
||||||
{
|
{
|
||||||
fseek(bf, 0, SEEK_SET);
|
fseek(bf, 0, SEEK_SET);
|
||||||
beacon.magic = SBig('HECL');
|
beacon.magic = HECLfcc;
|
||||||
beacon.version = SBig(DATA_VERSION);
|
beacon.version = SBig(DATA_VERSION);
|
||||||
fwrite(&beacon, 1, sizeof(beacon), bf);
|
fwrite(&beacon, 1, sizeof(beacon), bf);
|
||||||
}
|
}
|
||||||
fclose(bf);
|
fclose(bf);
|
||||||
if (beacon.magic != SBig('HECL') ||
|
if (beacon.magic != HECLfcc ||
|
||||||
SBig(beacon.version) != DATA_VERSION)
|
SBig(beacon.version) != DATA_VERSION)
|
||||||
{
|
{
|
||||||
LogModule.report(LogVisor::FatalError, "incompatible project version");
|
LogModule.report(LogVisor::FatalError, "incompatible project version");
|
||||||
|
|
Loading…
Reference in New Issue