[Scummvm-cvs-logs] SF.net SVN: scummvm:[34209] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Aug 30 17:49:55 CEST 2008


Revision: 34209
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34209&view=rev
Author:   peres001
Date:     2008-08-30 15:49:54 +0000 (Sat, 30 Aug 2008)

Log Message:
-----------
Removed global g_system.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/gui_br.cpp
    scummvm/trunk/engines/parallaction/gui_ns.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -170,7 +170,7 @@
 		_gfx->setPalette(pal);
 
 		_gfx->updateScreen();
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 	}
 
 	return;
@@ -305,7 +305,7 @@
 		_gfx->setPalette(_gfx->_palette);
 
 		_gfx->updateScreen();
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 	}
 
 	_input->waitForButtonEvent(kMouseLeftUp);
@@ -324,10 +324,10 @@
 	}
 
 	for (uint16 _di = 0; _di < 30; _di++) {
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 		_gfx->setPalette(pal0);
 		_gfx->updateScreen();
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 		_gfx->setPalette(pal1);
 		_gfx->updateScreen();
 	}

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -252,7 +252,7 @@
 	byte sysPal[256*4];
 
 	uint n = pal.fillRGBA(sysPal);
-	g_system->setPalette(sysPal, 0, n);
+	_vm->_system->setPalette(sysPal, 0, n);
 }
 
 void Gfx::setBlackPalette() {
@@ -328,7 +328,7 @@
 	_vm->_inventoryRenderer->getRect(r);
 	byte *data = _vm->_inventoryRenderer->getData();
 
-	g_system->copyRectToScreen(data, r.width(), r.left, r.top, r.width(), r.height());
+	_vm->_system->copyRectToScreen(data, r.width(), r.left, r.top, r.width(), r.height());
 }
 
 void Gfx::drawItems() {
@@ -336,11 +336,11 @@
 		return;
 	}
 
-	Graphics::Surface *surf = g_system->lockScreen();
+	Graphics::Surface *surf = _vm->_system->lockScreen();
 	for (uint i = 0; i < _numItems; i++) {
 		drawGfxObject(_items[i].data, *surf, false);
 	}
-	g_system->unlockScreen();
+	_vm->_system->unlockScreen();
 }
 
 void Gfx::drawBalloons() {
@@ -348,15 +348,15 @@
 		return;
 	}
 
-	Graphics::Surface *surf = g_system->lockScreen();
+	Graphics::Surface *surf = _vm->_system->lockScreen();
 	for (uint i = 0; i < _balloons.size(); i++) {
 		drawGfxObject(_balloons[i], *surf, false);
 	}
-	g_system->unlockScreen();
+	_vm->_system->unlockScreen();
 }
 
 void Gfx::clearScreen() {
-	g_system->clearScreen();
+	_vm->_system->clearScreen();
 }
 
 void Gfx::beginFrame() {
@@ -438,11 +438,11 @@
 			backgroundPitch = _bitmapMask.pitch;
 			break;
 		}
-		g_system->copyRectToScreen(backgroundData, backgroundPitch, _backgroundInfo->x, _backgroundInfo->y, w, h);
+		_vm->_system->copyRectToScreen(backgroundData, backgroundPitch, _backgroundInfo->x, _backgroundInfo->y, w, h);
 	}
 
 	if (_varDrawPathZones == 1) {
-		Graphics::Surface *surf = g_system->lockScreen();
+		Graphics::Surface *surf = _vm->_system->lockScreen();
 		ZoneList::iterator b = _vm->_location._zones.begin();
 		ZoneList::iterator e = _vm->_location._zones.end();
 		for (; b != e; b++) {
@@ -451,13 +451,13 @@
 				surf->frameRect(Common::Rect(z->getX(), z->getY(), z->getX() + z->width(), z->getY() + z->height()), 2);
 			}
 		}
-		g_system->unlockScreen();
+		_vm->_system->unlockScreen();
 	}
 
 	_varRenderMode = _varAnimRenderMode;
 
 	// TODO: transform objects coordinates to be drawn with scrolling
-	Graphics::Surface *surf = g_system->lockScreen();
+	Graphics::Surface *surf = _vm->_system->lockScreen();
 	drawGfxObjects(*surf);
 
 	if (_halfbrite) {
@@ -481,7 +481,7 @@
 		}
 	}
 
-	g_system->unlockScreen();
+	_vm->_system->unlockScreen();
 
 	_varRenderMode = _varMiscRenderMode;
 
@@ -490,7 +490,7 @@
 	drawBalloons();
 	drawLabels();
 
-	g_system->updateScreen();
+	_vm->_system->updateScreen();
 	return;
 }
 
@@ -715,13 +715,13 @@
 
 	updateFloatingLabel();
 
