summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actorsprite.h2
-rw-r--r--src/configuration.h12
-rw-r--r--src/gui/palette.h16
-rw-r--r--src/gui/quitdialog.h4
-rw-r--r--src/gui/setup_players.cpp7
-rw-r--r--src/gui/specialswindow.h5
-rw-r--r--src/gui/widgets/chattab.h1
-rw-r--r--src/gui/widgets/dropdown.h4
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/widgets/itemcontainer.h8
-rw-r--r--src/gui/widgets/shopitems.h2
-rw-r--r--src/gui/widgets/spacer.h12
-rw-r--r--src/playerrelations.cpp9
-rw-r--r--src/playerrelations.h8
-rw-r--r--src/resources/resourcemanager.h8
-rw-r--r--src/resources/theme.h4
-rw-r--r--src/resources/userpalette.h3
17 files changed, 50 insertions, 60 deletions
diff --git a/src/actorsprite.h b/src/actorsprite.h
index 81bbd963..af06b478 100644
--- a/src/actorsprite.h
+++ b/src/actorsprite.h
@@ -185,7 +185,7 @@ protected:
/**
* Handle an update to a status or stun effect
*
- * \param The StatusEffect to effect
+ * \param effect The StatusEffect to effect
* \param effectId -1 for stun, otherwise the effect index
*/
virtual void handleStatusEffect(StatusEffect *effect, int effectId);
diff --git a/src/configuration.h b/src/configuration.h
index 44ce688d..a675002b 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -113,9 +113,9 @@ class ConfigurationObject
/**
* Serialises a container into a list of configuration options
*
- * \param IT Iterator type over CONT
- * \param T Elements that IT iterates over
- * \param CONT The associated container type
+ * \tparam IT Iterator type over CONT
+ * \tparam T Elements that IT iterates over
+ * \tparam CONT The associated container type
*
* \param name Name of the list the elements should be stored under
* \param begin Iterator start
@@ -151,9 +151,9 @@ class ConfigurationObject
/**
* Serialises a container into a list of configuration options
*
- * \param IT Iterator type over CONT
- * \param T Elements that IT iterates over
- * \param CONT The associated container type
+ * \tparam IT Iterator type over CONT
+ * \tparam T Elements that IT iterates over
+ * \tparam CONT The associated container type
*
* \param name Name of the list the elements should be read from under
* \param empty Initial (empty) container to write to
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 51cf7d5f..fcee670f 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -70,9 +70,9 @@ class Palette
*
* @return the requested color
*/
- inline const gcn::Color &getColor(int type, int alpha = 255)
+ const gcn::Color &getColor(int type, int alpha = 255)
{
- gcn::Color* col = &mColors[type].color;
+ gcn::Color *col = &mColors[type].color;
col->a = alpha;
return *col;
}
@@ -84,7 +84,7 @@ class Palette
*
* @return the gradient type of the color with the given index
*/
- inline GradientType getGradientType(int type)
+ GradientType getGradientType(int type) const
{
return mColors[type].grad;
}
@@ -96,7 +96,7 @@ class Palette
*
* @return the color char of the color with the given index
*/
- inline char getColorChar(int type)
+ char getColorChar(int type) const
{
return mColors[type].ch;
}
@@ -108,8 +108,8 @@ class Palette
*
* @return the gradient delay of the color with the given index
*/
- inline int getGradientDelay(int type)
- { return mColors[type].delay; }
+ int getGradientDelay(int type) const
+ { return mColors[type].delay; }
/**
* Updates all colors, that are non-static.
@@ -147,7 +147,7 @@ class Palette
int delay;
int committedDelay;
- void set(int type, gcn::Color& color, GradientType grad, int delay)
+ void set(int type, gcn::Color &color, GradientType grad, int delay)
{
ColorElem::type = type;
ColorElem::color = color;
@@ -157,7 +157,7 @@ class Palette
ColorElem::gradientIndex = rand();
}
- inline int getRGB()
+ int getRGB() const
{
return (committedColor.r << 16) | (committedColor.g << 8) |
committedColor.b;
diff --git a/src/gui/quitdialog.h b/src/gui/quitdialog.h
index 21fe2f8a..1571c7d1 100644
--- a/src/gui/quitdialog.h
+++ b/src/gui/quitdialog.h
@@ -41,9 +41,9 @@ class QuitDialog : public Window, public gcn::ActionListener,
{
public:
/**
- * Constructor
+ * Constructor.
*
- * @pointerToMe will be set to NULL when the QuitDialog is destroyed
+ * @param pointerToMe will be set to NULL when the QuitDialog is destroyed
*/
QuitDialog(QuitDialog **pointerToMe);
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp
index 6fab8bd2..e9faaf3a 100644
--- a/src/gui/setup_players.cpp
+++ b/src/gui/setup_players.cpp
@@ -131,15 +131,14 @@ public:
signalBeforeUpdate();
freeWidgets();
- std::vector<std::string> *player_names = player_relations.getPlayers();
if (mPlayers)
delete mPlayers;
- mPlayers = player_names;
+ mPlayers = player_relations.getPlayers();
// set up widgets
- for (unsigned int r = 0; r < player_names->size(); ++r)
+ for (unsigned int r = 0; r < mPlayers->size(); ++r)
{
- std::string name = (*player_names)[r];
+ std::string name = (*mPlayers)[r];
gcn::Widget *widget = new Label(name);
mWidgets.push_back(widget);
diff --git a/src/gui/specialswindow.h b/src/gui/specialswindow.h
index b440ce13..9917acc2 100644
--- a/src/gui/specialswindow.h
+++ b/src/gui/specialswindow.h
@@ -38,7 +38,8 @@ class TabbedArea;
struct SpecialEntry;
-class SpecialsWindow : public Window, public gcn::ActionListener {
+class SpecialsWindow : public Window, public gcn::ActionListener
+{
public:
SpecialsWindow();
@@ -51,7 +52,7 @@ class SpecialsWindow : public Window, public gcn::ActionListener {
void draw(gcn::Graphics *graphics);
- bool hasSpecials()
+ bool hasSpecials() const
{ return !mEntries.empty(); }
private:
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 6d262e11..bc139079 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -45,7 +45,6 @@ class ChatTab : public Tab, public AutoCompleteLister
*
* @param line Text message.
* @param own Type of message (usually the owner-type).
- * @param channelName which channel to send the message to.
* @param ignoreRecord should this not be recorded?
*/
void chatLog(std::string line, Own own = BY_SERVER,
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index e0cfd0d7..c7b3cdb1 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -41,9 +41,7 @@ class DropDown : public gcn::DropDown
* Contructor.
*
* @param listModel the ListModel to use.
- * @param scrollArea the ScrollArea to use.
- * @param listBox the listBox to use.
- * @see ListModel, ScrollArea, ListBox.
+ * @see ListModel
*/
DropDown(gcn::ListModel *listModel = 0);
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 546a16d2..d88a5747 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -52,7 +52,7 @@
static const int BOX_WIDTH = 35;
static const int BOX_HEIGHT = 43;
-ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
+ItemContainer::ItemContainer(Inventory *inventory):
mInventory(inventory),
mGridColumns(1),
mGridRows(1),
@@ -60,7 +60,6 @@ ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
mHighlightedIndex(-1),
mLastUsedSlot(-1),
mSelectionStatus(SEL_NONE),
- mForceQuantity(forceQuantity),
mSwapItems(false),
mDescItems(false)
{
@@ -159,7 +158,7 @@ void ItemContainer::draw(gcn::Graphics *graphics)
}
// Draw item caption
std::string caption;
- if (item->getQuantity() > 1 || mForceQuantity)
+ if (item->getQuantity() > 1)
caption = toString(item->getQuantity());
else if (item->isEquipped())
caption = "Eq.";
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 4d5afde2..0da894ea 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -54,11 +54,8 @@ class ItemContainer : public gcn::Widget,
* Constructor. Initializes the graphic.
*
* @param inventory
- * @param gridColumns Amount of columns in grid.
- * @param gridRows Amount of rows in grid.
- * @param offset Index offset
*/
- ItemContainer(Inventory *inventory, bool forceQuantity = false);
+ ItemContainer(Inventory *inventory);
virtual ~ItemContainer();
@@ -184,7 +181,6 @@ class ItemContainer : public gcn::Widget,
int mSelectedIndex, mHighlightedIndex;
int mLastUsedSlot;
SelectionState mSelectionStatus;
- bool mForceQuantity;
bool mSwapItems;
bool mDescItems;
int mDragPosX, mDragPosY;
@@ -201,4 +197,4 @@ class ItemContainer : public gcn::Widget,
SelectionListenerList mSelectionListeners;
};
-#endif
+#endif // ITEMCONTAINER_H
diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h
index 0e95d9a0..f3e774aa 100644
--- a/src/gui/widgets/shopitems.h
+++ b/src/gui/widgets/shopitems.h
@@ -62,7 +62,7 @@ class ShopItems : public gcn::ListModel
*
* @param inventoryIndex the inventory index of the item
* @param id the id of the item
- * @param quantity number of available copies of the item
+ * @param amount number of available copies of the item
* @param price price of the item
*/
void addItem(int inventoryIndex, int id, int amount, int price);
diff --git a/src/gui/widgets/spacer.h b/src/gui/widgets/spacer.h
index cc171890..4756b452 100644
--- a/src/gui/widgets/spacer.h
+++ b/src/gui/widgets/spacer.h
@@ -37,17 +37,17 @@ class Spacer : public gcn::Widget
/**
* Constructor.
*
- * @note Can be called empty, will default to a 5x5 px space
+ * @note Can be called empty, will default to a space of 5x5 pixels.
*
- * @param w - width in px.
- * @param h - height in px.
+ * @param w width in pixels.
+ * @param h height in pixels.
*/
- Spacer(int x = 5, int y = 5);
+ Spacer(int w = 5, int h = 5);
/**
- * Draws the Space.
+ * Draws nothing.
*/
- void draw(gcn::Graphics *g){}
+ void draw(gcn::Graphics *g) {}
};
#endif // SPACER_H
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index 8b6e6255..4a70e695 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -249,7 +249,7 @@ void PlayerRelationsManager::setRelation(const std::string &player_name,
signalUpdate(player_name);
}
-std::vector<std::string> * PlayerRelationsManager::getPlayers()
+std::vector<std::string> * PlayerRelationsManager::getPlayers() const
{
std::vector<std::string> *retval = new std::vector<std::string>();
@@ -273,10 +273,11 @@ void PlayerRelationsManager::removePlayer(const std::string &name)
}
-PlayerRelation::Relation PlayerRelationsManager::getRelation(const std::string &name)
+PlayerRelation::Relation PlayerRelationsManager::getRelation(const std::string &name) const
{
- if (mRelations[name])
- return mRelations[name]->mRelation;
+ std::map<std::string, PlayerRelation *>::const_iterator it = mRelations.find(name);
+ if (it != mRelations.end())
+ return it->second->mRelation;
return PlayerRelation::NEUTRAL;
}
diff --git a/src/playerrelations.h b/src/playerrelations.h
index d6ca31ad..fd76aa03 100644
--- a/src/playerrelations.h
+++ b/src/playerrelations.h
@@ -135,7 +135,7 @@ public:
/**
* Updates the relationship with this player.
*/
- PlayerRelation::Relation getRelation(const std::string &name);
+ PlayerRelation::Relation getRelation(const std::string &name) const;
/**
* Deletes the information recorded for a player.
@@ -182,16 +182,16 @@ public:
* For a given ignore strategy short name, find the appropriate index in
* the ignore strategies vector.
*
- * \param The short name of the ignore strategy to look up
+ * \param shortName The short name of the ignore strategy to look up
* \return The appropriate index, or -1
*/
- int getPlayerIgnoreStrategyIndex(const std::string &shortname);
+ int getPlayerIgnoreStrategyIndex(const std::string &shortName);
/**
* Retrieves a sorted vector of all players for which we have any relations
* recorded.
*/
- std::vector<std::string> *getPlayers();
+ std::vector<std::string> *getPlayers() const;
/**
* Removes all recorded player info.
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 870182e4..9b40814f 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -128,11 +128,11 @@ class ResourceManager
/**
* Adds a preformatted resource to the resource map.
*
- * @param path The file name.
- * @param Resource The Resource to add.
- * @return true if successfull, false otherwise.
+ * @param idPath The resource identifier path.
+ * @param resource The Resource to add.
+ * @return true if successful, false otherwise.
*/
- bool addResource(const std::string &idPath, Resource* resource);
+ bool addResource(const std::string &idPath, Resource *resource);
/**
* Copies a file from one place to another (useful for extracting
diff --git a/src/resources/theme.h b/src/resources/theme.h
index d6d660e2..57274291 100644
--- a/src/resources/theme.h
+++ b/src/resources/theme.h
@@ -183,12 +183,12 @@ class Theme : public Palette, public EventListener
*
* @return the requested color
*/
- inline static const gcn::Color &getThemeColor(int type, int alpha = 255)
+ static const gcn::Color &getThemeColor(int type, int alpha = 255)
{
return mInstance->getColor(type, alpha);
}
- const static gcn::Color &getThemeColor(char c, bool &valid)
+ static const gcn::Color &getThemeColor(char c, bool &valid)
{
return mInstance->getColor(c, valid);
}
diff --git a/src/resources/userpalette.h b/src/resources/userpalette.h
index 01f66ca7..1dd5cf6a 100644
--- a/src/resources/userpalette.h
+++ b/src/resources/userpalette.h
@@ -114,8 +114,6 @@ class UserPalette : public Palette, public gcn::ListModel
/**
* Sets the gradient delay for the specified color.
- *
- * @param grad gradient type to set
*/
void setGradientDelay(int type, int delay)
{ mColors[type].delay = delay; }
@@ -191,7 +189,6 @@ class UserPalette : public Palette, public gcn::ListModel
/**
* Initialise color
*
- * @param c character that needs initialising
* @param rgb default color if not found in config
* @param text identifier of color
*/