[Scummvm-cvs-logs] scummvm master -> e20b90543d05b8e2c6e97004be36e43d5c671aa7

DrMcCoy drmccoy at drmccoy.de
Fri Aug 26 06:13:45 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e20b90543d GOB: Fix the Geisha cursor


Commit: e20b90543d05b8e2c6e97004be36e43d5c671aa7
    https://github.com/scummvm/scummvm/commit/e20b90543d05b8e2c6e97004be36e43d5c671aa7
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-08-25T21:09:56-07:00

Commit Message:
GOB: Fix the Geisha cursor

Changed paths:
  A engines/gob/init_geisha.cpp
    engines/gob/draw_v1.cpp
    engines/gob/game.cpp
    engines/gob/gob.cpp
    engines/gob/init.h
    engines/gob/init_v1.cpp
    engines/gob/init_v2.cpp
    engines/gob/inter.h
    engines/gob/inter_geisha.cpp
    engines/gob/module.mk



diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 3873a99..064c749 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -44,8 +44,8 @@ void Draw_v1::initScreen() {
 	_backSurface  = _vm->_video->initSurfDesc(320, 200);
 	_frontSurface = _vm->_global->_primarySurfDesc;
 
-	_cursorSprites = _vm->_video->initSurfDesc(32, 16, 2);
-	_scummvmCursor = _vm->_video->initSurfDesc(16, 16, SCUMMVM_CURSOR);
+	_cursorSprites = _vm->_video->initSurfDesc(_cursorWidth * 2, _cursorHeight, 2);
+	_scummvmCursor = _vm->_video->initSurfDesc(_cursorWidth    , _cursorHeight, SCUMMVM_CURSOR);
 }
 
 void Draw_v1::closeScreen() {
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 926027e..7b43e9c 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -492,9 +492,6 @@ void Game::prepareStart() {
 	_vm->_draw->_noInvalidated = true;
 	_vm->_draw->_applyPal = false;
 	_vm->_draw->_paletteCleared = false;
-	_vm->_draw->_cursorWidth = 16;
-	_vm->_draw->_cursorHeight = 16;
-	_vm->_draw->_transparentCursor = 1;
 
 	for (int i = 0; i < 40; i++) {
 		_vm->_draw->_cursorAnimLow[i] = -1;
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 59a9695..7bb7928 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -414,7 +414,7 @@ bool GobEngine::initGameParts() {
 		break;
 
 	case kGameTypeGeisha:
-		_init     = new Init_v1(this);
+		_init     = new Init_Geisha(this);
 		_video    = new Video_v1(this);
 		_inter    = new Inter_Geisha(this);
 		_mult     = new Mult_v1(this);
diff --git a/engines/gob/init.h b/engines/gob/init.h
index 1cb2904..e8c948c 100644
--- a/engines/gob/init.h
+++ b/engines/gob/init.h
@@ -56,6 +56,14 @@ public:
 	void initVideo();
 };
 
+class Init_Geisha : public Init_v1 {
+public:
+	Init_Geisha(GobEngine *vm);
+	~Init_Geisha();
+
+	void initVideo();
+};
+
 class Init_v2 : public Init_v1 {
 public:
 	Init_v2(GobEngine *vm);
diff --git a/engines/gob/init_geisha.cpp b/engines/gob/init_geisha.cpp
new file mode 100644
index 0000000..01081a5
--- /dev/null
+++ b/engines/gob/init_geisha.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/endian.h"
+
+#include "gob/gob.h"
+#include "gob/init.h"
+#include "gob/global.h"
+#include "gob/draw.h"
+#include "gob/video.h"
+
+namespace Gob {
+
+Init_Geisha::Init_Geisha(GobEngine *vm) : Init_v1(vm) {
+}
+
+Init_Geisha::~Init_Geisha() {
+}
+
+void Init_Geisha::initVideo() {
+	Init_v1::initVideo();
+
+	_vm->_draw->_cursorWidth       = 16;
+	_vm->_draw->_cursorHeight      = 23;
+	_vm->_draw->_transparentCursor =  1;
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/init_v1.cpp b/engines/gob/init_v1.cpp
index 6772a13..25d521a 100644
--- a/engines/gob/init_v1.cpp
+++ b/engines/gob/init_v1.cpp
@@ -52,6 +52,10 @@ void Init_v1::initVideo() {
 	_vm->_global->_pPaletteDesc->unused2 = _vm->_global->_unusedPalette2;
 
 	_vm->_video->initSurfDesc(320, 200, PRIMARY_SURFACE);
+
+	_vm->_draw->_cursorWidth       = 16;
+	_vm->_draw->_cursorHeight      = 16;
+	_vm->_draw->_transparentCursor =  1;
 }
 
 } // End of namespace Gob
diff --git a/engines/gob/init_v2.cpp b/engines/gob/init_v2.cpp
index f10d586..1289d56 100644
--- a/engines/gob/init_v2.cpp
+++ b/engines/gob/init_v2.cpp
@@ -62,6 +62,10 @@ void Init_v2::initVideo() {
 	_vm->_global->_pPaletteDesc->unused2 = _vm->_global->_unusedPalette2;
 
 	_vm->_video->initSurfDesc(_vm->_video->_surfWidth, _vm->_video->_surfHeight, PRIMARY_SURFACE);
+
+	_vm->_draw->_cursorWidth       = 16;
+	_vm->_draw->_cursorHeight      = 16;
+	_vm->_draw->_transparentCursor =  1;
 }
 
 } // End of namespace Gob
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index ecbf226..dc509b6 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -344,6 +344,7 @@ protected:
 	virtual void setupOpcodesFunc();
 	virtual void setupOpcodesGob();
 
+	void oGeisha_loadCursor(OpFuncParams &params);
 	void oGeisha_loadSound(OpFuncParams &params);
 
 	int16 loadSound(int16 slot);
diff --git a/engines/gob/inter_geisha.cpp b/engines/gob/inter_geisha.cpp
index e3f3a24..98e904a 100644
--- a/engines/gob/inter_geisha.cpp
+++ b/engines/gob/inter_geisha.cpp
@@ -26,7 +26,9 @@
 #include "gob/inter.h"
 #include "gob/dataio.h"
 #include "gob/script.h"
+#include "gob/resources.h"
 #include "gob/game.h"
+#include "gob/draw.h"
 #include "gob/sound/sound.h"
 #include "gob/sound/sounddesc.h"
 
@@ -47,12 +49,20 @@ void Inter_Geisha::setupOpcodesDraw() {
 void Inter_Geisha::setupOpcodesFunc() {
 	Inter_v1::setupOpcodesFunc();
 
+	OPCODEFUNC(0x03, oGeisha_loadCursor);
 	OPCODEFUNC(0x3A, oGeisha_loadSound);
 }
 
 void Inter_Geisha::setupOpcodesGob() {
 }
 
+void Inter_Geisha::oGeisha_loadCursor(OpFuncParams &params) {
+	if (_vm->_game->_script->peekByte(1) & 0x80)
+		warning("Geisha Stub: oGeisha_loadCursor: script[1] & 0x80");
+
+	o1_loadCursor(params);
+}
+
 void Inter_Geisha::oGeisha_loadSound(OpFuncParams &params) {
 	loadSound(-1);
 }
diff --git a/engines/gob/module.mk b/engines/gob/module.mk
index 7c634df..b85c387 100644
--- a/engines/gob/module.mk
+++ b/engines/gob/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS := \
 	iniconfig.o \
 	init.o \
 	init_v1.o \
+	init_geisha.o \
 	init_v2.o \
 	init_fascin.o \
 	init_v3.o \






More information about the Scummvm-git-logs mailing list