pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2673 - in branches/pingus_sdl/src: . display gui worldobjs


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2673 - in branches/pingus_sdl/src: . display gui worldobjs
Date: Wed, 17 Jan 2007 10:29:30 +0100

Author: grumbel
Date: 2007-01-17 10:29:29 +0100 (Wed, 17 Jan 2007)
New Revision: 2673

Added:
   branches/pingus_sdl/src/display/surface.cpp
   branches/pingus_sdl/src/display/surface.hpp
   branches/pingus_sdl/src/pixel_buffer.cpp
   branches/pingus_sdl/src/sexpr_pingus_level.cxx
   branches/pingus_sdl/src/sexpr_pingus_level.hxx
Removed:
   branches/pingus_sdl/src/loading.cxx
   branches/pingus_sdl/src/loading.hxx
   branches/pingus_sdl/src/pingus_map_manager.cxx
   branches/pingus_sdl/src/pingus_map_manager.hxx
   branches/pingus_sdl/src/range.cxx
   branches/pingus_sdl/src/range.hxx
Modified:
   branches/pingus_sdl/src/SConscript
   branches/pingus_sdl/src/ground_map.cxx
   branches/pingus_sdl/src/ground_map.hxx
   branches/pingus_sdl/src/gui/display.cxx
   branches/pingus_sdl/src/gui/display.hxx
   branches/pingus_sdl/src/pingus_main.cxx
   branches/pingus_sdl/src/pixel_buffer.hpp
   branches/pingus_sdl/src/story_screen.cxx
   branches/pingus_sdl/src/theme_selector.cxx
   branches/pingus_sdl/src/worldobjs/surface_background.cxx
Log:
- removed some unused files
- added some new

Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript  2007-01-16 07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/SConscript  2007-01-17 09:29:29 UTC (rev 2673)
@@ -130,6 +130,8 @@
 'command_line.cpp',
 'command_line_generic.cpp',
 
+'pixel_buffer.cpp',
+
 'exit_menu.cxx', 
 'file_dialog.cxx', 
 'file_dialog_item.cxx', 
@@ -195,8 +197,6 @@
 # # 'input/scrollers/pointer_scroller.cxx', 
 
 'layer_manager.cxx', 
-# 'level_interrupt.cxx', 
-# 'loading.cxx', 
 'components/menu_button.cxx', 
 'mover.cxx', 
 'movers/linear_mover.cxx', 
@@ -216,14 +216,12 @@
 'pingus_error.cxx', 
 'pingus_level.cxx', 
 'pingus_main.cxx', 
-# 'pingus_map_manager.cxx', 
 'pingus_menu.cxx', 
 'pingus_menu_manager.cxx', 
 'pingus_sub_menu.cxx', 
 'plf_res_mgr.cxx', 
 # 'plt_xml.cxx', 
 # 'preview_renderer.cxx', 
-# 'range.cxx', 
 'res_descriptor.cxx', 
 'resource.cxx',
 'resource_manager.cpp', 
@@ -243,7 +241,7 @@
 'start_screen.cxx', 
 'stat_manager.cxx', 
 'state_sprite.cxx', 
-# 'story_screen.cxx', 
+'story_screen.cxx', 
 'string_format.cxx',
 'math/origin.cpp',
 'math/rect.cpp',

Added: branches/pingus_sdl/src/display/surface.cpp
===================================================================
--- branches/pingus_sdl/src/display/surface.cpp 2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/display/surface.cpp 2007-01-17 09:29:29 UTC (rev 
2673)
@@ -0,0 +1,62 @@
+/*  $Id$
+**   __      __ __             ___        __   __ __   __
+**  /  \    /  \__| ____    __| _/_______/  |_|__|  | |  |   ____
+**  \   \/\/   /  |/    \  / __ |/  ___/\   __\  |  | |  | _/ __ \
+**   \        /|  |   |  \/ /_/ |\___ \  |  | |  |  |_|  |_\  ___/
+**    \__/\  / |__|___|  /\____ /____  > |__| |__|____/____/\___  >
+**         \/          \/      \/    \/                         \/
+**  Copyright (C) 2005 Ingo Ruhnke <address@hidden>
+**
+**  This program is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU General Public License
+**  as published by the Free Software Foundation; either version 2
+**  of the License, or (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+** 
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+**  02111-1307, USA.
+*/
+
+#include "surface.hpp"
+
+class SurfaceImpl
+{
+public:
+  SDL_Surface* surface;
+};
+
+Surface::Surface(SDL_Surface* surface, bool delete_it = false)
+  : surface(surface_)
+{
+  
+}
+
+Surface::Surface(const std::string& filename)
+  : impl(new SurfaceImpl(filename))
+{
+  surface = IMG_Load(filename.c_str());
+  if (!surface)
+    {
+      std::cout << "Error: Couldn't load " << filename << std::endl;
+      surface = IMG_Load("data/images/core/misc/404.png");
+      assert(surface);
+    }
+}
+
+Surface::~Surface()
+{
+  
+}
+  
+Surface::operate bool() const
+{
+  return impl.get();
+}
+
+/* EOF */

