galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
PhysFSError.cpp
Go to the documentation of this file.
1
7
8#include <physfs.h>
9
11
12#include "PhysFSError.hpp"
13
14namespace galaxy
15{
16 namespace logging
17 {
18 bool physfs_check(const int code) noexcept
19 {
20 if (code == 0 || code == -1)
21 {
22 GALAXY_LOG(GALAXY_ERROR, "PHYSFS: {0}.", PHYSFS_getLastError());
23 return false;
24 }
25
26 return true;
27 }
28
29 bool physfs_check(void* ptr) noexcept
30 {
31 if (!ptr)
32 {
33 GALAXY_LOG(GALAXY_ERROR, "PHYSFS: {0}.", PHYSFS_getLastError());
34 return false;
35 }
36
37 return true;
38 }
39 } // namespace logging
40} // namespace galaxy
#define GALAXY_LOG(level, msg,...)
Definition Log.hpp:29
#define GALAXY_ERROR
Definition Log.hpp:25
bool physfs_check(const int code) noexcept
Call a physfs function with error handling and logs a message for you.
Timer.hpp galaxy.
Definition Async.hpp:17