From 8bcbd2729388edc63c82d77d314b583af1447c49 Mon Sep 17 00:00:00 2001 From: untodesu Date: Sun, 14 Sep 2025 19:16:44 +0500 Subject: Cleanup math with qfengine ports again --- game/shared/game.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'game/shared/game.cc') diff --git a/game/shared/game.cc b/game/shared/game.cc index f7b9da4..91bc3bc 100644 --- a/game/shared/game.cc +++ b/game/shared/game.cc @@ -3,6 +3,7 @@ #include "shared/game.hh" #include "core/io/cmdline.hh" +#include "core/io/physfs.hh" static std::filesystem::path get_gamepath(void) { @@ -77,7 +78,7 @@ void shared_game::init(int argc, char** argv) logger->flush(); if(!PHYSFS_init(argv[0])) { - spdlog::critical("physfs: init failed: {}", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("physfs: init failed: {}", io::physfs_error()); std::terminate(); } @@ -92,17 +93,17 @@ void shared_game::init(int argc, char** argv) std::filesystem::create_directories(userpath, ignore_error); if(!PHYSFS_mount(gamepath.string().c_str(), nullptr, false)) { - spdlog::critical("physfs: mount {} failed: {}", gamepath.string(), PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("physfs: mount {} failed: {}", gamepath.string(), io::physfs_error()); std::terminate(); } if(!PHYSFS_mount(userpath.string().c_str(), nullptr, false)) { - spdlog::critical("physfs: mount {} failed: {}", userpath.string(), PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("physfs: mount {} failed: {}", userpath.string(), io::physfs_error()); std::terminate(); } if(!PHYSFS_setWriteDir(userpath.string().c_str())) { - spdlog::critical("physfs: setwritedir {} failed: {}", userpath.string(), PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("physfs: setwritedir {} failed: {}", userpath.string(), io::physfs_error()); std::terminate(); } @@ -117,7 +118,7 @@ void shared_game::shutdown(void) enet_deinitialize(); if(!PHYSFS_deinit()) { - spdlog::critical("physfs: deinit failed: {}", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("physfs: deinit failed: {}", io::physfs_error()); std::terminate(); } } -- cgit