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

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Sat Sep 20 15:52:13 CEST 2008


Revision: 34610
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34610&view=rev
Author:   Tanoku
Date:     2008-09-20 13:52:12 +0000 (Sat, 20 Sep 2008)

Log Message:
-----------
- Reverted circle drawing algorithm.
- Fixed Launcher savegame load menu.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/graphics/VectorRendererSpec.cpp
    scummvm/branches/gsoc2008-gui/gui/launcher.cpp

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRendererSpec.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRendererSpec.cpp	2008-09-20 13:04:50 UTC (rev 34609)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRendererSpec.cpp	2008-09-20 13:52:12 UTC (rev 34610)
@@ -36,70 +36,30 @@
 
 #define VECTOR_RENDERER_FAST_TRIANGLES
 
-const uint16 inv_sqrt_tbl[] = {
-	0x0000, 0x0100, 0x016A, 0x01BB, 0x0200, 0x023C, 0x0273, 0x02A5,
-	0x02D4, 0x0300, 0x0329, 0x0351, 0x0376, 0x039B, 0x03BD, 0x03DF,
-	0x0400, 0x041F, 0x043E, 0x045B, 0x0478, 0x0495, 0x04B0, 0x04CB,
-	0x04E6, 0x0500, 0x0519, 0x0532, 0x054A, 0x0562, 0x057A, 0x0591,
-	0x05A8, 0x05BE, 0x05D4, 0x05EA, 0x0600, 0x0615, 0x062A, 0x063E,
-	0x0653, 0x0667, 0x067B, 0x068E, 0x06A2, 0x06B5, 0x06C8, 0x06DB,
-	0x06ED, 0x0700, 0x0712, 0x0724, 0x0736, 0x0747, 0x0759, 0x076A,
-	0x077B, 0x078C, 0x079D, 0x07AE, 0x07BE, 0x07CF, 0x07DF, 0x07EF,
-	0x0800, 0x080F, 0x081F, 0x082F, 0x083F, 0x084E, 0x085D, 0x086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, 0x0E63,
-	0x0E6C, 0x0E74, 0x0E7D, 0x0E86, 0x0E8F, 0x0E98, 0x0EA0, 0x0EA9,
-	0x0EB2, 0x0EBB, 0x0EC3, 0x0ECC, 0x0ED5, 0x0EDD, 0x0EE6, 0x0EEE,
-	0x0EF7, 0x0F00, 0x0F08, 0x0F11, 0x0F19, 0x0F21, 0x0F2A, 0x0F32,
-	0x0F3B, 0x0F43, 0x0F4C, 0x0F54, 0x0F5C, 0x0F65, 0x0F6D, 0x0F75,
-	0x0F7D, 0x0F86, 0x0F8E, 0x0F96, 0x0F9E, 0x0FA7, 0x0FAF, 0x0FB7,
-	0x0FBF, 0x0FC7, 0x0FCF, 0x0FD7, 0x0FDF, 0x0FE7, 0x0FEF, 0x0FF7,
-	0x1000
-};
-
+/** Fixed point SQUARE ROOT **/
 inline uint32 fp_sqroot(uint32 x) {
-    int bit;
+	register uint32 root, remHI, remLO, testDIV, count;
 
-//#if defined(ARM9)
-//	__asm__ ("clz  %0, %1\nrsb  %0, %0, #31\n" : "=r"(bit) : "r" (x));
-#if defined(__i386__)
-	__asm__("bsrl %1, %0" : "=r" (bit) : "r" (x));
-#else
-	unsigned int mask = 0x40000000;
-	bit = 30;
-	while (bit >= 0) {
-	    if (x & mask)
-			break;
+	root = 0;
+	remHI = 0;
+	remLO = x;
+	count = 23;
 
-	    mask = (mask >> 1 | mask >> 2);
-	    bit -= 2;
-	}
-#endif
-	
-	bit -= 6 + (bit & 1);
-	return inv_sqrt_tbl[x >> bit] << (bit >> 1);
-}
+	do {
+		remHI = (remHI << 2) | (remLO >> 30);
+		remLO <<= 2;
+		root <<= 1;
+		testDIV = (root << 1) + 1;
 
-inline uint32 circleSqrt(int x) {
-	return (x > 255 ? fp_sqroot(x) : inv_sqrt_tbl[x]) ^ 0xFF;
+		if (remHI >= testDIV) {
+			remHI -= testDIV;
+			root++;
+		}
+	} while (count--);
+
+	return root;
 }
 
-
 /*
 	HELPER MACROS for Bresenham's circle drawing algorithm 
 	Note the proper spelling on this header.
@@ -179,13 +139,15 @@
 }
 
 // optimized Wu's algorithm
-#define __WU_ALGORITHM() {\
-	py += p; \
+#define __WU_ALGORITHM() { \
 	oldT = T; \
-	T = circleSqrt(rsq - (y * y)); \
-	a2 = T; \
-	a1 = ~T; \
-	if (T < oldT) { x--; px -= p; } \
+	T = fp_sqroot(rsq - ((y * y) << 16)) ^ 0xFFFF; \
+	py += p; \
+	if (T < oldT) { \
+		x--; px -= p; \
+	} \
+	a2 = (T >> 8); \
+	a1 = ~a2; \
 }
 
 

Modified: scummvm/branches/gsoc2008-gui/gui/launcher.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/launcher.cpp	2008-09-20 13:04:50 UTC (rev 34609)
+++ scummvm/branches/gsoc2008-gui/gui/launcher.cpp	2008-09-20 13:52:12 UTC (rev 34610)
@@ -517,6 +517,7 @@
 	_delSupport = _metaInfoSupport = _thumbnailSupport = _saveDateSupport = _playTimeSupport = false;
 
 //	_drawingHints |= GUI::THEME_HINT_SPECIAL_COLOR;
+	_backgroundType = Theme::kDialogBackgroundDefault;
 
 	new StaticTextWidget(this, "ScummSaveLoad.Title", title);
 
@@ -622,15 +623,12 @@
 		int thumbY = y + kLineHeight;
 
 		int textLines = 0;
-		if (_saveDateSupport)
-			textLines += 2;
-		if (_playTimeSupport)
-			textLines += 1;
+		if (!_saveDateSupport)
+			textLines++;
+		if (!_playTimeSupport)
+			textLines++;
 
-		if (textLines)
-			++textLines;
-
-		_container->resize(x, y, w, h + textLines * kLineHeight);
+		_container->resize(x, y, w, h - (kLineHeight * textLines));
 		_gfxWidget->resize(thumbX, thumbY, thumbW, thumbH); 
 
 		int height = thumbY + thumbH + kLineHeight;


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