[Scummvm-cvs-logs] SF.net SVN: scummvm: [31885] scummvm/branches/gsoc2008-gui/graphics
tanoku at users.sourceforge.net
tanoku at users.sourceforge.net
Tue May 6 00:21:34 CEST 2008
Revision: 31885
http://scummvm.svn.sourceforge.net/scummvm/?rev=31885&view=rev
Author: tanoku
Date: 2008-05-05 15:21:34 -0700 (Mon, 05 May 2008)
Log Message:
-----------
Fixes for GCC 4.0.2+ in strict mode. Max, is it working now?
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-05-05 21:57:26 UTC (rev 31884)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp 2008-05-05 22:21:34 UTC (rev 31885)
@@ -77,7 +77,7 @@
drawSquare(int x, int y, int w, int h, bool fill) {
if ( fill ) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
- int pitch = surfacePitch();
+ int pitch = Base::surfacePitch();
while (h--) {
Common::set_to(ptr, ptr + w, (PixelType)_color);
@@ -95,7 +95,7 @@
void VectorRendererSpec<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();
+ int pitch = Base::surfacePitch();
int xdir = (x2 > x1) ? 1 : -1;
*ptr = (PixelType)_color;
@@ -226,7 +226,7 @@
return;
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
- int pitch = surfacePitch();
+ int pitch = Base::surfacePitch();
if (dy == 0) { // horizontal lines
// these can be filled really fast with a single memset.
@@ -319,22 +319,22 @@
drawCircleAlg(int x1, int y1, int r) {
int x = r;
int y = 0;
- int p = surfacePitch(), px = 0, py = 0;
+ int p = Base::surfacePitch(), px = 0, py = 0;
uint32 rsq = (r * r) << 16;
uint32 T = 0, oldT;
uint8 a1, a2;
bool fill = false;
- PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
+ PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
px = p*x;
py = p*y;
- *(ptr + x) = (PixelType)_color;
- *(ptr - x) = (PixelType)_color;
- *(ptr + px) = (PixelType)_color;
- *(ptr - px) = (PixelType)_color;
+ *(ptr + x) = (PixelType)Base::_color;
+ *(ptr - x) = (PixelType)Base::_color;
+ *(ptr + px) = (PixelType)Base::_color;
+ *(ptr - px) = (PixelType)Base::_color;
- if (fill) Common::set_to( ptr - x, ptr + x, _color );
+ if (fill) Common::set_to(ptr - x, ptr + x, Base::_color);
while (x > y++)
{
@@ -352,10 +352,10 @@
a1 = ~a2;
if (fill) {
- Common::set_to( ptr - x + py, ptr + x + py, _color );
- Common::set_to( ptr - x - py, ptr + x - py, _color );
- Common::set_to( ptr - y + px, ptr + y + px, _color );
- Common::set_to( ptr - y - px, ptr + y - px, _color );
+ Common::set_to(ptr - x + py, ptr + x + py, Base::_color);
+ Common::set_to(ptr - x - py, ptr + x - py, Base::_color);
+ Common::set_to(ptr - y + px, ptr + y + px, Base::_color);
+ Common::set_to(ptr - y - px, ptr + y - px, Base::_color);
} else {
blendPixelPtr(ptr + x - 1 + py, a2);
blendPixelPtr(ptr + y - (px-p), a2);
Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-05-05 21:57:26 UTC (rev 31884)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h 2008-05-05 22:21:34 UTC (rev 31885)
@@ -204,6 +204,7 @@
*/
template<typename PixelType, typename PixelFormat>
class VectorRendererSpec : public VectorRenderer {
+ typedef VectorRenderer Base;
public:
/**
@@ -217,18 +218,11 @@
void drawSquare(int x, int y, int w, int h, bool fill);
- /**
+/**
* @see VectorRenderer::setColor()
*/
- void setColor(uint8 r, uint8 g, uint8 b, uint8 a) {
- _color = ARGBToColor<PixelFormat>(r, g, b, a);
- }
-
- /**
- * @see VectorRenderer::setColor()
- */
void setColor(uint8 r, uint8 g, uint8 b) {
- _color = RGBToColor<PixelFormat>(r, g, b);
+ this->_color = RGBToColor<PixelFormat>(r, g, b);
}
/**
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