[Scummvm-cvs-logs] SF.net SVN: scummvm: [32272] scummvm/branches/gsoc2008-gui

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Sun May 25 19:06:10 CEST 2008


Revision: 32272
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32272&view=rev
Author:   Tanoku
Date:     2008-05-25 10:06:10 -0700 (Sun, 25 May 2008)

Log Message:
-----------
Compilation fixes. Sorry about the mess.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
    scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
    scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp
    scummvm/branches/gsoc2008-gui/gui/InterfaceManager.h

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp	2008-05-25 14:39:59 UTC (rev 32271)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp	2008-05-25 17:06:10 UTC (rev 32272)
@@ -65,13 +65,13 @@
 		vr->setFgColor(255, 0, 206);
 		vr->setGradientFactor(1);
 		vr->setGradientColors(214, 113, 8, 240, 200, 25);
-		vr->fillSurface(VectorRenderer::kGradientFill);
+		vr->fillSurface(kFillMode_Gradient);
 
 		vr->setBgColor(25, 25, 175);
 		vr->shadowEnable(3);
 		vr->setFgColor(240, 204, 120);
 		vr->setStrokeWidth(1);
-		vr->setFillMode(VectorRenderer::kGradientFill);
+		vr->setFillMode(kFillMode_Gradient);
 
 		vr->setGradientFactor(3);
 		vr->setGradientColors(255, 231, 140, 255, 243, 206);	
@@ -240,33 +240,33 @@
 	if (x + r > Base::_activeSurface->w || y + r > Base::_activeSurface->h)
 		return;
 
-	if (Base::_fillMode != kNoFill && Base::_shadowOffset 
+	if (Base::_fillMode != kFillMode_Disabled && Base::_shadowOffset 
 		&& x + r + Base::_shadowOffset < Base::_activeSurface->w
 		&& y + r + Base::_shadowOffset < Base::_activeSurface->h) {
-		drawCircleAlg(x + Base::_shadowOffset + 1, y + Base::_shadowOffset + 1, r, 0, kForegroundFill);
+		drawCircleAlg(x + Base::_shadowOffset + 1, y + Base::_shadowOffset + 1, r, 0, kFillMode_Foreground);
 	}
 
 	switch(Base::_fillMode) {
-	case kNoFill:
+	case kFillMode_Disabled:
 		if (Base::_strokeWidth)
-			drawCircleAlg(x, y, r, _fgColor, kNoFill);
+			drawCircleAlg(x, y, r, _fgColor, kFillMode_Disabled);
 		break;
 
-	case kForegroundFill:
-		drawCircleAlg(x, y, r, _fgColor, kForegroundFill);
+	case kFillMode_Foreground:
+		drawCircleAlg(x, y, r, _fgColor, kFillMode_Foreground);
 		break;
 
-	case kBackgroundFill:
+	case kFillMode_Background:
 		if (Base::_strokeWidth > 1) {
-			drawCircleAlg(x, y, r, _fgColor, kForegroundFill);
-			drawCircleAlg(x, y, r - Base::_strokeWidth, _bgColor, kBackgroundFill);
+			drawCircleAlg(x, y, r, _fgColor, kFillMode_Foreground);
+			drawCircleAlg(x, y, r - Base::_strokeWidth, _bgColor, kFillMode_Background);
 		} else {
-			drawCircleAlg(x, y, r, _bgColor, kBackgroundFill);
-			drawCircleAlg(x, y, r, _fgColor, kNoFill);
+			drawCircleAlg(x, y, r, _bgColor, kFillMode_Background);
+			drawCircleAlg(x, y, r, _fgColor, kFillMode_Disabled);
 		}
 		break;
 
-	case kGradientFill:
+	case kFillMode_Gradient:
 		break;
 	}
 }
@@ -278,31 +278,31 @@
 	if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h)
 		return;
 
