[Scummvm-cvs-logs] SF.net SVN: scummvm:[41202] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jun 6 01:08:35 CEST 2009


Revision: 41202
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41202&view=rev
Author:   thebluegr
Date:     2009-06-05 23:08:35 +0000 (Fri, 05 Jun 2009)

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/sfx/core.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-05 22:53:36 UTC (rev 41201)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-05 23:08:35 UTC (rev 41202)
@@ -304,7 +304,7 @@
 	switch (argc) {
 	case 1 :
 		if (s->_version < SCI_VERSION_1_1) {
-			if (SKPV(0) == 0 || SKPV(0) == 1 || SKPV(0) == -1) {
+			if (SKPV(0) <= 1) {
 				// Newer (SCI1.1) semantics: show/hide cursor
 				g_system->showMouse(SKPV(0) != 0);
 			} else {
@@ -329,7 +329,7 @@
 			// this would open the menu on top. LSL5 is an exception, as the game can open
 			// the menu when the player presses a button during the intro, but the cursor is
 			// not placed on (x, 0) or (x, 1)
-			if (SKPV(1) == 0 || SKPV(1) == 1 || SKPV(1) == -1) {
+			if (SKPV(1) <= 1) {
 				GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, 
 							SKPV(1) == 0 ? GFXOP_NO_POINTER : SKPV(0)));
 			} else {	// newer (SCI1.1) semantics: set pointer position

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-05 22:53:36 UTC (rev 41201)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-06-05 23:08:35 UTC (rev 41202)
@@ -36,7 +36,6 @@
 struct _scummvm_driver_state {
 	gfx_pixmap_t *priority[2];
 	byte *visual[2];
-	uint8 *pointer_data;
 	int xsize, ysize;
 };
 
@@ -53,7 +52,6 @@
 	S->xsize = xfact * 320;
 	S->ysize = yfact * 200;
 
-	S->pointer_data = NULL;
 	//S->buckystate = 0;
 
 	for (i = 0; i < 2; i++) {
@@ -94,9 +92,6 @@
 			S->visual[i] = NULL;
 		}
 
-		delete[] S->pointer_data;
-		S->pointer_data = NULL;
-
 		delete S;
 	}
 }
@@ -284,8 +279,7 @@
 	if ((pointer == NULL) || (hotspot == NULL)) {
 		g_system->showMouse(false);
 	} else {
-		delete[] S->pointer_data;
-		S->pointer_data = create_cursor(drv, pointer, 1);
+		uint8 *cursorData = create_cursor(drv, pointer, 1);
 
 		// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT
 		// Note that some cursors don't have a palette in SQ5
@@ -297,8 +291,11 @@
 		if (!pointer->palette)
 			color_key = 63;
 
-		g_system->setMouseCursor(S->pointer_data, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key);
+		g_system->setMouseCursor(cursorData, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key);
 		g_system->showMouse(true);
+
+		delete[] cursorData;
+		cursorData = 0;
 	}
 
 	return GFX_OK;

Modified: scummvm/trunk/engines/sci/sfx/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/core.cpp	2009-06-05 22:53:36 UTC (rev 41201)
+++ scummvm/trunk/engines/sci/sfx/core.cpp	2009-06-05 23:08:35 UTC (rev 41202)
@@ -807,14 +807,14 @@
 		setSongStatus( song, SOUND_STATUS_STOPPED);
 
 		fprintf(stderr, "Overwriting old song (%08lx) ...\n", handle);
-		if (song->status == SOUND_STATUS_PLAYING
-		        || song->status == SOUND_STATUS_SUSPENDED) {
+		if (song->status == SOUND_STATUS_PLAYING || song->status == SOUND_STATUS_SUSPENDED) {
 			delete it;
 			error("Unexpected (error): Song %ld still playing/suspended (%d)",
 			        handle, song->status);
 			return;
-		} else
+		} else {
 			song_lib_remove(_songlib, handle); /* No duplicates */
+		}
 
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list