aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2008-05-03 21:09:08 +0000
committerJohannes Schickel2008-05-03 21:09:08 +0000
commit8004a64c2f8e80bf2998970bcf352bb9c20f8805 (patch)
tree6bd38fe4d11ef7120e8701b14e18d61034c16095 /graphics
parent8c043f53edd164644048836202d96ee9ab996c5c (diff)
downloadscummvm-rg350-8004a64c2f8e80bf2998970bcf352bb9c20f8805.tar.gz
scummvm-rg350-8004a64c2f8e80bf2998970bcf352bb9c20f8805.tar.bz2
scummvm-rg350-8004a64c2f8e80bf2998970bcf352bb9c20f8805.zip
- Added missing virtual destructor in VectorRenderer
- Added graphics/VectorRenderer.cpp to the build system - Fixed compiling with g++ 4.2 svn-id: r31847
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp12
-rw-r--r--graphics/VectorRenderer.h11
-rw-r--r--graphics/module.mk3
3 files changed, 15 insertions, 11 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 0ffaf9811d..4a462cf5fa 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -34,7 +34,7 @@ namespace Graphics {
inline uint32 fp_sqroot( uint32 x );
VectorRenderer *createRenderer() {
- return new VectorRendererAA<uint16,ColorMasks<565>>;
+ return new VectorRendererAA<uint16,ColorMasks<565> >;
}
@@ -125,7 +125,7 @@ template<typename PixelType, typename PixelFormat>
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 @@ template<typename PixelType, typename PixelFormat>
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 @@ drawLineAlg(int x1, int y1, int x2, int y2, int dx, int dy) {
}
}
- putPixel( x2, y2 );
+ Base::putPixel( x2, y2 );
}
template<typename PixelType, typename PixelFormat>
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index b7ee7d1680..1b71a7164c 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -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 @@ void vector_renderer_test( OSystem *_system );
class VectorRenderer {
public:
+ virtual ~VectorRenderer() {}
+
/**
* Draws a line by considering the special cases for optimization.
*
@@ -284,8 +287,8 @@ protected:
* @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 @@ protected:
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 );
}
/**
diff --git a/graphics/module.mk b/graphics/module.mk
index 93e2db26c5..b8dfd94ad2 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -16,7 +16,8 @@ MODULE_OBJS := \
primitives.o \
scaler.o \
scaler/thumbnail.o \
- surface.o
+ surface.o \
+ VectorRenderer.o
ifndef DISABLE_SCALERS
MODULE_OBJS += \