From 8f98b316812609594484795c1ccab07f51284264 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Mon, 20 Jan 2003 07:58:41 +0000 Subject: [PATCH] NoGameX file - put in root directory (HPC debug option) and NoMusic configuration option (for really slow devices, can break some games) svn-id: r6525 --- backends/wince/pocketpc.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/backends/wince/pocketpc.cpp b/backends/wince/pocketpc.cpp index 4dbf9768521..33b3aaeb351 100644 --- a/backends/wince/pocketpc.cpp +++ b/backends/wince/pocketpc.cpp @@ -313,7 +313,7 @@ GameX *gameX; int gameXGXOpenDisplay(HWND hWnd, DWORD dwFlags) { gameX = new GameX(); - if (!gameX->OpenGraphics()) { + if (!gameX || !gameX->OpenGraphics() || !gameX->GetFBAddress()) { //MessageBox(NULL, TEXT("Couldn't initialize GameX. Reverting to GDI graphics"), TEXT("PocketScumm rendering"), MB_OK); noGAPI = 1; } @@ -791,7 +791,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLin dynamicGXBeginDraw = defaultGXBeginDraw; #else - dynamicGXOpenInput = gameXGXOpenInput; dynamicGXGetDefaultKeys = gameXGXGetDefaultKeys; dynamicGXCloseDisplay = gameXGXCloseDisplay; @@ -803,6 +802,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLin dynamicGXEndDraw = gameXGXEndDraw; dynamicGXBeginDraw = gameXGXBeginDraw; + FILE *test; + + test = fopen("NoGameX", "r"); + if (test) { + noGAPI = 1; + fclose(test); + } + else + if (g_config->getBool("NoGameX", false, "wince")) + noGAPI = 1; + #endif gfx_mode_switch = false; @@ -881,19 +891,23 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLin } void runGame(char *game_name) { - int argc = 3; - char* argv[3]; + int argc = 4; + char* argv[4]; char argdir[MAX_PATH]; + char music[100]; + bool no_music; select_game = false; argv[0] = NULL; sprintf(argdir, "-p%s", _directory); argv[1] = argdir; - argv[2] = game_name; + no_music = g_config->getBool("NoMusic", false, "wince"); + sprintf(music, "-e%s", (no_music ? "null" : "adlib")); + argv[2] = music; + argv[3] = game_name; - if (!argv[2]) - //return 0; + if (!argv[3]) return; // No default toolbar for zak256