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

work on extract tool

This commit is contained in:
Jack Andersen
2015-07-09 19:28:33 -10:00
parent 81d8329f74
commit 45c593b596
6 changed files with 92 additions and 19 deletions

View File

@@ -207,20 +207,19 @@ Project::Project(const ProjectRootPath& rootPath)
FILE* bf = HECL::Fopen((m_rootPath.getAbsolutePath() + _S("/.hecl/beacon")).c_str(), _S("a+b"));
struct BeaconStruct
{
FourCC magic;
uint32_t magic;
uint32_t version;
} beacon;
#define DATA_VERSION 1
static const FourCC hecl("HECL");
if (fread(&beacon, 1, sizeof(beacon), bf) != sizeof(beacon))
{
fseek(bf, 0, SEEK_SET);
beacon.magic = hecl;
beacon.magic = SBig('HECL');
beacon.version = SBig(DATA_VERSION);
fwrite(&beacon, 1, sizeof(beacon), bf);
}
fclose(bf);
if (beacon.magic != hecl ||
if (beacon.magic != SBig('HECL') ||
SBig(beacon.version) != DATA_VERSION)
{
LogModule.report(LogVisor::FatalError, "incompatible project version");