[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds surface_background.cxx,1.
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/backgrounds surface_background.cxx,1.5,1.6 surface_background.hxx,1.5,1.6 |
Date: |
4 Sep 2002 19:40:22 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/backgrounds
In directory dark:/tmp/cvs-serv28686/backgrounds
Modified Files:
surface_background.cxx surface_background.hxx
Log Message:
some more GC adds
Index: surface_background.cxx
===================================================================
RCS file:
/usr/local/cvsroot/Games/Pingus/src/backgrounds/surface_background.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- surface_background.cxx 23 Aug 2002 15:49:54 -0000 1.5
+++ surface_background.cxx 4 Sep 2002 19:40:19 -0000 1.6
@@ -19,6 +19,7 @@
#include <ClanLib/Display/SurfaceProviders/canvas.h>
#include <ClanLib/Display/Display/display.h>
+#include "../graphic_context.hxx"
#include "../world.hxx"
#include "../timer.hxx"
#include "../pingus_resource.hxx"
@@ -210,7 +211,7 @@
}
void
-SurfaceBackground::draw_offset(int x_of, int y_of, float s)
+SurfaceBackground::draw (GraphicContext& gc)
{
if (fast_mode)
{
@@ -218,6 +219,9 @@
}
else
{
+ int x_of = int(gc.get_x_offset () + (gc.get_width ()/2));
+ int y_of = int(gc.get_y_offset () + (gc.get_height ()/2));
+
int start_x;
int start_y;
@@ -232,28 +236,16 @@
else if (start_y < 0 - int(bg_surface.get_height()))
start_y += bg_surface.get_height();
- if (s == 1.0)
+ for(int y = start_y;
+ y < CL_Display::get_height();
+ y += bg_surface.get_height())
{
- for(int y = start_y;
- y < CL_Display::get_height();
- y += bg_surface.get_height())
+ for(int x = start_x;
+ x < CL_Display::get_width();
+ x += bg_surface.get_width())
{
- for(int x = start_x;
- x < CL_Display::get_width();
- x += bg_surface.get_width())
- {
- bg_surface.put_screen(x, y, counter);
- }
- }
- }
- else
- {
- std::cout << "SurfaceBackground: Zooming not supported: " << s <<
std::endl;
- for(int y=(y_of/2); y < CL_Display::get_height(); y +=
(int)(bg_surface.get_height() * s)) {
- for(int x = start_x; x < CL_Display::get_width(); x +=
(int)(bg_surface.get_width() * s)) {
- bg_surface.put_screen(x, y, s, s);
+ bg_surface.put_screen(x, y, counter); // FIXME: should use gc
}
- }
}
}
}
Index: surface_background.hxx
===================================================================
RCS file:
/usr/local/cvsroot/Games/Pingus/src/backgrounds/surface_background.hxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- surface_background.hxx 23 Aug 2002 15:49:54 -0000 1.5
+++ surface_background.hxx 4 Sep 2002 19:40:19 -0000 1.6
@@ -46,7 +46,7 @@
float get_z_pos () const { return pos.z; }
void update (float delta);
- void draw_offset (int x_of, int y_of, float s = 1.0);
+ void draw (GraphicContext& gc);
private:
SurfaceBackground (const SurfaceBackground&);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/backgrounds surface_background.cxx,1.5,1.6 surface_background.hxx,1.5,1.6,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/particles particle_holder.cxx,1.3,1.4
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.8,1.9 conveyor_belt.hxx,1.6,1.7 guillotine.cxx,1.1,1.2 guillotine.hxx,1.1,1.2 ice_block.cxx,1.9,1.10 ice_block.hxx,1.7,1.8 info_box.cxx,1.5,1.6 info_box.hxx,1.7,1.8
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/particles particle_holder.cxx,1.3,1.4
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs conveyor_belt.cxx,1.8,1.9 conveyor_belt.hxx,1.6,1.7 guillotine.cxx,1.1,1.2 guillotine.hxx,1.1,1.2 ice_block.cxx,1.9,1.10 ice_block.hxx,1.7,1.8 info_box.cxx,1.5,1.6 info_box.hxx,1.7,1.8
- Index(es):