summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-28 22:27:28 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-28 22:27:28 +0200
commita558eaffb2fa37c5ae2598c08a12fd3c2b6aa3ec (patch)
treed6020d6910bf2c0c8d128ce46bf9857655a962f9 /src
parent84f26bda10cf641f8aa3c05a721d9eb3512c7511 (diff)
parentd052dbe8646f1d4a80ca543435aeb9afe44321da (diff)
downloadmana-a558eaffb2fa37c5ae2598c08a12fd3c2b6aa3ec.tar.gz
mana-a558eaffb2fa37c5ae2598c08a12fd3c2b6aa3ec.tar.bz2
mana-a558eaffb2fa37c5ae2598c08a12fd3c2b6aa3ec.tar.xz
mana-a558eaffb2fa37c5ae2598c08a12fd3c2b6aa3ec.zip
Merge branch '0.0.29'
Diffstat (limited to 'src')
-rw-r--r--src/gui/emotepopup.cpp4
-rw-r--r--src/gui/widgets/browserbox.cpp12
-rw-r--r--src/resources/npcdb.cpp3
3 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/emotepopup.cpp b/src/gui/emotepopup.cpp
index 036a25ec..707f4bfa 100644
--- a/src/gui/emotepopup.cpp
+++ b/src/gui/emotepopup.cpp
@@ -35,8 +35,6 @@
#include "resources/resourcemanager.h"
#include "utils/dtor.h"
-#include "utils/gettext.h"
-#include "utils/stringutils.h"
#include <guichan/mouseinput.hpp>
#include <guichan/selectionlistener.hpp>
@@ -61,7 +59,7 @@ EmotePopup::EmotePopup():
ResourceManager *resman = ResourceManager::getInstance();
mSelectionImage = resman->getImage("graphics/gui/selection.png");
if (!mSelectionImage)
- logger->error(_("Unable to load selection.png"));
+ logger->error("Unable to load selection.png");
mSelectionImage->setAlpha(config.getValue("guialpha", 0.8));
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index e4f0774b..91098074 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -343,7 +343,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
mLinks[link].x1 = x;
mLinks[link].y1 = y;
mLinks[link].x2 = mLinks[link].x1 + size;
- mLinks[link].y2 = y + font->getHeight();
+ mLinks[link].y2 = y + font->getHeight() - 1;
link++;
prevColor = selColor;
selColor = col;
@@ -386,7 +386,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
// Auto wrap mode
if (mMode == AUTO_WRAP &&
- (x + font->getWidth(part.c_str()) + 10) > getWidth())
+ (x + font->getWidth(part) + 10) > getWidth())
{
bool forced = false;
char const *hyphen = "~";
@@ -399,14 +399,14 @@ void BrowserBox::draw(gcn::Graphics *graphics)
do
{
if (!forced)
- end = row.rfind(" ", end);
+ end = row.rfind(' ', end);
// Check if we have to (stupidly) force-wrap
if (end == std::string::npos || end <= start)
{
forced = true;
end = row.size();
- x += hyphenWidth * 2; // Account for the wrap-notifier
+ x += hyphenWidth; // Account for the wrap-notifier
continue;
}
@@ -416,7 +416,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
end--; // And then to the last byte of the previous one
part = row.substr(start, end - start + 1);
- } while ((x + font->getWidth(part.c_str()) + 10) > getWidth());
+ } while (end > start && (x + font->getWidth(part) + 10) > getWidth());
if (forced)
{
@@ -432,7 +432,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
wrappedLines++;
}
font->drawString(graphics, part, x, y);
- x += font->getWidth(part.c_str());
+ x += font->getWidth(part);
}
y += font->getHeight();
setHeight((mTextRows.size() + wrappedLines) * font->getHeight());
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp
index 6a880faa..57fa9fc0 100644
--- a/src/resources/npcdb.cpp
+++ b/src/resources/npcdb.cpp
@@ -23,7 +23,6 @@
#include "log.h"
-#include "utils/gettext.h"
#include "utils/xml.h"
namespace
@@ -50,7 +49,7 @@ void NPCDB::load()
if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "npcs"))
{
- logger->error(_("NPC Database: Error while loading npcs.xml!"));
+ logger->error("NPC Database: Error while loading npcs.xml!");
}
//iterate <npc>s