Added: branches/pingus_sdl/src/display/surface.hpp
===================================================================
--- branches/pingus_sdl/src/display/surface.hpp 2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/display/surface.hpp 2007-01-17 09:29:29 UTC (rev 
2673)
@@ -0,0 +1,48 @@
+/*  $Id$
+**   __      __ __             ___        __   __ __   __
+**  /  \    /  \__| ____    __| _/_______/  |_|__|  | |  |   ____
+**  \   \/\/   /  |/    \  / __ |/  ___/\   __\  |  | |  | _/ __ \
+**   \        /|  |   |  \/ /_/ |\___ \  |  | |  |  |_|  |_\  ___/
+**    \__/\  / |__|___|  /\____ /____  > |__| |__|____/____/\___  >
+**         \/          \/      \/    \/                         \/
+**  Copyright (C) 2005 Ingo Ruhnke <address@hidden>
+**
+**  This program is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU General Public License
+**  as published by the Free Software Foundation; either version 2
+**  of the License, or (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+** 
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+**  02111-1307, USA.
+*/
+
+#ifndef HEADER_SURFACE_HPP
+#define HEADER_SURFACE_HPP
+
+class SurfaceImpl;
+
+/** */
+class Surface
+{
+private:
+public:
+  Surface();
+  Surface(SDL_Surface*, bool delete_it = false);
+  Surface(const std::string& filename);
+  ~Surface();
+  
+  operate bool() const;
+private:
+  SharedPtr<SurfaceImpl> impl;
+};
+
+#endif
+
+/* EOF */

Modified: branches/pingus_sdl/src/ground_map.cxx
===================================================================
--- branches/pingus_sdl/src/ground_map.cxx      2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/ground_map.cxx      2007-01-17 09:29:29 UTC (rev 
2673)
@@ -119,7 +119,6 @@
 void
 GroundMap::draw(SceneContext& gc)
 {
-#if 0
   const Rect& display = gc.color().get_clip_rect();
 
   // FIXME: delete the next four lines and replace them with gc.get_clip_rect()
@@ -141,22 +140,20 @@
           {
             if (tile[x][y].get_surface())
               {
-                gc.color().draw(tile[x][y].get_surface(),
-                                Vector(static_cast<float>(x * tile_size),
-                                       static_cast<float>(y * tile_size)));
+                ////gc.color().draw(tile[x][y].get_surface(),
+                ////Vector3f((x * tile_size, y * tile_size)));
               }
             else
               {
                 if (pingus_debug_flags & PINGUS_DEBUG_TILES)
-                  gc.color().draw_fillrect(static_cast<float>(x * tile_size),
-                                           static_cast<float>(y * tile_size),
-                                           static_cast<float>(x * tile_size + 
tile_size),
-                                           static_cast<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));
               }
           }
     }
-#endif
 }
 
 // Returns the width of the map, it is read directly from the *.psm file

