From 10a9dbacd9334caede10f1b21d42cdf7e1efcd03 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 15 Jan 2009 11:06:32 -0700 Subject: Style cleanups throughout most of the code. Splitting function type from the function names should no longer be around. Signed-off-by: Ira Rice --- src/resources/action.h | 6 ++---- src/resources/animation.cpp | 9 +++------ src/resources/animation.h | 18 ++++++------------ src/resources/buddylist.cpp | 2 +- src/resources/buddylist.h | 2 +- src/resources/colordb.cpp | 11 ++++++----- src/resources/image.h | 29 +++++++++------------------- src/resources/imagewriter.h | 2 +- src/resources/itemdb.cpp | 16 ++++++++-------- src/resources/iteminfo.cpp | 10 +++------- src/resources/monsterdb.cpp | 16 ++++++++-------- src/resources/monsterdb.h | 6 ++---- src/resources/monsterinfo.cpp | 6 ++---- src/resources/monsterinfo.h | 40 ++++++++++++++++----------------------- src/resources/music.cpp | 6 ++---- src/resources/music.h | 6 ++---- src/resources/npcdb.cpp | 15 +++++++-------- src/resources/npcdb.h | 6 ++---- src/resources/resource.cpp | 6 ++---- src/resources/resource.h | 6 ++---- src/resources/resourcemanager.cpp | 3 +-- src/resources/soundeffect.cpp | 3 +-- src/resources/soundeffect.h | 3 +-- src/resources/spritedef.cpp | 25 +++++++++--------------- src/resources/spritedef.h | 23 ++++++++-------------- 25 files changed, 105 insertions(+), 170 deletions(-) (limited to 'src/resources') diff --git a/src/resources/action.h b/src/resources/action.h index 09eb066e..5f159a00 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -44,11 +44,9 @@ class Action */ ~Action(); - void - setAnimation(int direction, Animation *animation); + void setAnimation(int direction, Animation *animation); - Animation* - getAnimation(int direction) const; + Animation* getAnimation(int direction) const; protected: typedef std::map Animations; diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 596c5fac..5721c7f0 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -30,22 +30,19 @@ Animation::Animation(): { } -void -Animation::addFrame(Image *image, unsigned int delay, int offsetX, int offsetY) +void Animation::addFrame(Image *image, unsigned int delay, int offsetX, int offsetY) { Frame frame = { image, delay, offsetX, offsetY }; mFrames.push_back(frame); mDuration += delay; } -void -Animation::addTerminator() +void Animation::addTerminator() { addFrame(NULL, 0, 0, 0); } -bool -Animation::isTerminator(const Frame &candidate) +bool Animation::isTerminator(const Frame &candidate) { return (candidate.image == NULL); } diff --git a/src/resources/animation.h b/src/resources/animation.h index 8dfe8614..93e100bd 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -54,39 +54,33 @@ class Animation /** * Appends a new animation at the end of the sequence. */ - void - addFrame(Image *image, unsigned int delay, int offsetX, int offsetY); + void addFrame(Image *image, unsigned int delay, int offsetX, int offsetY); /** * Appends an animation terminator that states that the animation * should not loop. */ - void - addTerminator(); + void addTerminator(); /** * Returns the frame at the specified index. */ - Frame* - getFrame(int index) { return &(mFrames[index]); } + Frame* getFrame(int index) { return &(mFrames[index]); } /** * Returns the length of this animation in frames. */ - unsigned int - getLength() const { return mFrames.size(); } + unsigned int getLength() const { return mFrames.size(); } /** * Returns the duration of this animation. */ - int - getDuration() const { return mDuration; } + int getDuration() const { return mDuration; } /** * Determines whether the given animation frame is a terminator. */ - static bool - isTerminator(const Frame &phase); + static bool isTerminator(const Frame &phase); protected: std::vector mFrames; diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp index 1bd98680..8c02735a 100644 --- a/src/resources/buddylist.cpp +++ b/src/resources/buddylist.cpp @@ -111,7 +111,7 @@ bool BuddyList::removeBuddy(const std::string buddy) return false; } -int BuddyList::getNumberOfElements() +int BuddyList::getNumberOfElements() { return mBuddylist.size(); } diff --git a/src/resources/buddylist.h b/src/resources/buddylist.h index 6a3de8c4..092abc6a 100644 --- a/src/resources/buddylist.h +++ b/src/resources/buddylist.h @@ -52,7 +52,7 @@ class BuddyList : public gcn::ListModel { /** * Returns the number of buddy on the list */ - int getNumberOfElements(); + int getNumberOfElements(); /** * Returns the buddy of the number or null diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index bdc6211a..f80ca6b3 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -27,6 +27,7 @@ #include "../log.h" #include "../utils/dtor.h" +#include "../utils/gettext.h" #include "../utils/xml.h" #define HAIR_COLOR_FILE "colors.xml" @@ -52,7 +53,7 @@ void ColorDB::load() if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log("Trying TMW's color file, %s.", TMW_COLOR_FILE); + logger->log(_("Trying TMW's color file, %s."), TMW_COLOR_FILE); TMWHair = true; @@ -62,7 +63,7 @@ void ColorDB::load() root = doc->rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) { - logger->log("ColorDB: Failed"); + logger->log(_("ColorDB: Failed")); mColors[0] = mFail; mLoaded = true; @@ -79,7 +80,7 @@ void ColorDB::load() if (mColors.find(id) != mColors.end()) { - logger->log("ColorDB: Redefinition of dye ID %d", id); + logger->log(_("ColorDB: Redefinition of dye ID %d"), id); } TMWHair ? mColors[id] = XML::getProperty(node, "value", "#FFFFFF") : @@ -94,7 +95,7 @@ void ColorDB::load() void ColorDB::unload() { - logger->log("Unloading color database..."); + logger->log(_("Unloading color database...")); mColors.clear(); mLoaded = false; @@ -109,7 +110,7 @@ std::string& ColorDB::get(int id) if (i == mColors.end()) { - logger->log("ColorDB: Error, unknown dye ID# %d", id); + logger->log(_("ColorDB: Error, unknown dye ID# %d"), id); return mFail; } else diff --git a/src/resources/image.h b/src/resources/image.h index 6eb33ed9..a2e52d3d 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -55,8 +55,7 @@ class Image : public Resource /** * Destructor. */ - virtual - ~Image(); + virtual ~Image(); /** * Loads an image from a buffer in memory. @@ -89,21 +88,17 @@ class Image : public Resource /** * Frees the resources created by SDL. */ - virtual void - unload(); + virtual void unload(); /** * Returns the width of the image. */ - virtual int - getWidth() const { return mBounds.w; } - + virtual int getWidth() const { return mBounds.w; } /** * Returns the height of the image. */ - virtual int - getHeight() const { return mBounds.h; } + virtual int getHeight() const { return mBounds.h; } /** * Creates a new image with the desired clipping rectangle. @@ -111,20 +106,17 @@ class Image : public Resource * @return NULL if creation failed and a valid * object otherwise. */ - virtual Image* - getSubImage(int x, int y, int width, int height); + virtual Image* getSubImage(int x, int y, int width, int height); /** * Sets the alpha value of this image. */ - void - setAlpha(float alpha); + void setAlpha(float alpha); /** * Returns the alpha value of this image. */ - float - getAlpha(); + float getAlpha(); #ifdef USE_OPENGL /** @@ -134,7 +126,6 @@ class Image : public Resource static void setLoadAsOpenGL(bool useOpenGL); #endif - protected: /** * Constructor. @@ -146,8 +137,7 @@ class Image : public Resource /** * Returns the first power of two equal or bigger than the input. */ - static int - powerOfTwo(int input); + static int powerOfTwo(int input); #endif Image(SDL_Surface *image); @@ -193,8 +183,7 @@ class SubImage : public Image * @return NULL if creation failed and a valid * image otherwise. */ - Image* - getSubImage(int x, int y, int width, int height); + Image* getSubImage(int x, int y, int width, int height); private: Image *mParent; diff --git a/src/resources/imagewriter.h b/src/resources/imagewriter.h index 632e2ae4..0dcc0c33 100644 --- a/src/resources/imagewriter.h +++ b/src/resources/imagewriter.h @@ -27,5 +27,5 @@ class ImageWriter { public: static bool writePNG(SDL_Surface *surface, - const std::string &filename); + const std::string &filename); }; diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 027b9e16..270083ef 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -49,10 +49,10 @@ void ItemDB::load() if (mLoaded) return; - logger->log("Initializing item database..."); + logger->log(_("Initializing item database...")); mUnknown = new ItemInfo(); - mUnknown->setName("Unknown item"); + mUnknown->setName(_("Unknown item")); mUnknown->setImageName(""); mUnknown->setSprite("error.xml", GENDER_MALE); mUnknown->setSprite("error.xml", GENDER_FEMALE); @@ -62,7 +62,7 @@ void ItemDB::load() if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) { - logger->error("ItemDB: Error while loading items.xml!"); + logger->error(_("ItemDB: Error while loading items.xml!")); } for_each_xml_child_node(node, rootNode) @@ -74,12 +74,12 @@ void ItemDB::load() if (id == 0) { - logger->log("ItemDB: Invalid or missing item ID in items.xml!"); + logger->log(_("ItemDB: Invalid or missing item ID in items.xml!")); continue; } else if (mItemInfos.find(id) != mItemInfos.end()) { - logger->log("ItemDB: Redefinition of item ID %d", id); + logger->log(_("ItemDB: Redefinition of item ID %d"), id); } int type = XML::getProperty(node, "type", 0); @@ -139,7 +139,7 @@ void ItemDB::load() void ItemDB::unload() { - logger->log("Unloading item database..."); + logger->log(_("Unloading item database...")); delete mUnknown; mUnknown = NULL; @@ -157,7 +157,7 @@ const ItemInfo& ItemDB::get(int id) if (i == mItemInfos.end()) { - logger->log("ItemDB: Error, unknown item ID# %d", id); + logger->log(_("ItemDB: Error, unknown item ID# %d"), id); return *mUnknown; } else @@ -196,7 +196,7 @@ void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) } else { - logger->log("ItemDB: Ignoring unknown sound event '%s'", + logger->log(_("ItemDB: Ignoring unknown sound event '%s'"), event.c_str()); } } diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 6f669376..4c04678a 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -22,8 +22,7 @@ #include "itemdb.h" #include "iteminfo.h" -const std::string& -ItemInfo::getSprite(Gender gender) const +const std::string& ItemInfo::getSprite(Gender gender) const { if (mView) { @@ -66,15 +65,12 @@ void ItemInfo::setWeaponType(int type) } } -void -ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename) +void ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename) { mSounds[event].push_back("sfx/" + filename); } - -const std::string& -ItemInfo::getSound(EquipmentSoundEvent event) const +const std::string& ItemInfo::getSound(EquipmentSoundEvent event) const { static const std::string empty; std::map< EquipmentSoundEvent, std::vector >::const_iterator i; diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 7e2d7a1d..92009826 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -25,6 +25,7 @@ #include "../log.h" #include "../utils/dtor.h" +#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -34,23 +35,22 @@ namespace bool mLoaded = false; } -void -MonsterDB::load() +void MonsterDB::load() { if (mLoaded) return; mUnknown.addSprite("error.xml"); - mUnknown.setName("unnamed"); + mUnknown.setName(_("unnamed")); - logger->log("Initializing monster database..."); + logger->log(_("Initializing monster database...")); XML::Document doc("monsters.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { - logger->error("Monster Database: Error while loading monster.xml!"); + logger->error(_("Monster Database: Error while loading monster.xml!")); } //iterate s @@ -81,7 +81,7 @@ MonsterDB::load() } else { - logger->log("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one", + logger->log(_("MonsterDB: Unknown target cursor type \"%s\" for %s - using medium sized one"), targetCursor.c_str(), currentInfo->getName().c_str()); currentInfo->setTargetCursorSize(Being::TC_MEDIUM); } @@ -118,7 +118,7 @@ MonsterDB::load() } else { - logger->log("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s", + logger->log(_("MonsterDB: Warning, sound effect %s for unknown event %s of monster %s"), filename, event.c_str(), currentInfo->getName().c_str()); } } @@ -156,7 +156,7 @@ const MonsterInfo &MonsterDB::get(int id) if (i == mMonsterInfos.end()) { - logger->log("MonsterDB: Warning, unknown monster ID %d requested", id); + logger->log(_("MonsterDB: Warning, unknown monster ID %d requested"), id); return mUnknown; } else diff --git a/src/resources/monsterdb.h b/src/resources/monsterdb.h index f1d69e72..2e186c15 100644 --- a/src/resources/monsterdb.h +++ b/src/resources/monsterdb.h @@ -31,11 +31,9 @@ */ namespace MonsterDB { - void - load(); + void load(); - void - unload(); + void unload(); const MonsterInfo& get(int id); diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp index 4a71a122..faa759af 100644 --- a/src/resources/monsterinfo.cpp +++ b/src/resources/monsterinfo.cpp @@ -36,8 +36,7 @@ MonsterInfo::~MonsterInfo() } -void -MonsterInfo::addSound(MonsterSoundEvent event, std::string filename) +void MonsterInfo::addSound(MonsterSoundEvent event, std::string filename) { if (mSounds.find(event) == mSounds.end()) { @@ -48,8 +47,7 @@ MonsterInfo::addSound(MonsterSoundEvent event, std::string filename) } -std::string -MonsterInfo::getSound(MonsterSoundEvent event) const +std::string MonsterInfo::getSound(MonsterSoundEvent event) const { std::map* >::const_iterator i; diff --git a/src/resources/monsterinfo.h b/src/resources/monsterinfo.h index 05a78c5a..8d36cc06 100644 --- a/src/resources/monsterinfo.h +++ b/src/resources/monsterinfo.h @@ -56,43 +56,35 @@ class MonsterInfo */ ~MonsterInfo(); - void - setName(std::string name) { mName = name; } + void setName(std::string name) { mName = name; } - void - addSprite(std::string filename) { mSprites.push_back(filename); } + void addSprite(std::string filename) { mSprites.push_back(filename); } - void - setTargetCursorSize(Being::TargetCursorSize targetCursorSize) + void setTargetCursorSize(Being::TargetCursorSize targetCursorSize) { mTargetCursorSize = targetCursorSize; } - void - addSound(MonsterSoundEvent event, std::string filename); + void addSound(MonsterSoundEvent event, std::string filename); - void - addParticleEffect(std::string filename); + void addParticleEffect(std::string filename); - const std::string& - getName() const { return mName; } + const std::string& getName() const + { return mName; } - const std::list& - getSprites() const { return mSprites; } + const std::list& getSprites() const + { return mSprites; } - Being::TargetCursorSize - getTargetCursorSize() const { return mTargetCursorSize; } + Being::TargetCursorSize getTargetCursorSize() const + { return mTargetCursorSize; } - std::string - getSound(MonsterSoundEvent event) const; + std::string getSound(MonsterSoundEvent event) const; - std::string - getAttackParticleEffect() const { return mAttackParticle; } + std::string getAttackParticleEffect() const { return mAttackParticle; } - void - addAttackParticleEffect(const std::string &particleEffect) + void addAttackParticleEffect(const std::string &particleEffect) { mAttackParticle = particleEffect; } - const std::list& - getParticleEffects() const { return mParticleEffects; } + const std::list& getParticleEffects() const + { return mParticleEffects; } private: std::string mName; diff --git a/src/resources/music.cpp b/src/resources/music.cpp index 2386aa43..ed71d62c 100644 --- a/src/resources/music.cpp +++ b/src/resources/music.cpp @@ -55,8 +55,7 @@ Resource *Music::load(void *buffer, unsigned bufferSize) } } -bool -Music::play(int loops) +bool Music::play(int loops) { /* * Warning: loops should be always set to -1 (infinite) with current @@ -71,8 +70,7 @@ Music::play(int loops) return mChannel != -1; } -void -Music::stop() +void Music::stop() { /* * Warning: very dungerous trick, it could try to stop channels occupied diff --git a/src/resources/music.h b/src/resources/music.h index d50150b8..322cfecd 100644 --- a/src/resources/music.h +++ b/src/resources/music.h @@ -56,14 +56,12 @@ class Music : public Resource * @return true if the playback started properly * false otherwise. */ - virtual bool - play(int loops); + virtual bool play(int loops); /** * Stops the music. */ - virtual void - stop(); + virtual void stop(); protected: /** diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 3ae58067..bfa22214 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -25,6 +25,7 @@ #include "../log.h" #include "../utils/dtor.h" +#include "../utils/gettext.h" #include "../utils/xml.h" namespace @@ -44,14 +45,14 @@ void NPCDB::load() unknownSprite->variant = 0; mUnknown.sprites.push_back(unknownSprite); - logger->log("Initializing NPC database..."); + logger->log(_("Initializing NPC database...")); XML::Document doc("npcs.xml"); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "npcs")) { - logger->error("NPC Database: Error while loading items.xml!"); + logger->error(_("NPC Database: Error while loading npcs.xml!")); } //iterate s @@ -63,7 +64,7 @@ void NPCDB::load() int id = XML::getProperty(npcNode, "id", 0); if (id == 0) { - logger->log("NPC Database: NPC with missing ID in npcs.xml!"); + logger->log(_("NPC Database: NPC with missing ID in npcs.xml!")); continue; } @@ -90,8 +91,7 @@ void NPCDB::load() mLoaded = true; } -void -NPCDB::unload() +void NPCDB::unload() { for ( NPCInfosIterator i = mNPCInfos.begin(); i != mNPCInfos.end(); @@ -116,14 +116,13 @@ NPCDB::unload() mLoaded = false; } -const NPCInfo& -NPCDB::get(int id) +const NPCInfo& NPCDB::get(int id) { NPCInfosIterator i = mNPCInfos.find(id); if (i == mNPCInfos.end()) { - logger->log("NPCDB: Warning, unknown NPC ID %d requested", id); + logger->log(_("NPCDB: Warning, unknown NPC ID %d requested"), id); return mUnknown; } else diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h index b4539866..1883d747 100644 --- a/src/resources/npcdb.h +++ b/src/resources/npcdb.h @@ -45,11 +45,9 @@ typedef std::map NPCInfos; */ namespace NPCDB { - void - load(); + void load(); - void - unload(); + void unload(); const NPCInfo& get(int id); diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index e9310905..82562691 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -28,14 +28,12 @@ Resource::~Resource() { } -void -Resource::incRef() +void Resource::incRef() { mRefCount++; } -void -Resource::decRef() +void Resource::decRef() { // Reference may not already have reached zero assert(mRefCount != 0); diff --git a/src/resources/resource.h b/src/resources/resource.h index e85e3147..168fd70a 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -41,8 +41,7 @@ class Resource /** * Increments the internal reference count. */ - void - incRef(); + void incRef(); /** * Decrements the reference count and deletes the object @@ -51,8 +50,7 @@ class Resource * @return true if the object was deleted * false otherwise. */ - void - decRef(); + void decRef(); /** * Return the path identifying this resource. diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index a317e445..99b84506 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -418,8 +418,7 @@ void *ResourceManager::loadFile(const std::string &fileName, int &fileSize) return buffer; } -std::vector -ResourceManager::loadTextFile(const std::string &fileName) +std::vector ResourceManager::loadTextFile(const std::string &fileName) { int contentsLength; char *fileContents = (char*)loadFile(fileName, contentsLength); diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp index e21fd2b0..f7b2b874 100644 --- a/src/resources/soundeffect.cpp +++ b/src/resources/soundeffect.cpp @@ -47,8 +47,7 @@ Resource *SoundEffect::load(void *buffer, unsigned bufferSize) } } -bool -SoundEffect::play(int loops, int volume) +bool SoundEffect::play(int loops, int volume) { Mix_VolumeChunk(mChunk, volume); diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index c3ff6668..b9abefd7 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -58,8 +58,7 @@ class SoundEffect : public Resource * @return true if the playback started properly * false otherwise. */ - virtual bool - play(int loops, int volume); + virtual bool play(int loops, int volume); protected: /** diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index b4193fd3..41b1e789 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -32,8 +32,7 @@ #include "../log.h" #include "../utils/xml.h" -Action* -SpriteDef::getAction(SpriteAction action) const +Action* SpriteDef::getAction(SpriteAction action) const { Actions::const_iterator i = mActions.find(action); @@ -146,8 +145,7 @@ void SpriteDef::loadImageSet(xmlNodePtr node, std::string const &palettes) mImageSets[name] = imageSet; } -void -SpriteDef::loadAction(xmlNodePtr node, int variant_offset) +void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) { const std::string actionName = XML::getProperty(node, "name", ""); const std::string imageSetName = XML::getProperty(node, "imageset", ""); @@ -187,10 +185,9 @@ SpriteDef::loadAction(xmlNodePtr node, int variant_offset) } } -void -SpriteDef::loadAnimation(xmlNodePtr animationNode, - Action *action, ImageSet *imageSet, - int variant_offset) +void SpriteDef::loadAnimation(xmlNodePtr animationNode, + Action *action, ImageSet *imageSet, + int variant_offset) { const std::string directionName = XML::getProperty(animationNode, "direction", ""); @@ -267,8 +264,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode, } // for frameNode } -void -SpriteDef::includeSprite(xmlNodePtr includeNode) +void SpriteDef::includeSprite(xmlNodePtr includeNode) { // TODO: Perform circular dependency check, since it's easy to crash the // client this way. @@ -289,8 +285,7 @@ SpriteDef::includeSprite(xmlNodePtr includeNode) loadSprite(rootNode, 0); } -void -SpriteDef::substituteAction(SpriteAction complete, SpriteAction with) +void SpriteDef::substituteAction(SpriteAction complete, SpriteAction with) { if (mActions.find(complete) == mActions.end()) { @@ -324,8 +319,7 @@ SpriteDef::~SpriteDef() } } -SpriteAction -SpriteDef::makeSpriteAction(const std::string& action) +SpriteAction SpriteDef::makeSpriteAction(const std::string& action) { if (action == "" || action == "default") { return ACTION_DEFAULT; @@ -377,8 +371,7 @@ SpriteDef::makeSpriteAction(const std::string& action) } } -SpriteDirection -SpriteDef::makeSpriteDirection(const std::string& direction) +SpriteDirection SpriteDef::makeSpriteDirection(const std::string& direction) { if (direction == "" || direction == "default") { return DIRECTION_DEFAULT; diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 4b712340..033de6cd 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -103,22 +103,19 @@ class SpriteDef : public Resource /** * Loads an action element. */ - void - loadAction(xmlNodePtr node, int variant_offset); + void loadAction(xmlNodePtr node, int variant_offset); /** * Loads an animation element. */ - void - loadAnimation(xmlNodePtr animationNode, - Action *action, ImageSet *imageSet, - int variant_offset); + void loadAnimation(xmlNodePtr animationNode, + Action *action, ImageSet *imageSet, + int variant_offset); /** * Include another sprite into this one. */ - void - includeSprite(xmlNodePtr includeNode); + void includeSprite(xmlNodePtr includeNode); /** * Complete missing actions by copying existing ones. @@ -129,21 +126,17 @@ class SpriteDef : public Resource * When there are no animations defined for the action "complete", its * animations become a copy of those of the action "with". */ - void - substituteAction(SpriteAction complete, SpriteAction with); + void substituteAction(SpriteAction complete, SpriteAction with); /** * Converts a string into a SpriteAction enum. */ - static SpriteAction - makeSpriteAction(const std::string &action); + static SpriteAction makeSpriteAction(const std::string &action); /** * Converts a string into a SpriteDirection enum. */ - static SpriteDirection - makeSpriteDirection(const std::string &direction); - + static SpriteDirection makeSpriteDirection(const std::string &direction); typedef std::map ImageSets; typedef ImageSets::iterator ImageSetIterator; -- cgit v1.2.3-70-g09d2