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

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Fri Jul 25 02:59:54 CEST 2008


Revision: 33268
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33268&view=rev
Author:   Tanoku
Date:     2008-07-25 00:59:53 +0000 (Fri, 25 Jul 2008)

Log Message:
-----------
Fixed triangle drawing. A bit.

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

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp	2008-07-24 22:14:34 UTC (rev 33267)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.cpp	2008-07-25 00:59:53 UTC (rev 33268)
@@ -498,9 +498,9 @@
 drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
 	// Awesome hack: the AA messes up the last pixel triangles if their width is even
 	// ...fix the width instead of fixing the AA :p
-	if (w % 2 == 0) {
-		w++; h++;
-	}
+	// if (w % 2 == 0) {
+	// 	w++; h++;
+	// }
 	
 	if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h)
 		return;
@@ -517,16 +517,22 @@
 			return;
 		color = _fgColor;
 	}
+	
+	if (Base::_dynamicData != 0)
+		orient = (TriangleOrientation)Base::_dynamicData;
+		
+	int newW = w * 3 / 4;
+	if (newW % 2) newW++;
 
 	switch(orient) {
 		case kTriangleUp:
 		case kTriangleDown:
-#ifdef VECTOR_RENDERER_FAST_TRIANGLES
-			if (w == h)
-				drawTriangleFast(x, y, w, (orient == kTriangleDown), color, Base::_fillMode);
-			else 
-#endif
-				drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), color, Base::_fillMode);
+// #ifdef VECTOR_RENDERER_FAST_TRIANGLES
+			// if (w == h)
+				drawTriangleFast(x + (w / 2) - w * 3 / 8, y + w / 4, newW, (orient == kTriangleDown), color, Base::_fillMode);
+			// else 
+// #endif
+				// drawTriangleVertAlg(x, y, w, h, (orient == kTriangleDown), color, Base::_fillMode);
 			break;
 
 		case kTriangleLeft:

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-07-24 22:14:34 UTC (rev 33267)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-07-25 00:59:53 UTC (rev 33268)
@@ -107,6 +107,7 @@
 	};
 
 	enum TriangleOrientation {
+		kTriangleAuto = 0,
 		kTriangleUp,
 		kTriangleDown,
 		kTriangleLeft,

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp	2008-07-24 22:14:34 UTC (rev 33267)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp	2008-07-25 00:59:53 UTC (rev 33268)
@@ -79,12 +79,12 @@
 	
 	"<drawdata id = 'scrollbar_button_idle' cache = false>"
 		"<drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '120, 120, 120' stroke = 1 />"
-		"<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />"
+		"<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' />"
 	"</drawdata>"
 	
 	"<drawdata id = 'scrollbar_button_hover' cache = false>"
 	"<drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 />"
-		"<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />"
+		"<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = 'auto' height = 'auto' xpos = 'center' ypos = 'center' orientation = 'top' />"
 	"</drawdata>"
 	
 	"<drawdata id = 'tab_active' cache = false>"

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-07-24 22:14:34 UTC (rev 33267)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp	2008-07-25 00:59:53 UTC (rev 33268)
@@ -476,10 +476,10 @@
 	const int buttonExtra = (r.width() * 120) / 100;
 	
 	r2.bottom = r2.top + buttonExtra;
-	queueDD(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2);
+	queueDD(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, Graphics::VectorRenderer::kTriangleUp);
 	
 	r2.translate(0, r.height() - r2.height());
-	queueDD(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2);
+	queueDD(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, Graphics::VectorRenderer::kTriangleDown);
 	
 	r2 = r;
 	r2.left += 1;


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