[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3138 - in trunk/pingus/src: . components display editor gu
From: |
jsalmon3 |
Subject: |
[Pingus-CVS] r3138 - in trunk/pingus/src: . components display editor gui worldmap worldobjs |
Date: |
Thu, 13 Sep 2007 07:27:53 +0200 |
Author: jsalmon3
Date: 2007-09-13 07:27:19 +0200 (Thu, 13 Sep 2007)
New Revision: 3138
Modified:
trunk/pingus/src/capture_rectangle.cpp
trunk/pingus/src/client.cpp
trunk/pingus/src/components/action_button.cpp
trunk/pingus/src/components/menu_button.cpp
trunk/pingus/src/components/pingus_counter.cpp
trunk/pingus/src/components/playfield.cpp
trunk/pingus/src/components/smallmap.cpp
trunk/pingus/src/components/time_display.cpp
trunk/pingus/src/credits.cpp
trunk/pingus/src/display/drawing_context.cpp
trunk/pingus/src/display/drawing_context.hpp
trunk/pingus/src/editor/combobox.cpp
trunk/pingus/src/editor/context_menu.cpp
trunk/pingus/src/editor/context_menu.hpp
trunk/pingus/src/editor/editor_viewport.cpp
trunk/pingus/src/editor/file_list.cpp
trunk/pingus/src/editor/level_objs.cpp
trunk/pingus/src/editor/object_selector.cpp
trunk/pingus/src/editor/panel.cpp
trunk/pingus/src/exit_menu.cpp
trunk/pingus/src/file_dialog.cpp
trunk/pingus/src/file_dialog_item.cpp
trunk/pingus/src/file_dialog_item.hpp
trunk/pingus/src/font_test_screen.cpp
trunk/pingus/src/ground_map.cpp
trunk/pingus/src/gui/checkbox.cpp
trunk/pingus/src/gui/checkbox.hpp
trunk/pingus/src/gui/combobox.cpp
trunk/pingus/src/gui/combobox.hpp
trunk/pingus/src/gui/input_box.cpp
trunk/pingus/src/gui/input_box.hpp
trunk/pingus/src/gui/surface_button.cpp
trunk/pingus/src/pingu.cpp
trunk/pingus/src/pingus_menu.cpp
trunk/pingus/src/pingus_menu_manager.cpp
trunk/pingus/src/result_screen.cpp
trunk/pingus/src/start_screen.cpp
trunk/pingus/src/story_screen.cpp
trunk/pingus/src/worldmap/level_dot.cpp
trunk/pingus/src/worldmap/manager.cpp
trunk/pingus/src/worldmap/path_drawable.cpp
trunk/pingus/src/worldobjs/thunderstorm_background.cpp
Log:
Fixed warnings, use int for drawing functions
Modified: trunk/pingus/src/capture_rectangle.cpp
===================================================================
--- trunk/pingus/src/capture_rectangle.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/capture_rectangle.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -70,8 +70,8 @@
}
sc.color().print_center(font,
- pingu->get_center_pos().x,
- pingu->get_center_pos().y - 32,
+ (int)pingu->get_center_pos().x,
+ (int)pingu->get_center_pos().y - 32,
action_str,
1000);
}
Modified: trunk/pingus/src/client.cpp
===================================================================
--- trunk/pingus/src/client.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/client.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -92,16 +92,16 @@
{
Color border_color(50, 65, 75);
// top
- gc.draw_fillrect(0, 0, (float)Display::get_width(), (float)rect.top,
+ gc.draw_fillrect(0, 0, Display::get_width(), rect.top,
border_color);
// bottom
- gc.draw_fillrect(0, (float)rect.bottom, (float)Display::get_width(),
(float)Display::get_height(),
+ gc.draw_fillrect(0, rect.bottom, Display::get_width(),
Display::get_height(),
border_color);
// left
- gc.draw_fillrect(0, (float)rect.top, (float)rect.left, (float)rect.bottom,
+ gc.draw_fillrect(0, rect.top, rect.left, rect.bottom,
border_color);
// right
- gc.draw_fillrect((float)rect.right, (float)rect.top,
(float)Display::get_width(), (float)rect.bottom,
+ gc.draw_fillrect(rect.right, rect.top, Display::get_width(), rect.bottom,
border_color);
}
}
Modified: trunk/pingus/src/components/action_button.cpp
===================================================================
--- trunk/pingus/src/components/action_button.cpp 2007-09-13 01:38:03 UTC
(rev 3137)
+++ trunk/pingus/src/components/action_button.cpp 2007-09-13 05:27:19 UTC
(rev 3138)
@@ -96,14 +96,14 @@
{
if (fast_mode)
{
- gc.draw_fillrect((float)x_pos, (float)y_pos, (float)x_pos + 60,
(float)y_pos + 35,
+ gc.draw_fillrect(x_pos, y_pos, x_pos + 60, y_pos + 35,
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, (float)x_pos, (float)y_pos);
+ gc.draw(backgroundhl, Vector2i(x_pos, y_pos));
}
}
else
@@ -113,14 +113,14 @@
if (fast_mode) {
// do nothing
} else {
- gc.draw(background, (float)x_pos, (float)y_pos);
+ gc.draw(background, Vector2i(x_pos, y_pos));
}
}
if (this->get_action_name() == Climber) {
- gc.draw(sprite, Vector3f((float)x_pos + 32, (float)y_pos + 32));
+ gc.draw(sprite, Vector2i(x_pos + 32, y_pos + 32));
} else {
- gc.draw(sprite, Vector3f((float)x_pos + 20, (float)y_pos + 32));
+ gc.draw(sprite, Vector2i(x_pos + 20, y_pos + 32));
}
Font myfont = font;
@@ -135,18 +135,18 @@
&& x > x_pos && x < x_pos + 60
&& y < y_pos + 35 && y > y_pos)
{
- gc.print_left(myfontb, (float)x_pos + 65, (float)y_pos-10,
action_to_screenname(name));
+ gc.print_left(myfontb, x_pos + 65, y_pos-10, action_to_screenname(name));
}
if (Cheat::unlimited_actions)
{
// FIXME: insert unlimited surface here
- gc.print_center(myfont, (float)x_pos + 46, (float)y_pos + 5, "oo");
+ gc.print_center(myfont, x_pos + 46, y_pos + 5, "oo");
}
else
{
std::string str =
StringUtil::to_string(action_holder->get_available(name));
- gc.print_center(myfont, (float)x_pos + 46, (float)y_pos + 5, str);
+ gc.print_center(myfont, x_pos + 46, y_pos + 5, str);
}
}
@@ -168,16 +168,16 @@
{
if (server->get_world()->check_armageddon ())
{
- gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
- gc.draw(sprite, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector2i(x_pos, y_pos));
+ gc.draw(sprite, Vector2i(x_pos, y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector2i(x_pos, y_pos));
sprite.set_frame(7);
- gc.draw(sprite, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(sprite, Vector2i(x_pos, y_pos));
}
}
@@ -246,15 +246,15 @@
{
if (server->get_fast_forward())
{
- gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector2i(x_pos, y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector2i(x_pos, y_pos));
}
- gc.draw(surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(surface, Vector2i(x_pos, y_pos));
}
bool
@@ -294,15 +294,15 @@
{
if (server->get_pause())
{
- gc.draw(backgroundhl, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(backgroundhl, Vector2i(x_pos, y_pos));
}
else
{
if (!fast_mode)
- gc.draw(background, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(background, Vector2i(x_pos, y_pos));
}
- gc.draw(surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(surface, Vector2i(x_pos, y_pos));
}
bool
Modified: trunk/pingus/src/components/menu_button.cpp
===================================================================
--- trunk/pingus/src/components/menu_button.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/components/menu_button.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -78,39 +78,39 @@
{
if (mouse_over && !pressed)
{
- gc.print_center(font, (float)Display::get_width() / 2,
- (float)(Display::get_height() - font.get_height() - 2),
+ gc.print_center(font, Display::get_width() / 2,
+ Display::get_height() - font.get_height() - 2,
desc.c_str());
- gc.draw(surface_p, Vector3f((float)(x_pos - surface_p.get_width()/2),
- (float)(y_pos - surface_p.get_height()/2)));
+ gc.draw(surface_p, Vector2i(x_pos - surface_p.get_width()/2,
+ y_pos - surface_p.get_height()/2));
- gc.print_center(font_large, (float)x_pos + 32,
- (float)(y_pos - 32 - font_large.get_height()/2),
+ gc.print_center(font_large, x_pos + 32,
+ y_pos - 32 - font_large.get_height()/2,
text);
}
else if (mouse_over && pressed)
{
float shrink = 0.9f;
- gc.print_center(font, (float)Display::get_width() / 2,
- (float)Display::get_height() - 20,
+ gc.print_center(font, Display::get_width() / 2,
+ Display::get_height() - 20,
desc.c_str());
gc.draw(surface_p,
- Vector3f((float)(x_pos - surface_p.get_width()/2 * shrink),
- (float)(y_pos - surface_p.get_height()/2 * shrink)));
+ Vector3f(x_pos - surface_p.get_width()/2 * shrink,
+ y_pos - surface_p.get_height()/2 * shrink));
gc.print_center(font_large,
- (float)x_pos + 32,
- (float)(y_pos - 32 - font_large.get_height()/2),
+ x_pos + 32,
+ y_pos - 32 - font_large.get_height()/2,
text);
}
else
{
gc.draw(surface_p,
- Vector3f((float)(x_pos - surface_p.get_width()/2),
- (float)(y_pos - surface_p.get_height()/2)));
+ Vector2i(x_pos - surface_p.get_width()/2,
+ y_pos - surface_p.get_height()/2));
}
UNUSED_ARG(gc);
}
Modified: trunk/pingus/src/components/pingus_counter.cpp
===================================================================
--- trunk/pingus/src/components/pingus_counter.cpp 2007-09-13 01:38:03 UTC
(rev 3137)
+++ trunk/pingus/src/components/pingus_counter.cpp 2007-09-13 05:27:19 UTC
(rev 3138)
@@ -42,7 +42,7 @@
char str[128];
if (!fast_mode)
- gc.draw(background, Vector3f(gc.get_width()/2, 0));
+ gc.draw(background, Vector2i(gc.get_width()/2, 0));
World* world = server->get_world();
Modified: trunk/pingus/src/components/playfield.cpp
===================================================================
--- trunk/pingus/src/components/playfield.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/components/playfield.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -71,24 +71,24 @@
// Draw the scrolling band
if (mouse_scrolling && !drag_drop_scrolling)
{
- gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
- (float)scroll_center.x, (float)scroll_center.y-15,
+ gc.draw_line(mouse_pos.x, mouse_pos.y,
+ scroll_center.x, scroll_center.y-15,
Color(0, 255, 0));
- gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
- (float)scroll_center.x, (float)scroll_center.y,
+ gc.draw_line(mouse_pos.x, mouse_pos.y,
+ scroll_center.x, scroll_center.y,
Color(255, 0, 0));
- gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
- (float)scroll_center.x, (float)scroll_center.y+15,
+ gc.draw_line(mouse_pos.x, mouse_pos.y,
+ scroll_center.x, scroll_center.y+15,
Color(0, 0, 255));
- gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
- (float)scroll_center.x + 15, (float)scroll_center.y,
+ gc.draw_line(mouse_pos.x, mouse_pos.y,
+ scroll_center.x + 15, scroll_center.y,
Color(0, 255, 255));
- gc.draw_line((float)mouse_pos.x, (float)mouse_pos.y,
- (float)scroll_center.x - 15, (float)scroll_center.y,
+ gc.draw_line(mouse_pos.x, mouse_pos.y,
+ scroll_center.x - 15, scroll_center.y,
Color(255, 255, 0));
}
Modified: trunk/pingus/src/components/smallmap.cpp
===================================================================
--- trunk/pingus/src/components/smallmap.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/components/smallmap.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -112,8 +112,8 @@
rect.bottom = y_pos + height;
}
- gc.draw(image->get_surface(), Vector3f((float)x_pos, (float)y_pos));
- gc.draw_rect((float)rect.left, (float)rect.top, (float)rect.right,
(float)rect.bottom,
+ gc.draw(image->get_surface(), Vector2i(x_pos, y_pos));
+ gc.draw_rect(rect.left, rect.top, rect.right, rect.bottom,
Color(0, 255, 0));
client->get_server()->get_world()->draw_smallmap(this);
@@ -125,7 +125,7 @@
int x = static_cast<int>(x_pos + ((*i)->get_x() * width /
world->get_width()));
int y = static_cast<int>(y_pos + ((*i)->get_y() * height /
world->get_height()));
- gc.draw_line((float)x, (float)y, (float)x, (float)y-2, Color(255, 255,
0));
+ gc.draw_line(x, y, x, y-2, Color(255, 255, 0));
}
gc_ptr = 0;
Modified: trunk/pingus/src/components/time_display.cpp
===================================================================
--- trunk/pingus/src/components/time_display.cpp 2007-09-13 01:38:03 UTC
(rev 3137)
+++ trunk/pingus/src/components/time_display.cpp 2007-09-13 05:27:19 UTC
(rev 3138)
@@ -62,8 +62,7 @@
time_string = StringUtil::to_string(time_value);
}
- gc.print_right(font, static_cast<float>(Display::get_width() - 30),
- 3.0f, time_string, 150.0f);
+ gc.print_right(font, Display::get_width() - 30, 3, time_string, 150);
}
}
Modified: trunk/pingus/src/credits.cpp
===================================================================
--- trunk/pingus/src/credits.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/credits.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -260,20 +260,20 @@
void
Credits::draw_background (DrawingContext& gc)
{
- float x;
- float y;
- float yof;
+ int x;
+ int y;
+ int yof;
- x = (float)Display::get_width()/2;
- y = offset;
+ x = Display::get_width()/2;
+ y = (int)offset;
- gc.draw(background, Vector3f(gc.get_width()/2, gc.get_height()/2));
- gc.draw(pingu, Vector3f(gc.get_width()/2, gc.get_height()/2 - 20));
+ gc.draw(background, Vector2i(gc.get_width()/2, gc.get_height()/2));
+ gc.draw(pingu, Vector2i(gc.get_width()/2, gc.get_height()/2 - 20));
gc.print_right(Fonts::chalk_normal,
- static_cast<float>(Display::get_width()/2 + 275),
- static_cast<float>(Display::get_height()/2 + 110),
- _("Exit"));
+ Display::get_width()/2 + 275,
+ Display::get_height()/2 + 110,
+ _("Exit"));
yof = 0;
Modified: trunk/pingus/src/display/drawing_context.cpp
===================================================================
--- trunk/pingus/src/display/drawing_context.cpp 2007-09-13 01:38:03 UTC
(rev 3137)
+++ trunk/pingus/src/display/drawing_context.cpp 2007-09-13 05:27:19 UTC
(rev 3138)
@@ -251,6 +251,12 @@
}
void
+DrawingContext::draw(const Sprite& sprite, const Vector2i& pos)
+{
+ draw(sprite, (float)pos.x, (float)pos.y, 0.f);
+}
+
+void
DrawingContext::draw(const Sprite& sprite, const Vector3f& pos)
{
draw(sprite, pos.x, pos.y, pos.z);
@@ -266,7 +272,7 @@
}
void
-DrawingContext::draw_line (float x1, float y1, float x2, float y2,
+DrawingContext::draw_line (int x1, int y1, int x2, int y2,
const Color& color, float z)
{
draw(new LineDrawingRequest(Vector2i(int(x1 + translate_stack.back().x),
int(y1 + translate_stack.back().y)),
@@ -298,7 +304,7 @@
}
void
-DrawingContext::draw_fillrect (float x1, float y1, float x2, float y2,
+DrawingContext::draw_fillrect (int x1, int y1, int x2, int y2,
const Color& color, float z)
{
draw(new RectDrawingRequest(Rect(int(x1 + translate_stack.back().x), int(y1
+ translate_stack.back().y),
@@ -309,7 +315,7 @@
}
void
-DrawingContext::draw_rect (float x1, float y1, float x2, float y2,
+DrawingContext::draw_rect (int x1, int y1, int x2, int y2,
const Color& color, float z)
{
draw(new RectDrawingRequest(Rect(int(x1 + translate_stack.back().x), int(y1
+ translate_stack.back().y),
@@ -404,20 +410,20 @@
return rect;
}
-float
+int
DrawingContext::get_width() const
{
- return (float)rect.get_width();
+ return rect.get_width();
}
-float
+int
DrawingContext::get_height() const
{
- return (float)rect.get_height();
+ return rect.get_height();
}
void
-DrawingContext::print_left (const Font& font_, float x_pos, float y_pos, const
std::string& str, float z)
+DrawingContext::print_left (const Font& font_, int x_pos, int y_pos, const
std::string& str, float z)
{
draw(new FontDrawingRequest(font_,
origin_top_left,
@@ -428,7 +434,7 @@
}
void
-DrawingContext::print_center (const Font& font_, float x_pos, float y_pos,
const std::string& str, float z)
+DrawingContext::print_center (const Font& font_, int x_pos, int y_pos, const
std::string& str, float z)
{
draw(new FontDrawingRequest(font_,
origin_top_center,
@@ -439,7 +445,7 @@
}
void
-DrawingContext::print_right (const Font& font_, float x_pos, float y_pos,
const std::string& str, float z)
+DrawingContext::print_right (const Font& font_, int x_pos, int y_pos, const
std::string& str, float z)
{
draw(new FontDrawingRequest(font_,
origin_top_right,
Modified: trunk/pingus/src/display/drawing_context.hpp
===================================================================
--- trunk/pingus/src/display/drawing_context.hpp 2007-09-13 01:38:03 UTC
(rev 3137)
+++ trunk/pingus/src/display/drawing_context.hpp 2007-09-13 05:27:19 UTC
(rev 3138)
@@ -71,6 +71,7 @@
worth a try */
void draw(DrawingContext& dc, float z = 0);
+ void draw(const Sprite& sprite, const Vector2i& pos);
void draw(const Sprite& sprite, const Vector3f& pos);
void draw(const Sprite& sprite, float x, float y, float z = 0);
@@ -79,11 +80,11 @@
queue */
void fill_screen(const Color& color);
- void draw_line (float x1, float y1, float x2, float y2,
+ void draw_line (int x1, int y1, int x2, int y2,
const Color& color, float z = 0);
- void draw_fillrect (float x1, float y1, float x2, float y2,
+ void draw_fillrect (int x1, int y1, int x2, int y2,
const Color& color, float z = 0);
- void draw_rect (float x1, float y1, float x2, float y2,
+ void draw_rect (int x1, int y1, int x2, int y2,
const Color& color, float z = 0);
void draw_fillrect (const Rect& rect,
@@ -121,17 +122,17 @@
void set_rect(const Rect& rect);
Rect get_rect() const;
- float get_width() const;
- float get_height() const;
+ int get_width() const;
+ int get_height() const;
/** Print a text left aligned */
- void print_left (const Font& font, float x_pos, float y_pos, const
std::string& str, float z = 0.0f);
+ void print_left (const Font& font, int x_pos, int y_pos, const std::string&
str, float z = 0.0f);
/** Print a text centred to the given position */
- void print_center (const Font& font, float x_pos, float y_pos, const
std::string& str, float z = 0.0f);
+ void print_center (const Font& font, int x_pos, int y_pos, const
std::string& str, float z = 0.0f);
/** Print a text right aligned */
- void print_right (const Font& font, float x_pos, float y_pos, const
std::string& str, float z = 0.0f);
+ void print_right (const Font& font, int x_pos, int y_pos, const std::string&
str, float z = 0.0f);
Vector3f screen_to_world (Vector3f pos);
Vector3f world_to_screen (Vector3f pos);
Modified: trunk/pingus/src/editor/combobox.cpp
===================================================================
--- trunk/pingus/src/editor/combobox.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/combobox.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -23,6 +23,7 @@
#include "combobox.hpp"
#include "math.hpp"
#include "../fonts.hpp"
+#include "../math/vector2i.hpp"
namespace Editor {
@@ -119,7 +120,7 @@
else
{
gc.draw_fillrect(rect, Color(255,255,255));
- gc.draw(sprite, rect.right - 12, rect.top);
+ gc.draw(sprite, Vector2i(rect.right - 12, rect.top));
gc.draw_rect(rect, Color(0,0,0));
if (current_item != -1)
Modified: trunk/pingus/src/editor/context_menu.cpp
===================================================================
--- trunk/pingus/src/editor/context_menu.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/context_menu.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -29,7 +29,7 @@
namespace Editor {
// Determine which actions are available for these objects
-ContextMenu::ContextMenu(std::vector<LevelObj*> o, Vector3f p, EditorViewport*
vp, bool base_menu)
+ContextMenu::ContextMenu(std::vector<LevelObj*> o, Vector2i p, EditorViewport*
vp, bool base_menu)
: objs(o),
viewport(vp),
pos(p),
@@ -63,8 +63,8 @@
void
ContextMenu::on_pointer_move(int x, int y)
{
- mouse_at.x = (float)x;
- mouse_at.y = (float)y;
+ mouse_at.x = x;
+ mouse_at.y = y;
selected_action_offset = (unsigned)((mouse_at.y - pos.y) / item_height);
}
@@ -99,8 +99,8 @@
ContextMenu::is_at(int x, int y)
{
if (show)
- return (x > pos.x && x < pos.x + width &&
- y > pos.y && y < pos.y + total_height);
+ return (x > pos.x && x < pos.x + (int)width &&
+ y > pos.y && y < pos.y + (int)total_height);
else
return false;
}
@@ -160,7 +160,7 @@
ContextMenu* menu;
if (available_attribs & CAN_ROTATE)
{
- menu = new ContextMenu(objs, Vector3f(pos.x + width, pos.y), viewport,
false);
+ menu = new ContextMenu(objs, Vector2i(pos.x + width, pos.y), viewport,
false);
viewport->get_screen()->get_gui_manager()->add(menu, true);
menu->add_action(ContextItem("0 degrees", "ROT0", ROTATE, 0));
menu->add_action(ContextItem("90 Degrees", "ROT90", ROTATE, 0));
@@ -174,7 +174,7 @@
}
if (available_attribs & HAS_OWNER)
{
- menu = new ContextMenu(objs, Vector3f(pos.x + width, pos.y), viewport,
false);
+ menu = new ContextMenu(objs, Vector2i(pos.x + width, pos.y), viewport,
false);
viewport->get_screen()->get_gui_manager()->add(menu, true);
menu->add_action(ContextItem("0", "0", SET_OWNER, 0));
menu->add_action(ContextItem("1", "1", SET_OWNER, 0));
@@ -184,14 +184,14 @@
}
if (available_attribs & HAS_DIRECTION)
{
- menu = new ContextMenu(objs, Vector3f(pos.x + width, pos.y), viewport,
false);
+ menu = new ContextMenu(objs, Vector2i(pos.x + width, pos.y), viewport,
false);
viewport->get_screen()->get_gui_manager()->add(menu, true);
menu->add_action(ContextItem("Left", "left", SET_DIRECTION, 0));
menu->add_action(ContextItem("Right", "right", SET_DIRECTION, 0));
menu->add_action(ContextItem("Misc.", "misc", SET_DIRECTION, 0));
add_action(ContextItem("Direction >", "", SET_DIRECTION, menu));
}
- menu = new ContextMenu(objs, Vector3f(pos.x + width, pos.y), viewport,
false);
+ menu = new ContextMenu(objs, Vector2i(pos.x + width, pos.y), viewport,
false);
viewport->get_screen()->get_gui_manager()->add(menu, true);
menu->add_action(ContextItem("-50", "-50", SET_Z_POS, 0));
menu->add_action(ContextItem("-25", "-25", SET_Z_POS, 0));
Modified: trunk/pingus/src/editor/context_menu.hpp
===================================================================
--- trunk/pingus/src/editor/context_menu.hpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/context_menu.hpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -23,7 +23,7 @@
#include <vector>
#include <string>
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
#include "../gui/component.hpp"
namespace Editor {
@@ -67,10 +67,10 @@
std::vector<ContextItem> actions;
/** Where the mouse is located */
- Vector3f mouse_at;
+ Vector2i mouse_at;
/** Location of context menu */
- Vector3f pos;
+ Vector2i pos;
/** Is the mouse over the menu? */
bool hover;
@@ -92,7 +92,7 @@
public:
// Constructor
- ContextMenu (std::vector<LevelObj*>, Vector3f p, EditorViewport* v, bool
base_menu = true);
+ ContextMenu (std::vector<LevelObj*>, Vector2i p, EditorViewport* v, bool
base_menu = true);
// Desctructor
~ContextMenu ();
Modified: trunk/pingus/src/editor/editor_viewport.cpp
===================================================================
--- trunk/pingus/src/editor/editor_viewport.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/editor_viewport.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -96,7 +96,7 @@
{
// std::vector<LevelObj*> objs;
// objs.push_back(obj);
- context_menu = new ContextMenu(selected_objs, Vector3f((float)x_,
(float)y_), this);
+ context_menu = new ContextMenu(selected_objs, Vector2i(x_, y_),
this);
editor->get_gui_manager()->add(context_menu, true);
}
}
@@ -243,8 +243,8 @@
objs[i]->draw(*drawing_context);
if (current_action == HIGHLIGHTING)
- drawing_context->draw_rect((float)highlighted_area.left,
(float)highlighted_area.top,
- (float)highlighted_area.right,
(float)highlighted_area.bottom,
+ drawing_context->draw_rect(highlighted_area.left, highlighted_area.top,
+ highlighted_area.right,
highlighted_area.bottom,
Color(255,0,255), 1000.0f);
state.pop(*drawing_context);
@@ -274,11 +274,11 @@
{
if (mouse_screen_pos.x < autoscroll_border)
state.set_pos(state.get_pos() - Vector2f(5, 0));
- else if ((float)Display::get_width() - mouse_screen_pos.x <
autoscroll_border)
+ else if (Display::get_width() - mouse_screen_pos.x <
autoscroll_border)
state.set_pos(state.get_pos() + Vector2f(5, 0));
else if (mouse_screen_pos.y < autoscroll_border)
state.set_pos(state.get_pos() - Vector2f(0, 5));
- else if ((float)Display::get_height() - mouse_screen_pos.y <
autoscroll_border)
+ else if (Display::get_height() - mouse_screen_pos.y <
autoscroll_border)
state.set_pos(state.get_pos() + Vector2f(0, 5));
}
}
Modified: trunk/pingus/src/editor/file_list.cpp
===================================================================
--- trunk/pingus/src/editor/file_list.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/file_list.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -21,6 +21,7 @@
#include "math.hpp"
#include "fonts.hpp"
#include "file_list.hpp"
+#include "../math/vector2i.hpp"
namespace Editor {
@@ -96,9 +97,9 @@
i != directory.begin() + end; ++i)
{
if (i->type == System::DE_DIRECTORY)
- gc.draw(directory_icon, x, y);
+ gc.draw(directory_icon, Vector2i(x, y));
else if (i->type == System::DE_FILE)
- gc.draw(file_icon, x, y);
+ gc.draw(file_icon, Vector2i(x, y));
if ((click_item == -1 && (i - directory.begin()) == current_item) ||
(i - directory.begin()) == click_item)
Modified: trunk/pingus/src/editor/level_objs.cpp
===================================================================
--- trunk/pingus/src/editor/level_objs.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/level_objs.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -96,9 +96,9 @@
// If selected, draw a highlighted box around it
if (selected)
{
- gc.draw_rect(translated_pos.x, translated_pos.y,
- translated_pos.x + sprite.get_width(),
- translated_pos.y + sprite.get_height(),
+ gc.draw_rect((int)translated_pos.x, (int)translated_pos.y,
+ (int)translated_pos.x + sprite.get_width(),
+ (int)translated_pos.y + sprite.get_height(),
Color(255,0,0), 5000);
}
Modified: trunk/pingus/src/editor/object_selector.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/editor/object_selector.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -55,7 +55,7 @@
LevelObj* create(const Vector2i& pos, LevelImpl* impl) {
LevelObj* obj = new LevelObj("groundpiece", impl);
- obj->set_pos(Vector3f(pos.x, pos.y));
+ obj->set_pos(pos);
obj->set_res_desc(desc);
obj->set_type(type);
return obj;
@@ -71,7 +71,7 @@
LevelObj* create(const Vector2i& pos, LevelImpl* impl) {
LevelObj* obj = new LevelObj("entrance", impl);
obj->set_type("generic");
- obj->set_pos(Vector3f(pos.x, pos.y));
+ obj->set_pos(pos);
obj->set_direction("misc");
obj->set_release_rate(150);
obj->set_owner(0);
@@ -90,7 +90,7 @@
LevelObj* create(const Vector2i& pos, LevelImpl* impl) {
LevelObj* obj = new LevelObj("exit", impl);
- obj->set_pos(Vector3f(pos.x, pos.y));
+ obj->set_pos(pos);
obj->set_res_desc(desc);
// obj->set_para();
return obj;
@@ -108,7 +108,7 @@
LevelObj* create(const Vector2i& pos, LevelImpl* impl) {
LevelObj* obj = new LevelObj("hotspot", impl);
- obj->set_pos(Vector3f(pos.x, pos.y));
+ obj->set_pos(pos);
obj->set_res_desc(desc);
// obj->set_para();
return obj;
@@ -126,7 +126,7 @@
LevelObj* create(const Vector2i& pos, LevelImpl* impl) {
LevelObj* obj = new LevelObj("surface-background", impl);
- obj->set_pos(Vector3f(pos.x, pos.y));
+ obj->set_pos(pos);
obj->set_res_desc(desc);
// obj->set_para();
return obj;
@@ -180,7 +180,7 @@
rect.left + 17 + t_w/2 + 4, rect.top + 38 +
Fonts::verdana11.get_height() + 2);
gc.draw_fillrect(t_r, Color(255, 255, 200), 1000.0f);
gc.draw_rect(t_r, Color(0,0,0), 1000.0f);
- gc.print_center(Fonts::verdana11, rect.left + 17.0f, rect.top + 38.0f,
tooltip, 1000.0f);
+ gc.print_center(Fonts::verdana11, rect.left + 17, rect.top + 38,
tooltip, 1000.0f);
}
}
@@ -300,8 +300,8 @@
}
gc.draw((*i)->sprite,
- x * 48 + std::max(0, (48 - (*i)->sprite.get_width())/2),
- y * 48 + std::max(0, (48 - (*i)->sprite.get_height())/2));
+ Vector2i(x * 48 + std::max(0, (48 -
(*i)->sprite.get_width())/2),
+ y * 48 + std::max(0, (48 -
(*i)->sprite.get_height())/2)));
++i;
}
else
@@ -316,8 +316,8 @@
if (mode == OBJECT_DRAG)
{
- parent_gc.draw(objects[current_object]->sprite,
Vector3f(real_mouse_pos.x,
-
real_mouse_pos.y,
+ parent_gc.draw(objects[current_object]->sprite,
Vector3f((float)real_mouse_pos.x,
+
(float)real_mouse_pos.y,
2000.0f));
}
parent_gc.draw(gc);
Modified: trunk/pingus/src/editor/panel.cpp
===================================================================
--- trunk/pingus/src/editor/panel.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/editor/panel.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -104,7 +104,7 @@
pos.x + 17 + t_w/2 + 4, pos.y + 38 +
Fonts::verdana11.get_height() + 2);
gc.draw_fillrect(t_r, Color(255, 255, 200), 1000.0f);
gc.draw_rect(t_r, Color(0,0,0), 1000.0f);
- gc.print_center(Fonts::verdana11, pos.x + 17.0f, pos.y + 38.0f,
tooltip, 1000.0f);
+ gc.print_center(Fonts::verdana11, pos.x + 17, pos.y + 38, tooltip,
1000.0f);
}
}
@@ -216,9 +216,9 @@
Panel::draw (DrawingContext& gc)
{
// FIXME: Could use draw_line
- gc.draw_fillrect(0, 0, float(Display::get_width()), 38, Color(255, 255,
255));
- gc.draw_fillrect(1, 1, float(Display::get_width()), 38, Color(169, 157,
140));
- gc.draw_fillrect(1, 1, float(Display::get_width()-1), 37, Color(237, 233,
227));
+ gc.draw_fillrect(0, 0, Display::get_width(), 38, Color(255, 255, 255));
+ gc.draw_fillrect(1, 1, Display::get_width(), 38, Color(169, 157, 140));
+ gc.draw_fillrect(1, 1, Display::get_width()-1, 37, Color(237, 233, 227));
}
void
Modified: trunk/pingus/src/exit_menu.cpp
===================================================================
--- trunk/pingus/src/exit_menu.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/exit_menu.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -42,8 +42,8 @@
void draw (DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large, (float)Display::get_width()/2 - 80,
- (float)Display::get_height()/2 + 15, _("Yes"));
+ gc.print_right(Fonts::chalk_large, Display::get_width()/2 - 80,
+ Display::get_height()/2 + 15, _("Yes"));
}
bool is_at(int x, int y) {
@@ -81,8 +81,8 @@
void draw(DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large, (float)Display::get_width()/2 + 80,
- (float)Display::get_height()/2 + 15, _("No"));
+ gc.print_right(Fonts::chalk_large, Display::get_width()/2 + 80,
+ Display::get_height()/2 + 15, _("No"));
}
bool is_at(int x, int y) {
@@ -119,7 +119,7 @@
{
//gc.draw_fillrect (0, 0, Display::get_width (), Display::get_height (),
//0, 0, 0, 0.5);
- gc.draw(sur, Vector3f(gc.get_width()/2 - sur.get_width()/2,
+ gc.draw(sur, Vector2i(gc.get_width()/2 - sur.get_width()/2,
gc.get_height()/2 - sur.get_height()/2));
gc.print_center(Fonts::chalk_large, gc.get_width()/2, gc.get_height()/2 -
70, _("Exit Pingus?"));
PingusSubMenu::draw(gc);
Modified: trunk/pingus/src/file_dialog.cpp
===================================================================
--- trunk/pingus/src/file_dialog.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/file_dialog.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -60,8 +60,8 @@
if (!is_hidden)
{
SurfaceButton::draw(gc);
- gc.print_right(Fonts::chalk_large, (float)Display::get_width()/2 + 230,
- (float)Display::get_height()/2 + 160, label);
+ gc.print_right(Fonts::chalk_large, Display::get_width()/2 + 230,
+ Display::get_height()/2 + 160, label);
}
}
@@ -112,8 +112,8 @@
void draw (DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_left(Fonts::chalk_large, (float)Display::get_width()/2 - 280,
- (float)Display::get_height()/2 + 160, CANCEL_TEXT);
+ gc.print_left(Fonts::chalk_large, Display::get_width()/2 - 280,
+ Display::get_height()/2 + 160, CANCEL_TEXT);
}
bool is_at(int x, int y) {
@@ -142,7 +142,7 @@
FileDialog* file_dialog;
/** Where the image is located */
- Vector3f pos;
+ Vector2i pos;
/** Image used for the scroll button */
Sprite sprite;
@@ -158,8 +158,8 @@
public:
FileDialogScrollButton (FileDialog* f, int d, int height_offset)
: file_dialog(f),
- pos(Vector3f((float)Display::get_width()/2 + 210,
- (float)Display::get_height()/2 + height_offset)),
+ pos(Vector2i(Display::get_width()/2 + 210,
+ Display::get_height()/2 + height_offset)),
direction(d),
is_hidden(false),
hover(false)
@@ -190,8 +190,8 @@
{
if (is_hidden)
return false;
- return (x > (int)pos.x && x < (int)pos.x + sprite.get_width()
- && y > (int)pos.y && y < (int)pos.y + sprite.get_height());
+ return (x > pos.x && x < pos.x + sprite.get_width()
+ && y > pos.y && y < pos.y + sprite.get_height());
}
void show() { is_hidden = false; }
@@ -205,7 +205,7 @@
FileDialog* file_dialog;
/** Where the image is located */
- Vector3f pos;
+ Vector2i pos;
/** Image used for the parent folder button */
Sprite sprite;
@@ -215,8 +215,8 @@
public:
FileDialogParentFolderButton (FileDialog* f)
: file_dialog(f),
- pos(Vector3f((float)Display::get_width()/2 + 230,
- (float)Display::get_height()/2 - 210)),
+ pos(Vector2i(Display::get_width()/2 + 230,
+ Display::get_height()/2 - 210)),
sprite(Resource::load_sprite("core/menu/parent_folder")),
hover(false)
{
@@ -242,8 +242,8 @@
bool is_at(int x, int y)
{
- return (x > (int)pos.x && x < (int)pos.x + sprite.get_width()
- && y > (int)pos.y && y < (int)pos.y + sprite.get_height());
+ return (x > pos.x && x < pos.x + sprite.get_width()
+ && y > pos.y && y < pos.y + sprite.get_height());
}
};
@@ -272,29 +272,29 @@
// FIXME: Ugly - hardcoded values for items in file dialog. Should be
dynamic.
// Create 8 FileDialogItems and add them to the gui_manager.
- float center_x = (float)Display::get_width()/2;
- float center_y = (float)Display::get_height()/2;
+ int center_x = Display::get_width()/2;
+ int center_y = Display::get_height()/2;
- inputbox = new GUI::InputBox(450, Vector3f(center_x - 225,
+ inputbox = new GUI::InputBox(450, Vector2i(center_x - 225,
center_y - 170), "", for_loading);
gui_manager->add((GUI::Component*)inputbox, true);
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 280,
center_y - 140)));
+ Vector2i(center_x - 280,
center_y - 140)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 280,
center_y - 70)));
+ Vector2i(center_x - 280,
center_y - 70)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 280,
center_y + 10)));
+ Vector2i(center_x - 280,
center_y + 10)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 280,
center_y + 80)));
+ Vector2i(center_x - 280,
center_y + 80)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 10,
center_y - 140)));
+ Vector2i(center_x - 10,
center_y - 140)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 10,
center_y - 70)));
+ Vector2i(center_x - 10,
center_y - 70)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 10,
center_y + 10)));
+ Vector2i(center_x - 10,
center_y + 10)));
file_dialog_items.push_back(new FileDialogItem(this,
- Vector3f(center_x - 10,
center_y + 80)));
+ Vector2i(center_x - 10,
center_y + 80)));
for (std::vector<FileDialogItem*>::const_iterator i =
file_dialog_items.begin();
i != file_dialog_items.end(); i++)
@@ -309,7 +309,7 @@
bool FileDialog::draw (DrawingContext& gc)
{
- gc.draw(sprite, Vector3f(gc.get_width ()/2 - sprite.get_width ()/2,
+ gc.draw(sprite, Vector2i(gc.get_width ()/2 - sprite.get_width ()/2,
gc.get_height ()/2 - sprite.get_height ()/2));
gc.draw_rect(gc.get_width() / 2 - 285, gc.get_height() / 2 - 160,
gc.get_width() / 2 + 285, gc.get_height() / 2 + 160,
Color(0,0,0));
Modified: trunk/pingus/src/file_dialog_item.cpp
===================================================================
--- trunk/pingus/src/file_dialog_item.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/file_dialog_item.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -32,7 +32,7 @@
#include "worldmap/metamap.hpp"
// Only Constructor
- FileDialogItem::FileDialogItem(FileDialog* f, Vector3f p)
+ FileDialogItem::FileDialogItem(FileDialog* f, Vector2i p)
: mouse_over(false),
is_hidden(true),
file_dialog(f),
@@ -145,7 +145,7 @@
if (!mouse_over || file_item.is_directory)
{
// Draw title
- gc.print_left(Fonts::pingus_small, pos.x +
(float)sprite.get_width(),
+ gc.print_left(Fonts::pingus_small, pos.x +
sprite.get_width(),
pos.y, get_filename());
}
else
Modified: trunk/pingus/src/file_dialog_item.hpp
===================================================================
--- trunk/pingus/src/file_dialog_item.hpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/file_dialog_item.hpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -21,7 +21,7 @@
#define HEADER_PINGUS_FILE_DIALOG_ITEM_HXX
#include "gui/component.hpp"
-#include "math/vector3f.hpp"
+#include "math/vector2i.hpp"
#include "sprite.hpp"
#include "file_dialog.hpp"
@@ -39,7 +39,7 @@
std::string status;
FileDialog* file_dialog;
- Vector3f pos;
+ Vector2i pos;
/** This file_item name will change based on the current file list */
FileItem file_item;
@@ -49,7 +49,7 @@
public:
// Only Constructor
- FileDialogItem(FileDialog* f, Vector3f p) ;
+ FileDialogItem(FileDialog* f, Vector2i p) ;
/** Set the current file assigned to this button */
void set_file(FileItem f);
Modified: trunk/pingus/src/font_test_screen.cpp
===================================================================
--- trunk/pingus/src/font_test_screen.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/font_test_screen.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -36,7 +36,7 @@
bool
FontTestScreen::draw(DrawingContext& gc)
{
- float checker = 40.f;
+ int checker = 40;
for(int y = 0; y < gc.get_height()/checker; y += 1)
for(int x = 0; x < gc.get_width()/checker; x += 1)
{
@@ -57,8 +57,8 @@
for(int i = 0; i < 256; ++i)
{
- float x = 64.0f + (i%20)*(font.get_height() + 24);
- float y = 64.0f + (i/20)*(font.get_height() + reference.get_height()*3);
+ int x = 64 + (i%20)*(font.get_height() + 24);
+ int y = 64 + (i/20)*(font.get_height() + reference.get_height()*3);
// print the actual character
gc.print_left(reference,
Modified: trunk/pingus/src/ground_map.cpp
===================================================================
--- trunk/pingus/src/ground_map.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/ground_map.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -134,15 +134,15 @@
{
//std::cout << "Drawing GroundMap Tile " << std::endl;
gc.color().draw(tile[x][y].get_sprite(),
- Vector3f((float)x * tile_size, (float)y *
tile_size));
+ Vector2i(x * tile_size, y * tile_size));
}
else
{
if (0 /*pingus_debug_flags & PINGUS_DEBUG_TILES*/)
- gc.color().draw_fillrect((float)x * tile_size,
- (float)y * tile_size,
- (float)x * tile_size + tile_size,
- (float)y * tile_size + tile_size,
+ gc.color().draw_fillrect(x * tile_size,
+ y * tile_size,
+ x * tile_size + tile_size,
+ y * tile_size + tile_size,
Color(255, 0, 0, 75));
}
}
Modified: trunk/pingus/src/gui/checkbox.cpp
===================================================================
--- trunk/pingus/src/gui/checkbox.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/checkbox.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -19,7 +19,7 @@
#include "checkbox.hpp"
#include "../fonts.hpp"
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
#include "../resource.hpp"
#include "../display/drawing_context.hpp"
#include "../gui/checkbox_listener.hpp"
@@ -27,7 +27,7 @@
namespace GUI {
-Checkbox::Checkbox(Vector3f p, std::string label_, CheckboxListener* l) :
+Checkbox::Checkbox(Vector2i p, std::string label_, CheckboxListener* l) :
checkmark(Resource::load_sprite("core/misc/checkbox_clicked")),
is_checked(false),
pos(p),
Modified: trunk/pingus/src/gui/checkbox.hpp
===================================================================
--- trunk/pingus/src/gui/checkbox.hpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/checkbox.hpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -21,7 +21,7 @@
#define HEADER_PINGUS_GUI_CHECKBOX_HXX
#include "../gui/component.hpp"
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
#include "../sprite.hpp"
class DrawingContext;
@@ -36,17 +36,17 @@
Sprite box;
Sprite checkmark;
- bool is_checked;
- Vector3f pos;
+ bool is_checked;
+ Vector2i pos;
- float width;
- float height;
+ int width;
+ int height;
CheckboxListener* listener;
std::string label;
public:
- Checkbox(Vector3f p, std::string label_, CheckboxListener* l);
+ Checkbox(Vector2i p, std::string label_, CheckboxListener* l);
void draw(DrawingContext& gc);
bool is_at(int x, int y);
Modified: trunk/pingus/src/gui/combobox.cpp
===================================================================
--- trunk/pingus/src/gui/combobox.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/combobox.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -26,7 +26,7 @@
namespace GUI {
// Constructor
-Combobox::Combobox (Vector3f p, ComboboxListener* listener_, std::string l) :
+Combobox::Combobox (Vector2i p, ComboboxListener* listener_, std::string l) :
current_item(0),
drop_down(false),
hover(false),
@@ -36,8 +36,8 @@
listener(listener_)
{
// Default to 20 characters wide.
- width = Fonts::pingus_small.get_width('O') * 20.0f;
- height = (float)Fonts::pingus_small.get_height();
+ width = Fonts::pingus_small.get_width('O') * 20;
+ height = Fonts::pingus_small.get_height();
}
// Destructor
@@ -89,25 +89,25 @@
Combobox::is_at(int x, int y)
{
if (enabled)
- return ((float)x > pos.x && (float)x < pos.x + get_width() &&
- (float)y > pos.y && (float)y < pos.y + get_height());
+ return (x > pos.x && x < pos.x + get_width() &&
+ y > pos.y && y < pos.y + get_height());
else
return false;
}
// Returns the width of the box
-float
+int
Combobox::get_width()
{
return width;
}
// Returns the height of the box
-float
+int
Combobox::get_height()
{
if (drop_down)
- return height * ((float)item_list.size() + 1.0f);
+ return height * (item_list.size() + 1);
else
return height;
}
@@ -122,7 +122,7 @@
drop_down = false;
if (y > pos.y + height)
{
- current_item = item_list[static_cast<int>((y - pos.y - height) /
height)];
+ current_item = item_list[(y - pos.y - height) / height];
listener->combobox_changed(this);
}
}
@@ -153,14 +153,14 @@
if (drop_down && item_list.size() > 0)
{
// Draw the highlighted box
- int y_offset = int(int(((mouse_pos.y - pos.y - height)/height)+1) *
height);
+ int y_offset = (((mouse_pos.y - pos.y - height)/height)+1) * height;
gc.draw_fillrect(pos.x, pos.y + y_offset, pos.x + get_width(), pos.y +
y_offset +
height, Color(128,128,128));
// Draw all of the items
for (unsigned i = 0; i < item_list.size(); i++)
{
- gc.print_left(Fonts::pingus_small, pos.x + 5.0f, pos.y + ((i + 1) *
height),
+ gc.print_left(Fonts::pingus_small, pos.x + 5, pos.y + ((i + 1) *
height),
item_list[i]->get_displayed_string());
}
}
@@ -168,7 +168,7 @@
if (current_item)
{
// Print the currently selected item
- gc.print_left(Fonts::pingus_small, pos.x + 3.0f, pos.y,
current_item->get_displayed_string());
+ gc.print_left(Fonts::pingus_small, pos.x + 3, pos.y,
current_item->get_displayed_string());
}
}
Modified: trunk/pingus/src/gui/combobox.hpp
===================================================================
--- trunk/pingus/src/gui/combobox.hpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/combobox.hpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -23,7 +23,7 @@
#include <vector>
#include <string>
#include "component.hpp"
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
namespace GUI {
@@ -91,19 +91,19 @@
bool hover;
/** Where the mouse is located */
- Vector3f mouse_pos;
+ Vector2i mouse_pos;
/** Width of the Combobox */
- float width;
+ int width;
/** Height of EACH ITEM in the Combobox. So, when drop_down is false, this
should be the height of the entire widget/component. When drop_down is
true, the entire widget's height should be this height times the number
of
items */
- float height;
+ int height;
/** Location of the Combobox */
- Vector3f pos;
+ Vector2i pos;
/** Whether or not this combobox is enabled */
bool enabled;
@@ -116,7 +116,7 @@
public:
/** Constructor */
- Combobox (Vector3f p, ComboboxListener* listener, std::string label =
std::string());
+ Combobox (Vector2i p, ComboboxListener* listener, std::string label =
std::string());
/** Destructor */
virtual ~Combobox ();
@@ -147,10 +147,10 @@
/** Returns the height of the Combobox at this given moment. Will be tall
if
drop_down = true, and short if drop_down = false */
- virtual float get_height();
+ virtual int get_height();
/** Returns the width of the Combobox */
- virtual float get_width();
+ virtual int get_width();
/** Gets emmited when a button is pressed and released over the
same component */
@@ -158,7 +158,7 @@
virtual void on_pointer_enter() { hover = true; }
virtual void on_pointer_leave() { hover = false; }
- virtual void on_pointer_move(int x, int y) { mouse_pos = Vector3f((float)x,
(float)y); }
+ virtual void on_pointer_move(int x, int y) { mouse_pos = Vector2i(x, y); }
/** Sets whether or not this combobox is clickable */
virtual void set_enabled(bool e) { enabled = e; }
Modified: trunk/pingus/src/gui/input_box.cpp
===================================================================
--- trunk/pingus/src/gui/input_box.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/input_box.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -20,17 +20,17 @@
#include <algorithm>
#include "input_box.hpp"
#include "../display/drawing_context.hpp"
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
#include "../fonts.hpp"
namespace GUI {
-InputBox::InputBox(float width_, Vector3f p, const std::string& default_value,
+InputBox::InputBox(int width_, Vector2i p, const std::string& default_value,
bool locked, const std::string& label_)
: str(default_value),
pos(p),
width(width_),
- height((float)Fonts::pingus_small.get_height()),
+ height(Fonts::pingus_small.get_height()),
is_locked(locked),
label(label_)
{
Modified: trunk/pingus/src/gui/input_box.hpp
===================================================================
--- trunk/pingus/src/gui/input_box.hpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/gui/input_box.hpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -21,7 +21,7 @@
#define HEADER_PINGUS_GUI_INPUTBOX_HXX
#include "component.hpp"
-#include "../math/vector3f.hpp"
+#include "../math/vector2i.hpp"
#include <string>
class DrawingContext;
@@ -32,9 +32,9 @@
class InputBox : public GUI::Component {
protected:
std::string str;
- Vector3f pos;
- float width;
- float height;
+ Vector2i pos;
+ int width;
+ int height;
bool is_locked;
/** Shrink the string to fit in the box */
@@ -44,7 +44,7 @@
std::string label;
public:
- InputBox(float width_, Vector3f p, const std::string&
+ InputBox(int width_, Vector2i p, const std::string&
default_value = std::string(), bool locked = false,
const std::string& label_ = std::string());
Modified: trunk/pingus/src/gui/surface_button.cpp
===================================================================
--- trunk/pingus/src/gui/surface_button.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/gui/surface_button.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -44,11 +44,11 @@
SurfaceButton::draw (DrawingContext& gc)
{
if (pressed && mouse_over)
- gc.draw(button_pressed_surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(button_pressed_surface, Vector2i(x_pos, y_pos));
else if (!pressed && mouse_over)
- gc.draw(button_mouse_over_surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(button_mouse_over_surface, Vector2i(x_pos, y_pos));
else
- gc.draw(button_surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(button_surface, Vector2i(x_pos, y_pos));
}
bool
Modified: trunk/pingus/src/pingu.cpp
===================================================================
--- trunk/pingus/src/pingu.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/pingu.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -353,7 +353,7 @@
// FIXME: in ticks, should probally be in seconds]
snprintf(str, 16, "%d", action_time/3);
- gc.color().print_center(Fonts::lcd, pos_x, pos_y - 45 + 2, str);
+ gc.color().print_center(Fonts::lcd, (int)pos_x, (int)pos_y - 45 + 2,
str);
}
}
Modified: trunk/pingus/src/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus_menu.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/pingus_menu.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -227,28 +227,28 @@
if (gc.get_height() == 480)
{
gc.draw(background,
- Vector3f((gc.get_width()/2) - (background.get_width()/2),
- 20.0f));
+ Vector2i((gc.get_width()/2) - (background.get_width()/2),
+ 20));
}
else
{
gc.draw(background,
- Vector3f((gc.get_width()/2) - (background.get_width()/2),
- static_cast<float>(Display::get_height()/10)));
+ Vector2i((gc.get_width()/2) - (background.get_width()/2),
+ Display::get_height()/10));
}
#ifdef OFFICIAL_PINGUS_BUILD
- gc.print_left(Fonts::pingus_small, 25.0f,
- static_cast<float>(Display::get_height()-114),
+ gc.print_left(Fonts::pingus_small, 25,
+ Display::get_height()-114,
"Pingus version "VERSION", Copyright (C) 2003 Ingo Ruhnke
<address@hidden>\n");
#else
- gc.print_left(Fonts::pingus_small, 25.0f,
- static_cast<float>(Display::get_height()-114),
+ gc.print_left(Fonts::pingus_small, 25,
+ Display::get_height()-114,
"Pingus version "VERSION" (unofficial build), Copyright (C)
2003 Ingo Ruhnke <address@hidden>\n");
#endif
- gc.print_left(Fonts::pingus_small, 25.0f,
- static_cast<float>(Display::get_height()-80),
+ gc.print_left(Fonts::pingus_small, 25,
+ Display::get_height()-80,
"Pingus comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are\n"
"welcome to redistribute it under certain conditions; see the
file COPYING for details.\n");
}
Modified: trunk/pingus/src/pingus_menu_manager.cpp
===================================================================
--- trunk/pingus/src/pingus_menu_manager.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/pingus_menu_manager.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -68,10 +68,10 @@
{
background.draw(gc);
- gc.draw_fillrect(0.0,
- static_cast<float>(Display::get_height () - 26),
- static_cast<float>(Display::get_width ()),
- static_cast<float>(Display::get_height ()),
+ gc.draw_fillrect(0,
+ Display::get_height () - 26,
+ Display::get_width (),
+ Display::get_height (),
Color(0, 0, 0, 255));
for (MenuStackIter i = menu_stack.begin (); i != menu_stack.end (); ++i)
Modified: trunk/pingus/src/result_screen.cpp
===================================================================
--- trunk/pingus/src/result_screen.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/result_screen.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -95,7 +95,7 @@
void draw(DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_normal, x_pos + 55.0f, y_pos - 4.0f,
_("Abort"));
+ gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos - 4, _("Abort"));
}
void on_click() {
@@ -128,7 +128,7 @@
void draw (DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_normal, x_pos + 30.0f, y_pos - 24.0f,
_("Retry"));
+ gc.print_center(Fonts::chalk_normal, x_pos + 30, y_pos - 24, _("Retry"));
}
bool is_at(int x, int y) {
@@ -169,22 +169,22 @@
void
ResultScreenComponent::draw(DrawingContext& gc)
{
- gc.draw(background, Vector3f(gc.get_width()/2, gc.get_height()/2));
+ gc.draw(background, Vector2i(gc.get_width()/2, gc.get_height()/2));
gc.print_center(Fonts::chalk_large, gc.get_width()/2,
- (float)Display::get_height()/2 - 200,
+ Display::get_height()/2 - 200,
_(result.plf.get_levelname()));
if (result.success())
{
gc.print_center(Fonts::chalk_large, gc.get_width()/2,
- (float)Display::get_height()/2 - 140, _("Success!"));
+ Display::get_height()/2 - 140, _("Success!"));
/*gc.print_center(Fonts::pingus_small, gc.get_width()/2,
gc.get_height()-30,
"..:: Press Space to continue ::..");*/
}
else
{
- gc.print_center(Fonts::chalk_large, gc.get_width()/2,
(float)Display::get_height()/2 - 140,
+ gc.print_center(Fonts::chalk_large, gc.get_width()/2,
Display::get_height()/2 - 140,
_("Failure!"));
/*gc.print_center(Fonts::pingus_normal, gc.get_width()/2,
gc.get_height()-30,
"..:: Press Space to retry the level ::..");*/
@@ -222,7 +222,7 @@
message = _("Better luck next time!");
}
gc.print_center(Fonts::chalk_normal, gc.get_width()/2,
- (float)Display::get_height()/2 - 70, message);
+ Display::get_height()/2 - 70, message);
#if 0
@@ -236,16 +236,16 @@
int right_x = Display::get_width()/2 + 100;
int y = Display::get_height()/2 + 10;
- gc.print_left(Fonts::chalk_normal, (float)left_x, (float)y, _("Saved: "));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
StringUtil::to_string(result.saved)
+ gc.print_left(Fonts::chalk_normal, left_x, y, _("Saved: "));
+ gc.print_right(Fonts::chalk_normal, right_x, y,
StringUtil::to_string(result.saved)
+ "/" + StringUtil::to_string(result.needed));;
- gc.print_left(Fonts::chalk_normal, (float)left_x, (float)(y+=30), _("Died:
"));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
StringUtil::to_string(result.killed));
+ gc.print_left(Fonts::chalk_normal, left_x, (y+=30), _("Died: "));
+ gc.print_right(Fonts::chalk_normal, right_x, y,
StringUtil::to_string(result.killed));
- gc.print_left(Fonts::chalk_normal, (float)left_x, (float)(y+=30), _("Time
left: "));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y, time_str);
+ gc.print_left(Fonts::chalk_normal, left_x, (y+=30), _("Time left: "));
+ gc.print_right(Fonts::chalk_normal, right_x, y, time_str);
}
ResultScreen::ResultScreen(Result arg_result)
Modified: trunk/pingus/src/start_screen.cpp
===================================================================
--- trunk/pingus/src/start_screen.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/start_screen.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -71,7 +71,7 @@
void draw(DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_normal, (float)x_pos + 30, (float)y_pos - 20,
_("Ok"));
+ gc.print_center(Fonts::chalk_normal, x_pos + 30, y_pos - 20, _("Ok"));
}
bool is_at(int x, int y) {
@@ -112,7 +112,7 @@
void draw(DrawingContext& gc) {
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_normal, (float)x_pos + 55, (float)y_pos,
_("Abort"));
+ gc.print_center(Fonts::chalk_normal, x_pos + 55, y_pos, _("Abort"));
}
void on_click() {
@@ -150,30 +150,30 @@
gc.print_center(Fonts::chalk_large,
gc.get_width()/2,
- (float)Display::get_height()/2 - 200,
+ Display::get_height()/2 - 200,
_(plf.get_levelname()));
gc.print_left(Fonts::chalk_normal,
- (float)Display::get_width()/2 - 290,
- (float)Display::get_height()/2 - 140,
+ Display::get_width()/2 - 290,
+ Display::get_height()/2 - 140,
format_description(800 - 230));
y += 32;
- gc.print_left (Fonts::chalk_normal, (float)left_x, (float)y, _("Number of
Pingus: "));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
StringUtil::to_string(plf.get_number_of_pingus()));
+ gc.print_left (Fonts::chalk_normal, left_x, y, _("Number of Pingus: "));
+ gc.print_right(Fonts::chalk_normal, right_x, y,
StringUtil::to_string(plf.get_number_of_pingus()));
- gc.print_left (Fonts::chalk_normal, (float)left_x, float(y += 30),
_("Number to Save: "));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
StringUtil::to_string(plf.get_number_to_save()));
+ gc.print_left (Fonts::chalk_normal, left_x, (y += 30), _("Number to Save:
"));
+ gc.print_right(Fonts::chalk_normal, right_x, y,
StringUtil::to_string(plf.get_number_to_save()));
- gc.print_left (Fonts::chalk_normal, (float)left_x, float(y += 30), _("Time:
"));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y, time_str);
+ gc.print_left (Fonts::chalk_normal, left_x, (y += 30), _("Time: "));
+ gc.print_right(Fonts::chalk_normal, right_x, y, time_str);
- gc.print_left (Fonts::chalk_normal, (float)left_x, float(y += 30),
_("Difficulty:"));
- gc.print_right(Fonts::chalk_normal, (float)right_x, (float)y,
StringUtil::to_string(plf.get_difficulty()) + "/100");
+ gc.print_left (Fonts::chalk_normal, left_x, (y += 30), _("Difficulty:"));
+ gc.print_right(Fonts::chalk_normal, right_x, y,
StringUtil::to_string(plf.get_difficulty()) + "/100");
- gc.print_center(Fonts::chalk_small, (float)Display::get_width()/2,
- (float)Display::get_height()/2 + 270, _("Author: ") +
plf.get_author());
+ gc.print_center(Fonts::chalk_small, Display::get_width()/2,
+ Display::get_height()/2 + 270, _("Author: ") +
plf.get_author());
if (maintainer_mode)
gc.print_left(Fonts::chalk_small, 110, 430, _("Filename: ") +
plf.get_resname());
Modified: trunk/pingus/src/story_screen.cpp
===================================================================
--- trunk/pingus/src/story_screen.cpp 2007-09-13 01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/story_screen.cpp 2007-09-13 05:27:19 UTC (rev 3138)
@@ -105,7 +105,7 @@
void draw (DrawingContext& gc)
{
- gc.print_right(Fonts::chalk_small, (float)x_pos, (float)y_pos,
SKIP_TEXT);
+ gc.print_right(Fonts::chalk_small, x_pos, y_pos, SKIP_TEXT);
}
bool is_at(int x, int y) {
@@ -154,15 +154,15 @@
void
StoryScreenComponent::draw (DrawingContext& gc)
{
- gc.draw(background, Vector3f(gc.get_width()/2, gc.get_height()/2));
+ gc.draw(background, Vector2i(gc.get_width()/2, gc.get_height()/2));
- gc.print_center(Fonts::chalk_large,
static_cast<float>(Display::get_width()/2),
- static_cast<float>(Display::get_height()/2 - 200),
story->get_title());
- gc.draw(page_surface, Vector3f(gc.get_width()/2, gc.get_height()/2 - 65));
+ gc.print_center(Fonts::chalk_large, Display::get_width()/2,
+ Display::get_height()/2 - 200, story->get_title());
+ gc.draw(page_surface, Vector2i(gc.get_width()/2, gc.get_height()/2 - 65));
gc.print_left(Fonts::chalk_normal,
- static_cast<float>(Display::get_width()/2 - 280),
- static_cast<float>(Display::get_height()/2 + 35),
+ Display::get_width()/2 - 280,
+ Display::get_height()/2 + 35,
display_text);
}
Modified: trunk/pingus/src/worldmap/level_dot.cpp
===================================================================
--- trunk/pingus/src/worldmap/level_dot.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/worldmap/level_dot.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -143,8 +143,8 @@
pos_correction = realpos + length - static_cast<int>(gc.get_width());
gc.print_center(Fonts::pingus_small,
- pos.x - (float)pos_correction,
- pos.y - 44,
+ (int)pos.x - pos_correction,
+ (int)pos.y - 44,
_(get_plf().get_levelname()),
10000);
}
@@ -158,8 +158,8 @@
pos_correction = realpos + length - static_cast<int>(gc.get_width());
gc.print_center(Fonts::pingus_small,
- pos.x - (float)pos_correction,
- pos.y - 30,
+ (int)pos.x - pos_correction,
+ (int)pos.y - 30,
_("locked"),
10000);
}
@@ -167,7 +167,7 @@
if (maintainer_mode)
{
gc.print_center(Fonts::pingus_small,
- pos.x, pos.y - 56,
+ (int)pos.x, (int)pos.y - 56,
get_plf().get_resname(),
10000);
}
Modified: trunk/pingus/src/worldmap/manager.cpp
===================================================================
--- trunk/pingus/src/worldmap/manager.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/worldmap/manager.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -104,7 +104,7 @@
WorldMapManagerCreditsButton::draw (DrawingContext& gc)
{
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_small, (float)(Display::get_width() - 59 - 24),
2, _("Show Ending?"));
+ gc.print_center(Fonts::chalk_small, Display::get_width() - 59 - 24, 2,
_("Show Ending?"));
}
void
@@ -164,7 +164,7 @@
WorldMapManagerCloseButton::draw (DrawingContext& gc)
{
SurfaceButton::draw(gc);
- gc.print_center(Fonts::chalk_small, 44, (float)Display::get_height() - 25,
_("Leave?"));
+ gc.print_center(Fonts::chalk_small, 44, Display::get_height() - 25,
_("Leave?"));
}
void
@@ -196,14 +196,14 @@
{
if (WorldMapManager::instance()->get_worldmap()->get_pingus()->is_walking())
{
- gc.draw(button_surface, Vector3f((float)x_pos, (float)y_pos));
+ gc.draw(button_surface, Vector2i(x_pos, y_pos));
}
else
{
SurfaceButton::draw(gc);
gc.print_center(Fonts::chalk_small,
- (float)Display::get_width() - 43 - 22,
- (float)Display::get_height() - 25,
+ Display::get_width() - 43 - 22,
+ Display::get_height() - 25,
_("Enter?"));
}
}
@@ -337,16 +337,16 @@
{
Color border_color(50, 65, 75);
// top
- gc.draw_fillrect(0, 0, (float)Display::get_width(), (float)cliprect.top,
+ gc.draw_fillrect(0, 0, Display::get_width(), cliprect.top,
border_color);
// bottom
- gc.draw_fillrect(0, (float)cliprect.bottom, (float)Display::get_width(),
(float)Display::get_height(),
+ gc.draw_fillrect(0, cliprect.bottom, Display::get_width(),
Display::get_height(),
border_color);
// left
- gc.draw_fillrect(0, (float)cliprect.top, (float)cliprect.left,
(float)cliprect.bottom,
+ gc.draw_fillrect(0, cliprect.top, cliprect.left, cliprect.bottom,
border_color);
// right
- gc.draw_fillrect((float)cliprect.right, (float)cliprect.top,
(float)Display::get_width(), (float)cliprect.bottom,
+ gc.draw_fillrect(cliprect.right, cliprect.top, Display::get_width(),
cliprect.bottom,
border_color);
}
}
@@ -363,7 +363,7 @@
{
// Draw the levelname
gc.draw(levelname_bg,
- Vector3f(gc.get_width()/2 - levelname_bg.get_width()/2,
+ Vector2i(gc.get_width()/2 - levelname_bg.get_width()/2,
gc.get_height() - levelname_bg.get_height()));
gc.print_center(Fonts::chalk_small, gc.get_width()/2, gc.get_height() - 25,
Modified: trunk/pingus/src/worldmap/path_drawable.cpp
===================================================================
--- trunk/pingus/src/worldmap/path_drawable.cpp 2007-09-13 01:38:03 UTC (rev
3137)
+++ trunk/pingus/src/worldmap/path_drawable.cpp 2007-09-13 05:27:19 UTC (rev
3138)
@@ -36,8 +36,8 @@
for(Path::iterator next = prev + 1; next != path.end(); ++next)
{
- gc.draw_line(prev->x, prev->y,
- next->x, next->y,
+ gc.draw_line((int)prev->x, (int)prev->y,
+ (int)next->x, (int)next->y,
Color(255, 255, 255));
prev = next;
}
Modified: trunk/pingus/src/worldobjs/thunderstorm_background.cpp
===================================================================
--- trunk/pingus/src/worldobjs/thunderstorm_background.cpp 2007-09-13
01:38:03 UTC (rev 3137)
+++ trunk/pingus/src/worldobjs/thunderstorm_background.cpp 2007-09-13
05:27:19 UTC (rev 3138)
@@ -47,7 +47,7 @@
void
ThunderstormBackground::draw (SceneContext& gc)
{
- gc.color().draw(clouds_sur, Vector3f((float)x_pos, 0));
+ gc.color().draw(clouds_sur, Vector2i(x_pos, 0));
}
} // namespace WorldObjs
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3138 - in trunk/pingus/src: . components display editor gui worldmap worldobjs,
jsalmon3 <=