[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2622 - in trunk: . src/components src/gui
From: |
jave27 |
Subject: |
[Pingus-CVS] r2622 - in trunk: . src/components src/gui |
Date: |
Mon, 23 Jan 2006 19:22:32 +0100 |
Author: jave27
Date: 2006-01-23 19:22:04 +0100 (Mon, 23 Jan 2006)
New Revision: 2622
Modified:
trunk/Pingus.vcproj
trunk/src/components/action_button.cxx
trunk/src/components/button_panel.cxx
trunk/src/components/hurry_up.cxx
trunk/src/gui/checkbox.cxx
trunk/src/gui/cursor.cxx
trunk/src/gui/input_box.cxx
trunk/src/gui/input_box.hxx
trunk/src/gui/surface_button.cxx
Log:
Updated MSVC project and got rid of some more float->int conversion warnings.
Modified: trunk/Pingus.vcproj
===================================================================
--- trunk/Pingus.vcproj 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/Pingus.vcproj 2006-01-23 18:22:04 UTC (rev 2622)
@@ -326,6 +326,12 @@
RelativePath=".\src\gui\gui_screen.hxx">
</File>
<File
+ RelativePath=".\src\gui\input_box.cxx">
+ </File>
+ <File
+ RelativePath=".\src\gui\input_box.hxx">
+ </File>
+ <File
RelativePath=".\src\gui\input_debug_screen.cxx">
</File>
<File
Modified: trunk/src/components/action_button.cxx
===================================================================
--- trunk/src/components/action_button.cxx 2006-01-23 05:00:10 UTC (rev
2621)
+++ trunk/src/components/action_button.cxx 2006-01-23 18:22:04 UTC (rev
2622)
@@ -103,14 +103,14 @@
{
if (fast_mode)
{
- gc.draw_fillrect(x_pos, y_pos, x_pos + 60, y_pos + 35,
+ gc.draw_fillrect((float)x_pos, (float)y_pos, (float)x_pos + 60,
(float)y_pos + 35,
CL_Color(255, 255, 255));
}
else
{
//CL_Display::fill_rect(x_pos, y_pos, x_pos + 60, y_pos + 35 ,
//1.0, 1.0, 1.0, 0.5);
- gc.draw(backgroundhl, x_pos, y_pos);
+ gc.draw(backgroundhl, (float)x_pos, (float)y_pos);
}
}
else
@@ -120,11 +120,11 @@
if (fast_mode) {
// do nothing
} else {
- gc.draw(background, x_pos, y_pos);
+ gc.draw(background, (float)x_pos, (float)y_pos);
}
}
- gc.draw(sprite, Vector(x_pos + 20, y_pos + 32));
+ gc.draw(sprite, Vector((float)x_pos + 20, (float)y_pos + 32));
CL_Font myfont = font;
CL_Font myfontb = font_b;
@@ -136,19 +136,19 @@
&& CL_Mouse::get_x() > x_pos && CL_Mouse::get_x() < x_pos + 60
&& CL_Mouse::get_y() < y_pos + 35 && CL_Mouse::get_y() > y_pos)
{
- gc.print_left(myfontb, x_pos + 65, y_pos, action_to_screenname(name));
+ gc.print_left(myfontb, (float)x_pos + 65, (float)y_pos,
action_to_screenname(name));
}
if (Cheat::unlimited_actions)
{
// FIXME: insert unlimited surface here
- gc.print_center(myfont, x_pos + 46, y_pos + 5, "oo");
+ gc.print_center(myfont, (float)x_pos + 46, (float)y_pos + 5, "oo");
}
else
{
std::string str = CL_String::to(action_holder->get_available(name));
- gc.print_center(myfont, x_pos + 46, y_pos + 5, str);
+ gc.print_center(myfont, (float)x_pos + 46, (float)y_pos + 5, str);
}
}
@@ -170,16 +170,16 @@
{
if (server->get_world()->check_armageddon ())
{
- gc.draw(backgroundhl, Vector(x_pos, y_pos));
- gc.draw(sprite, Vector(x_pos, y_pos));
+ gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
+ gc.draw(sprite, Vector((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector(x_pos, y_pos));
+ gc.draw(background, Vector((float)x_pos, (float)y_pos));
sprite.set_frame(7);
- gc.draw(sprite, Vector(x_pos, y_pos));
+ gc.draw(sprite, Vector((float)x_pos, (float)y_pos));
}
}
@@ -248,15 +248,15 @@
{
if (server->get_fast_forward())
{
- gc.draw(backgroundhl, Vector(x_pos, y_pos));
+ gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector(x_pos, y_pos));
+ gc.draw(background, Vector((float)x_pos, (float)y_pos));
}
- gc.draw(surface, Vector(x_pos, y_pos));
+ gc.draw(surface, Vector((float)x_pos, (float)y_pos));
}
bool
@@ -296,15 +296,15 @@
{
if (server->get_pause())
{
- gc.draw(backgroundhl, Vector(x_pos, y_pos));
+ gc.draw(backgroundhl, Vector((float)x_pos, (float)y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector(x_pos, y_pos));
+ gc.draw(background, Vector((float)x_pos, (float)y_pos));
}
- gc.draw(surface, Vector(x_pos, y_pos));
+ gc.draw(surface, Vector((float)x_pos, (float)y_pos));
}
bool
Modified: trunk/src/components/button_panel.cxx
===================================================================
--- trunk/src/components/button_panel.cxx 2006-01-23 05:00:10 UTC (rev
2621)
+++ trunk/src/components/button_panel.cxx 2006-01-23 18:22:04 UTC (rev
2622)
@@ -56,13 +56,13 @@
// panel
std::sort(actions.begin(), actions.end(), action_sorter());
- y_pos -= (actions.size() * 38)/2 + 70;
+ y_pos -= ((int)actions.size() * 38)/2 + 70;
for(std::vector<ActionName>::iterator i = actions.begin();
i != actions.end(); ++i)
{
a_buttons.push_back(new VerticalActionButton (aholder,
- x_pos, (i -
actions.begin()) * 38 + y_pos,
+ x_pos, int(i -
actions.begin()) * 38 + y_pos,
*i,
0));
//FIXMEcontroller->get_owner ()));
}
@@ -149,7 +149,7 @@
for(AButtonIter button = a_buttons.begin(); button != a_buttons.end();
button++)
{
if ((*button)->is_at(x, y))
- pressed_button = button - a_buttons.begin();
+ pressed_button = int(button - a_buttons.begin());
}
}
@@ -175,14 +175,14 @@
void
ButtonPanel::next_action ()
{
- pressed_button = (pressed_button + 1) % a_buttons.size();
+ pressed_button = (pressed_button + 1) % (int)a_buttons.size();
}
/// Select the previous action
void
ButtonPanel::previous_action ()
{
- pressed_button = (pressed_button - 1 + a_buttons.size()) % a_buttons.size();
+ pressed_button = (pressed_button - 1 + (int)a_buttons.size()) %
(int)a_buttons.size();
}
} // namespace Pingus
Modified: trunk/src/components/hurry_up.cxx
===================================================================
--- trunk/src/components/hurry_up.cxx 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/src/components/hurry_up.cxx 2006-01-23 18:22:04 UTC (rev 2622)
@@ -88,7 +88,7 @@
if (static_cast<int>(x_pos) > CL_Display::get_width()/2)
{
- x_pos = CL_Display::get_width()/2;
+ x_pos = (float)CL_Display::get_width()/2;
center_reached = true;
wait_counter = CL_System::get_time() + 2000;
}
Modified: trunk/src/gui/checkbox.cxx
===================================================================
--- trunk/src/gui/checkbox.cxx 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/src/gui/checkbox.cxx 2006-01-23 18:22:04 UTC (rev 2622)
@@ -48,7 +48,7 @@
if (is_checked)
gc.draw(checkmark, pos);
- gc.print_right(Fonts::smallfont, (int)pos.x, (int)pos.y, label);
+ gc.print_right(Fonts::smallfont, pos.x, pos.y, label);
}
bool
Modified: trunk/src/gui/cursor.cxx
===================================================================
--- trunk/src/gui/cursor.cxx 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/src/gui/cursor.cxx 2006-01-23 18:22:04 UTC (rev 2622)
@@ -43,8 +43,8 @@
Cursor::on_event()
{
const Input::Pointer* pointer =
Input::Controller::get_current()->get_pointer();
- sprite.draw(static_cast<int>(pointer->get_x_pos ()),
- static_cast<int>(pointer->get_y_pos ()));
+ sprite.draw(pointer->get_x_pos (),
+ pointer->get_y_pos ());
}
} // namespace Pingus
Modified: trunk/src/gui/input_box.cxx
===================================================================
--- trunk/src/gui/input_box.cxx 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/src/gui/input_box.cxx 2006-01-23 18:22:04 UTC (rev 2622)
@@ -29,7 +29,7 @@
: str(default_value),
pos(p),
width(width_),
- height(Fonts::pingus_small.get_height())
+ height((float)Fonts::pingus_small.get_height())
{
}
Property changes on: trunk/src/gui/input_box.cxx
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/gui/input_box.hxx
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/gui/surface_button.cxx
===================================================================
--- trunk/src/gui/surface_button.cxx 2006-01-23 05:00:10 UTC (rev 2621)
+++ trunk/src/gui/surface_button.cxx 2006-01-23 18:22:04 UTC (rev 2622)
@@ -45,11 +45,11 @@
SurfaceButton::draw (DrawingContext& gc)
{
if (pressed && mouse_over)
- gc.draw(button_pressed_surface, Vector(x_pos, y_pos));
+ gc.draw(button_pressed_surface, Vector((float)x_pos, (float)y_pos));
else if (!pressed && mouse_over)
- gc.draw(button_mouse_over_surface, Vector(x_pos, y_pos));
+ gc.draw(button_mouse_over_surface, Vector((float)x_pos, (float)y_pos));
else
- gc.draw(button_surface, Vector(x_pos, y_pos));
+ gc.draw(button_surface, Vector((float)x_pos, (float)y_pos));
}
bool
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2622 - in trunk: . src/components src/gui,
jave27 <=