-	if (Base::_fillMode != kNoFill && Base::_shadowOffset
+	if (Base::_fillMode != kFillMode_Disabled && Base::_shadowOffset
 		&& x + w + Base::_shadowOffset < Base::_activeSurface->w
 		&& y + h + Base::_shadowOffset < Base::_activeSurface->h) {
 		drawSquareShadow(x, y, w, h, Base::_shadowOffset);
 	}
 
 	switch(Base::_fillMode) {
-	case kNoFill:
+	case kFillMode_Disabled:
 		if (Base::_strokeWidth)
-			drawSquareAlg(x, y, w, h, _fgColor, kNoFill);
+			drawSquareAlg(x, y, w, h, _fgColor, kFillMode_Disabled);
 		break;
 
-	case kForegroundFill:
-		drawSquareAlg(x, y, w, h, _fgColor, kForegroundFill);
+	case kFillMode_Foreground:
+		drawSquareAlg(x, y, w, h, _fgColor, kFillMode_Foreground);
 		break;
 
-	case kBackgroundFill:
-		drawSquareAlg(x, y, w, h, _bgColor, kBackgroundFill);
-		drawSquareAlg(x, y, w, h, _fgColor, kNoFill);
+	case kFillMode_Background:
+		drawSquareAlg(x, y, w, h, _bgColor, kFillMode_Background);
+		drawSquareAlg(x, y, w, h, _fgColor, kFillMode_Disabled);
 		break;
 
-	case kGradientFill:
-		VectorRendererSpec::drawSquareAlg(x, y, w, h, 0, kGradientFill);
+	case kFillMode_Gradient:
+		VectorRendererSpec::drawSquareAlg(x, y, w, h, 0, kFillMode_Gradient);
 		if (Base::_strokeWidth)
-			drawSquareAlg(x, y, w, h, _fgColor, kNoFill);
+			drawSquareAlg(x, y, w, h, _fgColor, kFillMode_Disabled);
 		break;
 	}
 }
@@ -314,36 +314,36 @@
 	if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h)
 		return;
 
-	if (Base::_fillMode != kNoFill && Base::_shadowOffset
+	if (Base::_fillMode != kFillMode_Disabled && Base::_shadowOffset
 		&& x + w + Base::_shadowOffset < Base::_activeSurface->w
 		&& y + h + Base::_shadowOffset < Base::_activeSurface->h) {
 		drawRoundedSquareShadow(x, y, r, w, h, Base::_shadowOffset);
 	}
 
 	switch(Base::_fillMode) {
-	case kNoFill:
+	case kFillMode_Disabled:
 		if (Base::_strokeWidth)
-			drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kNoFill);
+			drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillMode_Disabled);
 		break;
 
-	case kForegroundFill:
-		drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kForegroundFill);
+	case kFillMode_Foreground:
+		drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillMode_Foreground);
 		break;
 
-	case kBackgroundFill:
-		VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, _bgColor, kBackgroundFill);
-		drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kNoFill);
+	case kFillMode_Background:
+		VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, _bgColor, kFillMode_Background);
+		drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillMode_Disabled);
 		break;
 
-	case kGradientFill:
+	case kFillMode_Gradient:
 		if (Base::_strokeWidth > 1) {
-			drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kForegroundFill);
+			drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillMode_Foreground);
 			VectorRendererSpec::drawRoundedSquareAlg(x + Base::_strokeWidth/2, y + Base::_strokeWidth/2, 
-				r - Base::_strokeWidth/2, w - Base::_strokeWidth, h - Base::_strokeWidth, 0, kGradientFill);
+				r - Base::_strokeWidth/2, w - Base::_strokeWidth, h - Base::_strokeWidth, 0, kFillMode_Gradient);
 		} else {
-			VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, 0, kGradientFill);
+			VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, 0, kFillMode_Gradient);
 			if (Base::_strokeWidth)
-				drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kNoFill);
+				drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillMode_Disabled);
 		}
 		break;
 	}
@@ -360,9 +360,9 @@
 	int pitch = Base::surfacePitch();
 	int max_h = h;
 	
