diff options
| -rw-r--r-- | engines/draci/animation.cpp | 68 | ||||
| -rw-r--r-- | engines/draci/animation.h | 34 | ||||
| -rw-r--r-- | engines/draci/draci.h | 3 | ||||
| -rw-r--r-- | engines/draci/game.cpp | 192 | ||||
| -rw-r--r-- | engines/draci/game.h | 104 | ||||
| -rw-r--r-- | engines/draci/music.h | 8 | ||||
| -rw-r--r-- | engines/draci/screen.cpp | 51 | ||||
| -rw-r--r-- | engines/draci/screen.h | 6 | ||||
| -rw-r--r-- | engines/draci/sound.cpp | 5 | ||||
| -rw-r--r-- | engines/draci/sound.h | 3 | ||||
| -rw-r--r-- | engines/draci/sprite.cpp | 22 | ||||
| -rw-r--r-- | engines/draci/sprite.h | 10 | ||||
| -rw-r--r-- | engines/draci/surface.cpp | 44 | ||||
| -rw-r--r-- | engines/draci/surface.h | 12 | 
14 files changed, 92 insertions, 470 deletions
| diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index 1c729e9c85..a0f983100b 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -47,10 +47,6 @@ Animation::~Animation() {  	deleteFrames();  } -bool Animation::isLooping() const { -	return _looping; -} -  void Animation::setRelative(int relx, int rely) {  	// Delete the previous frame if there is one  	if (_frames.size() > 0) @@ -143,34 +139,6 @@ void Animation::drawFrame(Surface *surface) {  	_hasChangedFrame = false;  } -void Animation::setID(int id) { -	_id = id; -} - -int Animation::getID() const { -	return _id; -} - -void Animation::setZ(uint z) { -	_z = z; -} - -uint Animation::getZ() const { -	return _z; -} - -int Animation::getRelativeX() const { -	return _displacement.relX; -} - -int Animation::getRelativeY() const { -	return _displacement.relY; -} - -bool Animation::isPlaying() const { -	return _playing; -} -  void Animation::setPlaying(bool playing) {  	_tick = _vm->_system->getMillis();  	_playing = playing; @@ -179,14 +147,6 @@ void Animation::setPlaying(bool playing) {  	_hasChangedFrame |= playing;  } -bool Animation::isPaused() const { -	return _paused; -} - -void Animation::setPaused(bool paused) { -	_paused = paused; -} -  void Animation::setScaleFactors(double scaleX, double scaleY) {  	debugC(5, kDraciAnimationDebugLevel,  		"Setting scaling factors on anim %d (scaleX: %.3f scaleY: %.3f)", @@ -198,27 +158,11 @@ void Animation::setScaleFactors(double scaleX, double scaleY) {  	_displacement.extraScaleY = scaleY;  } -double Animation::getScaleX() const { -	return _displacement.extraScaleX; -} - -double Animation::getScaleY() const { -	return _displacement.extraScaleY; -} -  void Animation::addFrame(Drawable *frame, const SoundSample *sample) {  	_frames.push_back(frame);  	_samples.push_back(sample);  } -int Animation::getIndex() const { -	return _index; -} - -void Animation::setIndex(int index) { -	_index = index; -} -  Drawable *Animation::getCurrentFrame() {  	// If there are no frames stored, return NULL  	return _frames.size() > 0 ? _frames[_currentFrame] : NULL; @@ -229,14 +173,6 @@ Drawable *Animation::getFrame(int frameNum) {  	return _frames.size() > 0 ? _frames[frameNum] : NULL;  } -uint Animation::getFrameCount() const { -	return _frames.size(); -} - -uint Animation::currentFrameNum() const { -	return _currentFrame; -} -  void Animation::setCurrentFrame(uint frame) {  	// Check whether the value is sane  	if (frame >= _frames.size()) { @@ -516,10 +452,6 @@ void AnimationManager::deleteAll() {  	_lastIndex = -1;  } -int AnimationManager::getLastIndex() const { -	return _lastIndex; -} -  void AnimationManager::deleteAfterIndex(int index) {  	Common::List<Animation *>::iterator it; diff --git a/engines/draci/animation.h b/engines/draci/animation.h index c0d536f2a2..6805822640 100644 --- a/engines/draci/animation.h +++ b/engines/draci/animation.h @@ -62,11 +62,11 @@ public:  	Animation(DraciEngine *v, int index);  	~Animation(); -	uint getZ() const; -	void setZ(uint z); +	uint getZ() const { return _z; } +	void setZ(uint z) { _z = z; } -	void setID(int id); -	int getID() const; +	void setID(int id) { _id = id; } +	int getID() const { return _id; }  	void nextFrame(bool force);  	void drawFrame(Surface *surface); @@ -75,29 +75,29 @@ public:  	Drawable *getCurrentFrame();  	Drawable *getFrame(int frameNum);  	void setCurrentFrame(uint frame); -	uint currentFrameNum() const; -	uint getFrameCount() const; +	uint currentFrameNum() const { return _currentFrame; } +	uint getFrameCount() const { return _frames.size(); } -	bool isPlaying() const; +	bool isPlaying() const { return _playing; }  	void setPlaying(bool playing); -	bool isPaused() const; -	void setPaused(bool paused); +	bool isPaused() const { return _paused; } +	void setPaused(bool paused) { _paused = paused; } -	bool isLooping() const; +	bool isLooping() const { return _looping; }  	void setLooping(bool looping);  	void setRelative(int relx, int rely); -	int getRelativeX() const; -	int getRelativeY() const; +	int getRelativeX() const { return _displacement.relX; } +	int getRelativeY() const { return _displacement.relY; }  	const Displacement &getDisplacement() const { return _displacement; } -	int getIndex() const; -	void setIndex(int index); +	int getIndex() const { return _index; } +	void setIndex(int index) { _index = index; }  	void setScaleFactors(double scaleX, double scaleY); -	double getScaleX() const; -	double getScaleY() const; +	double getScaleX() const { return _displacement.extraScaleX; } +	double getScaleY() const { return _displacement.extraScaleY; }  	void markDirtyRect(Surface *surface) const; @@ -173,7 +173,7 @@ public:  	Animation *getAnimation(int id); -	int getLastIndex() const; +	int getLastIndex() const { return _lastIndex; }  	void deleteAfterIndex(int index);  	int getTopAnimationID(int x, int y) const; diff --git a/engines/draci/draci.h b/engines/draci/draci.h index 8de37ac312..c09b086cf2 100644 --- a/engines/draci/draci.h +++ b/engines/draci/draci.h @@ -108,9 +108,6 @@ enum {  	kDraciSoundDebugLevel     = 1 << 5  }; -// Macro to simulate lround() for non-C99 compilers -static inline long scummvm_lround(double val) { return (long)floor(val + 0.5); } -  } // End of namespace Draci  #endif // DRACI_H diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index caa83cf6d1..350499fc06 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -49,6 +49,7 @@ Game::Game(DraciEngine *vm) : _vm(vm) {  	file = initArchive->getFile(5);  	Common::MemoryReadStream personData(file->_data, file->_length); +	const int personSize = sizeof(uint16) * 2 + sizeof(byte);  	uint numPersons = file->_length / personSize;  	_persons = new Person[numPersons]; @@ -921,50 +922,6 @@ void Game::runDialogueProg(GPL2Program prog, int offset) {  	deleteAnimationsAfterIndex(lastAnimIndex);  } -bool Game::isDialogueBegin() const { -	return _dialogueBegin; -} - -bool Game::shouldExitDialogue() const { -	return _dialogueExit; -} - -void Game::setDialogueExit(bool exit) { -	_dialogueExit = exit; -} - -int Game::getDialogueBlockNum() const { -	return _blockNum; -} - -int Game::getDialogueVar(int dialogueID) const { -	return _dialogueVars[dialogueID]; -} - -void Game::setDialogueVar(int dialogueID, int value) { -	_dialogueVars[dialogueID] = value; -} - -int Game::getCurrentDialogue() const { -	return _currentDialogue; -} - -int Game::getDialogueLastBlock() const { -	return _lastBlock; -} - -int Game::getDialogueLinesNum() const { -	return _dialogueLinesNum; -} - -int Game::getDialogueCurrentBlock() const { -	return _currentBlock; -} - -int Game::getCurrentDialogueOffset() const { -	return _dialogueOffsets[_currentDialogue]; -} -  void Game::playHeroAnimation(int anim_index) {  	const GameObject *dragon = getObject(kDragonObject);  	const int animID = dragon->_anim[anim_index]; @@ -1262,14 +1219,6 @@ void Game::loadWalkingMap(int mapID) {  	_walkingMap.load(f->_data, f->_length);  } -GameObject *Game::getObject(uint objNum) { -	return _objects + objNum; -} - -uint Game::getNumObjects() const { -	return _info._numObjects; -} -  void Game::loadOverlays() {  	uint x, y, z, num; @@ -1442,51 +1391,6 @@ void Game::positionAnimAsHero(Animation *anim) {  	anim->setRelative(p.x, p.y);  } -int Game::getHeroX() const { -	return _hero.x; -} - -int Game::getHeroY() const { -	return _hero.y; -} - -double Game::getPers0() const { -	return _currentRoom._pers0; -} - -double Game::getPersStep() const { -	return _currentRoom._persStep; -} - -int Game::getMusicTrack() const { -	return _currentRoom._music; -} - -void Game::setMusicTrack(int num) { -	_currentRoom._music = num; -} - -int Game::getRoomNum() const { -	return _currentRoom._roomNum; -} - -void Game::setRoomNum(int num) { -	_currentRoom._roomNum = num; -} - -int Game::getPreviousRoomNum() const { -	return _previousRoom; -} - -void Game::rememberRoomNumAsPrevious() { -	_previousRoom = getRoomNum(); -} - -void Game::scheduleEnteringRoomUsingGate(int room, int gate) { -	_newRoom = room; -	_newGate = gate; -} -  void Game::pushNewRoom() {  	_pushedNewRoom = _newRoom;  	_pushedNewGate = _newGate; @@ -1499,50 +1403,6 @@ void Game::popNewRoom() {  	}  } -void Game::setLoopStatus(LoopStatus status) { -	_loopStatus = status; -} - -void Game::setLoopSubstatus(LoopSubstatus status) { -	_loopSubstatus = status; -} - -LoopStatus Game::getLoopStatus() const { -	return _loopStatus; -} - -LoopSubstatus Game::getLoopSubstatus() const { -	return _loopSubstatus; -} - -int Game::getVariable(int numVar) const { -	return _variables[numVar]; -} - -void Game::setVariable(int numVar, int value) { -	_variables[numVar] = value; -} - -int Game::getItemStatus(int itemID) const { -	return _itemStatus[itemID]; -} - -void Game::setItemStatus(int itemID, int status) { -	_itemStatus[itemID] = status; -} - -int Game::getCurrentItem() const { -	return _currentItem; -} - -void Game::setCurrentItem(int itemID) { -	_currentItem = itemID; -} - -const Person *Game::getPerson(int personID) const { -	return &_persons[personID]; -} -  void Game::setSpeechTiming(uint tick, uint duration) {  	_speechTick = tick;  	_speechDuration = duration; @@ -1553,53 +1413,11 @@ void Game::shiftSpeechAndFadeTick(int delta) {  	_fadeTick += delta;  } -int Game::getEscRoom() const { -	return _currentRoom._escRoom; -} - -int Game::getMapRoom() const { -	return _info._mapRoom; -} - -int Game::getMapID() const { -	return _currentRoom._mapID; -} - -void Game::schedulePalette(int paletteID) { -	_scheduledPalette = paletteID; -} - -int Game::getScheduledPalette() const { -	return _scheduledPalette; -} -  void Game::initializeFading(int phases) {  	_fadePhases = _fadePhase = phases;  	_fadeTick = _vm->_system->getMillis();  } -void Game::setEnableQuickHero(bool value) { -	_enableQuickHero = value; -} - -void Game::setWantQuickHero(bool value) { -	_wantQuickHero = value; -	// TODO: after proper walking is implemented, do super-fast animation when walking -} - -void Game::setEnableSpeedText(bool value) { -	_enableSpeedText = value; -} - -/** - * The GPL command Mark sets the animation index (which specifies the order in which - * animations were loaded in) which is then used by the Release command to delete - * all animations that have an index greater than the one marked. - */ -int Game::getMarkedAnimationIndex() const { -	return _markedAnimationIndex; -} -  void Game::deleteAnimationsAfterIndex(int lastAnimIndex) {  	// Delete all animations loaded after the marked one  	// (from objects and from the AnimationManager) @@ -1624,14 +1442,6 @@ void Game::stopObjectAnimations(const GameObject *obj) {  	}  } -/** - * See Game::getMarkedAnimationIndex(). - */ - -void Game::setMarkedAnimationIndex(int index) { -	_markedAnimationIndex = index; -} -  Game::~Game() {  	delete[] _persons;  	delete[] _variables; diff --git a/engines/draci/game.h b/engines/draci/game.h index c8ec693dbd..d8155dbcae 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -42,11 +42,6 @@ enum {  	kDragonObject = 0  }; -enum StructSizes { -	personSize = sizeof(uint16) * 2 + sizeof(byte) -}; - -  // Used as a return value for Game::getObjectWithAnimation() if no object  // owns the animation in question  enum { @@ -211,8 +206,8 @@ public:  	}  	void walkHero(int x, int y, SightDirection dir); -	int getHeroX() const; -	int getHeroY() const; +	int getHeroX() const { return _hero.x; } +	int getHeroY() const { return _hero.y; }  	void positionAnimAsHero(Animation *anim);  	void playHeroAnimation(int anim_index); @@ -222,51 +217,57 @@ public:  	void loadWalkingMap(int mapID);		// but leaves _currentRoom._mapID untouched  	void loadItem(int itemID); -	uint getNumObjects() const; -	GameObject *getObject(uint objNum); +	uint getNumObjects() const { return _info._numObjects; } +	GameObject *getObject(uint objNum) { return _objects + objNum; }  	int getObjectWithAnimation(int animID) const;  	void deleteObjectAnimations();  	void deleteAnimationsAfterIndex(int lastAnimIndex);  	void stopObjectAnimations(const GameObject *obj);  	int playingObjectAnimation(const GameObject *obj) const; -	int getVariable(int varNum) const; -	void setVariable(int varNum, int value); +	int getVariable(int varNum) const { return _variables[varNum]; } +	void setVariable(int varNum, int value) { _variables[varNum] = value; } -	const Person *getPerson(int personID) const; +	const Person *getPerson(int personID) const { return &_persons[personID]; } -	int getRoomNum() const; -	void setRoomNum(int num); -	int getPreviousRoomNum() const; -	void rememberRoomNumAsPrevious(); -	void scheduleEnteringRoomUsingGate(int room, int gate); +	int getRoomNum() const { return _currentRoom._roomNum; } +	void setRoomNum(int num) { _currentRoom._roomNum = num; } +	int getPreviousRoomNum() const { return _previousRoom; } +	void rememberRoomNumAsPrevious() { _previousRoom = getRoomNum(); } +	void scheduleEnteringRoomUsingGate(int room, int gate) { _newRoom = room; _newGate = gate; }  	void pushNewRoom();  	void popNewRoom(); -	double getPers0() const; -	double getPersStep() const; -	int getMusicTrack() const; -	void setMusicTrack(int num); +	double getPers0() const { return _currentRoom._pers0; } +	double getPersStep() const { return _currentRoom._persStep; } +	int getMusicTrack() const { return _currentRoom._music; } +	void setMusicTrack(int num) { _currentRoom._music = num; } -	int getItemStatus(int itemID) const; -	void setItemStatus(int itemID, int status); -	int getCurrentItem() const; -	void setCurrentItem(int itemID); +	int getItemStatus(int itemID) const { return _itemStatus[itemID]; } +	void setItemStatus(int itemID, int status) { _itemStatus[itemID] = status; } +	int getCurrentItem() const { return _currentItem; } +	void setCurrentItem(int itemID) { _currentItem = itemID; }  	void removeItem(int itemID);  	void putItem(int itemID, int position);  	void addItem(int itemID); -	int getEscRoom() const; -	int getMapRoom() const; -	int getMapID() const; +	int getEscRoom() const { return _currentRoom._escRoom; } +	int getMapRoom() const { return _info._mapRoom; } +	int getMapID() const { return _currentRoom._mapID; } -	int getMarkedAnimationIndex() const; -	void setMarkedAnimationIndex(int index); +	/** +	 * The GPL command Mark sets the animation index (which specifies the +	 * order in which animations were loaded in) which is then used by the +	 * Release command to delete all animations that have an index greater +	 * than the one marked. +	 */ +	int getMarkedAnimationIndex() const { return _markedAnimationIndex; } +	void setMarkedAnimationIndex(int index) { _markedAnimationIndex = index; } -	void setLoopStatus(LoopStatus status); -	void setLoopSubstatus(LoopSubstatus status); -	LoopStatus getLoopStatus() const; -	LoopSubstatus getLoopSubstatus() const; +	void setLoopStatus(LoopStatus status) { _loopStatus = status; } +	void setLoopSubstatus(LoopSubstatus status) { _loopSubstatus = status; } +	LoopStatus getLoopStatus() const { return _loopStatus; } +	LoopSubstatus getLoopSubstatus() const { return _loopSubstatus; }  	bool shouldQuit() const { return _shouldQuit; }  	void setQuit(bool quit) { _shouldQuit = quit; } @@ -291,26 +292,27 @@ public:  	void dialogueDone();  	void runDialogueProg(GPL2Program, int offset); -	bool isDialogueBegin() const; -	bool shouldExitDialogue() const; -	void setDialogueExit(bool exit); -	int getDialogueBlockNum() const; -	int getDialogueVar(int dialogueID) const; -	void setDialogueVar(int dialogueID, int value); -	int getCurrentDialogue() const; -	int getDialogueCurrentBlock() const; -	int getDialogueLastBlock() const; -	int getDialogueLinesNum() const; -	int getCurrentDialogueOffset() const; - -	void schedulePalette(int paletteID); -	int getScheduledPalette() const; +	bool isDialogueBegin() const { return _dialogueBegin; } +	bool shouldExitDialogue() const { return _dialogueExit; } +	void setDialogueExit(bool exit) { _dialogueExit = exit; } +	int getDialogueBlockNum() const { return _blockNum; } +	int getDialogueVar(int dialogueID) const { return _dialogueVars[dialogueID]; } +	void setDialogueVar(int dialogueID, int value) { _dialogueVars[dialogueID] = value; } +	int getCurrentDialogue() const { return _currentDialogue; } +	int getDialogueCurrentBlock() const { return _currentBlock; } +	int getDialogueLastBlock() const { return _lastBlock; } +	int getDialogueLinesNum() const { return _dialogueLinesNum; } +	int getCurrentDialogueOffset() const { return _dialogueOffsets[_currentDialogue]; } + +	void schedulePalette(int paletteID) { _scheduledPalette = paletteID; } +	int getScheduledPalette() const { return _scheduledPalette; }  	void initializeFading(int phases); -	void setEnableQuickHero(bool value); +	void setEnableQuickHero(bool value) { _enableQuickHero = value; }  	bool getEnableQuickHero() const { return _enableQuickHero; } -	void setWantQuickHero(bool value); +	void setWantQuickHero(bool value) { _wantQuickHero = value; }  	bool getWantQuickHero() const { return _wantQuickHero; } -	void setEnableSpeedText(bool value); +	// TODO: after proper walking is implemented, do super-fast animation when walking +	void setEnableSpeedText(bool value) { _enableSpeedText = value; }  	bool getEnableSpeedText() const { return _enableSpeedText; }  	void DoSync(Common::Serializer &s); diff --git a/engines/draci/music.h b/engines/draci/music.h index 06ecde5d37..0db062d73b 100644 --- a/engines/draci/music.h +++ b/engines/draci/music.h @@ -59,7 +59,7 @@ public:  	void setGM(bool isGM) { _isGM = isGM; } -	//MidiDriver interface implementation +	// MidiDriver interface implementation  	int open();  	void close();  	void send(uint32 b); @@ -67,11 +67,11 @@ public:  	void metaEvent(byte type, byte *data, uint16 length);  	void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { } -	uint32 getBaseTempo(void)	{ return _driver ? _driver->getBaseTempo() : 0; } +	uint32 getBaseTempo(void) { return _driver ? _driver->getBaseTempo() : 0; }  	//Channel allocation functions -	MidiChannel *allocateChannel()		{ return 0; } -	MidiChannel *getPercussionChannel()	{ return 0; } +	MidiChannel *allocateChannel() { return 0; } +	MidiChannel *getPercussionChannel() { return 0; }  	MidiParser *_parser;  	Common::Mutex _mutex; diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index 019ffa605e..70e0faa40a 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -145,57 +145,6 @@ void Screen::clearScreen() {  	memset(ptr, 0, kScreenWidth * kScreenHeight);  } -/** - * @brief Fills the screen with the specified colour - * @param colour The colour the screen should be filled with - * - * Fills the screen with the specified colour and marks the whole screen dirty. - */ -void Screen::fillScreen(uint8 colour) { -	_surface->fill(colour); -	_surface->markDirty(); -} - -/** - * @brief Draws a rectangle on the screen - * @param r Which rectangle to draw - *        colour The colour of the rectangle - */ -void Screen::drawRect(Common::Rect r, uint8 colour) { -	// Clip the rectangle to screen size -	r.clip(_surface->w, _surface->h); - -	// If the whole rectangle is outside the screen, return -	if (r.isEmpty()) -		return; - -	byte *ptr = (byte *)_surface->getBasePtr(r.left, r.top); - -	for (uint16 i = 0; i < r.width(); ++i) { -		for (uint16 j = 0; j < r.height(); ++j) { -			ptr[j * kScreenWidth + i] = colour; -		} -	} - -	_surface->markDirtyRect(r); -} - -/** - * @brief Fetches the current palette - * @return A byte pointer to the current palette - */ -const byte *Screen::getPalette() const { -	return _palette; -} - -/** - * @brief Fetches the current surface - * @return A pointer to the current surface - */ -Draci::Surface *Screen::getSurface() { -	return _surface; -} -  } // End of namespace Draci diff --git a/engines/draci/screen.h b/engines/draci/screen.h index 846b38efa3..648d3c40ed 100644 --- a/engines/draci/screen.h +++ b/engines/draci/screen.h @@ -48,12 +48,10 @@ public:  	void setPalette(const byte *data, uint16 start, uint16 num);  	void interpolatePalettes(const byte *first, const byte *second, uint16 start, uint16 num, int index, int number); -	const byte *getPalette() const; +	const byte *getPalette() const { return _palette; }  	void copyToScreen();  	void clearScreen(); -	void fillScreen(uint8 colour); -	Surface *getSurface(); -	void drawRect(Common::Rect r, uint8 colour); +	Surface *getSurface() { return _surface; }  private:  	int interpolate(int first, int second, int index, int number); diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index cd2ed6aafb..2d0a8863e9 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -263,11 +263,6 @@ void Sound::stopVoice() {  		}  } -void Sound::stopAll() { -	stopVoice(); -	stopSound(); -} -  void Sound::setVolume() {  	// TODO: how to retrieve "Mute All" ?          if (_mixer->isReady()) { diff --git a/engines/draci/sound.h b/engines/draci/sound.h index 8888ec995c..ab0df52dea 100644 --- a/engines/draci/sound.h +++ b/engines/draci/sound.h @@ -112,7 +112,7 @@ public:  	void stopVoice();  	bool isMutedVoice() const { return _muteVoice; } -	void stopAll(); +	void stopAll() { stopVoice(); stopSound(); }  	void setVolume(); @@ -120,7 +120,6 @@ public:  	int talkSpeed() const { return _talkSpeed; }   private: -  	void playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffer, int volume,  				sndHandleType handleType, bool loop); diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index 183a3d1030..1fdd5339f4 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -122,13 +122,9 @@ Sprite::~Sprite() {  	delete[] _data;  } -void Sprite::setMirrorOn() { -	_mirror = true; -} - -void Sprite::setMirrorOff() { -	_mirror = false; -} +// Macro to simulate lround() for non-C99 compilers +// TODO: get rid of it +static inline long scummvm_lround(double val) { return (long)floor(val + 0.5); }  int Sprite::getPixel(int x, int y, const Displacement &displacement) const {  	Common::Rect rect = getRect(displacement); @@ -319,18 +315,6 @@ void Text::setText(const Common::String &str) {  	}  } -void Text::setColour(byte fontColour) { -	_colour = fontColour; -} - -void Text::setSpacing(uint spacing) { -	_spacing = spacing; -} - -uint Text::getLength() const { -	return _length; -} -  void Text::draw(Surface *surface, bool markDirty, int relX, int relY) const {  	_font->drawString(surface, _text, _x + relX, _y + relY, _colour, _spacing, true);  } diff --git a/engines/draci/sprite.h b/engines/draci/sprite.h index 25c255547e..0d805e0385 100644 --- a/engines/draci/sprite.h +++ b/engines/draci/sprite.h @@ -109,8 +109,8 @@ public:  	void draw(Surface *surface, bool markDirty, int relX, int relY) const;  	void drawReScaled(Surface *surface, bool markDirty, const Displacement &displacement) const; -	void setMirrorOn(); -	void setMirrorOff(); +	void setMirrorOn() { _mirror = true; } +	void setMirrorOff() { _mirror = false; }  	Common::Rect getRect(const Displacement &displacement) const; @@ -132,11 +132,11 @@ public:  	~Text() {};  	void setText(const Common::String &str); -	void setColour(byte fontColour); -	void setSpacing(uint spacing); +	void setColour(byte fontColour) { _colour = fontColour; } +	void setSpacing(uint spacing) { _spacing = spacing; }  	void setFont(const Font *font); -	uint getLength() const; +	uint getLength() const { return _length; }  	void draw(Surface *surface, bool markDirty, int relX, int relY) const; diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 1832aa6b02..1c7ecfb23b 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -65,14 +65,6 @@ void Surface::markDirtyRect(Common::Rect r) {  }  /** - * @brief Clears all dirty rectangles - * - */ -void Surface::clearDirtyRects() { -	_dirtyRects.clear(); -} - -/**   * @brief Marks the whole surface dirty   */  void Surface::markDirty() { @@ -88,35 +80,6 @@ void Surface::markClean() {  }  /** - * @brief Checks whether the surface needs a full update - */ -bool Surface::needsFullUpdate() const { -	return _fullUpdate; -} - -/** - * @brief Fetches the surface's dirty rectangles - * @return A pointer a list of dirty rectangles - */ -const Common::List<Common::Rect> *Surface::getDirtyRects() const { -	return &_dirtyRects; -} - -/** - * @brief Returns the current transparent colour of the surface - */ -uint Surface::getTransparentColour() const { -	return _transparentColour; -} - -/** - * @brief Sets the surface's transparent colour - */ -void Surface::setTransparentColour(uint colour) { -	_transparentColour = colour; -} - -/**   * @brief Fills the surface with the specified colour   */  void Surface::fill(uint colour) { @@ -165,11 +128,4 @@ uint Surface::putAboveY(int y, int height) const {  	return newY;  } -/** - * @brief Returns a Common::Rect corresponding to the surface. - */ -Common::Rect Surface::getDimensions() const { -	return Common::Rect(w, h); -} -  } // End of namespace Draci diff --git a/engines/draci/surface.h b/engines/draci/surface.h index f026357a2a..f3c0bd55e8 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -37,17 +37,17 @@ public:  	~Surface();  	void markDirtyRect(Common::Rect r); -	const Common::List<Common::Rect> *getDirtyRects() const; -	void clearDirtyRects(); +	const Common::List<Common::Rect> *getDirtyRects() const { return &_dirtyRects; } +	void clearDirtyRects() { _dirtyRects.clear(); }  	void markDirty();  	void markClean(); -	bool needsFullUpdate() const; -	uint getTransparentColour() const; -	void setTransparentColour(uint colour); +	bool needsFullUpdate() const { return _fullUpdate; } +	uint getTransparentColour() const { return _transparentColour; } +	void setTransparentColour(uint colour) { _transparentColour = colour; }  	void fill(uint colour);  	uint putAboveY(int y, int height) const;  	uint centerOnX(int x, int width) const; -	Common::Rect getDimensions() const; +	Common::Rect getDimensions() const { return Common::Rect(w, h); }  private:  	/** The current transparent colour of the surface. See getTransparentColour() and | 
