[Scummvm-cvs-logs] SF.net SVN: scummvm:[35793] scummvm/trunk/engines/groovie

spookypeanut at users.sourceforge.net spookypeanut at users.sourceforge.net
Fri Jan 9 00:06:09 CET 2009


Revision: 35793
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35793&view=rev
Author:   spookypeanut
Date:     2009-01-08 23:06:08 +0000 (Thu, 08 Jan 2009)

Log Message:
-----------
T7G: Stage one of move to ScummVM's CursorMan: rename groovie one so it doesn't have same name

Modified Paths:
--------------
    scummvm/trunk/engines/groovie/cursor.cpp
    scummvm/trunk/engines/groovie/cursor.h
    scummvm/trunk/engines/groovie/groovie.cpp
    scummvm/trunk/engines/groovie/groovie.h
    scummvm/trunk/engines/groovie/script.cpp

Modified: scummvm/trunk/engines/groovie/cursor.cpp
===================================================================
--- scummvm/trunk/engines/groovie/cursor.cpp	2009-01-08 23:01:34 UTC (rev 35792)
+++ scummvm/trunk/engines/groovie/cursor.cpp	2009-01-08 23:06:08 UTC (rev 35793)
@@ -28,33 +28,28 @@
 
 #include "graphics/cursorman.h"
 
