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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Dec 14 11:32:27 CET 2008


Revision: 35358
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35358&view=rev
Author:   peres001
Date:     2008-12-14 10:32:26 +0000 (Sun, 14 Dec 2008)

Log Message:
-----------
Removed references to _vm from the engine itself.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/balloons.cpp
    scummvm/trunk/engines/parallaction/callables_ns.cpp
    scummvm/trunk/engines/parallaction/dialogue.cpp
    scummvm/trunk/engines/parallaction/disk.h
    scummvm/trunk/engines/parallaction/disk_ns.cpp
    scummvm/trunk/engines/parallaction/exec.h
    scummvm/trunk/engines/parallaction/exec_ns.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp
    scummvm/trunk/engines/parallaction/parser_ns.cpp

Modified: scummvm/trunk/engines/parallaction/balloons.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/balloons.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/balloons.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -261,9 +261,10 @@
 	Balloon *getBalloon(uint id);
 
 	Gfx *_gfx;
+	Font *_font;
 
 public:
-	BalloonManager_ns(Gfx *gfx);
+	BalloonManager_ns(Gfx *gfx, Font *font);
 	~BalloonManager_ns();
 
 	void freeBalloons();
@@ -276,7 +277,7 @@
 
 int16 BalloonManager_ns::_dialogueBalloonX[5] = { 80, 120, 150, 150, 150 };
 
