pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3792 - in trunk/pingus: . src/display


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3792 - in trunk/pingus: . src/display
Date: Fri, 11 Jul 2008 15:26:41 +0200

Author: grumbel
Date: 2008-07-11 15:26:41 +0200 (Fri, 11 Jul 2008)
New Revision: 3792

Added:
   trunk/pingus/src/display/delta_framebuffer.cpp
   trunk/pingus/src/display/delta_framebuffer.hpp
Modified:
   trunk/pingus/SConstruct
   trunk/pingus/src/display/display.cpp
Log:
Started DeltaFramebuffer

Modified: trunk/pingus/SConstruct
===================================================================
--- trunk/pingus/SConstruct     2008-07-11 13:12:03 UTC (rev 3791)
+++ trunk/pingus/SConstruct     2008-07-11 13:26:41 UTC (rev 3792)
@@ -122,6 +122,7 @@
 'src/gui/combobox.cpp', 
 'src/display/display.cpp', 
 'src/display/sdl_framebuffer.cpp', 
+'src/display/delta_framebuffer.cpp', 
 'src/gui/group_component.cpp', 
 'src/gui/gui_manager.cpp', 
 'src/gui/input_box.cpp', 

Added: trunk/pingus/src/display/delta_framebuffer.cpp
===================================================================
--- trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-11 13:12:03 UTC 
(rev 3791)
+++ trunk/pingus/src/display/delta_framebuffer.cpp      2008-07-11 13:26:41 UTC 
(rev 3792)
@@ -0,0 +1,84 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2008 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 3 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, see <http://www.gnu.org/licenses/>.
+
+#include "delta_framebuffer.hpp"
+
+DeltaFramebuffer::DeltaFramebuffer(Framebuffer* framebuffer_)
+  : framebuffer(framebuffer_)
+{
+}
+
+void
+DeltaFramebuffer::set_video_mode(int width, int height, bool fullscreen)
+{
+  framebuffer->set_video_mode(width, height, fullscreen);
+}
+
+void
+DeltaFramebuffer::flip()
+{
+  framebuffer->flip();
+}
+
+void
+DeltaFramebuffer::push_cliprect(const Rect& rect)
+{
+  framebuffer->push_cliprect(rect);
+}
+
+void
+DeltaFramebuffer::pop_cliprect()
+{
+  framebuffer->pop_cliprect();
+}
+
+void
+DeltaFramebuffer::draw_surface(SDL_Surface* src, const Vector2i& pos)
+{
+  framebuffer->draw_surface(src, pos);
+}
+
+void
+DeltaFramebuffer::draw_surface(SDL_Surface* src, const Rect& srcrect, const 
Vector2i& pos)
+{
+  framebuffer->draw_surface(src, srcrect, pos);
+}
+
+void
+DeltaFramebuffer::draw_line(const Vector2i& pos1, const Vector2i& pos2, const 
Color& color)
+{
+  framebuffer->draw_line(pos1, pos2, color);
+}
+
+void
+DeltaFramebuffer::draw_rect(const Rect& rect, const Color& color)
+{
+  framebuffer->draw_rect(rect, color);
+}
+
+void
+DeltaFramebuffer::fill_rect(const Rect& rect, const Color& color)
+{
+  framebuffer->fill_rect(rect, color);
+}
+
+Size
+DeltaFramebuffer::get_size()
+{
+  return framebuffer->get_size();
+}
+
+/* EOF */


Property changes on: trunk/pingus/src/display/delta_framebuffer.cpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/pingus/src/display/delta_framebuffer.hpp
===================================================================
--- trunk/pingus/src/display/delta_framebuffer.hpp      2008-07-11 13:12:03 UTC 
(rev 3791)
+++ trunk/pingus/src/display/delta_framebuffer.hpp      2008-07-11 13:26:41 UTC 
(rev 3792)
@@ -0,0 +1,54 @@
+//  Pingus - A free Lemmings clone
+//  Copyright (C) 2008 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 3 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, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_DELTA_FRAMEBUFFER_HPP
+#define HEADER_DELTA_FRAMEBUFFER_HPP
+
+#include <memory>
+#include "framebuffer.hpp"
+
+class DeltaFramebuffer : public Framebuffer
+{
+private:
+  std::auto_ptr<Framebuffer> framebuffer;
+
+public:
+  DeltaFramebuffer(Framebuffer* framebuffer);
+
+  void set_video_mode(int width, int height, bool fullscreen);
+  void flip();
+
+  void push_cliprect(const Rect&);
+  void pop_cliprect();
+
+  void draw_surface(SDL_Surface* src, const Vector2i& pos);
+  void draw_surface(SDL_Surface* src, const Rect& srcrect, const Vector2i& 
pos);
+
+  void draw_line(const Vector2i& pos1, const Vector2i& pos2, const Color& 
color);
+
+  void draw_rect(const Rect& rect, const Color& color);
+  void fill_rect(const Rect& rect, const Color& color);
+
+  Size get_size();
+
+private:
+  DeltaFramebuffer (const DeltaFramebuffer&);
+  DeltaFramebuffer& operator= (const DeltaFramebuffer&);
+};
+
+#endif
+
+/* EOF */


Property changes on: trunk/pingus/src/display/delta_framebuffer.hpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: trunk/pingus/src/display/display.cpp
===================================================================
--- trunk/pingus/src/display/display.cpp        2008-07-11 13:12:03 UTC (rev 
3791)
+++ trunk/pingus/src/display/display.cpp        2008-07-11 13:26:41 UTC (rev 
3792)
@@ -23,6 +23,7 @@
 #include "../math/color.hpp"
 #include "../math.hpp"
 #include "sdl_framebuffer.hpp"
+#include "delta_framebuffer.hpp"
 #include "display.hpp"
 
 std::auto_ptr<Framebuffer> Display::framebuffer;
@@ -55,7 +56,7 @@
 Display::set_video_mode(int width, int height, bool fullscreen)
 {
   if (!framebuffer.get())
-    framebuffer = std::auto_ptr<Framebuffer>(new SDLFramebuffer());
+    framebuffer = std::auto_ptr<Framebuffer>(new DeltaFramebuffer(new 
SDLFramebuffer()));
 
   framebuffer->set_video_mode(width, height, fullscreen);
 }





reply via email to

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