aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorMax Horn2007-03-17 00:39:18 +0000
committerMax Horn2007-03-17 00:39:18 +0000
commita6f3ed8173a0490855df84e955229c9f77ecf9c2 (patch)
treea6167cd37896d27072579ea0cd6ede23ba218aa7 /engines/lure
parent8fc8c4847df493de85736447c1c8d9528a9b1299 (diff)
downloadscummvm-rg350-a6f3ed8173a0490855df84e955229c9f77ecf9c2.tar.gz
scummvm-rg350-a6f3ed8173a0490855df84e955229c9f77ecf9c2.tar.bz2
scummvm-rg350-a6f3ed8173a0490855df84e955229c9f77ecf9c2.zip
Got rid of Lure::System
svn-id: r26155
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/events.cpp11
-rw-r--r--engines/lure/game.cpp7
-rw-r--r--engines/lure/lure.cpp3
-rw-r--r--engines/lure/lure.h2
-rw-r--r--engines/lure/menu.cpp5
-rw-r--r--engines/lure/module.mk3
-rw-r--r--engines/lure/res_struct.cpp5
-rw-r--r--engines/lure/surface.cpp9
-rw-r--r--engines/lure/system.cpp41
-rw-r--r--engines/lure/system.h40
10 files changed, 16 insertions, 110 deletions
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 4e90d76b63..7a1ef4ea9a 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -23,7 +23,6 @@
#include "graphics/cursorman.h"
#include "lure/events.h"
-#include "lure/system.h"
#include "lure/res.h"
namespace Lure {
@@ -120,16 +119,15 @@ void Mouse::popCursor() {
}
void Mouse::setPosition(int newX, int newY) {
- System::getReference().warpMouse(newX, newY);
+ g_system->warpMouse(newX, newY);
}
void Mouse::waitForRelease() {
- OSystem &system = System::getReference();
Events &e = Events::getReference();
do {
e.pollEvent();
- system.delayMillis(20);
+ g_system->delayMillis(20);
} while (!e.quitFlag && (lButton() || rButton()));
}
@@ -148,7 +146,7 @@ Events &Events::getReference() {
bool Events::pollEvent() {
- if (!System::getReference().pollEvent(_event)) return false;
+ if (!g_system->pollEvent(_event)) return false;
// Handle keypress
switch (_event.type) {
@@ -174,7 +172,6 @@ bool Events::pollEvent() {
}
void Events::waitForPress() {
- OSystem &system = System::getReference();
bool keyButton = false;
while (!keyButton) {
if (pollEvent()) {
@@ -186,7 +183,7 @@ void Events::waitForPress() {
Mouse::getReference().waitForRelease();
}
}
- system.delayMillis(20);
+ g_system->delayMillis(20);
}
}
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index b925896f29..600173af20 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -23,7 +23,6 @@
#include "lure/game.h"
#include "lure/strings.h"
#include "lure/room.h"
-#include "lure/system.h"
#include "lure/scripts.h"
#include "lure/res_struct.h"
#include "lure/animseq.h"
@@ -86,7 +85,7 @@ void Game::nextFrame() {
}
void Game::execute() {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Room &room = Room::getReference();
Resources &res = Resources::getReference();
Events &events = Events::getReference();
@@ -287,7 +286,7 @@ void Game::playerChangeRoom() {
void Game::displayChuteAnimation()
{
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Resources &res = Resources::getReference();
Screen &screen = Screen::getReference();
Mouse &mouse = Mouse::getReference();
@@ -319,7 +318,7 @@ void Game::displayChuteAnimation()
void Game::displayBarrelAnimation()
{
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Screen &screen = Screen::getReference();
Mouse &mouse = Mouse::getReference();
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 455bcc2e32..de95aecb8a 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -42,7 +42,6 @@
#include "lure/lure.h"
#include "lure/intro.h"
#include "lure/game.h"
-#include "lure/system.h"
namespace Lure {
@@ -264,7 +263,6 @@ int LureEngine::init() {
_system->endGFXTransaction();
detectGame();
- _sys = new System(_system);
_disk = new Disk();
_resources = new Resources();
_strings = new StringData();
@@ -292,7 +290,6 @@ LureEngine::~LureEngine() {
delete _strings;
delete _resources;
delete _disk;
- delete _sys;
}
LureEngine &LureEngine::getReference() {
diff --git a/engines/lure/lure.h b/engines/lure/lure.h
index 814fc8bfb7..40405ae7a3 100644
--- a/engines/lure/lure.h
+++ b/engines/lure/lure.h
@@ -33,7 +33,6 @@
#include "lure/screen.h"
#include "lure/events.h"
#include "lure/menu.h"
-#include "lure/system.h"
#include "lure/strings.h"
#include "lure/room.h"
@@ -50,7 +49,6 @@ private:
Mouse *_mouse;
Events *_events;
Menu *_menu;
- System *_sys;
StringData *_strings;
Room *_room;
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index b2f07b57f2..21f9f78bb5 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -24,7 +24,6 @@
#include "lure/luredefs.h"
#include "lure/decode.h"
#include "lure/surface.h"
-#include "lure/system.h"
#include "lure/res_struct.h"
#include "lure/res.h"
#include "lure/strings.h"
@@ -87,7 +86,7 @@ Menu &Menu::getReference() {
}
uint8 Menu::execute() {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
Screen &screen = Screen::getReference();
@@ -415,7 +414,7 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
if (numEntries == 0) return 0xffff;
Events &e = Events::getReference();
Mouse &mouse = Mouse::getReference();
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Screen &screen = Screen::getReference();
Rect r;
diff --git a/engines/lure/module.mk b/engines/lure/module.mk
index 279a72850a..546721573d 100644
--- a/engines/lure/module.mk
+++ b/engines/lure/module.mk
@@ -19,8 +19,7 @@ MODULE_OBJS := \
screen.o \
scripts.o \
strings.o \
- surface.o \
- system.o
+ surface.o
# This module can be built as a plugin
ifdef BUILD_PLUGINS
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index fe182d3fec..ca7c9eb0b5 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -23,7 +23,6 @@
#include "lure/res.h"
#include "lure/disk.h"
#include "lure/scripts.h"
-#include "lure/system.h"
#include "common/endian.h"
namespace Lure {
@@ -594,7 +593,7 @@ RoomExitCoordinateData &RoomExitCoordinates::getData(uint16 destRoomNumber) {
// The following classes hold any sequence offsets that are being delayed
SequenceDelayData::SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag) {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
// The delay is in number of ticks (1/18th of a second) - convert to milliseconds
timeoutCtr = system.getMillis() + (delay * 1000 / 18);
@@ -608,7 +607,7 @@ void SequenceDelayList::add(uint16 delay, uint16 seqOffset, bool canClear) {
}
void SequenceDelayList::tick() {
- uint32 currTime = System::getReference().getMillis();
+ uint32 currTime = g_system->getMillis();
SequenceDelayList::iterator i;
for (i = begin(); i != end(); i++) {
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index 54292ac460..bd8a5e4359 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -22,7 +22,6 @@
#include "lure/surface.h"
#include "lure/decode.h"
-#include "lure/system.h"
#include "lure/events.h"
#include "lure/screen.h"
#include "lure/lure.h"
@@ -273,13 +272,13 @@ void Surface::createDialog(bool blackFlag) {
}
void Surface::copyToScreen(uint16 x, uint16 y) {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
system.copyRectToScreen(_data->data(), _width, x, y, _width, _height);
system.updateScreen();
}
void Surface::centerOnScreen() {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
system.copyRectToScreen(_data->data(), _width,
(FULL_SCREEN_WIDTH - _width) / 2, (FULL_SCREEN_HEIGHT - _height) / 2,
@@ -389,7 +388,7 @@ Surface *Surface::getScreen(uint16 resourceId) {
}
bool Surface::getString(Common::String &line, uint32 maxSize, bool isNumeric, bool varLength, int16 x, int16 y) {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
Screen &screen = Screen::getReference();
@@ -623,7 +622,7 @@ void SaveRestoreDialog::toggleHightlight(int xs, int xe, int ys, int ye) {
}
bool SaveRestoreDialog::show(bool saveDialog) {
- OSystem &system = System::getReference();
+ OSystem &system = *g_system;
Screen &screen = Screen::getReference();
Mouse &mouse = Mouse::getReference();
Events &events = Events::getReference();
diff --git a/engines/lure/system.cpp b/engines/lure/system.cpp
deleted file mode 100644
index 7f9b5b54a8..0000000000
--- a/engines/lure/system.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-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 "lure/system.h"
-
-namespace Lure {
-
-OSystem *int_system = NULL;
-
-System::System(OSystem *sys) {
- int_system = sys;
-}
-
-System::~System() {
- int_system = NULL;
-}
-
-OSystem &System::getReference() {
- return *int_system;
-}
-
-} // end of namespace Lure
diff --git a/engines/lure/system.h b/engines/lure/system.h
deleted file mode 100644
index 119bc0e59f..0000000000
--- a/engines/lure/system.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2005-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$
- *
- */
-
-#ifndef LURE_SYSTEM_H
-#define LURE_SYSTEM_H
-
-#include "common/stdafx.h"
-#include "common/system.h"
-
-namespace Lure {
-
-class System {
-public:
- System(OSystem *sys);
- ~System();
- static OSystem &getReference();
-};
-
-} // end of namspace Lure
-
-#endif