-	if (fill_m != kNoFill) {
+	if (fill_m != kFillMode_Disabled) {
 		while (h--) {
-			if (fill_m == kGradientFill)
+			if (fill_m == kFillMode_Gradient)
 				color = calcGradient(max_h - h, max_h);
 
 			colorFill(ptr, ptr + w, color);
@@ -452,7 +452,7 @@
 	int short_h = h - (2 * r) + 2;
 	int long_h = h;
 
-	if (fill_m == kNoFill) {
+	if (fill_m == kFillMode_Disabled) {
 		while (sw++ < Base::_strokeWidth) {
 			colorFill(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color);
 			colorFill(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color);
@@ -481,7 +481,7 @@
 	} else {
 		__BE_RESET();
 
-		if (fill_m == kGradientFill) {
+		if (fill_m == kFillMode_Gradient) {
 			while (x++ < y) {
 				__BE_ALGORITHM();
 				colorFill(ptr_tl - x - py, ptr_tr + x - py, calcGradient(real_radius - y, long_h));
@@ -507,7 +507,7 @@
 
 		ptr_fill += pitch * r;
 		while (short_h--) {
-			if (fill_m == kGradientFill)
+			if (fill_m == kFillMode_Gradient)
 				color = calcGradient(real_radius++, long_h);
 			colorFill(ptr_fill, ptr_fill + w + 1, color);
 			ptr_fill += pitch;
@@ -524,7 +524,7 @@
 	int pitch = Base::surfacePitch();
 	PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
 
-	if (fill_m == kNoFill) {
+	if (fill_m == kFillMode_Disabled) {
 		while (sw++ < Base::_strokeWidth) {
 			__BE_RESET();
 			r--;
@@ -711,7 +711,7 @@
 /** ROUNDED SQUARES **/
 template<typename PixelType, typename PixelFormat>
 void VectorRendererAA<PixelType, PixelFormat>::
-drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
+drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m) {
 	int x, y;
 	int p = Base::surfacePitch(), px, py;
 	int sw = 0, sp = 0, hp = h * p;
@@ -728,7 +728,7 @@
 
 	int short_h = h - 2 * r;
 
-	if (fill_m == VectorRenderer::kNoFill) {
+	if (fill_m == kFillMode_Disabled) {
 		while (sw++ < Base::_strokeWidth) {
 			colorFill(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color);
 			colorFill(ptr_fill + hp - sp + r, ptr_fill + w + hp + 1 - sp - r, color);
@@ -781,7 +781,7 @@
 /** CIRCLES **/
 template<typename PixelType, typename PixelFormat>
 void VectorRendererAA<PixelType, PixelFormat>::
-drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode fill_m) {
+drawCircleAlg(int x1, int y1, int r, PixelType color, FillMode fill_m) {
 	int x, y, sw = 0;
 	int p = Base::surfacePitch(), px, py;
 
@@ -791,7 +791,7 @@
 
 	PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
 
-	if (fill_m == VectorRenderer::kNoFill) {
+	if (fill_m == kFillMode_Disabled) {
 		while (sw++ < Base::_strokeWidth) {
 			x = r - (sw - 1); y = 0; T = 0;
 			px = p * x; py = 0;

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-05-25 14:39:59 UTC (rev 32271)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-05-25 17:06:10 UTC (rev 32272)
@@ -35,6 +35,14 @@
 
 void vector_renderer_test(OSystem *_system);
 
+/** Specified the way in which a shape is filled */
+enum FillMode {
+	kFillMode_Disabled = 0,
+	kFillMode_Foreground = 1,
+	kFillMode_Background = 2,
+	kFillMode_Gradient = 3
+};
+
 struct DrawStep {
 	bool set_fg, set_bg, set_grad;
 
@@ -47,7 +55,7 @@
 	uint16 x, y, w, h, r;
 	uint8 shadows, stroke, factor;
 
-	Graphics::VectorRenderer::FillMode fill_mode;
+	FillMode fill_mode;
 
 	void (*drawing_call)(DrawStep *step);
 };
@@ -70,17 +78,9 @@
  */
 class VectorRenderer {
 public:
-	VectorRenderer() : _shadowOffset(0), _fillMode(kNoFill), _activeSurface(NULL), _strokeWidth(1), _gradientFactor(1) {}
+	VectorRenderer() : _shadowOffset(0), _fillMode(kFillMode_Disabled), _activeSurface(NULL), _strokeWidth(1), _gradientFactor(1) {}
 	virtual ~VectorRenderer() {}
 
-	/** Specified the way in which a shape is filled */
-	enum FillMode {
-		kNoFill = 0,
-		kForegroundFill = 1,
-		kBackgroundFill = 2,
-		kGradientFill = 3
-	};
-
 	/**
 	 * Draws a line by considering the special cases for optimization.
 	 *
@@ -171,7 +171,7 @@
 	virtual void setBgColor(uint8 r, uint8 g, uint8 b) = 0;
 
 	/**
-	 * Set the active gradient color. All shapes drawn using kGradientFill
+	 * Set the active gradient color. All shapes drawn using kFillMode_Gradient
 	 * as their fill mode will use this VERTICAL gradient as their fill color.
 	 *
 	 * @param r1	value of the red color byte for the start color
@@ -199,7 +199,7 @@
 	 *
 	 * @param mode Fill mode (bg, fg or gradient) used to fill the surface
 	 */
-	virtual void fillSurface(FillMode mode = kForegroundFill) = 0;
+	virtual void fillSurface(FillMode mode = kFillMode_Foreground) = 0;
 
 	/**
 	 * Clears the active surface.
@@ -215,7 +215,7 @@
 	 * @see VectorRenderer::FillMode
 	 * @param mode Specified fill mode.
 	 */
-	virtual void setFillMode(VectorRenderer::FillMode mode) {
+	virtual void setFillMode(FillMode mode) {
 		_fillMode = mode;
 	}
 
@@ -370,18 +370,18 @@
 	/**
 	 * @see VectorRenderer::fillSurface()
 	 */
-	void fillSurface(FillMode mode = kForegroundFill) {
+	void fillSurface(FillMode mode = kFillMode_Foreground) {
 		PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(0, 0);
 
 		int w = _activeSurface->w;
 		int h = _activeSurface->h ;
 		int pitch = surfacePitch();
 
-		if (mode == kBackgroundFill)
+		if (mode == kFillMode_Background)
 			colorFill(ptr, ptr + w * h, _bgColor);
-		else if (mode == kForegroundFill)
+		else if (mode == kFillMode_Foreground)
 			colorFill(ptr, ptr + w * h, _fgColor);
-		else if (mode == kGradientFill) {
+		else if (mode == kFillMode_Gradient) {
 			int i = h;
 			while (i--) {
 				colorFill(ptr, ptr + w, calcGradient(h - i, h));
@@ -596,7 +596,7 @@
 	 *
 	 * @see VectorRenderer::drawCircleAlg()
 	 */
-	virtual void drawCircleAlg(int x, int y, int r, PixelType color, VectorRenderer::FillMode fill_m);
+	virtual void drawCircleAlg(int x, int y, int r, PixelType color, FillMode fill_m);
 
 	/**
 	 * "Wu's Circle Antialiasing Algorithm" as published by Xiaolin Wu, July 1991,
@@ -605,7 +605,7 @@
 	 *
 	 * @see VectorRenderer::drawRoundedAlg()
 	 */
-	virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m);
+	virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, FillMode fill_m);
 };
 
 } // end of namespace Graphics

Modified: scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp	2008-05-25 14:39:59 UTC (rev 32271)
+++ scummvm/branches/gsoc2008-gui/gui/InterfaceManager.cpp	2008-05-25 17:06:10 UTC (rev 32272)
@@ -36,4 +36,4 @@
 
 
 
-} // end of namespace GUI.
\ No newline at end of file
+} // end of namespace GUI.

Modified: scummvm/branches/gsoc2008-gui/gui/InterfaceManager.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/InterfaceManager.h	2008-05-25 14:39:59 UTC (rev 32271)
+++ scummvm/branches/gsoc2008-gui/gui/InterfaceManager.h	2008-05-25 17:06:10 UTC (rev 32272)
@@ -29,6 +29,7 @@
 #include "common/scummsys.h"
 #include "graphics/surface.h"
 #include "common/system.h"
+
 #include "graphics/VectorRenderer.h"
 
 namespace GUI {
@@ -48,7 +49,7 @@
 	Graphics::VectorRenderer *createRenderer() {
 		// TODO: Find out what pixel format we are using,
 		// create the renderer accordingly
-		return new VectorRendererSpec<uint16, ColorMasks<565> >;
+		return new Graphics::VectorRendererSpec<uint16, ColorMasks<565> >;
 	}
 
 	Graphics::VectorRenderer *_vectorRenderer;
@@ -56,4 +57,4 @@
 
 } // end of namespace GUI.
 
-#endif
\ No newline at end of file
+#endif


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