2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 14:24:56 +00:00

restored standalone FourCC class

This commit is contained in:
Jack Andersen
2015-07-11 12:42:40 -10:00
parent 45c593b596
commit e1a37b53eb
5 changed files with 10 additions and 13 deletions

View File

@@ -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
)

2
hecl/extern/Athena vendored

Submodule hecl/extern/Athena updated: 3ce2062686...55adeec69c

Submodule hecl/extern/RetroCommon updated: 043af55580...c1f4f31e6f

View File

@@ -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<Athena::BigEndian>
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);}
};
/**

View File

@@ -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");