summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-10 22:23:27 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-10 23:38:46 +0100
commit3b022084c6d661276b3a5f5151e2bfbf6201cb98 (patch)
tree85c4064a2c22db1267c4678ff2ebf6599e1c14e8
parentb89a8e3e6a2d31d886e31383a4add186f0fa3680 (diff)
downloadmana-3b022084c6d661276b3a5f5151e2bfbf6201cb98.tar.gz
mana-3b022084c6d661276b3a5f5151e2bfbf6201cb98.tar.bz2
mana-3b022084c6d661276b3a5f5151e2bfbf6201cb98.tar.xz
mana-3b022084c6d661276b3a5f5151e2bfbf6201cb98.zip
Arbitrary small code cleanups
Reviewed-by: Erik Schilling
-rw-r--r--src/gui/widgets/button.h8
-rw-r--r--src/gui/widgets/desktop.cpp2
-rw-r--r--src/gui/widgets/tabbedarea.h2
-rw-r--r--src/sound.cpp2
-rw-r--r--src/sound.h2
5 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index f07bb913..f31c3436 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -46,7 +46,7 @@ class Button : public gcn::Button
* adds the given action listener.
*/
Button(const std::string &caption, const std::string &actionEventId,
- gcn::ActionListener *listener);
+ gcn::ActionListener *listener);
~Button();
@@ -62,7 +62,7 @@ class Button : public gcn::Button
void adjustSize();
- void setCaption(const std::string& caption);
+ void setCaption(const std::string &caption);
/**
* Set the icons available next to the text
@@ -72,14 +72,14 @@ class Button : public gcn::Button
* Standard, Highlighted, Pressed, and Disabled.
* If the image is too short, the missing states won't be loaded.
*/
- bool setButtonIcon(const std::string& iconFile = std::string());
+ bool setButtonIcon(const std::string &iconFile);
/**
* Set the button popup text when hovering it for a few seconds.
*
* @note: An empty text will disable the popup.
*/
- void setButtonPopupText(const std::string& text = std::string())
+ void setButtonPopupText(const std::string &text)
{ mPopupText = text; }
void logic();
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index baf3e951..ce609891 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -86,7 +86,7 @@ void Desktop::draw(gcn::Graphics *graphics)
if (mWallpaper)
{
- if (!mWallpaper->useOpenGL())
+ if (!Image::useOpenGL())
g->drawImage(mWallpaper,
(getWidth() - mWallpaper->getWidth()) / 2,
(getHeight() - mWallpaper->getHeight()) / 2);
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 72ec324d..45b092a4 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -68,8 +68,6 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener
*/
gcn::Widget *getCurrentWidget();
- using gcn::TabbedArea::addTab;
-
/**
* Add a tab. Overridden since it needs to size the widget.
*
diff --git a/src/sound.cpp b/src/sound.cpp
index 4f562833..e8348a40 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -254,7 +254,7 @@ void Sound::playSfx(const std::string &path, int x, int y)
return;
std::string tmpPath;
- if (!path.find("sfx/"))
+ if (!path.compare(0, 4, "sfx/"))
tmpPath = path;
else
tmpPath = paths.getValue("sfx", "sfx/") + path;
diff --git a/src/sound.h b/src/sound.h
index 9f57ffb9..dd368f84 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -94,7 +94,7 @@ class Sound
void setSfxVolume(int volume);
/**
- * Plays an item.
+ * Plays a sound at the specified location.
*
* @param path The resource path to the sound file.
* @param x The vertical distance of the sound in pixels.