[Scummvm-cvs-logs] SF.net SVN: scummvm: [26155] scummvm/trunk/engines/lure

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Mar 17 01:39:20 CET 2007


Revision: 26155
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26155&view=rev
Author:   fingolfin
Date:     2007-03-16 17:39:18 -0700 (Fri, 16 Mar 2007)

Log Message:
-----------
Got rid of Lure::System

Modified Paths:
--------------
    scummvm/trunk/engines/lure/events.cpp
    scummvm/trunk/engines/lure/game.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/lure/lure.h
    scummvm/trunk/engines/lure/menu.cpp
    scummvm/trunk/engines/lure/module.mk
    scummvm/trunk/engines/lure/res_struct.cpp
    scummvm/trunk/engines/lure/surface.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/lure/system.cpp
    scummvm/trunk/engines/lure/system.h

Modified: scummvm/trunk/engines/lure/events.cpp
===================================================================
--- scummvm/trunk/engines/lure/events.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/events.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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::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 @@
 
 
 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 @@
 }
 
 void Events::waitForPress() {
-	OSystem &system = System::getReference();
 	bool keyButton = false;
 	while (!keyButton) {
 		if (pollEvent()) {
@@ -186,7 +183,7 @@
 				Mouse::getReference().waitForRelease();				
 			}
 		}
-		system.delayMillis(20);
+		g_system->delayMillis(20);
 	}
 }
 

Modified: scummvm/trunk/engines/lure/game.cpp
===================================================================
--- scummvm/trunk/engines/lure/game.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/game.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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::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::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::displayBarrelAnimation()
 {
-	OSystem &system = System::getReference();
+	OSystem &system = *g_system;
 	Screen &screen = Screen::getReference();
 	Mouse &mouse = Mouse::getReference();
 

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/lure.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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 @@
 	_system->endGFXTransaction();
 
 	detectGame();
-	_sys = new System(_system);
 	_disk = new Disk();
 	_resources = new Resources();
 	_strings = new StringData();
@@ -292,7 +290,6 @@
 	delete _strings;
 	delete _resources;
 	delete _disk;
-	delete _sys;
 }
 
 LureEngine &LureEngine::getReference() {

Modified: scummvm/trunk/engines/lure/lure.h
===================================================================
--- scummvm/trunk/engines/lure/lure.h	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/lure.h	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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 @@
 	Mouse *_mouse;
 	Events *_events;
 	Menu *_menu;
-	System *_sys;
 	StringData *_strings;
 	Room *_room;
 

Modified: scummvm/trunk/engines/lure/menu.cpp
===================================================================
--- scummvm/trunk/engines/lure/menu.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/menu.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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 @@
 }
 
 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 @@
 	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;
 

Modified: scummvm/trunk/engines/lure/module.mk
===================================================================
--- scummvm/trunk/engines/lure/module.mk	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/module.mk	2007-03-17 00:39:18 UTC (rev 26155)
@@ -19,8 +19,7 @@
 	screen.o \
 	scripts.o \
 	strings.o \
-	surface.o \
-	system.o
+	surface.o
 
 # This module can be built as a plugin
 ifdef BUILD_PLUGINS

Modified: scummvm/trunk/engines/lure/res_struct.cpp
===================================================================
--- scummvm/trunk/engines/lure/res_struct.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/res_struct.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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 @@
 // 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::tick() {
-	uint32 currTime = System::getReference().getMillis();
+	uint32 currTime = g_system->getMillis();
 	SequenceDelayList::iterator i;
 
 	for (i = begin(); i != end(); i++) {

Modified: scummvm/trunk/engines/lure/surface.cpp
===================================================================
--- scummvm/trunk/engines/lure/surface.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/surface.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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::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 @@
 }
 
 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 @@
 }
 
 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();

Deleted: scummvm/trunk/engines/lure/system.cpp
===================================================================
--- scummvm/trunk/engines/lure/system.cpp	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/system.cpp	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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

Deleted: scummvm/trunk/engines/lure/system.h
===================================================================
--- scummvm/trunk/engines/lure/system.h	2007-03-17 00:07:34 UTC (rev 26154)
+++ scummvm/trunk/engines/lure/system.h	2007-03-17 00:39:18 UTC (rev 26155)
@@ -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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list