Modified: branches/pingus_sdl/src/ground_map.hxx
===================================================================
--- branches/pingus_sdl/src/ground_map.hxx      2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/ground_map.hxx      2007-01-17 09:29:29 UTC (rev 
2673)
@@ -35,8 +35,8 @@
 class MapTile
 {
 private:
-  ////CL_Surface     surface;
-  PixelBuffer pixelbuffer;
+  SDL_Surface* surface;
+  PixelBuffer  pixelbuffer;
 
   void prepare();
 public:
@@ -46,7 +46,7 @@
   void remove(PixelBuffer, int x, int y, int real_x, int real_y, GroundMap*);  
   void put(PixelBuffer, int x, int y);  
 
-  ////CL_Surface get_surface() const { return surface; }
+  SDL_Surface* get_surface() const { return surface; }
 };
 
 /** This map type is the defaulh maptype, it is should be used for the

Modified: branches/pingus_sdl/src/gui/display.cxx
===================================================================
--- branches/pingus_sdl/src/gui/display.cxx     2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/gui/display.cxx     2007-01-17 09:29:29 UTC (rev 
2673)
@@ -104,5 +104,10 @@
   return screen->h;
 }
 
+void
+Display::clear()
+{
+  SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+}
 
 /* EOF */

Modified: branches/pingus_sdl/src/gui/display.hxx
===================================================================
--- branches/pingus_sdl/src/gui/display.hxx     2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/gui/display.hxx     2007-01-17 09:29:29 UTC (rev 
2673)
@@ -65,6 +65,9 @@
   static int get_height();
 
   static void set_video_mode(int width, int height);
+  
+  static void clear();
+
   static SDL_Surface* get_screen() { return screen; }
 private:
   Display ();

Deleted: branches/pingus_sdl/src/loading.cxx
===================================================================
--- branches/pingus_sdl/src/loading.cxx 2007-01-16 07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/loading.cxx 2007-01-17 09:29:29 UTC (rev 2673)
@@ -1,91 +0,0 @@
-//  $Id: loading.cxx,v 1.10 2003/10/21 21:37:06 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
-#include "resource.hxx"
-#include "gui/display.hxx"
-#include "fonts.hxx"
-#include "loading.hxx"
-
-
-Loading loading_screen;
-
-Loading::Loading()
-{
-  is_init = false;
-}
-
-Loading::~Loading()
-{
-}
-
-void
-Loading::init()
-{
-  sur  = Resource::load_surface("game/Game/loading");
-  font = Fonts::courier_small;
-  is_init = true;
-}
-
-void
-Loading::draw()
-{
-  if (!is_init)
-    init();
-
-  CL_Display::clear();
-
-  sur.draw(float(CL_Display::get_width() - sur.get_width())/2,
-                float(CL_Display::get_height() - sur.get_height())/2);
-
-  Display::flip_display();
-}
-
-void
-Loading::draw_progress(const std::string& str, float progress)
-{
-  if (!is_init)
-    init();
-
-  CL_Display::clear();
-
-  sur.draw((CL_Display::get_width() - sur.get_width())/2,
-                (CL_Display::get_height() - sur.get_height())/2);
-
-  CL_Font myfont = font;
-  myfont.set_alignment(origin_top_center);
-  myfont.draw(CL_Display::get_width() / 2,
-              CL_Display::get_height() - 130,
-              str);
-
-  CL_Display::fill_rect(CL_Rect(50, CL_Display::get_height() - 100,
-                                CL_Display::get_width() - 50, 
CL_Display::get_height() - 50),
-                       Color(128, 128, 128));
-
-  CL_Display::fill_rect(CL_Rect(50, CL_Display::get_height() - 100,
-                                50 + (int)((CL_Display::get_width()-100) * 
progress), 
-                                CL_Display::get_height() - 50),
-                       Color(255, 0, 0));
-
-  Display::flip_display();
-}
-
-
-/* EOF */

Deleted: branches/pingus_sdl/src/loading.hxx
===================================================================
--- branches/pingus_sdl/src/loading.hxx 2007-01-16 07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/loading.hxx 2007-01-17 09:29:29 UTC (rev 2673)
@@ -1,55 +0,0 @@
-//  $Id: loading.hxx,v 1.8 2003/10/19 12:25:47 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#ifndef HEADER_PINGUS_LOADING_HXX
-#define HEADER_PINGUS_LOADING_HXX
-
-#include "pingus.hxx"
-#include <ClanLib/Display/surface.h>
-
-class CL_Font;
-
-
-class Loading
-{
-private:
-  CL_Surface sur;
-  CL_Font    font;
-  bool is_init;
-
-public:
-  Loading ();
-  ~Loading ();
-
-  void init ();
-  void draw ();
-  void draw_progress (const std::string& str, float progress);
-
-private:
-  Loading (const Loading&);
-  Loading& operator= (const Loading&);
-};
-
-extern Loading loading_screen;
-
-
-#endif
-
-/* EOF */
-

