GOB: Fix the Geisha cursor

This commit is contained in:
Sven Hesse 2011-08-26 06:09:56 +02:00
parent 479eeb7e47
commit e20b90543d
10 changed files with 78 additions and 6 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);
}

View File

@ -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 \