summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-02-11 17:12:00 +0100
committerIra Rice <irarice@gmail.com>2009-02-11 10:12:36 -0700
commit3bf163c923526e545d9738d0047b5de352a85a7c (patch)
tree7a6bd6c8645f6f0853d2485b52ccbcb51391e603 /src/gui
parent1ea7d80aff0961e6f55ee467b8cbe26d146828f8 (diff)
downloadMana-3bf163c923526e545d9738d0047b5de352a85a7c.tar.gz
Mana-3bf163c923526e545d9738d0047b5de352a85a7c.tar.bz2
Mana-3bf163c923526e545d9738d0047b5de352a85a7c.tar.xz
Mana-3bf163c923526e545d9738d0047b5de352a85a7c.zip
Shut up some compiler warnings.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/color.cpp2
-rw-r--r--src/gui/gui.cpp4
-rw-r--r--src/gui/listbox.cpp2
-rw-r--r--src/gui/progressbar.cpp2
-rw-r--r--src/gui/shoplistbox.cpp2
-rw-r--r--src/gui/table.cpp6
-rw-r--r--src/gui/widgets/dropdown.cpp2
7 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/color.cpp b/src/gui/color.cpp
index 62537191..0b50c723 100644
--- a/src/gui/color.cpp
+++ b/src/gui/color.cpp
@@ -104,7 +104,7 @@ char Color::getColorCharAt(int i)
void Color::addColor(const char c, const int rgb, const std::string &text)
{
- int trueRgb = config.getValue("Color" + text, rgb);
+ int trueRgb = (int) config.getValue("Color" + text, rgb);
mColVector.push_back(ColorElem(c, trueRgb, text));
}
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index f8901119..4b5c375d 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -111,7 +111,7 @@ Gui::Gui(Graphics *graphics):
std::string path = resman->getPath("fonts/dejavusans.ttf");
try
{
- const int fontSize = config.getValue("fontSize", 11);
+ const int fontSize = (int)config.getValue("fontSize", 11);
mGuiFont = new TrueTypeFont(path, fontSize);
}
catch (gcn::Exception e)
@@ -124,7 +124,7 @@ Gui::Gui(Graphics *graphics):
path = resman->getPath("fonts/dejavusans-bold.ttf");
try
{
- const int fontSize = config.getValue("fontSize", 11);
+ const int fontSize = (int)config.getValue("fontSize", 11);
boldFont = new TrueTypeFont(path, fontSize);
}
catch (gcn::Exception e)
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index 12bb2c02..f16857ce 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -48,7 +48,7 @@ void ListBox::draw(gcn::Graphics *graphics)
const int red = (textColor->getColor('H', valid) >> 16) & 0xFF;
const int green = (textColor->getColor('H', valid) >> 8) & 0xFF;
const int blue = textColor->getColor('H', valid) & 0xFF;
- const int alpha = mAlpha * 255;
+ const int alpha = (int)(mAlpha * 255.0f);
graphics->setColor(gcn::Color(red, green, blue, alpha));
graphics->setFont(getFont());
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 10e8f1f1..7463d4cc 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -117,7 +117,7 @@ void ProgressBar::draw(gcn::Graphics *graphics)
static_cast<Graphics*>(graphics)->
drawImageRect(0, 0, getWidth(), getHeight(), mBorder);
- const int alpha = mAlpha * 255;
+ const int alpha = (int)(mAlpha * 255.0f);
// The bar
if (mProgress > 0) {
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index 4f9f9024..6d3d9464 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -68,7 +68,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
const int red = (textColor->getColor('H', valid) >> 16) & 0xFF;
const int green = (textColor->getColor('H', valid) >> 8) & 0xFF;
const int blue = textColor->getColor('H', valid) & 0xFF;
- const int alpha = mAlpha * 255;
+ const int alpha = (int)(mAlpha * 255.0f);
Graphics *graphics = static_cast<Graphics*>(gcnGraphics);
diff --git a/src/gui/table.cpp b/src/gui/table.cpp
index de7f11b2..1793948b 100644
--- a/src/gui/table.cpp
+++ b/src/gui/table.cpp
@@ -276,7 +276,7 @@ void GuiTable::draw(gcn::Graphics* graphics)
const int red = getBackgroundColor().r;
const int green = getBackgroundColor().g;
const int blue = getBackgroundColor().b;
- const int alpha = mAlpha * 255;
+ const int alpha = (int)(mAlpha * 255.0f);
graphics->setColor(gcn::Color(red, green, blue, alpha));
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
@@ -330,7 +330,7 @@ void GuiTable::draw(gcn::Graphics* graphics)
const int green =
(textColor->getColor('H', valid) >> 8) & 0xFF;
const int blue = textColor->getColor('H', valid) & 0xFF;
- const int alpha = mAlpha * 127;
+ const int alpha = (int)(mAlpha * 127.0f);
graphics->setColor(gcn::Color(red, green, blue, alpha));
graphics->fillRectangle(bounds);
@@ -352,7 +352,7 @@ void GuiTable::draw(gcn::Graphics* graphics)
const int green =
(textColor->getColor('H', valid) >> 8) & 0xFF;
const int blue = textColor->getColor('H', valid) & 0xFF;
- const int alpha = mAlpha * 127;
+ const int alpha = (int)(mAlpha * 127.0f);
graphics->setColor(gcn::Color(red, green, blue, alpha));
graphics->fillRectangle(gcn::Rectangle(0, y_offset,
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 5d1b8d4f..b829db1c 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -135,7 +135,7 @@ void DropDown::draw(gcn::Graphics* graphics)
}
bool valid;
- const int alpha = mAlpha * 255;
+ const int alpha = (int)(mAlpha * 255.0f);
gcn::Color faceColor = getBaseColor();
faceColor.a = alpha;
gcn::Color highlightColor = textColor->getColor('H', valid);