fallout2-ce/src/win32.cc

54 lines
994 B
C++

#include "win32.h"
#include <stdlib.h>
#include <SDL.h>
#include "core.h"
#include "main.h"
#include "window_manager.h"
#ifdef _WIN32
// 0x51E444
bool gProgramIsActive = false;
// GNW95MUTEX
HANDLE _GNW95_mutex = NULL;
// 0x4DE700
int main(int argc, char* argv[])
{
_GNW95_mutex = CreateMutexA(0, TRUE, "GNW95MUTEX");
if (GetLastError() == ERROR_SUCCESS) {
SDL_ShowCursor(SDL_DISABLE);
gProgramIsActive = true;
falloutMain(argc, argv);
CloseHandle(_GNW95_mutex);
}
return 0;
}
#else
bool gProgramIsActive = false;
int main(int argc, char* argv[])
{
#if __APPLE__
char* basePath = SDL_GetBasePath();
chdir(basePath);
SDL_free(basePath);
#endif
#if __ANDROID__
SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0");
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
chdir(SDL_AndroidGetExternalStoragePath());
#endif
SDL_ShowCursor(SDL_DISABLE);
gProgramIsActive = true;
return falloutMain(argc, argv);
}
#endif