-// HACK: Since CursorMan is the name of the global
-// cursor manager we just undefine it here
-#define GlobCursorMan (::Graphics::CursorManager::instance())
-#undef CursorMan
-
 namespace Groovie {
 
 // Cursor Manager
 
-CursorMan::CursorMan(OSystem *system) :
+GrvCursorMan::GrvCursorMan(OSystem *system) :
 	_syst(system), _lastTime(0), _current(0), _cursor(NULL) {
 }
 
-CursorMan::~CursorMan() {
+GrvCursorMan::~GrvCursorMan() {
 	// Delete the cursors
 	for (uint cursor = 0; cursor < _cursors.size(); cursor++) {
 		delete _cursors[cursor];
 	}
 
-	GlobCursorMan.popAllCursors();
+	CursorMan.popAllCursors();
 }
 
-uint8 CursorMan::getStyle() {
+uint8 GrvCursorMan::getStyle() {
 	return _current;
 }
 
-void CursorMan::setStyle(uint8 newStyle) {
+void GrvCursorMan::setStyle(uint8 newStyle) {
 	// Reset the animation
 	_lastFrame = 254;
 	_lastTime = 1;
@@ -68,7 +63,7 @@
 	animate();
 }
 
-void CursorMan::animate() {
+void GrvCursorMan::animate() {
 	if (_lastTime) {
 		int newTime = _syst->getMillis();
 		if (_lastTime - newTime >= 75) {
@@ -113,13 +108,13 @@
 
 void Cursor_t7g::enable() {
 	// Apply the palette
-	GlobCursorMan.replaceCursorPalette(_pal, 0, 32);
+	CursorMan.replaceCursorPalette(_pal, 0, 32);
 }
 
 void Cursor_t7g::showFrame(uint16 frame) {
 	// Set the mouse cursor
 	int offset = _width * _height * frame;
-	GlobCursorMan.replaceCursor((const byte *)_img + offset, _width, _height, _width >> 1, _height >> 1, 0);
+	CursorMan.replaceCursor((const byte *)_img + offset, _width, _height, _width >> 1, _height >> 1, 0);
 }
 
 
@@ -135,11 +130,11 @@
 
 #define NUM_STYLES 11
 // pyramid is cursor 8, eyes are 9 & 10
-const uint CursorMan_t7g::_cursorImg[NUM_STYLES] = {3, 5, 4, 3, 1, 0, 2, 6, 7, 8, 8};
-const uint CursorMan_t7g::_cursorPal[NUM_STYLES] = {0, 0, 0, 0, 2, 0, 1, 3, 5, 4, 6};
+const uint GrvCursorMan_t7g::_cursorImg[NUM_STYLES] = {3, 5, 4, 3, 1, 0, 2, 6, 7, 8, 8};
+const uint GrvCursorMan_t7g::_cursorPal[NUM_STYLES] = {0, 0, 0, 0, 2, 0, 1, 3, 5, 4, 6};
 
-CursorMan_t7g::CursorMan_t7g(OSystem *system) :
-	CursorMan(system) {
+GrvCursorMan_t7g::GrvCursorMan_t7g(OSystem *system) :
+	GrvCursorMan(system) {
 
 	// Open the cursors file
 	Common::File robgjd;
@@ -169,7 +164,7 @@
 	robgjd.close();
 }
 
-CursorMan_t7g::~CursorMan_t7g() {
+GrvCursorMan_t7g::~GrvCursorMan_t7g() {
 	// Delete the images
 	for (uint img = 0; img < _images.size(); img++) {
 		delete[] _images[img];
@@ -181,7 +176,7 @@
 	}
 }
 
-byte *CursorMan_t7g::loadImage(Common::File &file) {
+byte *GrvCursorMan_t7g::loadImage(Common::File &file) {
 	uint16 decompbytes = 0, offset, i, length;
 	uint8 flagbyte, lengthmask = 0x0F, offsetlen, var_8;
 	byte *cursorStorage = new byte[65536];
@@ -219,7 +214,7 @@
 	return cursorStorage;
 }
 
-byte *CursorMan_t7g::loadPalette(Common::File &file) {
+byte *GrvCursorMan_t7g::loadPalette(Common::File &file) {
 	byte *palette = new byte[4 * 32];
 	for (uint8 colournum = 0; colournum < 32; colournum++) {
 		palette[colournum * 4 + 0] = file.readByte();
@@ -287,8 +282,8 @@
 
 // v2 Cursor Manager
 
-CursorMan_v2::CursorMan_v2(OSystem *system) :
-	CursorMan(system) {
+GrvCursorMan_v2::GrvCursorMan_v2(OSystem *system) :
+	GrvCursorMan(system) {
 
 	// Open the icons file
 	Common::File iconsFile;
@@ -317,7 +312,7 @@
 	iconsFile.close();
 }
 
-CursorMan_v2::~CursorMan_v2() {
+GrvCursorMan_v2::~GrvCursorMan_v2() {
 }
 
 } // End of Groovie namespace

Modified: scummvm/trunk/engines/groovie/cursor.h
===================================================================
--- scummvm/trunk/engines/groovie/cursor.h	2009-01-08 23:01:34 UTC (rev 35792)
+++ scummvm/trunk/engines/groovie/cursor.h	2009-01-08 23:06:08 UTC (rev 35793)
@@ -44,10 +44,10 @@
 	uint16 _numFrames;
 };
 
-class CursorMan {
+class GrvCursorMan {
 public:
-	CursorMan(OSystem *system);
-	virtual ~CursorMan();
+	GrvCursorMan(OSystem *system);
+	virtual ~GrvCursorMan();
 
 	virtual void animate();
 	virtual void setStyle(uint8 newStyle);
@@ -66,10 +66,10 @@
 	Cursor *_cursor;
 };
 
-class CursorMan_t7g : public CursorMan {
+class GrvCursorMan_t7g : public GrvCursorMan {
 public:
-	CursorMan_t7g(OSystem *system);
-	~CursorMan_t7g();
+	GrvCursorMan_t7g(OSystem *system);
+	~GrvCursorMan_t7g();
 
 private:
 	// Styles data
@@ -85,10 +85,10 @@
 	byte *loadPalette(Common::File &file);
 };
 
-class CursorMan_v2 : public CursorMan {
+class GrvCursorMan_v2 : public GrvCursorMan {
 public:
-	CursorMan_v2(OSystem *system);
-	~CursorMan_v2();
+	GrvCursorMan_v2(OSystem *system);
+	~GrvCursorMan_v2();
 };
 
 } // End of Groovie namespace

Modified: scummvm/trunk/engines/groovie/groovie.cpp
===================================================================
--- scummvm/trunk/engines/groovie/groovie.cpp	2009-01-08 23:01:34 UTC (rev 35792)
+++ scummvm/trunk/engines/groovie/groovie.cpp	2009-01-08 23:06:08 UTC (rev 35793)
@@ -36,7 +36,7 @@
 
 GroovieEngine::GroovieEngine(OSystem *syst, GroovieGameDescription *gd) :
 	Engine(syst), _gameDescription(gd), _debugger(NULL), _script(this),
-	_resMan(NULL), _cursorMan(NULL), _videoPlayer(NULL), _musicPlayer(NULL),
+	_resMan(NULL), _grvCursorMan(NULL), _videoPlayer(NULL), _musicPlayer(NULL),
 	_graphicsMan(NULL), _waitingForInput(false) {
 
 	// Adding the default directories
@@ -62,7 +62,7 @@
 	// Delete the remaining objects
 	delete _debugger;
 	delete _resMan;
-	delete _cursorMan;
+	delete _grvCursorMan;
 	delete _videoPlayer;
 	delete _musicPlayer;
 	delete _graphicsMan;
@@ -83,12 +83,12 @@
 	switch (_gameDescription->version) {
 	case kGroovieT7G:
 		_resMan = new ResMan_t7g();
-		_cursorMan = new CursorMan_t7g(_system);
+		_grvCursorMan = new GrvCursorMan_t7g(_system);
 		_videoPlayer = new VDXPlayer(this);
 		break;
 	case kGroovieV2:
 		_resMan = new ResMan_v2();
-		_cursorMan = new CursorMan_v2(_system);
+		_grvCursorMan = new GrvCursorMan_v2(_system);
 		_videoPlayer = new ROQPlayer(this);
 		break;
 	}
@@ -227,7 +227,7 @@
 
 		if (_waitingForInput) {
 			// Still waiting for input, just update the mouse, game timer and then wait a bit more
-			_cursorMan->animate();
+			_grvCursorMan->animate();
 			_system->updateScreen();
 			tmr++;
 			// Wait a little bit between increments.  While mouse is moving, this triggers

Modified: scummvm/trunk/engines/groovie/groovie.h
===================================================================
--- scummvm/trunk/engines/groovie/groovie.h	2009-01-08 23:01:34 UTC (rev 35792)
+++ scummvm/trunk/engines/groovie/groovie.h	2009-01-08 23:06:08 UTC (rev 35793)
@@ -92,7 +92,7 @@
 
 	Script _script;
 	ResMan *_resMan;
-	CursorMan *_cursorMan;
+	GrvCursorMan *_grvCursorMan;
 	VideoPlayer *_videoPlayer;
 	MusicPlayer *_musicPlayer;
 	GraphicsMan *_graphicsMan;

Modified: scummvm/trunk/engines/groovie/script.cpp
===================================================================
--- scummvm/trunk/engines/groovie/script.cpp	2009-01-08 23:01:34 UTC (rev 35792)
+++ scummvm/trunk/engines/groovie/script.cpp	2009-01-08 23:06:08 UTC (rev 35793)
@@ -699,8 +699,8 @@
 
 	// Nothing to do
 	if (_inputLoopAddress) {
-		if (_newCursorStyle != _vm->_cursorMan->getStyle()) {
-			_vm->_cursorMan->setStyle(_newCursorStyle);
+		if (_newCursorStyle != _vm->_grvCursorMan->getStyle()) {
+			_vm->_grvCursorMan->setStyle(_newCursorStyle);
 		}
 		_vm->_system->showMouse(true);
 


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