[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.7
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx,1.7,1.8 |
Date: |
10 Apr 2003 18:28:32 -0000 |
Update of /var/lib/cvs/Games/Pingus/src/worldobjs
In directory dark:/tmp/cvs-serv2681/worldobjs
Modified Files:
surface_background.cxx
Log Message:
removed some unused stuff
Index: surface_background.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldobjs/surface_background.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- surface_background.cxx 19 Feb 2003 09:50:37 -0000 1.7
+++ surface_background.cxx 10 Apr 2003 18:28:30 -0000 1.8
@@ -42,75 +42,64 @@
if (data->color.alpha > 1.0)
std::cout << "Background: Warning dim larger than 1.0 are no longer
supported" << std::endl;
- // Testing animatied backgrounds...
- /*std::cout << "Res: " << data->desc.res_name << std::endl
- << "file: " << data->desc.datafile << std::endl;*/
-
- if (background_manipulation_enabled)
- {
- CL_Surface source_surface = PingusResource::load_surface(data->desc);
+ CL_Surface source_surface = PingusResource::load_surface(data->desc);
- CL_Canvas* canvas;
+ CL_Canvas* canvas;
- // Scaling Code
- if (data->stretch_x && data->stretch_y)
+ // Scaling Code
+ if (data->stretch_x && data->stretch_y)
+ {
+ canvas = Blitter::scale_surface_to_canvas(source_surface,
world->get_width(), world->get_height());
+ }
+ else if (data->stretch_x && !data->stretch_y)
+ {
+ if (data->keep_aspect)
{
- canvas = Blitter::scale_surface_to_canvas(source_surface,
world->get_width(), world->get_height());
+ float aspect =
source_surface.get_height()/float(source_surface.get_width());
+ canvas = Blitter::scale_surface_to_canvas(source_surface,
+ world->get_width(),
+
int(world->get_width()*aspect));
}
- else if (data->stretch_x && !data->stretch_y)
+ else
{
- if (data->keep_aspect)
- {
- float aspect =
source_surface.get_height()/float(source_surface.get_width());
- canvas = Blitter::scale_surface_to_canvas(source_surface,
- world->get_width(),
-
int(world->get_width()*aspect));
- }
- else
- {
- canvas = Blitter::scale_surface_to_canvas(source_surface,
source_surface.get_width(), world->get_height());
- }
+ canvas = Blitter::scale_surface_to_canvas(source_surface,
source_surface.get_width(), world->get_height());
}
- else if (!data->stretch_x && data->stretch_y)
+ }
+ else if (!data->stretch_x && data->stretch_y)
+ {
+ if (data->keep_aspect)
{
- if (data->keep_aspect)
- {
- float aspect =
float(source_surface.get_width())/source_surface.get_height();
- canvas = Blitter::scale_surface_to_canvas(source_surface,
-
int(world->get_height() * aspect),
- world->get_height());
- }
- else
- {
- canvas = Blitter::scale_surface_to_canvas(source_surface,
source_surface.get_width(), world->get_height());
- }
+ float aspect =
float(source_surface.get_width())/source_surface.get_height();
+ canvas = Blitter::scale_surface_to_canvas(source_surface,
+ int(world->get_height() *
aspect),
+ world->get_height());
}
else
{
- canvas = Blitter::create_canvas(source_surface);
+ canvas = Blitter::scale_surface_to_canvas(source_surface,
source_surface.get_width(), world->get_height());
}
-
- /* FIXME: fill_rect doesn't work with RGB images
- FIXME: seems to work fine with indexed images
- FIXME: not tested with RGBA images
- FIXME: the bug might be in create_canvas() and not in fill_rect()
- */
-
- if (data->color.alpha != 0.0 && data->color != Color(0, 0, 0, 1.0f))
- { // Workaround for a bug which caused all levels to have the
- // wrong background color
- canvas->fill_rect(0, 0,
- canvas->get_width(), canvas->get_height(),
- data->color.red, data->color.green,
data->color.blue,
- data->color.alpha);
- }
-
- bg_surface = CL_Surface(canvas, true);
}
else
{
- bg_surface = PingusResource::load_surface(data->desc);
+ canvas = Blitter::create_canvas(source_surface);
+ }
+
+ /* FIXME: fill_rect doesn't work with RGB images
+ FIXME: seems to work fine with indexed images
+ FIXME: not tested with RGBA images
+ FIXME: the bug might be in create_canvas() and not in fill_rect()
+ */
+
+ if (data->color.alpha != 0.0 && data->color != Color(0, 0, 0, 1.0f))
+ { // Workaround for a bug which caused all levels to have the
+ // wrong background color
+ canvas->fill_rect(0, 0,
+ canvas->get_width(), canvas->get_height(),
+ data->color.red, data->color.green, data->color.blue,
+ data->color.alpha);
}
+
+ bg_surface = CL_Surface(canvas, true);
//bg_surface = CAImageManipulation::changeHSV(bg_surface, 150, 100, 0);
counter.set_size(bg_surface.get_num_frames());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs surface_background.cxx,1.7,1.8,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/doc Makefile.am,1.2,1.3 config,1.1,NONE editor,1.1.1.1,NONE levelformat.txt,1.1.1.1,NONEpingus.texi,1.7,NONE
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.144,1.145 config.cxx,1.12,1.13 globals.cxx,1.9,1.10 globals.hxx,1.12,1.13 option_menu.cxx,1.13,1.14 pingus_main.cxx,1.70,1.71 pingus_menu_manager.cxx,1.23,1.24 pingus_menu_manager.hxx,1.18,1.19 playfield.cxx,1.31,1.32 intro.cxx,1.7,NONE intro.hxx,1.6,NONE
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/doc Makefile.am,1.2,1.3 config,1.1,NONE editor,1.1.1.1,NONE levelformat.txt,1.1.1.1,NONEpingus.texi,1.7,NONE
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src Makefile.am,1.144,1.145 config.cxx,1.12,1.13 globals.cxx,1.9,1.10 globals.hxx,1.12,1.13 option_menu.cxx,1.13,1.14 pingus_main.cxx,1.70,1.71 pingus_menu_manager.cxx,1.23,1.24 pingus_menu_manager.hxx,1.18,1.19 playfield.cxx,1.31,1.32 intro.cxx,1.7,NONE intro.hxx,1.6,NONE
- Index(es):