mirror of
https://github.com/decompals/wibo.git
synced 2025-12-16 00:17:04 +00:00
Implement enough process handling logic to make psyq4.0 happy (#46)
* Implement enough process handling logic to make psyq4.0 happy * revert gitignore * data type update * PR review * DEBUG_LOG mistake --------- Co-authored-by: ConorBobbleHat <c.github@firstpartners.net>
This commit is contained in:
15
main.cpp
15
main.cpp
@@ -13,15 +13,22 @@
|
||||
uint32_t wibo::lastError = 0;
|
||||
char** wibo::argv;
|
||||
int wibo::argc;
|
||||
char *wibo::executableName;
|
||||
char *wibo::commandLine;
|
||||
wibo::Executable *wibo::mainModule = 0;
|
||||
bool wibo::debugEnabled = false;
|
||||
unsigned int wibo::debugIndent = 0;
|
||||
|
||||
void wibo::debug_log(const char *fmt, ...) {
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
if (wibo::debugEnabled)
|
||||
if (wibo::debugEnabled) {
|
||||
for (size_t i = 0; i < wibo::debugIndent; i++)
|
||||
fprintf(stderr, "\t");
|
||||
|
||||
vfprintf(stderr, fmt, args);
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
@@ -198,6 +205,11 @@ int main(int argc, char **argv) {
|
||||
wibo::debugEnabled = true;
|
||||
}
|
||||
|
||||
if (getenv("WIBO_DEBUG_INDENT")) {
|
||||
wibo::debugIndent = std::stoul(getenv("WIBO_DEBUG_INDENT"));
|
||||
}
|
||||
|
||||
|
||||
files::init();
|
||||
|
||||
// Create TIB
|
||||
@@ -264,6 +276,7 @@ int main(int argc, char **argv) {
|
||||
wibo::commandLine = cmdLine.data();
|
||||
DEBUG_LOG("Command line: %s\n", wibo::commandLine);
|
||||
|
||||
wibo::executableName = argv[0];
|
||||
wibo::argv = argv + 1;
|
||||
wibo::argc = argc - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user