From bd69261cf556e89e6c4fe9586673697818d352b4 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Mon, 16 Apr 2007 05:04:41 +0000 Subject: Bargon Attack uses wide surfaces, but shouldn't scroll in-game regardless svn-id: r26522 --- engines/gob/game.cpp | 3 ++- engines/gob/game.h | 2 ++ engines/gob/gob.cpp | 2 +- engines/gob/init.h | 8 ++++++++ engines/gob/init_v3.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ engines/gob/module.mk | 1 + 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 engines/gob/init_v3.cpp (limited to 'engines/gob') diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp index 4bc95d78cf..b22721a024 100644 --- a/engines/gob/game.cpp +++ b/engines/gob/game.cpp @@ -77,6 +77,7 @@ Game::Game(GobEngine *vm) : _vm(vm) { _handleMouse = 0; _forceHandleMouse = 0; _menuLevel = 0; + _noScroll = true; _tempStr[0] = 0; _curImaFile[0] = 0; @@ -292,7 +293,7 @@ void Game::evaluateScroll(int16 x, int16 y) { if ((_handleMouse == 0) || (_menuLevel > 0)) return; - if (_vm->_global->_videoMode != 0x14) + if (_noScroll || (_vm->_global->_videoMode != 0x14)) return; if ((x == 0) && (_vm->_draw->_scrollOffsetX > 0)) { diff --git a/engines/gob/game.h b/engines/gob/game.h index f509e0d6a0..ca9162d3e7 100644 --- a/engines/gob/game.h +++ b/engines/gob/game.h @@ -128,6 +128,8 @@ public: int32 _startTimeKey; int16 _mouseButtons; + bool _noScroll; + Game(GobEngine *vm); virtual ~Game(); diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index e7ff850da1..78850ce706 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -191,7 +191,7 @@ int GobEngine::init() { _scenery = new Scenery_v2(this); _saveLoad = new SaveLoad_v2(this, _targetName.c_str()); } else if (_features & Gob::GF_GOB3) { - _init = new Init_v2(this); + _init = new Init_v3(this); _video = new Video_v2(this); _inter = new Inter_v3(this); _parse = new Parse_v2(this); diff --git a/engines/gob/init.h b/engines/gob/init.h index 3ca935c6b4..d64dcb91a0 100644 --- a/engines/gob/init.h +++ b/engines/gob/init.h @@ -61,6 +61,14 @@ public: virtual ~Init_v2() {}; }; +class Init_v3 : public Init_v2 { +public: + virtual void initVideo(); + + Init_v3(GobEngine *vm); + virtual ~Init_v3() {}; +}; + } // End of namespace Gob #endif // GOB_INIT_H diff --git a/engines/gob/init_v3.cpp b/engines/gob/init_v3.cpp new file mode 100644 index 0000000000..5e10240257 --- /dev/null +++ b/engines/gob/init_v3.cpp @@ -0,0 +1,42 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2004 Ivan Dubrov + * Copyright (C) 2004-2006 The ScummVM project + * + * 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. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "common/endian.h" + +#include "gob/gob.h" +#include "gob/init.h" +#include "gob/game.h" + +namespace Gob { + +Init_v3::Init_v3(GobEngine *vm) : Init_v2(vm) { +} + +void Init_v3::initVideo() { + Init_v2::initVideo(); + + _vm->_game->_noScroll = false; +} + +} // End of namespace Gob diff --git a/engines/gob/module.mk b/engines/gob/module.mk index 63aea49a29..db0660fa5c 100644 --- a/engines/gob/module.mk +++ b/engines/gob/module.mk @@ -22,6 +22,7 @@ MODULE_OBJS := \ init.o \ init_v1.o \ init_v2.o \ + init_v3.o \ inter.o \ inter_v1.o \ inter_v2.o \ -- cgit v1.2.3