[Scummvm-cvs-logs] SF.net SVN: scummvm:[45524] scummvm/trunk/engines/draci

spalek at users.sourceforge.net spalek at users.sourceforge.net
Fri Oct 30 07:11:05 CET 2009


Revision: 45524
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45524&view=rev
Author:   spalek
Date:     2009-10-30 06:11:04 +0000 (Fri, 30 Oct 2009)

Log Message:
-----------
Moved all one-line getters/setters to the header files

Modified Paths:
--------------
    scummvm/trunk/engines/draci/animation.cpp
    scummvm/trunk/engines/draci/animation.h
    scummvm/trunk/engines/draci/draci.h
    scummvm/trunk/engines/draci/game.cpp
    scummvm/trunk/engines/draci/game.h
    scummvm/trunk/engines/draci/music.h
    scummvm/trunk/engines/draci/screen.cpp
    scummvm/trunk/engines/draci/screen.h
    scummvm/trunk/engines/draci/sound.cpp
    scummvm/trunk/engines/draci/sound.h
    scummvm/trunk/engines/draci/sprite.cpp
    scummvm/trunk/engines/draci/sprite.h
    scummvm/trunk/engines/draci/surface.cpp
    scummvm/trunk/engines/draci/surface.h

Modified: scummvm/trunk/engines/draci/animation.cpp
===================================================================
--- scummvm/trunk/engines/draci/animation.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/animation.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -47,10 +47,6 @@
 	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 @@
 	_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 @@
 	_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 @@
 	_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 @@
 	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 @@
 	_lastIndex = -1;
 }
 
-int AnimationManager::getLastIndex() const {
-	return _lastIndex;
-}
-
 void AnimationManager::deleteAfterIndex(int index) {
 	Common::List<Animation *>::iterator it;
 

Modified: scummvm/trunk/engines/draci/animation.h
===================================================================
--- scummvm/trunk/engines/draci/animation.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/animation.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -62,11 +62,11 @@
 	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 @@
 	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 @@
 
 	Animation *getAnimation(int id);
 
-	int getLastIndex() const;
+	int getLastIndex() const { return _lastIndex; }
 	void deleteAfterIndex(int index);
 
 	int getTopAnimationID(int x, int y) const;

Modified: scummvm/trunk/engines/draci/draci.h
===================================================================
--- scummvm/trunk/engines/draci/draci.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/draci.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -108,9 +108,6 @@
 	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

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/game.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -49,6 +49,7 @@
 	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 @@
 	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 @@
 	_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 @@
 	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::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 @@
 	_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 @@
 	}
 }
 
-/**
- * See Game::getMarkedAnimationIndex().
- */
-
-void Game::setMarkedAnimationIndex(int index) {
-	_markedAnimationIndex = index;
-}
-
 Game::~Game() {
 	delete[] _persons;
 	delete[] _variables;

Modified: scummvm/trunk/engines/draci/game.h
===================================================================
--- scummvm/trunk/engines/draci/game.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/game.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -42,11 +42,6 @@
 	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 @@
 	}
 
 	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 @@
 	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 @@
 	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;
+	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);
-	int getScheduledPalette() const;
+	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);

Modified: scummvm/trunk/engines/draci/music.h
===================================================================
--- scummvm/trunk/engines/draci/music.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/music.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -59,7 +59,7 @@
 
 	void setGM(bool isGM) { _isGM = isGM; }
 
-	//MidiDriver interface implementation
+	// MidiDriver interface implementation
 	int open();
 	void close();
 	void send(uint32 b);
@@ -67,11 +67,11 @@
 	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;

Modified: scummvm/trunk/engines/draci/screen.cpp
===================================================================
--- scummvm/trunk/engines/draci/screen.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/screen.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -145,57 +145,6 @@
 	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
 
 

Modified: scummvm/trunk/engines/draci/screen.h
===================================================================
--- scummvm/trunk/engines/draci/screen.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/screen.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -48,12 +48,10 @@
 
 	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);

Modified: scummvm/trunk/engines/draci/sound.cpp
===================================================================
--- scummvm/trunk/engines/draci/sound.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/sound.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -263,11 +263,6 @@
 		}
 }
 
-void Sound::stopAll() {
-	stopVoice();
-	stopSound();
-}
-
 void Sound::setVolume() {
 	// TODO: how to retrieve "Mute All" ?
         if (_mixer->isReady()) {

Modified: scummvm/trunk/engines/draci/sound.h
===================================================================
--- scummvm/trunk/engines/draci/sound.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/sound.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -112,7 +112,7 @@
 	void stopVoice();
 	bool isMutedVoice() const { return _muteVoice; }
 
-	void stopAll();
+	void stopAll() { stopVoice(); stopSound(); }
 
 	void setVolume();
 
@@ -120,7 +120,6 @@
 	int talkSpeed() const { return _talkSpeed; }
 
  private:
-
 	void playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffer, int volume,
 				sndHandleType handleType, bool loop);
 

Modified: scummvm/trunk/engines/draci/sprite.cpp
===================================================================
--- scummvm/trunk/engines/draci/sprite.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/sprite.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -122,14 +122,10 @@
 	delete[] _data;
 }
 
-void Sprite::setMirrorOn() {
-	_mirror = true;
-}
+// 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); }
 
-void Sprite::setMirrorOff() {
-	_mirror = false;
-}
-
 int Sprite::getPixel(int x, int y, const Displacement &displacement) const {
 	Common::Rect rect = getRect(displacement);
 
@@ -319,18 +315,6 @@
 	}
 }
 
-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);
 }

Modified: scummvm/trunk/engines/draci/sprite.h
===================================================================
--- scummvm/trunk/engines/draci/sprite.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/sprite.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -109,8 +109,8 @@
 	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 @@
 	~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;
 

Modified: scummvm/trunk/engines/draci/surface.cpp
===================================================================
--- scummvm/trunk/engines/draci/surface.cpp	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/surface.cpp	2009-10-30 06:11:04 UTC (rev 45524)
@@ -65,14 +65,6 @@
 }
 
 /**
- * @brief Clears all dirty rectangles
- *
- */
-void Surface::clearDirtyRects() {
-	_dirtyRects.clear();
-}
-
-/**
  * @brief Marks the whole surface dirty
  */
 void Surface::markDirty() {
@@ -88,35 +80,6 @@
 }
 
 /**
- * @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 @@
 	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

Modified: scummvm/trunk/engines/draci/surface.h
===================================================================
--- scummvm/trunk/engines/draci/surface.h	2009-10-30 05:21:44 UTC (rev 45523)
+++ scummvm/trunk/engines/draci/surface.h	2009-10-30 06:11:04 UTC (rev 45524)
@@ -37,17 +37,17 @@
 	~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


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