summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-24 19:45:33 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-24 19:45:33 +0100
commita18d4dcf1eb9abb9b4ed8060aefd14088ccb9680 (patch)
treed625a96d6d978d00644e9dd6ffd75e099eb43149
parenta928798a9326de1e6781e14c8ccf5abec1232385 (diff)
downloadmana-client-a18d4dcf1eb9abb9b4ed8060aefd14088ccb9680.tar.gz
mana-client-a18d4dcf1eb9abb9b4ed8060aefd14088ccb9680.tar.bz2
mana-client-a18d4dcf1eb9abb9b4ed8060aefd14088ccb9680.tar.xz
mana-client-a18d4dcf1eb9abb9b4ed8060aefd14088ccb9680.zip
Code reformatting
-rw-r--r--src/gui/ministatus.cpp16
-rw-r--r--src/gui/progressbar.cpp11
-rw-r--r--src/gui/truetypefont.cpp6
-rw-r--r--src/monster.cpp21
-rw-r--r--src/player.cpp9
-rw-r--r--src/resources/image.h32
6 files changed, 36 insertions, 59 deletions
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index fa4f75da..f49022b6 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -72,8 +72,7 @@ MiniStatusWindow::MiniStatusWindow():
loadWindowState();
}
-void
-MiniStatusWindow::setIcon(int index, AnimatedSprite *sprite)
+void MiniStatusWindow::setIcon(int index, AnimatedSprite *sprite)
{
if (index >= (int) mIcons.size())
mIcons.resize(index + 1, NULL);
@@ -84,8 +83,7 @@ MiniStatusWindow::setIcon(int index, AnimatedSprite *sprite)
mIcons[index] = sprite;
}
-void
-MiniStatusWindow::eraseIcon(int index)
+void MiniStatusWindow::eraseIcon(int index)
{
mIcons.erase(mIcons.begin() + index);
}
@@ -148,20 +146,20 @@ void MiniStatusWindow::update()
}
-void MiniStatusWindow::draw(gcn::Graphics *gcn_graphics)
+void MiniStatusWindow::draw(gcn::Graphics *graphics)
{
update();
- drawChildren(gcn_graphics);
+ drawChildren(graphics);
}
-void
-MiniStatusWindow::drawIcons(Graphics *graphics)
+void MiniStatusWindow::drawIcons(Graphics *graphics)
{
// Draw icons
int icon_x = mXpBar->getX() + mXpBar->getWidth() + 4;
- for (unsigned int i = 0; i < mIcons.size(); i++)
+ for (unsigned int i = 0; i < mIcons.size(); i++) {
if (mIcons[i]) {
mIcons[i]->draw(graphics, icon_x, 3);
icon_x += 2 + mIcons[i]->getWidth();
}
+ }
}
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 7b88a556..5ce01b35 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -88,8 +88,7 @@ void ProgressBar::logic()
if (mBlueToGo < mBlue) mBlue--;
}
-void
-ProgressBar::draw(gcn::Graphics *graphics)
+void ProgressBar::draw(gcn::Graphics *graphics)
{
static_cast<Graphics*>(graphics)->
drawImageRect(0, 0, getWidth(), getHeight(), mBorder);
@@ -99,21 +98,19 @@ ProgressBar::draw(gcn::Graphics *graphics)
{
graphics->setColor(gcn::Color(mRed, mGreen, mBlue, 200));
graphics->fillRectangle(gcn::Rectangle(4, 4,
- (int)(mProgress * (getWidth() - 8)),
+ (int) (mProgress * (getWidth() - 8)),
getHeight() - 8));
}
}
-void
-ProgressBar::setProgress(float progress)
+void ProgressBar::setProgress(float progress)
{
if (progress < 0.0f) mProgress = 0.0;
else if (progress > 1.0f) mProgress = 1.0;
else mProgress = progress;
}
-void
-ProgressBar::setColor(Uint8 red, Uint8 green, Uint8 blue)
+void ProgressBar::setColor(Uint8 red, Uint8 green, Uint8 blue)
{
mRedToGo = red;
mGreenToGo = green;
diff --git a/src/gui/truetypefont.cpp b/src/gui/truetypefont.cpp
index fc6783f7..f65b3446 100644
--- a/src/gui/truetypefont.cpp
+++ b/src/gui/truetypefont.cpp
@@ -111,13 +111,11 @@ TrueTypeFont::~TrueTypeFont()
}
void TrueTypeFont::drawString(gcn::Graphics *graphics,
- const std::string &text,
- int x, int y)
+ const std::string &text,
+ int x, int y)
{
if (text.empty())
- {
return;
- }
Graphics *g = dynamic_cast<Graphics *>(graphics);
diff --git a/src/monster.cpp b/src/monster.cpp
index b6e6fc35..f50855ca 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -79,8 +79,7 @@ Monster::~Monster()
}
}
-void
-Monster::logic()
+void Monster::logic()
{
if (mAction != STAND)
{
@@ -95,14 +94,12 @@ Monster::logic()
Being::logic();
}
-Being::Type
-Monster::getType() const
+Being::Type Monster::getType() const
{
return MONSTER;
}
-void
-Monster::setAction(Uint8 action)
+void Monster::setAction(Uint8 action)
{
SpriteAction currentAction = ACTION_INVALID;
@@ -140,8 +137,7 @@ Monster::setAction(Uint8 action)
}
}
-void
-Monster::handleAttack(Being *victim, int damage)
+void Monster::handleAttack(Being *victim, int damage)
{
Being::handleAttack(victim, damage);
@@ -150,21 +146,18 @@ Monster::handleAttack(Being *victim, int damage)
MONSTER_EVENT_HIT : MONSTER_EVENT_MISS));
}
-void
-Monster::takeDamage(int amount)
+void Monster::takeDamage(int amount)
{
if (amount > 0) sound.playSfx(getInfo().getSound(MONSTER_EVENT_HURT));
Being::takeDamage(amount);
}
-Being::TargetCursorSize
-Monster::getTargetCursorSize() const
+Being::TargetCursorSize Monster::getTargetCursorSize() const
{
return getInfo().getTargetCursorSize();
}
-const MonsterInfo&
-Monster::getInfo() const
+const MonsterInfo &Monster::getInfo() const
{
return MonsterDB::get(mJob - 1002);
}
diff --git a/src/player.cpp b/src/player.cpp
index 27820acf..ec3b1c1c 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -61,8 +61,7 @@ void Player::setName(const std::string &name)
}
}
-void
-Player::logic()
+void Player::logic()
{
switch (mAction) {
case WALK:
@@ -89,14 +88,12 @@ Player::logic()
Being::logic();
}
-Being::Type
-Player::getType() const
+Being::Type Player::getType() const
{
return PLAYER;
}
-void
-Player::flash(int time)
+void Player::flash(int time)
{
if (mName)
{
diff --git a/src/resources/image.h b/src/resources/image.h
index faaf3db7..2c0569f9 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -54,8 +54,7 @@ class Image : public Resource
/**
* Destructor.
*/
- virtual
- ~Image();
+ virtual ~Image();
/**
* Loads an image from a buffer in memory.
@@ -78,7 +77,8 @@ class Image : public Resource
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- static Resource *load(void *buffer, unsigned bufferSize, Dye const &dye);
+ static Resource *load(void *buffer, unsigned bufferSize,
+ Dye const &dye);
/**
* Loads an image from an SDL surface.
@@ -88,21 +88,20 @@ 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.
@@ -110,20 +109,17 @@ class Image : public Resource
* @return <code>NULL</code> 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
/**
@@ -145,8 +141,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);
@@ -192,8 +187,7 @@ class SubImage : public Image
* @return <code>NULL</code> 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;