reman3/game_re/binders/gh_static_mem.cxx

13 lines
359 B
C++

#include "gh_static_mem.h"
#include <spdlog/spdlog.h>
unsigned char gh_static_mem[GH_DATA_SIZE];
void gh_init_data_segment() {
SPDLOG_INFO("Initializing data segment");
FILE *f = fopen("gh_datasegment.bin", "r");
if (!f) {
throw std::runtime_error("Failed to open gh_datasegment.bin");
}
fread(gh_static_mem, 1, gh_data_size, f);
fclose(f);
}