pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r2666 - in branches/pingus_sdl/src: . display


From: grumbel at BerliOS
Subject: [Pingus-CVS] r2666 - in branches/pingus_sdl/src: . display
Date: Tue, 16 Jan 2007 03:40:46 +0100

Author: grumbel
Date: 2007-01-16 03:40:45 +0100 (Tue, 16 Jan 2007)
New Revision: 2666

Added:
   branches/pingus_sdl/src/display/scene_node.cxx
   branches/pingus_sdl/src/display/scene_test.cxx
   branches/pingus_sdl/src/pixel_buffer.hpp
   branches/pingus_sdl/src/sprite_description.hpp
Removed:
   branches/pingus_sdl/src/level_desc.cxx
   branches/pingus_sdl/src/level_desc.hxx
   branches/pingus_sdl/src/level_interrupt.cxx
   branches/pingus_sdl/src/level_interrupt.hxx
   branches/pingus_sdl/src/level_result.cxx
   branches/pingus_sdl/src/level_result.hxx
   branches/pingus_sdl/src/result.cxx
Modified:
   branches/pingus_sdl/src/SConscript
Log:
- some missing files added, some obsolete ones removed

Modified: branches/pingus_sdl/src/SConscript
===================================================================
--- branches/pingus_sdl/src/SConscript  2007-01-16 02:33:09 UTC (rev 2665)
+++ branches/pingus_sdl/src/SConscript  2007-01-16 02:40:45 UTC (rev 2666)
@@ -60,8 +60,6 @@
 # # 'gui/buffer_graphic_context.cxx', 
 # # 'indexed_canvas.cxx', 
 # # 'input/axes/mouse_axis.cxx', 
-# # 'level_desc.cxx', 
-# # 'level_result.cxx', 
 # # 'pingus_level_test.cxx', 
 # # 'sound/slot_manager.cxx', 
 # # 'target_provider.cxx', 
@@ -231,7 +229,6 @@
 'resource.cxx',
 'resource_manager.cpp', 
 'resource_modifier.cxx', 
-'result.cxx', 
 'result_screen.cxx', 
 'savegame.cxx', 
 'savegame_manager.cxx', 

Added: branches/pingus_sdl/src/display/scene_node.cxx
===================================================================
--- branches/pingus_sdl/src/display/scene_node.cxx      2007-01-16 02:33:09 UTC 
(rev 2665)
+++ branches/pingus_sdl/src/display/scene_node.cxx      2007-01-16 02:40:45 UTC 
(rev 2666)
@@ -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 "scene_node.hxx"
+
+SceneNode::SceneNode()
+{
+}
+
+SceneNode::~SceneNode()
+{
+}
+
+/* EOF */

Added: branches/pingus_sdl/src/display/scene_test.cxx
===================================================================
--- branches/pingus_sdl/src/display/scene_test.cxx      2007-01-16 02:33:09 UTC 
(rev 2665)
+++ branches/pingus_sdl/src/display/scene_test.cxx      2007-01-16 02:40:45 UTC 
(rev 2666)
@@ -0,0 +1,65 @@
+#include <SDL.h>
+#include <SDL_image.h>
+#include <stdlib.h>
+#include <iostream>
+#include "scene_graph.hxx"
+#include "sprite_node.hxx"
+
+SDL_Surface* global_screen;
+
+int main()
+{
+  if(SDL_Init(SDL_INIT_VIDEO) < 0) {
+    std::cerr << "Unable to init SDL: " << SDL_GetError() << std::endl;
+    exit(1);
+  }
+  atexit(SDL_Quit);
+
+
+  global_screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
+
+  SDL_Event event;
+
+  SDL_Surface* surface = 
IMG_Load("/home/ingo/projects/pingus/svn/trunk/data/images/pingus/player0/tumble.png");
+
+  SceneGraph graph;
+  SpriteNode* sprite = new 
SpriteNode("/home/ingo/projects/pingus/svn/trunk/data/images/pingus/player0/tumble.png");
+  graph.add(sprite);
+
+  sprite->set_pos(Point(100, 100));
+
+  while(1)
+    {
+      while(SDL_PollEvent(&event)) 
+        {
+          switch (event.type)
+            {
+            case SDL_KEYDOWN:
+              std::cout << "Keypress" << std::endl;
+              break;
+
+            case SDL_QUIT:
+              exit(EXIT_SUCCESS);
+              break;
+            }
+        }
+
+      sprite->set_pos(Point(rand()%800, rand()%600));
+
+      graph.render();
+      {
+        SDL_Rect rect;
+        rect.x = 320;
+        rect.y = 200;
+        SDL_BlitSurface(surface, NULL, global_screen, &rect);
+      }
+
+      SDL_Flip(global_screen);
+
+      std::cout << "." << std::endl;
+      SDL_Delay(100);
+    }
+}
+
+/* EOF */
+