Modified: branches/pingus_sdl/src/pingus_main.cxx
===================================================================
--- branches/pingus_sdl/src/pingus_main.cxx     2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/pingus_main.cxx     2007-01-17 09:29:29 UTC (rev 
2673)
@@ -982,7 +982,6 @@
   Resource::deinit();
 }
 
-
 int main(int argc, char** argv)
 {
   PingusMain app;

Deleted: branches/pingus_sdl/src/pingus_map_manager.cxx
===================================================================
--- branches/pingus_sdl/src/pingus_map_manager.cxx      2007-01-16 07:58:00 UTC 
(rev 2672)
+++ branches/pingus_sdl/src/pingus_map_manager.cxx      2007-01-17 09:29:29 UTC 
(rev 2673)
@@ -1,49 +0,0 @@
-//  $Id: pingus_map_manager.cxx,v 1.6 2003/10/21 11:01:52 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#include <ClanLib/Display/surface.h>
-#include <ClanLib/Display/pixel_buffer.h>
-#include "pingus_map_manager.hxx"
-
-
-std::string PingusMapManager::directory;
-
-CL_Surface
-PingusMapManager::get_surface (const std::string& level_filename)
-{
-  UNUSED_ARG(level_filename);
-  return CL_Surface ();
-}
-
-void
-PingusMapManager::set_surface (const std::string& level_filename, const 
CL_Surface& surf)
-{
-  PixelBuffer provider = surf.get_pixeldata();
-
-  provider.lock ();
-
-  //provider->get_data ();
-
-  provider.unlock ();
-
-  UNUSED_ARG(level_filename);
-}
-
-
-/* EOF */

Deleted: branches/pingus_sdl/src/pingus_map_manager.hxx
===================================================================
--- branches/pingus_sdl/src/pingus_map_manager.hxx      2007-01-16 07:58:00 UTC 
(rev 2672)
+++ branches/pingus_sdl/src/pingus_map_manager.hxx      2007-01-17 09:29:29 UTC 
(rev 2673)
@@ -1,47 +0,0 @@
-//  $Id: pingus_map_manager.hxx,v 1.7 2003/10/18 23:17:27 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 2000 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#ifndef HEADER_PINGUS_PINGUS_MAP_MANAGER_HXX
-#define HEADER_PINGUS_PINGUS_MAP_MANAGER_HXX
-
-#include "pingus.hxx"
-#include <string>
-#include <assert.h>
-
-class CL_Surface;
-
-
-class PingusMapManager
-{
-private:
-  static std::string directory;
-
-public:
-  static CL_Surface get_surface (const std::string& level_filename);
-  static void set_surface (const std::string& level_filename, const 
CL_Surface&);
-
-private:
-  PingusMapManager (const PingusMapManager&);
-  PingusMapManager& operator= (const PingusMapManager&);
-};
-
-
-#endif
-
-/* EOF */

Added: branches/pingus_sdl/src/pixel_buffer.cpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.cpp    2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/pixel_buffer.cpp    2007-01-17 09:29:29 UTC (rev 
2673)
@@ -0,0 +1,44 @@
+/*  $Id$
+**   __      __ __             ___        __   __ __   __
+**  /  \    /  \__| ____    __| _/_______/  |_|__|  | |  |   ____
+**  \   \/\/   /  |/    \  / __ |/  ___/\   __\  |  | |  | _/ __ \
+**   \        /|  |   |  \/ /_/ |\___ \  |  | |  |  |_|  |_\  ___/
+**    \__/\  / |__|___|  /\____ /____  > |__| |__|____/____/\___  >
+**         \/          \/      \/    \/                         \/
+**  Copyright (C) 2005 Ingo Ruhnke <address@hidden>
+**
+**  This program is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU General Public License
+**  as published by the Free Software Foundation; either version 2
+**  of the License, or (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+** 
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+**  02111-1307, USA.
+*/
+
+#include "pixel_buffer.hpp"
+
+PixelBuffer::PixelBuffer()
+{
+}
+
+PixelBuffer::PixelBuffer(int width_, int height_)
+  : width(width_),
+    height(height_)
+{
+  data = new unsigned char[4 * width * height];
+}
+
+PixelBuffer::~PixelBuffer()
+{
+  delete[] data;
+}
+
+/* EOF */

Modified: branches/pingus_sdl/src/pixel_buffer.hpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.hpp    2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/pixel_buffer.hpp    2007-01-17 09:29:29 UTC (rev 
2673)
@@ -30,10 +30,18 @@
 class PixelBuffer
 {
 private:
+  int width;
+  int height;
+  unsigned char* data;
+
 public:
-  PixelBuffer() {}
-  int get_width()  const { return 0; }
-  int get_height() const { return 0; }
+  PixelBuffer();
+  PixelBuffer(int width, int height);
+  ~PixelBuffer();
+
+  unsigned char* get_data() { return data; }
+  int get_width()  const { return width; }
+  int get_height() const { return height; }
 };
 
 #endif

Deleted: branches/pingus_sdl/src/range.cxx
===================================================================
--- branches/pingus_sdl/src/range.cxx   2007-01-16 07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/range.cxx   2007-01-17 09:29:29 UTC (rev 2673)
@@ -1,133 +0,0 @@
-//  $Id: range.cxx,v 1.3 2003/10/18 23:17:27 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#include <algorithm>
-#include "range.hxx"
-
-
-#ifdef WIN32
-void swap(int& a, int& b)
-{
-  int aold = a;
-  a = b;
-  b = aold;
-}
-#endif /* WIN32 */
-
-Range::Range()
-{
-  start = 0;
-  stop = 100;
-}
-
-Range::Range(int a, int b)
-{
-  set_range(a, b);
-}
-
-Range::Range(int b)
-{
-  start = 0;
-  stop  = b;
-
-  if (start > stop)
-    std::swap(start, stop);
-}
-
-Range::Range(const Range& range)
-{
-  start = range.start;
-  stop = range.stop;
-  count = range.count;
-}
-
-Range::~Range()
-{
-  // do nothing
-}
-
-Range&
-Range::operator=(const Range& range)
-{
-  if (this != &range) {
-    count = range.count;
-    start = range.start;
-    stop  = range.stop;
-  }
-  return *this;
-}
-
-Range&
-Range::operator++()
-{
-  ++count;
-  check_range();
-
-  return *this;
-}
-
-Range&
-Range::operator+=(int a)
-{
-  count += a;
-  check_range();
-
-  return *this;
-}
-
-Range&
-Range::operator-=(int a)
-{
-  count -= a;
-  check_range();
-
-  return *this;
-}
-
-Range&
-Range::operator=(int a)
-{
-  count = a;
-  check_range();
-
-  return *this;
-}
-
-
-void
-Range::set_range(int a, int b)
-{
-  start = a;
-  stop  = b;
-
-  if (start > stop)
-    std::swap(start, stop);
-}
-
-void
-Range::check_range()
-{
-  if (count > stop)
-    count = stop;
-  if (count < start)
-    count = start;
-}
-
-
-/* EOF */

Deleted: branches/pingus_sdl/src/range.hxx
===================================================================
--- branches/pingus_sdl/src/range.hxx   2007-01-16 07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/range.hxx   2007-01-17 09:29:29 UTC (rev 2673)
@@ -1,63 +0,0 @@
-//  $Id: range.hxx,v 1.7 2003/10/18 23:17:27 grumbel Exp $
-//
-//  Pingus - A free Lemmings clone
-//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
-//
-//  This program is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU General Public License
-//  as published by the Free Software Foundation; either version 2
-//  of the License, or (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-#ifndef HEADER_PINGUS_RANGE_HXX
-#define HEADER_PINGUS_RANGE_HXX
-
-#include "pingus.hxx"
-
-
-/** A class similar to an integer, but keeps the value in a given range.
-
-    @deprecated The idea of this class is to keep a value inside a,
-    but this class is a bit cheap and I don't really know if we need
-    it or if we should handle the range-keeping in the client
-    source. */
-class Range
-{
-private:
-  int count;
-  int start;
-  int stop;
-  void check_range();
-public:
-  Range();
-  Range(int b);
-  Range(int a, int b);
-  Range(const Range&);
-  ~Range();
-
-  Range& operator=(const Range&);
-
-  operator int() const {
-    return count;
-  }
-
-  Range& operator++();
-  Range& operator+=(int a);
-  Range& operator-=(int a);
-  Range& operator=(int a);
-
-  void set_range(int, int);
-};
-
-
-#endif
-
-/* EOF */

Added: branches/pingus_sdl/src/sexpr_pingus_level.cxx
===================================================================
--- branches/pingus_sdl/src/sexpr_pingus_level.cxx      2007-01-16 07:58:00 UTC 
(rev 2672)
+++ branches/pingus_sdl/src/sexpr_pingus_level.cxx      2007-01-17 09:29:29 UTC 
(rev 2673)
@@ -0,0 +1,36 @@
+/*  $Id$
+**   __      __ __             ___        __   __ __   __
+**  /  \    /  \__| ____    __| _/_______/  |_|__|  | |  |   ____
+**  \   \/\/   /  |/    \  / __ |/  ___/\   __\  |  | |  | _/ __ \
+**   \        /|  |   |  \/ /_/ |\___ \  |  | |  |  |_|  |_\  ___/
+**    \__/\  / |__|___|  /\____ /____  > |__| |__|____/____/\___  >
+**         \/          \/      \/    \/                         \/
+**  Copyright (C) 2005 Ingo Ruhnke <address@hidden>
+**
+**  This program is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU General Public License
+**  as published by the Free Software Foundation; either version 2
+**  of the License, or (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+** 
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+**  02111-1307, USA.
+*/
+
+#include "sexpr_pingus_level.hpp"
+
+SExrPingusLevel::SExrPingusLevel(const std::string& res_name,
+                                 const std::string& filename)
+{
+   impl->resname = res_name;
+
+   
+}
+
+/* EOF */

Added: branches/pingus_sdl/src/sexpr_pingus_level.hxx
===================================================================
--- branches/pingus_sdl/src/sexpr_pingus_level.hxx      2007-01-16 07:58:00 UTC 
(rev 2672)
+++ branches/pingus_sdl/src/sexpr_pingus_level.hxx      2007-01-17 09:29:29 UTC 
(rev 2673)
@@ -0,0 +1,37 @@
+//  $Id$
+// 
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+// 
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+#ifndef HEADER_SEXPR_PINGUS_LEVEL_HXX
+#define HEADER_SEXPR_PINGUS_LEVEL_HXX
+
+#include "pingus_level.hxx"
+
+/** */
+class SExprPingusLevel : public PingusLevel
+{
+private:
+public:
+  SExrPingusLevel(const std::string& res_name,
+                  const std::string& filename);
+};
+
+
+#endif
+
+/* EOF */

Modified: branches/pingus_sdl/src/story_screen.cxx
===================================================================
--- branches/pingus_sdl/src/story_screen.cxx    2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/story_screen.cxx    2007-01-17 09:29:29 UTC (rev 
2673)
@@ -19,7 +19,6 @@
 
 #include <algorithm>
 #include <vector>
-#include <ClanLib/Display/surface.h>
 #include "gettext.h"
 #include "resource.hxx"
 #include "gui/gui_manager.hxx"
@@ -42,7 +41,7 @@
 class StoryScreenComponent : public GUI::Component
 {
 private:
-  CL_Sprite background;
+  Sprite background;
   std::string display_text;
   float time_passed;
 
@@ -50,7 +49,7 @@
 
   WorldMapNS::WorldMapStory *story;
   std::vector<StoryPage> pages;
-  CL_Sprite page_surface;
+  Sprite page_surface;
   StoryPage  current_page;
 public:
   StoryScreenComponent (WorldMapNS::WorldMapStory *arg_pages);
@@ -70,7 +69,7 @@
   StoryScreenComponent* story_comp;
 public:
   StoryScreenContinueButton(StoryScreenComponent* arg_story_comp)
-    : GUI::SurfaceButton(CL_Display::get_width()/2 + 220, 
CL_Display::get_height()/2 + 160,
+    : GUI::SurfaceButton(Display::get_width()/2 + 220, Display::get_height()/2 
+ 160,
                          ResDescriptor("core/misc/next"),
                          ResDescriptor("core/misc/next"),
                          ResDescriptor("core/misc/next_hover")),
@@ -117,15 +116,15 @@
 void
 StoryScreenComponent::draw (DrawingContext& gc)
 {
-  gc.draw(background, Vector(gc.get_width()/2, gc.get_height()/2));
+  gc.draw(background, Vector3f(gc.get_width()/2, gc.get_height()/2));
 
-  gc.print_center(Fonts::chalk_large, 
static_cast<float>(CL_Display::get_width()/2),
-                  static_cast<float>(CL_Display::get_height()/2 - 200), 
story->get_title());
-  gc.draw(page_surface, Vector(gc.get_width()/2, gc.get_height()/2 - 65));
+  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_left(Fonts::chalk_normal,
-                static_cast<float>(CL_Display::get_width()/2  - 280),
-                static_cast<float>(CL_Display::get_height()/2 + 35),
+                static_cast<float>(Display::get_width()/2  - 280),
+                static_cast<float>(Display::get_height()/2 + 35),
                 display_text);
 }
 

Modified: branches/pingus_sdl/src/theme_selector.cxx
===================================================================
--- branches/pingus_sdl/src/theme_selector.cxx  2007-01-16 07:58:00 UTC (rev 
2672)
+++ branches/pingus_sdl/src/theme_selector.cxx  2007-01-17 09:29:29 UTC (rev 
2673)
@@ -31,7 +31,6 @@
 #include "theme_selector.hxx"
 #include "pingus_error.hxx"
 #include "resource.hxx"
-#include "loading.hxx"
 #include "sound/sound.hxx"
 #include "path_manager.hxx"
 #include "system.hxx"

Modified: branches/pingus_sdl/src/worldobjs/surface_background.cxx
===================================================================
--- branches/pingus_sdl/src/worldobjs/surface_background.cxx    2007-01-16 
07:58:00 UTC (rev 2672)
+++ branches/pingus_sdl/src/worldobjs/surface_background.cxx    2007-01-17 
09:29:29 UTC (rev 2673)
@@ -65,32 +65,30 @@
   if (color.a > 1.0)
     std::cout << "Background: Warning dim larger than 1.0 are no longer 
supported" << std::endl;
 
+#if 0
   PixelBuffer canvas = Resource::load_pixelbuffer(desc);
 
   // Scaling Code
   if (stretch_x && stretch_y)
     {
-      ////canvas = Blitter::scale_surface_to_canvas(canvas, 
world->get_width(), world->get_height());
+      canvas = Blitter::scale_surface_to_canvas(canvas, world->get_width(), 
world->get_height());
     }
   else if (stretch_x && !stretch_y)
     {
       if (keep_aspect)
         {
-#if 0
           float aspect = canvas.get_height()/float(canvas.get_width());
           canvas = Blitter::scale_surface_to_canvas(canvas,
                                                     world->get_width(),
                                                     
int(world->get_width()*aspect));
-#endif
         }
       else
         {
-          ////canvas = Blitter::scale_surface_to_canvas(canvas, 
canvas.get_width(), world->get_height());
+          canvas = Blitter::scale_surface_to_canvas(canvas, 
canvas.get_width(), world->get_height());
         }
     }
   else if (!stretch_x && stretch_y)
     {
-#if 0
       if (keep_aspect)
         {
           float aspect = float(canvas.get_width())/canvas.get_height();
@@ -102,13 +100,13 @@
         {
           canvas = Blitter::scale_surface_to_canvas(canvas, 
canvas.get_width(), world->get_height());
         }
-#endif
     }
 
-#if 0
   SpriteDescription sprite_desc;
   sprite_desc.add_frame(canvas);
   bg_surface = Sprite(sprite_desc);
+#else
+  bg_surface = Resource::load_sprite(desc);
 #endif
 
   timer.stop();
@@ -155,7 +153,7 @@
 
   if (fast_mode)
     {
-      ////Display::clear();
+      Display::clear();
     }
   else
     {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]