[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3901 - in trunk/pingus/src: . components display particles
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3901 - in trunk/pingus/src: . components display particles |
Date: |
Sun, 27 Jul 2008 03:28:34 +0200 |
Author: grumbel
Date: 2008-07-27 03:28:31 +0200 (Sun, 27 Jul 2008)
New Revision: 3901
Modified:
trunk/pingus/src/collision_map.cpp
trunk/pingus/src/components/button_panel.cpp
trunk/pingus/src/credits.cpp
trunk/pingus/src/display/drawing_context.cpp
trunk/pingus/src/display/drawing_context.hpp
trunk/pingus/src/level_menu.cpp
trunk/pingus/src/particles/rain_particle_holder.cpp
trunk/pingus/src/result_screen.cpp
trunk/pingus/src/start_screen.cpp
trunk/pingus/src/story_screen.cpp
Log:
Removed void draw(const Sprite& sprite, float x, float y, float z = 0); call
from DrawingContext
Modified: trunk/pingus/src/collision_map.cpp
===================================================================
--- trunk/pingus/src/collision_map.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/collision_map.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -213,7 +213,7 @@
canvas.unlock();
Sprite sprite(canvas);
- gc.draw(sprite, 0, 0, 1000);
+ gc.draw(sprite, Vector2i(0, 0), 1000);
}
unsigned
Modified: trunk/pingus/src/components/button_panel.cpp
===================================================================
--- trunk/pingus/src/components/button_panel.cpp 2008-07-27 01:22:43 UTC
(rev 3900)
+++ trunk/pingus/src/components/button_panel.cpp 2008-07-27 01:28:31 UTC
(rev 3901)
@@ -67,11 +67,11 @@
for(std::vector<ActionButton>::size_type i = 0; i < buttons.size(); ++i)
{
if (current_button == i)
- gc.draw(highlight, rect.left, rect.top + 38*i);
+ gc.draw(highlight, Vector2i(rect.left, rect.top + 38*i));
else
- gc.draw(background, rect.left, rect.top + 38*i);
+ gc.draw(background, Vector2i(rect.left, rect.top + 38*i));
- gc.draw(buttons[i].sprite, rect.left + 20, rect.top + 38*i + 16);
+ gc.draw(buttons[i].sprite, Vector2i(rect.left + 20, rect.top + 38*i +
16));
std::string str =
StringUtil::to_string(aholder->get_available(buttons[i].name));
gc.print_center(Fonts::pingus_small, Vector2i(rect.left + 46, rect.top +
5 + 38*i), str);
Modified: trunk/pingus/src/credits.cpp
===================================================================
--- trunk/pingus/src/credits.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/credits.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -264,7 +264,7 @@
// Paint the background wood panel
for(int y = 0; y < gc.get_height(); y += background.get_height())
for(int x = 0; x < gc.get_width(); x += background.get_width())
- gc.draw(background, x, y);
+ gc.draw(background, Vector2i(x, y));
gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
Modified: trunk/pingus/src/display/drawing_context.cpp
===================================================================
--- trunk/pingus/src/display/drawing_context.cpp 2008-07-27 01:22:43 UTC
(rev 3900)
+++ trunk/pingus/src/display/drawing_context.cpp 2008-07-27 01:28:31 UTC
(rev 3901)
@@ -245,25 +245,18 @@
void
DrawingContext::draw(const Sprite& sprite, const Vector2i& pos, float z)
{
- draw(sprite, (float)pos.x, (float)pos.y, z);
+ draw(new SpriteDrawingRequest(sprite, pos + translate_stack.back(), z));
}
void
DrawingContext::draw(const Sprite& sprite, const Vector3f& pos)
{
- draw(sprite, pos.x, pos.y, pos.z);
+ draw(new SpriteDrawingRequest(sprite,
Vector2i(static_cast<int>(translate_stack.back().x + pos.x),
+
static_cast<int>(translate_stack.back().y + pos.y)),
+ pos.z));
}
void
-DrawingContext::draw(const Sprite& sprite, float x, float y, float z)
-{ // FIXME: This should get flattend down to a simple texture draw
- // command for easier sorting after texture-id/alpha
- draw(new SpriteDrawingRequest(sprite, Vector2i((int)translate_stack.back().x
+ x,
- (int)translate_stack.back().y
+ y),
- z));
-}
-
-void
DrawingContext::draw_line(const Vector2i& pos1, const Vector2i& pos2,
const Color& color, float z)
{
Modified: trunk/pingus/src/display/drawing_context.hpp
===================================================================
--- trunk/pingus/src/display/drawing_context.hpp 2008-07-27 01:22:43 UTC
(rev 3900)
+++ trunk/pingus/src/display/drawing_context.hpp 2008-07-27 01:28:31 UTC
(rev 3901)
@@ -69,7 +69,6 @@
void draw(const Sprite& sprite, const Vector2i& pos, float z = 0);
void draw(const Sprite& sprite, const Vector3f& pos);
- void draw(const Sprite& sprite, float x, float y, float z = 0);
/** Fills the screen with a given color, this is different from
clear() in that it doesn't remove other DrawingRequest from the
Modified: trunk/pingus/src/level_menu.cpp
===================================================================
--- trunk/pingus/src/level_menu.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/level_menu.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -378,9 +378,9 @@
// Paint the background wood panel
for(int y = 0; y < gc.get_height(); y += background.get_height())
for(int x = 0; x < gc.get_width(); x += background.get_width())
- gc.draw(background, x, y);
+ gc.draw(background, Vector2i(x, y));
- gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
+ gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
}
void
Modified: trunk/pingus/src/particles/rain_particle_holder.cpp
===================================================================
--- trunk/pingus/src/particles/rain_particle_holder.cpp 2008-07-27 01:22:43 UTC
(rev 3900)
+++ trunk/pingus/src/particles/rain_particle_holder.cpp 2008-07-27 01:28:31 UTC
(rev 3901)
@@ -117,9 +117,9 @@
}
else
if (it->use_rain2_surf)
- gc.color().draw(rain2_surf, it->pos.x, it->pos.y -
rain1_surf.get_height());
+ gc.color().draw(rain2_surf, Vector2i(it->pos.x, it->pos.y -
rain1_surf.get_height()));
else
- gc.color().draw(rain1_surf, it->pos.x, it->pos.y -
rain1_surf.get_height());
+ gc.color().draw(rain1_surf, Vector2i(it->pos.x, it->pos.y -
rain1_surf.get_height()));
}
}
Modified: trunk/pingus/src/result_screen.cpp
===================================================================
--- trunk/pingus/src/result_screen.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/result_screen.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -157,9 +157,9 @@
// Paint the background wood panel
for(int y = 0; y < gc.get_height(); y += background.get_height())
for(int x = 0; x < gc.get_width(); x += background.get_width())
- gc.draw(background, x, y);
+ gc.draw(background, Vector2i(x, y));
- gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
+ gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
gc.print_center(Fonts::chalk_large,
Vector2i(gc.get_width()/2,
Modified: trunk/pingus/src/start_screen.cpp
===================================================================
--- trunk/pingus/src/start_screen.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/start_screen.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -138,9 +138,9 @@
// Paint the background wood panel
for(int y = 0; y < gc.get_height(); y += background.get_height())
for(int x = 0; x < gc.get_width(); x += background.get_width())
- gc.draw(background, x, y);
+ gc.draw(background, Vector2i(x, y));
- gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
+ gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
int left_x = gc.get_width()/2 - 150;
int right_x = gc.get_width()/2 + 150;
Modified: trunk/pingus/src/story_screen.cpp
===================================================================
--- trunk/pingus/src/story_screen.cpp 2008-07-27 01:22:43 UTC (rev 3900)
+++ trunk/pingus/src/story_screen.cpp 2008-07-27 01:28:31 UTC (rev 3901)
@@ -163,9 +163,9 @@
// Paint the background wood panel
for(int y = 0; y < gc.get_height(); y += background.get_height())
for(int x = 0; x < gc.get_width(); x += background.get_width())
- gc.draw(background, x, y);
+ gc.draw(background, Vector2i(x, y));
- gc.draw(blackboard, gc.get_width()/2, gc.get_height()/2);
+ gc.draw(blackboard, Vector2i(gc.get_width()/2, gc.get_height()/2));
gc.print_center(Fonts::chalk_large,
Vector2i(gc.get_width()/2, gc.get_height()/2 - 200),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3901 - in trunk/pingus/src: . components display particles,
grumbel at BerliOS <=