-BalloonManager_ns::BalloonManager_ns(Gfx *gfx) : _numBalloons(0), _gfx(gfx) {
+BalloonManager_ns::BalloonManager_ns(Gfx *gfx, Font *font) : _numBalloons(0), _gfx(gfx), _font(font) {
 	_textColors[kSelectedColor] = 0;
 	_textColors[kUnselectedColor] = 3;
 	_textColors[kNormalColor] = 0;
@@ -331,7 +332,7 @@
 
 	int16 w, h;
 
-	StringExtent_NS	se(_vm->_dialogueFont);
+	StringExtent_NS	se(_font);
 	se.calc(text, MAX_BALLOON_WIDTH);
 	w = se.width() + 14;
 	h = se.height() + 20;
@@ -339,7 +340,7 @@
 	int id = createBalloon(w+5, h, winding, 1);
 	Balloon *balloon = &_intBalloons[id];
 
-	StringWriter_NS sw(_vm->_dialogueFont);
+	StringWriter_NS sw(_font);
 	sw.write(text, MAX_BALLOON_WIDTH, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
@@ -355,7 +356,7 @@
 
 	int16 w, h;
 
-	StringExtent_NS	se(_vm->_dialogueFont);
+	StringExtent_NS	se(_font);
 	se.calc(text, MAX_BALLOON_WIDTH);
 	w = se.width() + 14;
 	h = se.height() + 20;
@@ -364,7 +365,7 @@
 	int id = createBalloon(w+5, h, winding, 1);
 	Balloon *balloon = &_intBalloons[id];
 
-	StringWriter_NS sw(_vm->_dialogueFont);
+	StringWriter_NS sw(_font);
 	sw.write(text, MAX_BALLOON_WIDTH, _textColors[textColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
@@ -385,7 +386,7 @@
 	Balloon *balloon = getBalloon(id);
 	balloon->surface->fillRect(balloon->innerBox, 1);
 
-	StringWriter_NS sw(_vm->_dialogueFont);
+	StringWriter_NS sw(_font);
 	sw.write(text, MAX_BALLOON_WIDTH, _textColors[textColor], balloon->surface);
 }
 
@@ -394,14 +395,14 @@
 
 	int16 w, h;
 
-	StringExtent_NS	se(_vm->_dialogueFont);
+	StringExtent_NS	se(_font);
 	se.calc(text, MAX_BALLOON_WIDTH);
 	w = se.width() + 14;
 	h = se.height() + 20;
 
 	int id = createBalloon(w+(endGame ? 5 : 10), h+5, -1, BALLOON_TRANSPARENT_COLOR_NS);
 	Balloon *balloon = &_intBalloons[id];
-	StringWriter_NS sw(_vm->_dialogueFont);
+	StringWriter_NS sw(_font);
 	sw.write(text, MAX_BALLOON_WIDTH, _textColors[kNormalColor], balloon->surface);
 
 	// TODO: extract some text to make a name for obj
@@ -548,6 +549,7 @@
 
 	Disk *_disk;
 	Gfx *_gfx;
+	Font *_font;
 
 	Frames *_leftBalloon;
 	Frames *_rightBalloon;
@@ -561,7 +563,7 @@
 	StringWriter_BR	_writer;
 
 public:
-	BalloonManager_br(Disk *disk, Gfx *gfx);
+	BalloonManager_br(Disk *disk, Gfx *gfx, Font *font);
 	~BalloonManager_br();
 
 	void freeBalloons();
@@ -669,7 +671,7 @@
 void BalloonManager_br::setBalloonText(uint id, const char *text, TextColor textColor) {
 	Balloon *balloon = getBalloon(id);
 
-	StringWriter_BR sw(_vm->_dialogueFont);
+	StringWriter_BR sw(_font);
 	sw.write(text, 216, _textColors[textColor], balloon->surface);
 }
 
@@ -693,7 +695,7 @@
 }
 
 int BalloonManager_br::setLocationBalloon(const char *text, bool endGame) {
-	StringExtent_BR se(_vm->_dialogueFont);
+	StringExtent_BR se(_font);
 
 	se.calc(text, 240);
 
@@ -742,8 +744,8 @@
 
 
 
-BalloonManager_br::BalloonManager_br(Disk *disk, Gfx *gfx) : _numBalloons(0), _disk(disk), _gfx(gfx),
-	_leftBalloon(0), _rightBalloon(0), _writer(_vm->_dialogueFont) {
+BalloonManager_br::BalloonManager_br(Disk *disk, Gfx *gfx, Font *font) : _numBalloons(0), _disk(disk), _gfx(gfx), _font(font),
+	_leftBalloon(0), _rightBalloon(0), _writer(_font) {
 
 	_textColors[kSelectedColor] = 12;
 	_textColors[kUnselectedColor] = 0;
@@ -756,11 +758,11 @@
 }
 
 void Parallaction::setupBalloonManager() {
-	if (_vm->getGameType() == GType_Nippon) {
-		_balloonMan = new BalloonManager_ns(_vm->_gfx);
+	if (getGameType() == GType_Nippon) {
+		_balloonMan = new BalloonManager_ns(_gfx, _dialogueFont);
 	} else
-	if (_vm->getGameType() == GType_BRA) {
-		_balloonMan = new BalloonManager_br(_vm->_disk, _vm->_gfx);
+	if (getGameType() == GType_BRA) {
+		_balloonMan = new BalloonManager_br(_disk, _gfx, _dialogueFont);
 	} else {
 		error("Unknown game type");
 	}

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -171,7 +171,7 @@
 		_gfx->setPalette(pal);
 
 		_gfx->updateScreen();
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 	}
 
 	return;
@@ -306,7 +306,7 @@
 		_gfx->setPalette(_gfx->_palette);
 
 		_gfx->updateScreen();
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 	}
 
 	_input->waitForButtonEvent(kMouseLeftUp);
@@ -325,10 +325,10 @@
 	}
 
 	for (uint16 _di = 0; _di < 30; _di++) {
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 		_gfx->setPalette(pal0);
 		_gfx->updateScreen();
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 		_gfx->setPalette(pal1);
 		_gfx->updateScreen();
 	}

Modified: scummvm/trunk/engines/parallaction/dialogue.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/dialogue.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/dialogue.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -409,7 +409,7 @@
 	_input->_inputMode = Input::kInputModeGame;
 
 	if (_dialogueMan->_cmdList) {
-		_vm->_cmdExec->run(*_dialogueMan->_cmdList);
+		_cmdExec->run(*_dialogueMan->_cmdList);
 	}
 
 	// The current instance of _dialogueMan must be destroyed before the zone commands

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/disk.h	2008-12-14 10:32:26 UTC (rev 35358)
@@ -152,6 +152,7 @@
 	void loadMask(BackgroundInfo& info, const char *name);
 	void loadPath(BackgroundInfo& info, const char *name);
 	void loadBackground(BackgroundInfo& info, const char *name);
+	void buildMask(byte* buf);
 
 public:
 	AmigaDisk_ns(Parallaction *vm);

Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -914,7 +914,7 @@
 	NOTE: this routine is only able to build masks for Nippon Safes, since mask widths are hardcoded
 	into the main loop.
 */
-void buildMask(byte* buf) {
+void AmigaDisk_ns::buildMask(byte* buf) {
 
 	byte mask1[16] = { 0, 0x80, 0x20, 0xA0, 8, 0x88, 0x28, 0xA8, 2, 0x82, 0x22, 0xA2, 0xA, 0x8A, 0x2A, 0xAA };
 	byte mask0[16] = { 0, 0x40, 0x10, 0x50, 4, 0x44, 0x14, 0x54, 1, 0x41, 0x11, 0x51, 0x5, 0x45, 0x15, 0x55 };

Modified: scummvm/trunk/engines/parallaction/exec.h
===================================================================
--- scummvm/trunk/engines/parallaction/exec.h	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/exec.h	2008-12-14 10:32:26 UTC (rev 35358)
@@ -44,6 +44,8 @@
 
 class CommandExec {
 protected:
+	Parallaction *_vm;
+
 	struct ParallactionStruct1 {
 		CommandPtr cmd;
 		ZonePtr	z;
@@ -69,7 +71,7 @@
 	virtual void run(CommandList &list, ZonePtr z = nullZonePtr);
 	void runSuspended();
 
-	CommandExec() {
+	CommandExec(Parallaction *vm) : _vm(vm) {
 		_suspendedCtxt.valid = false;
 	}
 	virtual ~CommandExec() {

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -438,7 +438,7 @@
 	}
 }
 
-CommandExec_ns::CommandExec_ns(Parallaction_ns* vm) : _vm(vm) {
+CommandExec_ns::CommandExec_ns(Parallaction_ns* vm) : CommandExec(vm), _vm(vm) {
 
 }
 

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -73,8 +73,9 @@
 #define	LABEL_TRANSPARENT_COLOR 0xFF
 
 void halfbritePixel(int x, int y, int color, void *data) {
-	byte *buffer = (byte*)data;
-	buffer[x + y * _vm->_screenWidth] &= ~0x20;
+	Graphics::Surface *surf = (Graphics::Surface *)data;
+	byte *pixel = (byte*)surf->getBasePtr(x, y);
+	*pixel &= ~0x20;
 }
 
 void drawCircleLine(int xCenter, int yCenter, int x, int y, int color, void (*plotProc)(int, int, int, void *), void *data){
@@ -524,7 +525,7 @@
 		}
 	}
 	if (_hbCircleRadius > 0) {
-		drawCircle(_hbCirclePos.x, _hbCirclePos.y, _hbCircleRadius, 0, &halfbritePixel, surf.pixels);
+		drawCircle(_hbCirclePos.x, _hbCirclePos.y, _hbCircleRadius, 0, &halfbritePixel, &surf);
 	}
 }
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -42,9 +42,7 @@
 
 namespace Parallaction {
 
-// FIXME: remove this
 Parallaction *_vm = NULL;
-
 // public stuff
 
 char		_saveData1[30] = { '\0' };
@@ -61,11 +59,7 @@
 Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) :
 	Engine(syst), _gameDescription(gameDesc), _char(this) {
 
-	// FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what
-	// needs fixing, or remove it!
-	// FIXME
 	_vm = this;
-
 	Common::addSpecialDebugLevel(kDebugDialogue, "dialogue", "Dialogues debug level");
 	Common::addSpecialDebugLevel(kDebugParser, "parser", "Parser debug level");
 	Common::addSpecialDebugLevel(kDebugDisk, "disk", "Disk debug level");
@@ -161,7 +155,7 @@
 		//foot.y -= ...
 
 		int min = SCROLL_BAND_WIDTH;
-		int max = _vm->_screenWidth - SCROLL_BAND_WIDTH;
+		int max = _screenWidth - SCROLL_BAND_WIDTH;
 
 		if (foot.x < min) {
 			scrollX -= (min - foot.x);
@@ -175,7 +169,7 @@
 
 	_gfx->animatePalette();
 	_gfx->updateScreen();
-	_vm->_system->delayMillis(30);
+	_system->delayMillis(30);
 }
 
 
@@ -296,8 +290,8 @@
 	BackgroundInfo *info = new BackgroundInfo;
 	_disk->loadSlide(*info, name);
 
-	info->x = (x == CENTER_LABEL_HORIZONTAL) ? ((_vm->_screenWidth - info->width) >> 1) : x;
-	info->y = (y == CENTER_LABEL_VERTICAL) ? ((_vm->_screenHeight - info->height) >> 1) : y;
+	info->x = (x == CENTER_LABEL_HORIZONTAL) ? ((_screenWidth - info->width) >> 1) : x;
+	info->y = (y == CENTER_LABEL_VERTICAL) ? ((_screenHeight - info->height) >> 1) : y;
 
 	_gfx->setBackground(kBackgroundSlide, info);
 }
@@ -411,7 +405,7 @@
 		pal.fadeTo(_gfx->_palette, 4);
 		_gfx->setPalette(pal);
 		_gfx->updateScreen();
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 	}
 
 	_gfx->setPalette(_gfx->_palette);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-12-14 10:32:26 UTC (rev 35358)
@@ -519,7 +519,6 @@
 	void _c_password(void*);
 };
 
-// FIXME: remove global
 extern Parallaction *_vm;
 
 

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -267,8 +267,8 @@
 	delete script;
 
 	// this loads animation scripts
-	AnimationList::iterator it = _vm->_location._animations.begin();
-	for ( ; it != _vm->_location._animations.end(); it++) {
+	AnimationList::iterator it = _location._animations.begin();
+	for ( ; it != _location._animations.end(); it++) {
 		if ((*it)->_scriptName) {
 			loadProgram(*it, (*it)->_scriptName);
 		}
@@ -289,7 +289,7 @@
 
 	delete script;
 
-	_vm->_location._programs.push_back(program);
+	_location._programs.push_back(program);
 
 	debugC(1, kDebugParser, "loadProgram() done");
 

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -141,8 +141,8 @@
 	strcpy(_buf, s);		// kept as reference
 }
 
-Parallaction_ns::Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc), 
-	_locationParser(0), _programParser(0) { 
+Parallaction_ns::Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc),
+	_locationParser(0), _programParser(0) {
 }
 
 Common::Error Parallaction_ns::init() {
@@ -260,7 +260,7 @@
 			v2 += 4;
 		}
 
-		_vm->_system->delayMillis(20);
+		_system->delayMillis(20);
 		_gfx->setPalette(pal);
 		_gfx->updateScreen();
 	}
@@ -375,15 +375,15 @@
 
 	// TODO: the following two lines are specific to Nippon Safes
 	// and should be moved into something like 'initializeParsing()'
-	_vm->_location._hasSound = false;
+	_location._hasSound = false;
 
 	_locationParser->parse(script);
 
 	delete script;
 
 	// this loads animation scripts
-	AnimationList::iterator it = _vm->_location._animations.begin();
-	for ( ; it != _vm->_location._animations.end(); it++) {
+	AnimationList::iterator it = _location._animations.begin();
+	for ( ; it != _location._animations.end(); it++) {
 		if ((*it)->_scriptName) {
 			loadProgram(*it, (*it)->_scriptName);
 		}

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2008-12-14 10:08:31 UTC (rev 35357)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2008-12-14 10:32:26 UTC (rev 35358)
@@ -356,7 +356,7 @@
 
 	delete script;
 
-	_vm->_location._programs.push_back(program);
+	_location._programs.push_back(program);
 
 	debugC(1, kDebugParser, "loadProgram() done");
 


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