[Scummvm-cvs-logs] SF.net SVN: scummvm: [32279] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon May 26 09:27:46 CEST 2008


Revision: 32279
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32279&view=rev
Author:   john_doe
Date:     2008-05-26 00:27:46 -0700 (Mon, 26 May 2008)

Log Message:
-----------
- Hopefully fixed 'responsiveness' of the mouse cursor/event handling
- Disabled auto dirty rects which caused major gfx problems
- Added default mouse cursor for Manhole: N&E
- Fixed sound rate for Manhole: N&E
- Don't automatically show mouse cursor when a new cursor was loaded

Modified Paths:
--------------
    scummvm/trunk/engines/made/made.cpp
    scummvm/trunk/engines/made/screen.cpp
    scummvm/trunk/engines/made/screen.h
    scummvm/trunk/engines/made/scriptfuncs.cpp

Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp	2008-05-26 07:20:23 UTC (rev 32278)
+++ scummvm/trunk/engines/made/made.cpp	2008-05-26 07:27:46 UTC (rev 32279)
@@ -109,7 +109,13 @@
 	
 	_quit = false;
 
-	_soundRate = 8000;
+	// Set default sound frequency
+	// Return to Zork sets it itself via a script funtion
+	if (getGameID() == GID_MANHOLE) {
+		_soundRate = 11025;
+	} else {
+		_soundRate = 8000;
+	}
 
 }
 
@@ -176,7 +182,7 @@
 	Common::Event event;
 	Common::EventManager *eventMan = _system->getEventManager();
 
-	// NOTE: Don't reset _eventNum to 0 here or no events will come through to the scripts.
+	// NOTE: Don't reset _eventNum to 0 here or no events will get through to the scripts.
 
 	while (eventMan->pollEvent(event)) {
 		switch (event.type) {
@@ -225,8 +231,6 @@
 		}
 	}
 
-	_system->updateScreen();
-
 }
 
 int MadeEngine::go() {
@@ -265,13 +269,15 @@
 
 	// FIXME: This should make things a little faster until proper dirty rectangles
 	//        are implemented.
-	_system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true);
+	// NOTE: Disabled again since it causes major graphics errors.
+	//_system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true);
 
 	_eventNum = _eventKey = _eventMouseX = _eventMouseY = 0;
 	
 #ifdef DUMP_SCRIPTS
 	_script->dumpAllScripts();
 #else
+	_screen->setDefaultMouseCursor();
 	_script->runScript(_dat->getMainCodeObjectIndex());
 #endif
 

Modified: scummvm/trunk/engines/made/screen.cpp
===================================================================
--- scummvm/trunk/engines/made/screen.cpp	2008-05-26 07:20:23 UTC (rev 32278)
+++ scummvm/trunk/engines/made/screen.cpp	2008-05-26 07:27:46 UTC (rev 32279)
@@ -352,6 +352,8 @@
 
 	_vm->_system->copyRectToScreen((const byte*)_workScreen->pixels, _workScreen->pitch, 0, 0, _workScreen->w, _workScreen->h);
 	
+	_vm->_system->updateScreen();
+	
 }
 
 void Screen::clearChannels() {
@@ -824,4 +826,8 @@
 	_spriteList.clear();
 }
 
+void Screen::setDefaultMouseCursor() {
+	CursorMan.replaceCursor(defaultMouseCursor, 16, 16, 9, 2, 0);
+}
+
 } // End of namespace Made

Modified: scummvm/trunk/engines/made/screen.h
===================================================================
--- scummvm/trunk/engines/made/screen.h	2008-05-26 07:20:23 UTC (rev 32278)
+++ scummvm/trunk/engines/made/screen.h	2008-05-26 07:27:46 UTC (rev 32279)
@@ -31,6 +31,7 @@
 #include "common/rect.h"
 
 #include "graphics/surface.h"
+#include "graphics/cursorman.h"
 
 #include "made/resource.h"
 #include "made/screenfx.h"
@@ -62,6 +63,25 @@
 
 class MadeEngine;
 
+static const byte defaultMouseCursor[256] = {
+	0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  0,  0,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  0,  0,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  0,  0,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	0,  1,  1,  1,  1,  1,  1,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	1,  1, 15,  1, 15,  1, 15,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	1, 15, 15,  1, 15,  1, 15,  1, 15, 15,  1,  0,  0,  0,  0,  0,
+	1, 15, 15, 15, 15, 15, 15, 15, 15, 15,  1,  0,  1,  1,  1,  0,
+	1, 15, 15, 15, 15, 15, 15, 15, 15, 15,  1,  1, 15, 15, 15,  1,
+	1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  1,  1,  1,
+	1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  1,  1,  0,  0,
+	1,  1, 15, 15, 15, 15, 15, 15, 15, 15, 15,  1,  1,  0,  0,  0,
+	0,  1,  1, 15, 15, 15, 15, 15, 15, 15,  1,  1,  0,  0,  0,  0,
+	0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,
+	0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
+};
+
 class Screen {
 public:
 	Screen(MadeEngine *vm);
@@ -166,6 +186,8 @@
 	int16 addToSpriteList(int16 index, int16 xofs, int16 yofs);
 	SpriteListItem getFromSpriteList(int16 index);
 	void clearSpriteList();
+	
+	void setDefaultMouseCursor();
 
 protected:
 	MadeEngine *_vm;

Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	2008-05-26 07:20:23 UTC (rev 32278)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2008-05-26 07:27:46 UTC (rev 32279)
@@ -195,6 +195,9 @@
 }
 
 int16 ScriptFunctions::sfPollEvent(int16 argc, int16 *argv) {
+
+	_vm->_system->updateScreen();
+
 	int16 eventNum = _vm->_eventNum;
 	_vm->_eventNum = 0;
 	return eventNum;
@@ -487,7 +490,6 @@
 	if (flex) {
 		Graphics::Surface *surf = flex->getPicture();
 		CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
-		CursorMan.showMouse(true);
 		_vm->_res->freeResource(flex);
 	}
 	return 0;


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