Deleted: branches/pingus_sdl/src/level_desc.cxx
===================================================================
--- branches/pingus_sdl/src/level_desc.cxx      2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_desc.cxx      2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,103 +0,0 @@
-//  $Id: level_desc.cxx,v 1.15 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 <stdio.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
-#include "gui/display.hxx"
-#include "resource.hxx"
-#include "level_desc.hxx"
-#include "fonts.hxx"
-#include "system.hxx"
-#include "gettext.h"
-
-
-PingusLevelDesc::PingusLevelDesc(const PingusLevel& arg_plf)
-{
-  plf = arg_plf;
-
-  background = Resource::load_surface("Textures/stone", "textures");
-  font       = Fonts::pingus_small;
-  title      = Fonts::pingus_large;
-
-  description.set_font(font);
-  description.set_text(_(plf->get_description()), 350);
-  levelname = _(plf->get_levelname());
-}
-
-void
-PingusLevelDesc::draw(PingusLevelDesc::LoadingStatus status)
-{
-  int x_pos = CL_Display::get_width() / 2 ;
-  int y_pos = 120;
-
-  for(int y = 0; y < CL_Display::get_height(); y += background.get_height())
-    for(int x = 0; x < CL_Display::get_width(); x += background.get_width())
-      background.draw(x, y);
-
-  CL_Display::fill_rect(0, 0, CL_Display::get_width(), 
CL_Display::get_height(), 0.0, 0.0, 0.0, 0.5);
-
-  title->print_center(CL_Display::get_width() / 2, 50, levelname.c_str());
-
-  {
-    CL_Display::fill_rect(x_pos - description.get_width()/2 - 15,
-                         y_pos - 15,
-                         x_pos + description.get_width()/2 + 15,
-                         y_pos + description.get_height() + 15,
-                         0.0, 0.0, 0.0, 0.5);
-    description.print_center(x_pos, y_pos);
-    y_pos += description.get_height() + 40;
-  }
-
-  if (!plf->get_author().empty())
-    {
-      font->print_center(CL_Display::get_width() / 2,
-                        CL_Display::get_height() - 30,
-                        (_("Designed by ") + plf->get_author()).c_str());
-    }
-
-  {
-    char str[64];
-    snprintf(str, 64, _("Pingus to Save: %d"), plf->get_number_to_save());
-    font->print_center(CL_Display::get_width() / 2, y_pos, str);
-    snprintf(str, 64, _("Number of Pingus: %d"), plf->get_pingus());
-    font->print_center(CL_Display::get_width() / 2, (y_pos += 20), str);
-  }
-
-  if (status == LOADING) {
-    font->print_center(CL_Display::get_width() / 2, CL_Display::get_height() - 
80, _("Loading..."));
-    Display::flip_display();
-  } else {
-    font->print_center(CL_Display::get_width() / 2, CL_Display::get_height() - 
80, _("Loading finished. Press a mouse button to start the level"));
-    Display::flip_display();
-
-    /*
-    // FIXME: Busy waiting... ugly
-    while (!controller->pause->is_pressed () && !controller->left->is_pressed 
())
-      {
-       CL_System::keep_alive();
-       CL_System::sleep (50);
-      }
-    */
-  }
-}
-
-
-/* EOF */
-