-	Graphics::Surface* surf = g_system->lockScreen();
+	Graphics::Surface* surf = _vm->_system->lockScreen();
 
 	for (uint i = 0; i < _labels.size(); i++) {
 		drawGfxObject(_labels[i], *surf, false);
 	}
 
-	g_system->unlockScreen();
+	_vm->_system->unlockScreen();
 }
 
 
@@ -749,10 +749,10 @@
 Gfx::Gfx(Parallaction* vm) :
 	_vm(vm), _disk(vm->_disk) {
 
-	g_system->beginGFXTransaction();
-	g_system->initSize(_vm->_screenWidth, _vm->_screenHeight);
+	_vm->_system->beginGFXTransaction();
+	_vm->_system->initSize(_vm->_screenWidth, _vm->_screenHeight);
 	_vm->initCommonGFX(_vm->getGameType() == GType_BRA);
-	g_system->endGFXTransaction();
+	_vm->_system->endGFXTransaction();
 
 	setPalette(_palette);
 

Modified: scummvm/trunk/engines/parallaction/gui_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_br.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/gui_br.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -73,7 +73,7 @@
 		_vm->showSlide(_slideName.c_str(), CENTER_LABEL_HORIZONTAL, CENTER_LABEL_VERTICAL);
 		_vm->_input->setMouseState(MOUSE_DISABLED);
 
-		_startTime = g_system->getMillis();
+		_startTime = _vm->_system->getMillis();
 		_fadeSteps = -1;
 	}
 };

Modified: scummvm/trunk/engines/parallaction/gui_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/gui_ns.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -48,7 +48,7 @@
 	}
 
 	virtual MenuInputState* run() {
-		uint32 curTime = g_system->getMillis();
+		uint32 curTime = _vm->_system->getMillis();
 		if (curTime - _startTime > _timeOut) {
 			_vm->freeBackground();
 			return _helper->getState(_nextState);
@@ -59,7 +59,7 @@
 	virtual void enter() {
 		_vm->_input->setMouseState(MOUSE_DISABLED);
 		_vm->showSlide(_slideName.c_str());
-		_startTime = g_system->getMillis();
+		_startTime = _vm->_system->getMillis();
 	}
 };
 
@@ -389,7 +389,7 @@
 			_vm->_gfx->invertBackground(codeTrueBlocks[selection]);
 			_vm->_gfx->updateScreen();
 			_vm->beep();
-			g_system->delayMillis(100);
+			_vm->_system->delayMillis(100);
 			_vm->_gfx->invertBackground(codeTrueBlocks[selection]);
 			_vm->_gfx->updateScreen();
 		}
@@ -444,7 +444,7 @@
 	}
 
 	void delay() {
-		if (g_system->getMillis() - _startTime < 2000) {
+		if (_vm->_system->getMillis() - _startTime < 2000) {
 			return;
 		}
 		cleanup();
@@ -486,7 +486,7 @@
 		_vm->_gfx->patchBackground(_emptySlots, SLOT_X, SLOT_Y, false);
 		_vm->_gfx->hideLabel(_labels[0]);
 		_vm->_gfx->showLabel(_labels[1], 60, 30);
-		_startTime = g_system->getMillis();
+		_startTime = _vm->_system->getMillis();
 		_state = DELAY;
 	}
 
@@ -647,14 +647,14 @@
 
 	virtual MenuInputState* run() {
 		if (_current == -1) {
-			_startTime = g_system->getMillis();
+			_startTime = _vm->_system->getMillis();
 			_current = 0;
 			drawCurrentLabel();
 			return this;
 		}
 
 		int event = _vm->_input->getLastButtonEvent();
-		uint32 curTime = g_system->getMillis();
+		uint32 curTime = _vm->_system->getMillis();
 		if ((event == kMouseLeftUp) || (curTime - _startTime > 5500)) {
 			_current++;
 			_startTime = curTime;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -154,7 +154,7 @@
 
 	_gfx->animatePalette();
 	_gfx->updateScreen();
-	g_system->delayMillis(30);
+	_vm->_system->delayMillis(30);
 }
 
 
@@ -391,7 +391,7 @@
 		pal.fadeTo(_gfx->_palette, 4);
 		_gfx->setPalette(pal);
 		_gfx->updateScreen();
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 	}
 
 	_gfx->setPalette(_gfx->_palette);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-08-30 15:49:54 UTC (rev 34209)
@@ -45,8 +45,6 @@
 #define PATH_LEN	200
 
 
-extern OSystem *g_system;
-
 namespace Parallaction {
 
 enum {

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-08-30 12:54:54 UTC (rev 34208)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-08-30 15:49:54 UTC (rev 34209)
@@ -209,7 +209,7 @@
 			v2 += 4;
 		}
 
-		g_system->delayMillis(20);
+		_vm->_system->delayMillis(20);
 		_gfx->setPalette(pal);
 		_gfx->updateScreen();
 	}


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