diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-04-28 07:50:31 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-04-28 09:23:47 +0200 |
| commit | 63eb46698b1e19d3f36944992b948c54a7a3740b (patch) | |
| tree | 1aa8b686039e2f9291d680c21a47427de5daa12b /libraries/vfs.h | |
| parent | 0ed91795a2db720e688fd2daefd22f7e9c754c2f (diff) | |
| download | stalag-63eb46698b1e19d3f36944992b948c54a7a3740b.tar.gz | |
Compiler settings and macOS port
Diffstat (limited to 'libraries/vfs.h')
| -rw-r--r-- | libraries/vfs.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libraries/vfs.h b/libraries/vfs.h index 6a243cc..6017407 100644 --- a/libraries/vfs.h +++ b/libraries/vfs.h @@ -57,28 +57,28 @@ void vfs_init(const char* pak_path) { const char* debug_env = getenv("DEBUG"); if (debug_env && (strcmp(debug_env, "1") == 0 || strcmp(debug_env, "true") == 0)) { g_disk_mode = 1; - log_message(stdout, LOG_INFO, "VFS: Operating in Disk Mode (DEBUG enabled)"); + TraceLog(LOG_INFO, "VFS: Operating in Disk Mode (DEBUG enabled)"); return; } FILE* f = fopen(pak_path, "rb"); if (!f) { - log_message(stderr, LOG_ERROR, "VFS: Failed to open pak file: %s (Error: %s)", pak_path, strerror(errno)); - log_message(stderr, LOG_WARN, "VFS: Falling back to Disk Mode"); + TraceLog(LOG_ERROR, "VFS: Failed to open pak file: %s (Error: %s)", pak_path, strerror(errno)); + TraceLog(LOG_WARNING, "VFS: Falling back to Disk Mode"); g_disk_mode = 1; return; } VfsHeader header; if (fread(&header, sizeof(VfsHeader), 1, f) != 1) { - log_message(stderr, LOG_ERROR, "VFS: Failed to read header from %s", pak_path); + TraceLog(LOG_ERROR, "VFS: Failed to read header from %s", pak_path); fclose(f); g_disk_mode = 1; return; } if (memcmp(header.magic, "DRP1", 4) != 0) { - log_message(stderr, LOG_ERROR, "VFS: Invalid magic in %s", pak_path); + TraceLog(LOG_ERROR, "VFS: Invalid magic in %s", pak_path); fclose(f); g_disk_mode = 1; return; @@ -87,7 +87,7 @@ void vfs_init(const char* pak_path) { g_num_entries = header.num_files; g_entries = (VfsEntry*)malloc(sizeof(VfsEntry) * g_num_entries); if (fread(g_entries, sizeof(VfsEntry), g_num_entries, f) != g_num_entries) { - log_message(stderr, LOG_ERROR, "VFS: Failed to read index table from %s", pak_path); + TraceLog(LOG_ERROR, "VFS: Failed to read index table from %s", pak_path); free(g_entries); g_entries = NULL; fclose(f); @@ -97,7 +97,7 @@ void vfs_init(const char* pak_path) { fclose(f); strncpy(g_pak_path, pak_path, sizeof(g_pak_path) - 1); - log_message(stdout, LOG_INFO, "VFS: Loaded %u files from %s", g_num_entries, pak_path); + TraceLog(LOG_INFO, "VFS: Loaded %u files from %s", g_num_entries, pak_path); } void vfs_shutdown(void) { @@ -137,7 +137,7 @@ VfsFile* vfs_open(const char* path) { } } - log_message(stderr, LOG_WARN, "VFS: File not found: %s", path); + TraceLog(LOG_WARNING, "VFS: File not found: %s", path); return NULL; } |