Deleted: branches/pingus_sdl/src/level_desc.hxx
===================================================================
--- branches/pingus_sdl/src/level_desc.hxx      2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_desc.hxx      2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,55 +0,0 @@
-//  $Id: level_desc.hxx,v 1.8 2003/10/20 19:28:54 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_LEVEL_DESC_HXX
-#define HEADER_PINGUS_LEVEL_DESC_HXX
-
-#include <ClanLib/Display/surface.h>
-#include "multiline_text.hxx"
-
-class CL_Font;
-
-
-///
-class PingusLevelDesc
-{
-private:
-  CL_Surface background;
-  CL_Surface level;
-  CL_Font font;
-  CL_Font title;
-  PingusLevel plf;
-  
-  MultiLineText description;
-  std::string levelname;
-public:
-  enum LoadingStatus { LOADING, FINISHED };
-  PingusLevelDesc(const PingusLevel&);
-
-  void draw(PingusLevelDesc::LoadingStatus status);
-
-private:
-  PingusLevelDesc (const PingusLevelDesc&);
-  PingusLevelDesc& operator= (const PingusLevelDesc&);
-};
-
-
-#endif
-
-/* EOF */

Deleted: branches/pingus_sdl/src/level_interrupt.cxx
===================================================================
--- branches/pingus_sdl/src/level_interrupt.cxx 2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_interrupt.cxx 2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,39 +0,0 @@
-//  $Id: level_interrupt.cxx,v 1.2 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 "level_interrupt.hxx"
-
-
-LevelInterrupt::LevelInterrupt()
-{
-}
-
-LevelInterrupt::LevelInterrupt(Status s)
-{
-  status = s;
-}
-
-LevelInterrupt::Status
-LevelInterrupt::get_status()
-{
-  return status;
-}
-
-
-/* EOF */

Deleted: branches/pingus_sdl/src/level_interrupt.hxx
===================================================================
--- branches/pingus_sdl/src/level_interrupt.hxx 2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_interrupt.hxx 2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,45 +0,0 @@
-//  $Id: level_interrupt.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_LEVEL_INTERRUPT_HXX
-#define HEADER_PINGUS_LEVEL_INTERRUPT_HXX
-
-#include "pingus.hxx"
-
-
-class LevelInterrupt
-{
-public:
-  enum Status { restart, quit, select_new, undef };
-
-  LevelInterrupt ();
-  LevelInterrupt (Status s);
-
-  Status get_status();
-private:
-  Status status;
-
-  LevelInterrupt (const LevelInterrupt&);
-  LevelInterrupt& operator= (const LevelInterrupt&);
-};
-
-
-#endif
-
-/* EOF */

