[Scummvm-cvs-logs] SF.net SVN: scummvm: [31847] scummvm/branches/gsoc2008-gui/graphics
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Sat May 3 23:09:10 CEST 2008
Revision: 31847
http://scummvm.svn.sourceforge.net/scummvm/?rev=31847&view=rev
Author: lordhoto
Date: 2008-05-03 14:09:08 -0700 (Sat, 03 May 2008)
Log Message:
-----------
- Added missing virtual destructor in VectorRenderer
- Added graphics/VectorRenderer.cpp to the build system
- Fixed compiling with g++ 4.2
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
scummvm/branches/gsoc2008-gui/graphics/module.mk
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-05-03 20:08:46 UTC (rev 31846)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-05-03 21:09:08 UTC (rev 31847)
@@ -34,7 +34,7 @@
inline uint32 fp_sqroot( uint32 x );
VectorRenderer *createRenderer() {
- return new VectorRendererAA<uint16,ColorMasks<565>>;
+ return new VectorRendererAA<uint16,ColorMasks<565> >;
}
@@ -125,7 +125,7 @@
void VectorRendererAA<PixelType,PixelFormat>::
blendPixelPtr( PixelType *ptr, uint8 alpha ) {
register int idst = *ptr;
- register int isrc = _color;
+ register int isrc = Base::_color;
*ptr = (PixelType)(
(PixelFormat::kRedMask & ((idst & PixelFormat::kRedMask) +
@@ -144,12 +144,12 @@
void VectorRendererAA<PixelType,PixelFormat>::
drawLineAlg(int x1, int y1, int x2, int y2, int dx, int dy) {
- PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
- int pitch = surfacePitch();
+ PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
+ int pitch = Base::surfacePitch();
int xdir = (x2 > x1) ? 1 : -1;
uint16 error_tmp, error_acc, gradient;
- *ptr = (PixelType)_color;
+ *ptr = (PixelType)Base::_color;
if ( dx > dy ) {
gradient = (uint32)(dy<<16)/(uint32)dx;
@@ -185,7 +185,7 @@
}
}
- putPixel( x2, y2 );
+ Base::putPixel( x2, y2 );
}
template<typename PixelType, typename PixelFormat>
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-05-03 20:08:46 UTC (rev 31846)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-05-03 21:09:08 UTC (rev 31847)
@@ -28,6 +28,7 @@
#include "common/scummsys.h"
#include "graphics/surface.h"
+#include "graphics/colormasks.h"
#include "common/system.h"
namespace Graphics {
@@ -52,6 +53,8 @@
class VectorRenderer {
public:
+ virtual ~VectorRenderer() {}
+
/**
* Draws a line by considering the special cases for optimization.
*
@@ -284,8 +287,8 @@
* @see VectorRendererSpec
*/
template<typename PixelType, typename PixelFormat>
-class VectorRendererAA : public VectorRendererSpec<PixelType,PixelFormat> {
-
+class VectorRendererAA : public VectorRendererSpec<PixelType, PixelFormat> {
+ typedef VectorRendererSpec<PixelType, PixelFormat> Base;
protected:
/**
* "Wu's Line Antialiasing Algorithm" as published by Xiaolin Wu, July 1991
@@ -321,9 +324,9 @@
if ( alpha == 0 )
return;
else if ( alpha < 255 )
- blendPixelPtr( (PixelType*)_activeSurface->getBasePtr(x, y), alpha );
+ blendPixelPtr( (PixelType*)Base::_activeSurface->getBasePtr(x, y), alpha );
else
- putPixel( x, y );
+ Base::putPixel( x, y );
}
/**
Modified: scummvm/branches/gsoc2008-gui/graphics/module.mk
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/module.mk 2008-05-03 20:08:46 UTC (rev 31846)
+++ scummvm/branches/gsoc2008-gui/graphics/module.mk 2008-05-03 21:09:08 UTC (rev 31847)
@@ -16,7 +16,8 @@
primitives.o \
scaler.o \
scaler/thumbnail.o \
- surface.o
+ surface.o \
+ VectorRenderer.o
ifndef DISABLE_SCALERS
MODULE_OBJS += \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list