diff options
author | uruk | 2014-05-19 17:10:18 +0200 |
---|---|---|
committer | uruk | 2014-05-19 17:10:18 +0200 |
commit | e6229a259608de6bf1c9f81d2e66101addef1339 (patch) | |
tree | 404f15bd7c388746a8da09a51117f3fd9ccf87a1 | |
parent | b5931e205063c71ec82c7d80287b9228b2852cdc (diff) | |
download | scummvm-rg350-e6229a259608de6bf1c9f81d2e66101addef1339.tar.gz scummvm-rg350-e6229a259608de6bf1c9f81d2e66101addef1339.tar.bz2 scummvm-rg350-e6229a259608de6bf1c9f81d2e66101addef1339.zip |
CGE2: Add Mouse in events.h to further implement caveUp().
-rw-r--r-- | engines/cge2/cge2.cpp | 5 | ||||
-rw-r--r-- | engines/cge2/cge2.h | 4 | ||||
-rw-r--r-- | engines/cge2/cge2_main.cpp | 13 | ||||
-rw-r--r-- | engines/cge2/events.cpp | 61 | ||||
-rw-r--r-- | engines/cge2/events.h | 59 | ||||
-rw-r--r-- | engines/cge2/module.mk | 3 |
6 files changed, 142 insertions, 3 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index 54d3ee4c02..385fe4ea73 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -35,6 +35,7 @@ #include "cge2/hero.h" #include "cge2/general.h" #include "cge2/spare.h" +#include "cge2/events.h" namespace CGE2 { @@ -55,6 +56,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _spare = nullptr; _commandHandler = nullptr; _infoLine = nullptr; + _mouse = nullptr; _quitFlag = false; _bitmapPalette = nullptr; @@ -64,6 +66,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _now = 1; _sex = true; _mouseTop = kWorldHeight / 3; + _dark = false; } void CGE2Engine::init() { @@ -81,6 +84,7 @@ void CGE2Engine::init() { _spare = new Spare(this); _commandHandler = new CommandHandler(this, false); _infoLine = new InfoLine(this, kInfoW); + _mouse = new Mouse(this); } void CGE2Engine::deinit() { @@ -103,6 +107,7 @@ void CGE2Engine::deinit() { delete _spare; delete _commandHandler; delete _infoLine; + delete _mouse; } bool CGE2Engine::hasFeature(EngineFeature f) const { diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index d5015c28ab..f3a9a287c8 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -49,6 +49,7 @@ class Dac; class Spare; class CommandHandler; class InfoLine; +class Mouse; #define kScrWidth 320 #define kScrHeight 240 @@ -107,6 +108,7 @@ public: void openPocket(); void selectPocket(int n); void busy(bool on); + void show(); void setEye(V3D &e); void setEye(const V2D& e2, int z = -kScrWidth); @@ -130,6 +132,7 @@ public: int _now; bool _sex; int _mouseTop; + bool _dark; ResourceManager *_resman; Vga *_vga; @@ -144,6 +147,7 @@ public: Spare *_spare; CommandHandler *_commandHandler; InfoLine *_infoLine; + Mouse *_mouse; private: void init(); void deinit(); diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 4a0076d9d7..a20dbb6cfd 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -33,6 +33,7 @@ #include "cge2/snail.h" #include "cge2/hero.h" #include "cge2/spare.h" +#include "cge2/events.h" namespace CGE2 { @@ -350,9 +351,13 @@ void CGE2Engine::caveUp(int cav) { _infoLine->setText(nullptr); busy(false); - _vga->update(); + if (!_dark) + _vga->sunset(); + show(); + _vga->copyPage(1, 0); + show(); - + _vga->update(); } void CGE2Engine::showBak(int ref) { @@ -383,6 +388,10 @@ void CGE2Engine::busy(bool on) { warning("STUB: CGE2Engine::selectPocket()"); } +void CGE2Engine::show() { + warning("STUB: CGE2Engine::show()"); +} + void CGE2Engine::runGame() { warning("STUB: CGE2Engine::runGame()"); } diff --git a/engines/cge2/events.cpp b/engines/cge2/events.cpp new file mode 100644 index 0000000000..3675909d74 --- /dev/null +++ b/engines/cge2/events.cpp @@ -0,0 +1,61 @@ +/* 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. + * + */ + +/* + * This code is based on original Sfinx source code + * Copyright (c) 1994-1997 Janus B. Wisniewski and L.K. Avalon + */ + +#include "gui/saveload.h" +#include "gui/about.h" +#include "gui/message.h" +#include "common/config-manager.h" +#include "common/events.h" +#include "engines/advancedDetector.h" +#include "cge2/events.h" +#include "cge2/text.h" +#include "cge2/cge2_main.h" + +namespace CGE2 { +/*----------------- MOUSE interface -----------------*/ + +Mouse::Mouse(CGE2Engine *vm) : Sprite(vm), _busy(NULL), _hold(NULL), _hx(0), _vm(vm) { + warning("STUB: Mouse::Mouse() - Recheck the whole implementation!!!"); +} + +Mouse::~Mouse() { + warning("STUB: Mouse::~Mouse()"); +} + +void Mouse::on() { + warning("STUB: Mouse::on()"); +} + +void Mouse::off() { + warning("STUB: Mouse::off()"); +} + +void Mouse::newMouse(Common::Event &event) { + warning("STUB: Mouse::newMouse()"); +} + +} // End of namespace CGE2 diff --git a/engines/cge2/events.h b/engines/cge2/events.h new file mode 100644 index 0000000000..1442d85b39 --- /dev/null +++ b/engines/cge2/events.h @@ -0,0 +1,59 @@ +/* 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. + * + */ + +/* + * This code is based on original Sfinx source code + * Copyright (c) 1994-1997 Janus B. Wisniewski and L.K. Avalon + */ + +#ifndef CGE2_EVENTS_H +#define CGE2_EVENTS_H + +#include "common/events.h" +#include "cge2/talk.h" +#include "cge2/vga13h.h" + +namespace CGE2 { + +/*----------------- MOUSE interface -----------------*/ + +class Mouse : public Sprite { +public: + Sprite *_hold; + bool _active; + int _hx; + int _hy; + bool _exist; + int _buttons; + Sprite *_busy; + Mouse(CGE2Engine *vm); + ~Mouse(); + void on(); + void off(); + void newMouse(Common::Event &event); +private: + CGE2Engine *_vm; +}; + +} // End of namespace CGE + +#endif // #define CGE2_EVENTS_H diff --git a/engines/cge2/module.mk b/engines/cge2/module.mk index 4347dba315..7272ed3829 100644 --- a/engines/cge2/module.mk +++ b/engines/cge2/module.mk @@ -12,7 +12,8 @@ MODULE_OBJS = \ hero.o \ snail.o \ spare.o \ - talk.o + talk.o \ + events.o # This module can be built as a plugin ifeq ($(ENABLE_CGE2), DYNAMIC_PLUGIN) |