Deleted: branches/pingus_sdl/src/level_result.cxx
===================================================================
--- branches/pingus_sdl/src/level_result.cxx    2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_result.cxx    2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,132 +0,0 @@
-//  $Id: level_result.cxx,v 1.18 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 <stdio.h>
-#include <ClanLib/Core/System/system.h>
-#include <ClanLib/Display/display.h>
-#include <ClanLib/Display/font.h>
-#include <ClanLib/Display/mouse.h>
-
-#include "gui/display.hxx"
-#include "resource.hxx"
-#include "level_result.hxx"
-#include "sound/sound.hxx"
-#include "world.hxx"
-#include "pingu_holder.hxx"
-#include "fonts.hxx"
-#include "gettext.h"
-#include "input/controller.hxx"
-
-
-PingusLevelResult::PingusLevelResult(World* w, Controller* c)
-{
-  font  = Fonts::pingus_small;
-  title = Fonts::pingus_large;
-  background = Resource::load_surface("Textures/stone", "textures");
-  //result = r;
-  world = w;
-  controller = c;
-}
-
-void
-PingusLevelResult::draw(void)
-{
-  char str[128];
-
-  PingusSound::play_music("pingus-2.it");
-
-  for(int y = 0; y < CL_Display::get_height(); y += background.get_height())
-    for(int x = 0; x < CL_Display::get_width(); x += background.get_width())
-      background.draw(x, y);
-
-  CL_Display::fill_rect(0, 0, CL_Display::get_width(), 
CL_Display::get_height(), 0.0, 0.0, 0.0, 0.5);
-
-  title->print_center(CL_Display::get_width() / 2, 50, _("Results:"));
-
-  /* Ending messages are censored for the momement
-    font->print_center(CL_Display::get_width() / 2, 100,
-                    get_message(100 * world->get_saved_pingus() / 
world->get_allowed_pingus()).c_str());
-  */
-  snprintf(str, 128, _("Pingus saved:   %3d/%3d"),
-           world->get_pingus()->get_number_of_exited(),
-          world->get_pingus()->get_number_of_allowed());
-  font->print_center(CL_Display::get_width() / 2, 140, str);
-
-  snprintf(str, 128, _("Pingus died:  %3d/%3d"),
-         world->get_pingus()->get_number_of_allowed()
-           - world->get_pingus()->get_number_of_exited(),
-         world->get_pingus()->get_number_of_allowed());
-  font->print_center(CL_Display::get_width() / 2, 160, str);
-
-  /*
-  snprintf(str, 128, _("Required Time: %2d:%2d:%2d"),
-         result.time / (60 * game_speed),
-         result.time / game_speed % 60,
-         (result.time * 100) / game_speed % 100);
-  */
-
-  //font->print_center(CL_Display::get_width() / 2, 180, str);
-
-  font->print_center(CL_Display::get_width()/2, CL_Display::get_height() - 80,
-                    _("Press button to continue..."));
-  Display::flip_display();
-
-  while(!CL_Mouse::left_pressed())
-    CL_System::keep_alive();
-
-  while(CL_Mouse::left_pressed())
-    CL_System::keep_alive();
-}
-
-std::string
-PingusLevelResult::get_message (int saved)
-{
-  if (saved == 100) {
-    return _("As many Pingus escaped as entered the level. That's going to be 
hard to beat.... unless this game becomes pornographic.");
-  } else if (saved > 90) {
-    return _("Very impressive indeed.");
-  } else if (saved > 80) {
-    return _("Good work. Still room for improvement though.");
-  } else if (saved > 70) {
-    return _("Not too shabby, not too shabby at all.");
-  } else if (saved > 60) {
-    return _("That was OK, but Pingu life insurance premiums have just gotten 
more expensive.");
-  } else if (saved > 55) {
-    return _("Maybe this level calls for a different strategy.");
-  } else if (saved > 50) {
-    return _("Exactly half. Are you saving only the female ones?");
-  } else if (saved > 40) {
-    return _("If I were a Pingu, I never would have left that entrance.");
-  } else if (saved > 30) {
-    return _("Maybe you would feel more at home playing Quake.");
-  } else if (saved > 20) {
-    return _("Maybe this level calls for a different strategy. Like attempting 
to save them, for example.");
-  } else if (saved > 10) {
-    return _("Ever considered a career as a Pingu exterminator?");
-  } else if (saved > 0) {
-    return _("You missed one! What's your excuse!?");
-  } else if (saved == 0) {
-    return _("Please reassure me that you hit the Armageddon button.");
-  } else {
-    return _("You've got a negative save/total value, something is buggy.");
-  }
-}
-
-
-/* EOF */

Deleted: branches/pingus_sdl/src/level_result.hxx
===================================================================
--- branches/pingus_sdl/src/level_result.hxx    2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/level_result.hxx    2007-01-16 02:40:45 UTC (rev 
2666)
@@ -1,55 +0,0 @@
-//  $Id: level_result.hxx,v 1.7 2003/10/20 19:28:54 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_LEVEL_RESULT_HXX
-#define HEADER_PINGUS_LEVEL_RESULT_HXX
-
-#include "pingus.hxx"
-#include <ClanLib/Display/surface.h>
-
-class CL_Font;
-
-
-class World;
-class Controller;
-
-class PingusLevelResult
-{
-private:
-  CL_Surface  background;
-  CL_Font     title;
-  CL_Font     font;
-  World*      world;
-  Controller* controller;
-
-public:
-  PingusLevelResult(World*, Controller* c);
-
-  void draw(void);
-  std::string get_message(int);
-
-private:
-  PingusLevelResult (const PingusLevelResult&);
-  PingusLevelResult& operator= (const PingusLevelResult&);
-};
-
-
-#endif
-
-/* EOF */

Added: branches/pingus_sdl/src/pixel_buffer.hpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.hpp    2007-01-16 02:33:09 UTC (rev 
2665)
+++ branches/pingus_sdl/src/pixel_buffer.hpp    2007-01-16 02:40:45 UTC (rev 
2666)
@@ -0,0 +1,41 @@
+/*  $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_PIXEL_BUFFER_HPP
+#define HEADER_PIXEL_BUFFER_HPP
+
+/** */
+class PixelBuffer
+{
+private:
+public:
+  PixelBuffer() {}
+  int get_width()  const { return 0; }
+  int get_height() const { return 0; }
+};
+
+#endif
+
+/* EOF */

Deleted: branches/pingus_sdl/src/result.cxx
===================================================================
--- branches/pingus_sdl/src/result.cxx  2007-01-16 02:33:09 UTC (rev 2665)
+++ branches/pingus_sdl/src/result.cxx  2007-01-16 02:40:45 UTC (rev 2666)
@@ -1,112 +0,0 @@
-//  $Id: result.cxx,v 1.4 2003/10/21 21:37:06 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 <iostream>
-//#include "result.hxx"
-
-
-/*Result::Result()
-{
-  n_action = LevelInterrupt::quit;
-  total = 0;
-  killed = 0;
-  saved = 0;
-}
-
-int
-Result::get_total()
-{
-  return total;
-}
-
-int
-Result::get_killed()
-{
-  return killed;
-}
-
-int
-Result::get_saved()
-{
-  return saved;
-}
-
-int
-Result::get_time()
-{
-  return time;
-}
-
-int
-Result::set_total(int t)
-{
-  return total = t;
-}
-int
-Result::set_killed(int k)
-{
-  return killed = k;
-}
-
-int
-Result::set_saved(int s)
-{
-  return saved = s;
-}
-
-int
-Result::set_time(int t)
-{
-  return time = t;
-}
-
-void
-Result::print()
-{
-  std::cout << "Pingus Results:" << endl
-       << "-=-=-=-=-=-=-=-=-=-=-=-=-" << endl
-       << "Saved:       "   << saved  << endl
-       << "Killed:      "   << killed << endl
-       << "Unknown:     "  << unknown << endl
-       << "Unreleased:          ???"  << endl
-       << "-------------------------" << endl
-       << "Pingus total:  " << total  << std::endl;
-}
-
-LevelInterrupt
-Result::next_action(void)
-{
-  return n_action;
-}
-
-void
-Result::next_action(LevelInterrupt n)
-{
-  n_action = n;
-}
-
-int
-Result::set_unknown(int a)
-{
-  return unknown = a;
-}
-*/
-
-
-/* EOF */

Added: branches/pingus_sdl/src/sprite_description.hpp
===================================================================
--- branches/pingus_sdl/src/sprite_description.hpp      2007-01-16 02:33:09 UTC 
(rev 2665)
+++ branches/pingus_sdl/src/sprite_description.hpp      2007-01-16 02:40:45 UTC 
(rev 2666)
@@ -0,0 +1,87 @@
+/*  $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_SPRITE_DESCRIPTION_HPP
+#define HEADER_SPRITE_DESCRIPTION_HPP
+
+#include "math/vector2i.hpp"
+#include "math/size.hpp"
+#include "math/origin.hpp"
+#include "file_reader.hxx"
+
+/** */
+class SpriteDescription
+{
+public:
+  std::string filename;
+  Vector2i    offset;
+  Origin      origin;
+
+  bool        loop;
+  int         speed; 
+  Size        array;
+  Vector2i    frame_pos;
+  Size        frame_size;  
+
+  SpriteDescription() 
+    : origin(origin_top_left),
+      loop(true),
+      speed(30),
+      array(1, 1),
+      frame_size(-1, -1)
+  {}
+
+  SpriteDescription(const FileReader& reader)
+    : origin(origin_top_left),
+      loop(true),
+      speed(30),
+      array(1, 1),
+      frame_size(-1, -1)
+  {
+    reader.read_int   ("speed",  speed);
+    reader.read_bool  ("loop",   loop);
+    reader.read_vector2i("offset", offset);
+
+    reader.read_enum("origin", origin, string2origin);
+
+    reader.read_string("image-file",  filename);
+    filename = "data/data/" + filename;// FIXME: Hack
+    reader.read_size("image-array", array);
+    reader.read_vector2i("image-pos",   frame_pos);
+    reader.read_size("image-size",  frame_size);
+  }
+
+  ~SpriteDescription()
+  {  
+  }
+  
+private:
+  SpriteDescription (const SpriteDescription&);
+  SpriteDescription& operator= (const SpriteDescription&);
+};
+
+#endif
+
+/* EOF */





reply via email to

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