[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2861 - in branches/pingus_sdl/src: . worldobjs
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r2861 - in branches/pingus_sdl/src: . worldobjs |
Date: |
Sun, 12 Aug 2007 18:00:32 +0200 |
Author: grumbel
Date: 2007-08-12 18:00:32 +0200 (Sun, 12 Aug 2007)
New Revision: 2861
Modified:
branches/pingus_sdl/src/col_map.cpp
branches/pingus_sdl/src/pixel_buffer.cpp
branches/pingus_sdl/src/pixel_buffer.hpp
branches/pingus_sdl/src/worldobjs/groundpiece.cpp
Log:
- minor cleanup
Modified: branches/pingus_sdl/src/col_map.cpp
===================================================================
--- branches/pingus_sdl/src/col_map.cpp 2007-08-12 15:58:54 UTC (rev 2860)
+++ branches/pingus_sdl/src/col_map.cpp 2007-08-12 16:00:32 UTC (rev 2861)
@@ -188,68 +188,6 @@
if (blit_allowed(x + sur_x, y + sur_y, pixel))
put(x + sur_x, y + sur_y, pixel);
}
-
-#if 0
-
- // FIXME: Little slow
- provider.lock();
- // Rewritting blitter for 32bit depth (using get_pixel())
- for (int y=0; y < provider.get_height(); ++y)
- for (int x=0; x < provider.get_width(); ++x)
- {
- Color color = provider.get_pixel(x, y);
- if (color.a > 32) // Alpha threshold
- {
- if (blit_allowed (x + sur_x, y + sur_y, pixel))
- put(x + sur_x, y + sur_y, pixel);
- }
- }
- provider.unlock();
-
- else if (provider.get_format().get_depth() == 8)
- {
- unsigned char* buffer;
- int swidth = provider.get_width();
- int sheight = provider.get_height();
- int y_offset = -sur_y;
- int x_offset = -sur_x;
- if (y_offset < 0) y_offset = 0;
- if (x_offset < 0) x_offset = 0;
-
- //provider.lock();
- buffer = static_cast<unsigned char*>(provider.get_data());
-
- if (provider.get_format().has_colorkey())
- {
- unsigned int colorkey = provider.get_format().get_colorkey();
- for(int line = y_offset; line < sheight && (line + sur_y) < height;
++line)
- for (int i = x_offset; i < swidth && (i+sur_x) < width; ++i)
- {
- if (buffer[i + (swidth*line)] != colorkey)
- {
- if (blit_allowed (i + sur_x, line + sur_y, pixel))
- colmap[i + (width*(line+sur_y) + sur_x)] = pixel;
- }
- }
- }
- else
- {
- for(int line = y_offset; line < sheight && (line + sur_y) < height;
++line)
- for (int i = x_offset; i < swidth && (i+sur_x) < width; ++i)
- {
- if (blit_allowed (i + sur_x, line + sur_y, pixel))
- colmap[i + (width*(line+sur_y) + sur_x)] = pixel;
- }
- }
- }
- else
- {
- std::cout << "ColMap: Unsupported color depth, ignoring" << std::endl;
- }
-
- // FIXME: Memory hole
- // provider.unlock();
-#endif
}
void
Modified: branches/pingus_sdl/src/pixel_buffer.cpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.cpp 2007-08-12 15:58:54 UTC (rev
2860)
+++ branches/pingus_sdl/src/pixel_buffer.cpp 2007-08-12 16:00:32 UTC (rev
2861)
@@ -28,6 +28,16 @@
#include <iostream>
#include "pixel_buffer.hpp"
+class PixelBufferImpl
+{
+public:
+ PixelBufferImpl(SDL_Surface* surface = NULL) : surface(surface) {}
+ ~PixelBufferImpl() {
+ SDL_FreeSurface(surface);
+ }
+ SDL_Surface* surface;
+};
+
PixelBuffer::PixelBuffer()
{
}
Modified: branches/pingus_sdl/src/pixel_buffer.hpp
===================================================================
--- branches/pingus_sdl/src/pixel_buffer.hpp 2007-08-12 15:58:54 UTC (rev
2860)
+++ branches/pingus_sdl/src/pixel_buffer.hpp 2007-08-12 16:00:32 UTC (rev
2861)
@@ -31,15 +31,7 @@
#include <boost/shared_ptr.hpp>
#include "math/color.hpp"
-class PixelBufferImpl
-{
-public:
- PixelBufferImpl(SDL_Surface* surface = NULL) : surface(surface) {}
- ~PixelBufferImpl() {
- SDL_FreeSurface(surface);
- }
- SDL_Surface* surface;
-};
+class PixelBufferImpl;
/** */
class PixelBuffer
Modified: branches/pingus_sdl/src/worldobjs/groundpiece.cpp
===================================================================
--- branches/pingus_sdl/src/worldobjs/groundpiece.cpp 2007-08-12 15:58:54 UTC
(rev 2860)
+++ branches/pingus_sdl/src/worldobjs/groundpiece.cpp 2007-08-12 16:00:32 UTC
(rev 2861)
@@ -38,6 +38,7 @@
void
Groundpiece::on_startup ()
{
+ // FIXME: using a CollisionMask is kind of unneeded here
CollisionMask mask = Resource::load_collision_mask(desc);
// FIXME: overdrawing of bridges and similar things aren't handled here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2861 - in branches/pingus_sdl/src: . worldobjs,
grumbel at BerliOS <=