[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx, 1.
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx, 1.9, 1.10 |
Date: |
16 Aug 2003 20:51:30 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv15910/worldobjs
Modified Files:
surface_background.cxx
Log Message:
- added level preview render code
Index: surface_background.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldobjs/surface_background.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- surface_background.cxx 19 Apr 2003 10:23:19 -0000 1.9
+++ surface_background.cxx 16 Aug 2003 20:51:28 -0000 1.10
@@ -155,34 +155,43 @@
}
else
{
- int x_of = static_cast<int>(gc.get_x_offset () + (gc.get_width ()/2));
- int y_of = static_cast<int>(gc.get_y_offset () + (gc.get_height ()/2));
+ if (render_preview)
+ {
+ for(int y = 0; y < gc.get_height(); y += bg_surface.get_height())
+ for(int x = 0; x < gc.get_width(); x += bg_surface.get_height())
+ gc.draw(bg_surface, x, y, counter);
+ }
+ else
+ {
+ int x_of = static_cast<int>(gc.get_x_offset () + (gc.get_width
()/2));
+ int y_of = static_cast<int>(gc.get_y_offset () + (gc.get_height
()/2));
- int start_x;
- int start_y;
+ int start_x;
+ int start_y;
- start_x = static_cast<int>((x_of * data->para_x) + scroll_ox);
- start_y = static_cast<int>((y_of * data->para_y) + scroll_oy);
+ start_x = static_cast<int>((x_of * data->para_x) + scroll_ox);
+ start_y = static_cast<int>((y_of * data->para_y) + scroll_oy);
- if (start_x >= 0)
- start_x = start_x - bg_surface.get_width();
+ if (start_x >= 0)
+ start_x = start_x - bg_surface.get_width();
- if (start_y >= 0)
- start_y -= bg_surface.get_height();
- else if (start_y < 0 - static_cast<int>(bg_surface.get_height()))
- start_y += bg_surface.get_height();
+ if (start_y >= 0)
+ start_y -= bg_surface.get_height();
+ else if (start_y < 0 - static_cast<int>(bg_surface.get_height()))
+ start_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())
- {
- bg_surface.put_screen(x, y, counter); // FIXME: should use gc
- }
- }
+ 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())
+ {
+ bg_surface.put_screen(x, y, counter); // FIXME: should use gc
+ }
+ }
+ }
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx, 1.9, 1.10,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/actions blocker.cxx,1.19,1.20
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/gui Makefile.am, 1.5, 1.6 display_graphic_context.cxx, 1.5, 1.6 display_graphic_context.hxx, 1.4, 1.5 graphic_context.hxx, 1.4, 1.5 screen_manager.cxx, 1.9, 1.10 screen_manager.hxx, 1.4, 1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/actions blocker.cxx,1.19,1.20
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/gui Makefile.am, 1.5, 1.6 display_graphic_context.cxx, 1.5, 1.6 display_graphic_context.hxx, 1.4, 1.5 graphic_context.hxx, 1.4, 1.5 screen_manager.cxx, 1.9, 1.10 screen_manager.hxx, 1.4, 1.5
- Index(es):