diff options
Diffstat (limited to 'engines/draci')
31 files changed, 114 insertions, 203 deletions
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index d7582ec31d..6e6f167fba 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -18,9 +18,6 @@   * 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 "draci/draci.h" @@ -32,6 +29,7 @@  #include "draci/surface.h"  #include "common/memstream.h" +#include "common/system.h"  namespace Draci { @@ -359,7 +357,7 @@ void AnimationManager::insert(Animation *anim, bool allocateIndex) {  }  void AnimationManager::drawScene(Surface *surf) { -	// Fill the screen with colour zero since some rooms may rely on the screen being black +	// Fill the screen with color zero since some rooms may rely on the screen being black  	_vm->_screen->getSurface()->fill(0);  	sortAnimations(); @@ -498,8 +496,8 @@ const Animation *AnimationManager::getTopAnimation(int x, int y) const {  	Animation *retval = NULL; -	// Get transparent colour for the current screen -	const int transparent = _vm->_screen->getSurface()->getTransparentColour(); +	// Get transparent color for the current screen +	const int transparent = _vm->_screen->getSurface()->getTransparentColor();  	for (it = _animations.reverse_begin(); it != _animations.end(); --it) { diff --git a/engines/draci/animation.h b/engines/draci/animation.h index bbcf03b02f..8b2a3d98b8 100644 --- a/engines/draci/animation.h +++ b/engines/draci/animation.h @@ -18,9 +18,6 @@   * 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 DRACI_ANIMATION_H diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp index 5307e04250..154073250c 100644 --- a/engines/draci/barchive.cpp +++ b/engines/draci/barchive.cpp @@ -18,9 +18,6 @@   * 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 "common/debug.h" diff --git a/engines/draci/barchive.h b/engines/draci/barchive.h index 87ee301de5..52ce79ad2d 100644 --- a/engines/draci/barchive.h +++ b/engines/draci/barchive.h @@ -18,9 +18,6 @@   * 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 DRACI_BARCHIVE_H diff --git a/engines/draci/console.cpp b/engines/draci/console.cpp index 304b421ac3..a0013c59fe 100644 --- a/engines/draci/console.cpp +++ b/engines/draci/console.cpp @@ -18,9 +18,6 @@   * 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 "draci/console.h" diff --git a/engines/draci/console.h b/engines/draci/console.h index 9d463f2eb1..714871ffd3 100644 --- a/engines/draci/console.h +++ b/engines/draci/console.h @@ -18,9 +18,6 @@   * 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 DRACI_CONSOLE_H diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 78c5c71605..d3483eb5a4 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -18,9 +18,6 @@   * 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 "draci/draci.h" @@ -116,7 +113,7 @@ public:  	DraciMetaEngine() : AdvancedMetaEngine(detectionParams) {}  	virtual const char *getName() const { -		return "Draci Historie Engine"; +		return "Draci";  	}  	virtual const char *getOriginalCopyright() const { diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 45d17ea24f..cdc91e8d9f 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -18,9 +18,6 @@   * 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 "common/scummsys.h" @@ -30,7 +27,6 @@  #include "common/events.h"  #include "common/file.h"  #include "common/keyboard.h" -#include "common/EventRecorder.h"  #include "engines/util.h" @@ -74,7 +70,8 @@ const uint kSoundsFrequency = 13000;  const uint kDubbingFrequency = 22050;  DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc) - : Engine(syst) { + : Engine(syst), _rnd("draci") { +  	// Put your engine in a sane state, but do nothing big yet;  	// in particular, do not load data from files; rather, if you  	// need to do such things, do them from init(). @@ -95,9 +92,6 @@ DraciEngine::DraciEngine(OSystem *syst, const ADGameDescription *gameDesc)  	DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");  	_console = new DraciConsole(this); - -	// Don't forget to register your random source -	g_eventRec.registerRandomSource(_rnd, "draci");  }  bool DraciEngine::hasFeature(EngineFeature f) const { diff --git a/engines/draci/draci.h b/engines/draci/draci.h index 6a597e123e..83e69ca332 100644 --- a/engines/draci/draci.h +++ b/engines/draci/draci.h @@ -18,9 +18,6 @@   * 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 DRACI_H diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index 688458f3d4..b4e799deb7 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -18,9 +18,6 @@   * 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 "common/file.h" @@ -125,7 +122,7 @@ uint8 Font::getCharWidth(uint8 chr) const {   * @param ty    Vertical offset on the surface   */ -void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) const { +void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_color) const {  	assert(dst != NULL);  	assert(tx >= 0);  	assert(ty >= 0); @@ -147,39 +144,39 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) co  	int ySpaceLeft = dst->h - ty - 1;  	int yPixelsToDraw = (_fontHeight < ySpaceLeft) ? _fontHeight : ySpaceLeft; -	int _transparent = dst->getTransparentColour(); +	int _transparent = dst->getTransparentColor();  	for (int y = 0; y < yPixelsToDraw; ++y) {  		for (int x = 0; x <= xPixelsToDraw; ++x) {  			int curr = y * _maxCharWidth + x; -			int colour = _charData[charOffset + curr]; +			int color = _charData[charOffset + curr];  			// If pixel is transparent, skip it -			if (colour == _transparent) +			if (color == _transparent)  				continue; -			// Replace colour with font colours -			switch (colour) { +			// Replace color with font colors +			switch (color) {  			case 254: -				colour = with_colour; +				color = with_color;  				break;  			case 253: -				colour = kFontColour2; +				color = kFontColor2;  				break;  			case 252: -				colour = kFontColour3; +				color = kFontColor3;  				break;  			case 251: -				colour = kFontColour4; +				color = kFontColor4;  				break;  			}  			// Paint the pixel -			ptr[x] = colour; +			ptr[x] = color;  		}  		// Advance to next row @@ -198,8 +195,8 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) co   * @param spacing   Space to leave between individual characters. Defaults to 0.   */  void Font::drawString(Surface *dst, const byte *str, uint len, -	                  int x, int y, int with_colour, int spacing, bool markDirty) const { -	drawString(dst, Common::String((const char *)str, len), x, y, with_colour, spacing, markDirty); +	                  int x, int y, int with_color, int spacing, bool markDirty) const { +	drawString(dst, Common::String((const char *)str, len), x, y, with_color, spacing, markDirty);  }  /** @@ -213,7 +210,7 @@ void Font::drawString(Surface *dst, const byte *str, uint len,   */  void Font::drawString(Surface *dst, const Common::String &str, -	                  int x, int y, int with_colour, int spacing, bool markDirty) const { +	                  int x, int y, int with_color, int spacing, bool markDirty) const {  	assert(dst != NULL);  	assert(x >= 0);  	assert(y >= 0); @@ -238,7 +235,7 @@ void Font::drawString(Surface *dst, const Common::String &str,  			break;  		} -		drawChar(dst, str[i], curx, cury, with_colour); +		drawChar(dst, str[i], curx, cury, with_color);  		curx += getCharWidth(str[i]) + spacing;  	} diff --git a/engines/draci/font.h b/engines/draci/font.h index 010de66e2c..3d150f733e 100644 --- a/engines/draci/font.h +++ b/engines/draci/font.h @@ -18,9 +18,6 @@   * 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 DRACI_FONT_H @@ -36,19 +33,19 @@ extern const char * const kFontBig;  class Surface;  /** - *  Default font colours. They all seem to remain constant except for the + *  Default font colors. They all seem to remain constant except for the   *  first one which varies depending on the character speaking. - *  kOverFontColour is set to transparent. + *  kOverFontColor is set to transparent.   */  enum { -	kFontColour1 = 2, -	kFontColour2 = 0, -	kFontColour3 = 3, -	kFontColour4 = 4, -	kOverFontColour = 255, -	kTitleColour = 255, -	kLineActiveColour = 254, -	kLineInactiveColour = 255 +	kFontColor1 = 2, +	kFontColor2 = 0, +	kFontColor3 = 3, +	kFontColor4 = 4, +	kOverFontColor = 255, +	kTitleColor = 255, +	kLineActiveColor = 254, +	kLineInactiveColor = 255  };  /** @@ -64,12 +61,12 @@ public:  	uint8 getFontHeight() const { return _fontHeight; }  	uint8 getMaxCharWidth() const { return _maxCharWidth; }  	uint8 getCharWidth(byte chr) const; -	void drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_colour) const; +	void drawChar(Surface *dst, uint8 chr, int tx, int ty, int with_color) const; -	void drawString(Surface *dst, const byte *str, uint len, int x, int y, int with_colour, +	void drawString(Surface *dst, const byte *str, uint len, int x, int y, int with_color,  	                int spacing, bool markDirty) const;  	void drawString(Surface *dst, const Common::String &str, -	                int x, int y, int with_colour, int spacing, bool markDirty) const; +	                int x, int y, int with_color, int spacing, bool markDirty) const;  	uint getStringWidth(const Common::String &str, int spacing) const;  	uint getStringHeight(const Common::String &str) const; diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 060ee41077..657e381986 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -18,9 +18,6 @@   * 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 "common/keyboard.h" @@ -47,9 +44,9 @@ static const char *dialoguePath = "ROZH";  static double real_to_double(byte real[6]);  enum { -	kWalkingMapOverlayColour = 2, -	kWalkingShortestPathOverlayColour = 120, -	kWalkingObliquePathOverlayColour = 73 +	kWalkingMapOverlayColor = 2, +	kWalkingShortestPathOverlayColor = 120, +	kWalkingObliquePathOverlayColor = 73  };  Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) { @@ -69,7 +66,7 @@ Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {  	for (i = 0; i < numPersons; ++i) {  		_persons[i]._x = personData.readUint16LE();  		_persons[i]._y = personData.readUint16LE(); -		_persons[i]._fontColour = personData.readByte(); +		_persons[i]._fontColor = personData.readByte();  	}  	// Read in dialogue offsets @@ -217,12 +214,12 @@ void Game::init() {  	// Initialize animation for object / room titles  	_titleAnim = new Animation(_vm, kTitleText, 257, true); -	_titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColour, 0, 0, 0), NULL); +	_titleAnim->addFrame(new Text("", _vm->_smallFont, kTitleColor, 0, 0, 0), NULL);  	_vm->_anims->insert(_titleAnim, false);  	// Initialize animation for speech text  	Animation *speechAnim = new Animation(_vm, kSpeechText, 257, true); -	speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColour1, 0, 0, 0), NULL); +	speechAnim->addFrame(new Text("", _vm->_bigFont, kFontColor1, 0, 0, 0), NULL);  	_vm->_anims->insert(speechAnim, false);  	// Initialize inventory animation.  _iconsArchive is never flushed. @@ -236,7 +233,7 @@ void Game::init() {  	for (uint i = 0; i < kDialogueLines; ++i) {  		_dialogueAnims[i] = new Animation(_vm, kDialogueLinesID - i, 254, true); -		_dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColour, 0, 0, 0), NULL); +		_dialogueAnims[i]->addFrame(new Text("", _vm->_smallFont, kLineInactiveColor, 0, 0, 0), NULL);  		_dialogueAnims[i]->setRelative(1,  		                      kScreenHeight - (i + 1) * _vm->_smallFont->getFontHeight()); @@ -418,9 +415,9 @@ void Game::handleDialogueLoop() {  		text = reinterpret_cast<Text *>(_dialogueAnims[i]->getCurrentFrame());  		if (_animUnderCursor == _dialogueAnims[i]) { -			text->setColour(kLineActiveColour); +			text->setColor(kLineActiveColor);  		} else { -			text->setColour(kLineInactiveColour); +			text->setColor(kLineInactiveColor);  		}  	} @@ -442,7 +439,7 @@ void Game::fadePalette(bool fading_out) {  	}  	for (int i = 1; i <= kBlackFadingIterations; ++i) {  		_vm->_system->delayMillis(kBlackFadingTimeUnit); -		_vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColours, i, kBlackFadingIterations); +		_vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColors, i, kBlackFadingIterations);  		_vm->_screen->copyToScreen();  	}  } @@ -454,7 +451,7 @@ void Game::advanceAnimationsAndTestLoopExit() {  		--_fadePhase;  		const byte *startPal = _currentRoom._palette >= 0 ? _vm->_paletteArchive->getFile(_currentRoom._palette)->_data : NULL;  		const byte *endPal = getScheduledPalette() >= 0 ? _vm->_paletteArchive->getFile(getScheduledPalette())->_data : NULL; -		_vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColours, _fadePhases - _fadePhase, _fadePhases); +		_vm->_screen->interpolatePalettes(startPal, endPal, 0, kNumColors, _fadePhases - _fadePhase, _fadePhases);  		if (_fadePhase == 0) {  			if (_loopSubstatus == kInnerWhileFade) {  				setExitLoop(true); @@ -997,7 +994,7 @@ int Game::dialogueDraw() {  			dialogueLine = reinterpret_cast<Text *>(anim->getCurrentFrame());  			dialogueLine->setText(_dialogueBlocks[i]._title); -			dialogueLine->setColour(kLineInactiveColour); +			dialogueLine->setColor(kLineInactiveColor);  			_lines[_dialogueLinesNum] = i;  			_dialogueLinesNum++;  		} @@ -1114,8 +1111,8 @@ int Game::playHeroAnimation(int anim_index) {  	return anim->currentFrameNum();  } -void Game::redrawWalkingPath(Animation *anim, byte colour, const WalkingPath &path) { -	Sprite *ov = _walkingMap.newOverlayFromPath(path, colour); +void Game::redrawWalkingPath(Animation *anim, byte color, const WalkingPath &path) { +	Sprite *ov = _walkingMap.newOverlayFromPath(path, color);  	delete anim->getFrame(0);  	anim->replaceFrame(0, ov, NULL);  	anim->markDirtyRect(_vm->_screen->getSurface()); @@ -1148,8 +1145,8 @@ void Game::walkHero(int x, int y, SightDirection dir) {  	_walkingMap.obliquePath(shortestPath, &obliquePath);  	debugC(2, kDraciWalkingDebugLevel, "Walking path lengths: shortest=%d oblique=%d", shortestPath.size(), obliquePath.size());  	if (_vm->_showWalkingMap) { -		redrawWalkingPath(_walkingShortestPathOverlay, kWalkingShortestPathOverlayColour, shortestPath); -		redrawWalkingPath(_walkingObliquePathOverlay, kWalkingObliquePathOverlayColour, obliquePath); +		redrawWalkingPath(_walkingShortestPathOverlay, kWalkingShortestPathOverlayColor, shortestPath); +		redrawWalkingPath(_walkingObliquePathOverlay, kWalkingObliquePathOverlayColor, obliquePath);  	}  	// Start walking.  Walking will be gradually advanced by @@ -1211,7 +1208,7 @@ void Game::loadWalkingMap(int mapID) {  	f = _vm->_walkingMapsArchive->getFile(mapID);  	_walkingMap.load(f->_data, f->_length); -	Sprite *ov = _walkingMap.newOverlayFromMap(kWalkingMapOverlayColour); +	Sprite *ov = _walkingMap.newOverlayFromMap(kWalkingMapOverlayColor);  	delete _walkingMapOverlay->getFrame(0);  	_walkingMapOverlay->replaceFrame(0, ov, NULL);  	_walkingMapOverlay->markDirtyRect(_vm->_screen->getSurface()); @@ -1385,7 +1382,7 @@ void Game::enterNewRoom() {  	loadOverlays();  	// Draw the scene with the black palette and slowly fade into the right palette. -	_vm->_screen->setPalette(NULL, 0, kNumColours); +	_vm->_screen->setPalette(NULL, 0, kNumColors);  	_vm->_anims->drawScene(_vm->_screen->getSurface());  	_vm->_screen->copyToScreen();  	fadePalette(false); diff --git a/engines/draci/game.h b/engines/draci/game.h index 21baaed5cc..47821fcf86 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -18,9 +18,6 @@   * 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 DRACI_GAME_H @@ -31,7 +28,7 @@  #include "draci/walking.h"  namespace Common { -	class Serializer; +class Serializer;  }  namespace Draci { @@ -145,7 +142,7 @@ public:  struct Person {  	uint _x, _y; -	byte _fontColour; +	byte _fontColor;  };  struct Dialogue { @@ -348,7 +345,7 @@ private:  	void enterNewRoom();  	void initWalkingOverlays();  	void loadRoomObjects(); -	void redrawWalkingPath(Animation *anim, byte colour, const WalkingPath &path); +	void redrawWalkingPath(Animation *anim, byte color, const WalkingPath &path);  	DraciEngine *_vm; diff --git a/engines/draci/mouse.cpp b/engines/draci/mouse.cpp index 14d1162fed..90c04ed4c3 100644 --- a/engines/draci/mouse.cpp +++ b/engines/draci/mouse.cpp @@ -18,9 +18,6 @@   * 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 "draci/draci.h" @@ -106,14 +103,14 @@ void Mouse::setCursorType(CursorType cur) {  	f = _vm->_iconsArchive->getFile(cur);  	Sprite sp(f->_data, f->_length, 0, 0, true); -	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours); +	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColors);  	CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),  	        sp.getWidth() / 2, sp.getHeight() / 2, 255);  }  void Mouse::loadItemCursor(const GameItem *item, bool highlighted) {  	const int itemID = item->_absNum; -	const int archiveIndex = 2 * itemID + highlighted; +	const int archiveIndex = 2 * itemID + (highlighted ? 1 : 0);  	CursorType newCursor = static_cast<CursorType> (kItemCursor + archiveIndex);  	if (newCursor == getCursorType()) {  		return; @@ -124,7 +121,7 @@ void Mouse::loadItemCursor(const GameItem *item, bool highlighted) {  	f = _vm->_itemImagesArchive->getFile(archiveIndex);  	Sprite sp(f->_data, f->_length, 0, 0, true); -	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColours); +	CursorMan.replaceCursorPalette(_vm->_screen->getPalette(), 0, kNumColors);  	CursorMan.replaceCursor(sp.getBuffer(), sp.getWidth(), sp.getHeight(),  	        sp.getWidth() / 2, sp.getHeight() / 2, 255);  } diff --git a/engines/draci/mouse.h b/engines/draci/mouse.h index c7f492cb6e..b934475ade 100644 --- a/engines/draci/mouse.h +++ b/engines/draci/mouse.h @@ -18,9 +18,6 @@   * 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 DRACI_MOUSE_H diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 750410b329..6f3e3c8384 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -18,9 +18,6 @@   * 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$ - *   */  // MIDI and digital music class @@ -29,6 +26,7 @@  #include "audio/mididrv.h"  #include "audio/midiparser.h"  #include "common/config-manager.h" +#include "common/debug.h"  #include "common/file.h"  #include "draci/draci.h" diff --git a/engines/draci/music.h b/engines/draci/music.h index c0228074e5..62288a01dc 100644 --- a/engines/draci/music.h +++ b/engines/draci/music.h @@ -18,9 +18,6 @@   * 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$ - *   */  // Music class diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp index 32e852d9a6..ffb1ed7ff4 100644 --- a/engines/draci/saveload.cpp +++ b/engines/draci/saveload.cpp @@ -18,9 +18,6 @@   * 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 "draci/draci.h" diff --git a/engines/draci/saveload.h b/engines/draci/saveload.h index ca5f002ecd..3cc13701db 100644 --- a/engines/draci/saveload.h +++ b/engines/draci/saveload.h @@ -18,9 +18,6 @@   * 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 DRACI_SAVELOAD_H diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index dbe3fd98b8..8c1a0c40f7 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -18,14 +18,13 @@   * 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 "common/memstream.h"  #include "common/system.h" +#include "graphics/palette.h" +  #include "draci/draci.h"  #include "draci/screen.h"  #include "draci/surface.h" @@ -36,12 +35,12 @@ namespace Draci {  Screen::Screen(DraciEngine *vm) : _vm(vm) {  	_surface = new Surface(kScreenWidth, kScreenHeight); -	_palette = new byte[3 * kNumColours]; -	_blackPalette = new byte[3 * kNumColours]; -	for (int i = 0; i < 3 * kNumColours; ++i) { +	_palette = new byte[3 * kNumColors]; +	_blackPalette = new byte[3 * kNumColors]; +	for (int i = 0; i < 3 * kNumColors; ++i) {  		_blackPalette[i] = 0;  	} -	setPalette(NULL, 0, kNumColours); +	setPalette(NULL, 0, kNumColors);  	this->clearScreen();  } @@ -54,11 +53,11 @@ Screen::~Screen() {  /**   * @brief Sets a part of the palette   * @param data Pointer to a buffer containing new palette data - *        start Index of the colour where replacement should start - *        num Number of colours to replace + *        start Index of the color where replacement should start + *        num Number of colors to replace   */  void Screen::setPalette(const byte *data, uint16 start, uint16 num) { -	Common::MemoryReadStream pal(data ? data : _blackPalette, 3 * kNumColours); +	Common::MemoryReadStream pal(data ? data : _blackPalette, 3 * kNumColors);  	pal.seek(start * 3);  	// Copy the palette @@ -78,8 +77,8 @@ void Screen::setPalette(const byte *data, uint16 start, uint16 num) {  }  void Screen::interpolatePalettes(const byte *first, const byte *second, uint16 start, uint16 num, int index, int number) { -	Common::MemoryReadStream firstPal(first ? first : _blackPalette, 3 * kNumColours); -	Common::MemoryReadStream secondPal(second ? second : _blackPalette, 3 * kNumColours); +	Common::MemoryReadStream firstPal(first ? first : _blackPalette, 3 * kNumColors); +	Common::MemoryReadStream secondPal(second ? second : _blackPalette, 3 * kNumColors);  	firstPal.seek(start * 3);  	secondPal.seek(start * 3); diff --git a/engines/draci/screen.h b/engines/draci/screen.h index dc1aca092d..5a8297feba 100644 --- a/engines/draci/screen.h +++ b/engines/draci/screen.h @@ -18,9 +18,6 @@   * 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 DRACI_SCREEN_H @@ -33,7 +30,7 @@ namespace Draci {  enum ScreenParameters {  	kScreenWidth = 320,  	kScreenHeight = 200, -	kNumColours = 256, +	kNumColors = 256,  	kDefaultTransparent = 255  }; diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 2a27541ad9..c4df9d9dde 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -18,9 +18,6 @@   * 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 "common/array.h" @@ -716,14 +713,14 @@ void Script::talk(const Common::Array<int> ¶ms) {  	SoundSample *sample = _vm->_sound->isMutedVoice()  		? NULL : _vm->_dubbingArchive->getSample(sentenceID, 0); -	// Set the string and text colour +	// Set the string and text color  	surface->markDirtyRect(speechFrame->getRect(kNoDisplacement));  	if (_vm->_sound->showSubtitles() || !sample) {  		speechFrame->setText(Common::String((const char *)f->_data+1, f->_length-1));  	} else {  		speechFrame->setText("");  	} -	speechFrame->setColour(person->_fontColour); +	speechFrame->setColor(person->_fontColor);  	speechFrame->repeatedlySplitLongLines(kScreenWidth);  	// Speak the dubbing if possible @@ -873,11 +870,11 @@ void Script::fadePalettePlay(const Common::Array<int> ¶ms) {  void Script::setPalette(const Common::Array<int> ¶ms) {  	if (_vm->_game->getScheduledPalette() == -1) { -		_vm->_screen->setPalette(NULL, 0, kNumColours); +		_vm->_screen->setPalette(NULL, 0, kNumColors);  	} else {  		const BAFile *f;  		f = _vm->_paletteArchive->getFile(_vm->_game->getScheduledPalette()); -		_vm->_screen->setPalette(f->_data, 0, kNumColours); +		_vm->_screen->setPalette(f->_data, 0, kNumColors);  	}  	// Immediately update the palette  	_vm->_screen->copyToScreen(); diff --git a/engines/draci/script.h b/engines/draci/script.h index e81691204e..72d6f6c344 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -18,9 +18,6 @@   * 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 DRACI_SCRIPT_H @@ -30,7 +27,7 @@  #include "common/stream.h"  namespace Common { -	class ReadStream; +class ReadStream;  }  namespace Draci { @@ -109,7 +106,7 @@ private:  	int _jump;  	bool _endProgram; -	/** List of all GPL commands. Initialised in the constructor. */ +	/** List of all GPL commands. Initialized in the constructor. */  	const GPL2Command *_commandList;  	const GPL2Operator *_operatorList;  	const GPL2Function *_functionList; diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index c8646fff67..bbba9d9cc0 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -18,9 +18,6 @@   * 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 "common/archive.h" @@ -29,6 +26,7 @@  #include "common/file.h"  #include "common/str.h"  #include "common/substream.h" +#include "common/textconsole.h"  #include "common/memstream.h"  #include "common/unzip.h" @@ -417,15 +415,16 @@ void Sound::setVolume() {  	} else {  		_muteSound = _muteVoice = true;  	} +  	if (ConfMan.getBool("mute")) {  		_muteSound = _muteVoice = true;  	} -	const int soundVolume = _muteSound ? 0: ConfMan.getInt("sfx_volume"); -	const int speechVolume = _muteVoice ? 0 : ConfMan.getInt("speech_volume"); +	_mixer->muteSoundType(Audio::Mixer::kSFXSoundType, _muteSound); +	_mixer->muteSoundType(Audio::Mixer::kSpeechSoundType, _muteVoice); -	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolume); -	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, speechVolume); +	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); +	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));  }  } // End of namespace Draci diff --git a/engines/draci/sound.h b/engines/draci/sound.h index 4f69af7ff0..358c228604 100644 --- a/engines/draci/sound.h +++ b/engines/draci/sound.h @@ -18,9 +18,6 @@   * 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 DRACI_SOUND_H diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 65c6e21ee4..92ce7d31d9 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -18,9 +18,6 @@   * 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 "common/memstream.h" @@ -144,7 +141,7 @@ void Sprite::drawReScaled(Surface *surface, bool markDirty, const Displacement &  	// Get pointers to source and destination buffers  	byte *dst = (byte *)surface->getBasePtr(clippedDestRect.left, clippedDestRect.top); -	const int transparent = surface->getTransparentColour(); +	const int transparent = surface->getTransparentColor();  	// Calculate how many rows and columns we need to draw  	const int rows = clippedDestRect.height(); @@ -212,7 +209,7 @@ void Sprite::draw(Surface *surface, bool markDirty, int relX, int relY) const {  	const byte *src = _data + croppedBy.y * _width +  		(!_mirror ? croppedBy.x : _width - 1 - croppedBy.x); -	const int transparent = surface->getTransparentColour(); +	const int transparent = surface->getTransparentColor();  	// Calculate how many rows and columns we need to draw  	const int rows = clippedDestRect.height(); @@ -252,7 +249,7 @@ Common::Rect Sprite::getRect(const Displacement &displacement) const {  	    _y + displacement.relY + scummvm_lround(_scaledHeight * displacement.extraScaleY));  } -Text::Text(const Common::String &str, const Font *font, byte fontColour, +Text::Text(const Common::String &str, const Font *font, byte fontColor,                  int x, int y, uint spacing) {  	_x = x;  	_y = y; @@ -268,7 +265,7 @@ Text::Text(const Common::String &str, const Font *font, byte fontColour,  	}  	_spacing = spacing; -	_colour = fontColour; +	_color = fontColor;  	_font = font; @@ -294,7 +291,7 @@ void Text::setText(const Common::String &str) {  }  void Text::draw(Surface *surface, bool markDirty, int relX, int relY) const { -	_font->drawString(surface, _text, _x + relX, _y + relY, _colour, _spacing, true); +	_font->drawString(surface, _text, _x + relX, _y + relY, _color, _spacing, true);  }  Common::Rect Text::getRect(const Displacement &displacement) const { diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index ddc56ecd80..c86728914e 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -18,9 +18,6 @@   * 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 DRACI_SPRITE_H @@ -139,12 +136,12 @@ private:  class Text : public Drawable {  public: -	Text(const Common::String &str, const Font *font, byte fontColour, +	Text(const Common::String &str, const Font *font, byte fontColor,  	    int x, int y, uint spacing);  	~Text() {}  	void setText(const Common::String &str); -	void setColour(byte fontColour) { _colour = fontColour; } +	void setColor(byte fontColor) { _color = fontColor; }  	void setSpacing(uint spacing) { _spacing = spacing; }  	void setFont(const Font *font); @@ -165,7 +162,7 @@ private:  	Common::String _text;  	uint _length; -	uint8 _colour; +	uint8 _color;  	uint _spacing;  	const Font *_font;  }; diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 1c7ecfb23b..8380f8777b 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -18,9 +18,6 @@   * 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 "draci/screen.h" @@ -29,9 +26,9 @@  namespace Draci {  Surface::Surface(int width, int height) { -	this->create(width, height, 1); +	this->create(width, height, Graphics::PixelFormat::createFormatCLUT8());  	this->markClean(); -	_transparentColour = kDefaultTransparent; +	_transparentColor = kDefaultTransparent;  }  Surface::~Surface() { @@ -80,12 +77,12 @@ void Surface::markClean() {  }  /** - * @brief Fills the surface with the specified colour + * @brief Fills the surface with the specified color   */ -void Surface::fill(uint colour) { +void Surface::fill(uint color) {  	byte *ptr = (byte *)getBasePtr(0, 0); -	memset(ptr, colour, w * h); +	memset(ptr, color, w * h);  }  /** diff --git a/engines/draci/surface.h b/engines/draci/surface.h index a5c9ddb597..71a3722a2a 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -18,15 +18,13 @@   * 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 DRACI_SURFACE_H  #define DRACI_SURFACE_H  #include "common/list.h" +#include "common/rect.h"  #include "graphics/surface.h"  namespace Draci { @@ -43,18 +41,18 @@ public:  	void markDirty();  	void markClean();  	bool needsFullUpdate() const { return _fullUpdate; } -	uint getTransparentColour() const { return _transparentColour; } -	void setTransparentColour(uint colour) { _transparentColour = colour; } -	void fill(uint colour); +	uint getTransparentColor() const { return _transparentColor; } +	void setTransparentColor(uint color) { _transparentColor = color; } +	void fill(uint color);  	uint putAboveY(int y, int height) const;  	uint centerOnX(int x, int width) const;  	Common::Rect getDimensions() const { return Common::Rect(w, h); }  private: -	/** The current transparent colour of the surface. See getTransparentColour() and -	 *  setTransparentColour(). +	/** The current transparent color of the surface. See getTransparentColor() and +	 *  setTransparentColor().  	 */ -	uint _transparentColour; +	uint _transparentColor;  	/** Set when the surface is scheduled for a full update.  	 *  See markDirty(), markClean(). Accessed via needsFullUpdate(). diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp index c6f9a58a85..9a66c6163a 100644 --- a/engines/draci/walking.cpp +++ b/engines/draci/walking.cpp @@ -18,9 +18,6 @@   * 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 "common/memstream.h" @@ -58,7 +55,7 @@ bool WalkingMap::isWalkable(const Common::Point &p) const {  	return getPixel(p.x / _deltaX, p.y / _deltaY);  } -Sprite *WalkingMap::newOverlayFromMap(byte colour) const { +Sprite *WalkingMap::newOverlayFromMap(byte color) const {  	// HACK: Create a visible overlay from the walking map so we can test it  	byte *wlk = new byte[_realWidth * _realHeight];  	memset(wlk, 255, _realWidth * _realHeight); @@ -66,7 +63,7 @@ Sprite *WalkingMap::newOverlayFromMap(byte colour) const {  	for (int i = 0; i < _mapWidth; ++i) {  		for (int j = 0; j < _mapHeight; ++j) {  			if (getPixel(i, j)) { -				drawOverlayRectangle(Common::Point(i, j), colour, wlk); +				drawOverlayRectangle(Common::Point(i, j), color, wlk);  			}  		}  	} @@ -285,7 +282,7 @@ void WalkingMap::obliquePath(const WalkingPath& path, WalkingPath *obliquedPath)  	while (managedToOblique(obliquedPath)) {}  } -Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) const { +Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte color) const {  	// HACK: Create a visible overlay from the walking map so we can test it  	byte *wlk = new byte[_realWidth * _realHeight];  	memset(wlk, 255, _realWidth * _realHeight); @@ -297,14 +294,14 @@ Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) con  		// Draw only points in the interval [v1, v2).  These half-open  		// half-closed intervals connect all the way to the last point.  		for (int step = 0; step < steps; ++step) { -			drawOverlayRectangle(interpolate(v1, v2, step, steps), colour, wlk); +			drawOverlayRectangle(interpolate(v1, v2, step, steps), color, wlk);  		}  	}  	// Draw the last point.  This works also when the path has no segment,  	// but just one point.  	if (path.size() > 0) {  		const Common::Point &vLast = path[path.size()-1]; -		drawOverlayRectangle(vLast, colour, wlk); +		drawOverlayRectangle(vLast, color, wlk);  	}  	Sprite *ov = new Sprite(_realWidth, _realHeight, wlk, 0, 0, false); @@ -313,10 +310,10 @@ Sprite *WalkingMap::newOverlayFromPath(const WalkingPath &path, byte colour) con  	return ov;  } -void WalkingMap::drawOverlayRectangle(const Common::Point &p, byte colour, byte *buf) const { +void WalkingMap::drawOverlayRectangle(const Common::Point &p, byte color, byte *buf) const {  	for (int i = 0; i < _deltaX; ++i) {  		for (int j = 0; j < _deltaY; ++j) { -			buf[(p.y * _deltaY + j) * _realWidth + (p.x * _deltaX + i)] = colour; +			buf[(p.y * _deltaY + j) * _realWidth + (p.x * _deltaX + i)] = color;  		}  	}  } diff --git a/engines/draci/walking.h b/engines/draci/walking.h index 55b39792f1..a43aeb272a 100644 --- a/engines/draci/walking.h +++ b/engines/draci/walking.h @@ -18,9 +18,6 @@   * 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 DRACI_WALKING_H @@ -45,12 +42,12 @@ public:  	bool getPixel(int x, int y) const;  	bool isWalkable(const Common::Point &p) const; -	Sprite *newOverlayFromMap(byte colour) const; +	Sprite *newOverlayFromMap(byte color) const;  	Common::Point findNearestWalkable(int x, int y) const;  	bool findShortestPath(Common::Point p1, Common::Point p2, WalkingPath *path) const;  	void obliquePath(const WalkingPath& path, WalkingPath *obliquedPath); -	Sprite *newOverlayFromPath(const WalkingPath &path, byte colour) const; +	Sprite *newOverlayFromPath(const WalkingPath &path, byte color) const;  	Common::Point getDelta() const { return Common::Point(_deltaX, _deltaY); }  	static int pointsBetween(const Common::Point &p1, const Common::Point &p2); @@ -68,7 +65,7 @@ private:  	// 4 possible directions to walk from a pixel.  	static const int kDirections[][2]; -	void drawOverlayRectangle(const Common::Point &p, byte colour, byte *buf) const; +	void drawOverlayRectangle(const Common::Point &p, byte color, byte *buf) const;  	bool lineIsCovered(const Common::Point &p1, const Common::Point &p2) const;  	// Returns true if the number of vertices on the path was decreased.  | 
