[Scummvm-cvs-logs] CVS: scummvm/backends/wince pocketpc.cpp,1.16,1.17

Nicolas Bacca arisme at users.sourceforge.net
Sun Jan 19 23:59:12 CET 2003


Update of /cvsroot/scummvm/scummvm/backends/wince
In directory sc8-pr-cvs1:/tmp/cvs-serv25844

Modified Files:
	pocketpc.cpp 
Log Message:
NoGameX file - put in root directory (HPC debug option) and NoMusic configuration option (for really slow devices, can break some games)

Index: pocketpc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/pocketpc.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pocketpc.cpp	2 Dec 2002 00:42:40 -0000	1.16
+++ pocketpc.cpp	20 Jan 2003 07:58:41 -0000	1.17
@@ -313,7 +313,7 @@
 
 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;
 	}
@@ -697,7 +697,7 @@
 		MessageBox(NULL, TEXT(Function), TEXT("Error importing DLL function"), MB_OK); \
 		exit(1); \
 	}
-
+
 
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
 {
@@ -711,13 +711,13 @@
 	
 	HMODULE aygshell_handle;
 	//HMODULE SDLAudio_handle;
-	HMODULE GAPI_handle;
+	HMODULE GAPI_handle;
 
 	hide_toolbar = false;
-	noGAPI = 0;
+	noGAPI = 0;
 
 	g_config = new Config("scummvm.ini", "scummvm");
-	g_config->set_writing(true);
+	g_config->set_writing(true);
 
 	// See if we're running on a Windows CE version supporting aygshell
 	aygshell_handle = LoadLibrary(TEXT("aygshell.dll"));
@@ -791,7 +791,6 @@
 		dynamicGXBeginDraw = defaultGXBeginDraw;
 
 #else
-
 		dynamicGXOpenInput = gameXGXOpenInput;
 		dynamicGXGetDefaultKeys = gameXGXGetDefaultKeys;
 		dynamicGXCloseDisplay = gameXGXCloseDisplay;
@@ -802,6 +801,17 @@
 		dynamicGXOpenDisplay = gameXGXOpenDisplay;
 		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
 
@@ -880,20 +890,24 @@
 	return 0;
 }
 
-void runGame(char *game_name) {
-	int argc = 3;
-	char* argv[3];
+void runGame(char *game_name) {
+	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;
-
-	if (!argv[2])
-		//return 0;
+	argv[1] = argdir;
+	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[3])
 		return;
 
 	// No default toolbar for zak256





More information about the Scummvm-git-logs mailing list