[Scummvm-cvs-logs] SF.net SVN: scummvm:[45040] scummvm/trunk/engines/sci/engine

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Oct 13 20:53:11 CEST 2009


Revision: 45040
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45040&view=rev
Author:   fingolfin
Date:     2009-10-13 18:53:11 +0000 (Tue, 13 Oct 2009)

Log Message:
-----------
SCI: cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kpathing.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-10-13 18:52:36 UTC (rev 45039)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-10-13 18:53:11 UTC (rev 45040)
@@ -40,7 +40,6 @@
 struct Node;	// from segment.h
 struct List;	// from segment.h
 
-#define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline"
 //#define DEBUG_PARSER	// enable for parser debugging
 
 /* Generic description: */
@@ -162,7 +161,7 @@
 */
 
 #define PUT_SEL32(_o_, _slc_, _val_) write_selector(segMan, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._slc_, _val_, __FILE__, __LINE__)
-#define PUT_SEL32V(_o_, _slc_, _val_) write_selector(segMan, _o_, ((SciEngine*)g_engine)->getKernel()->_selectorCache._slc_, make_reg(0, _val_), __FILE__, __LINE__)
+#define PUT_SEL32V(_o_, _slc_, _val_) PUT_SEL32(_o_, _slc_, make_reg(0, _val_))
 /* Writes a selector value to an object
 ** Parameters: (reg_t) object: The address of the object which the selector should be written to
 **             (selector_name) selector: The selector to read

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-10-13 18:52:36 UTC (rev 45039)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-10-13 18:53:11 UTC (rev 45040)
@@ -33,6 +33,9 @@
 
 namespace Sci {
 
+// FIXME: Is AVOIDPATH_DYNMEM_STRING still needed?
+#define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline"
+
 #define POLY_LAST_POINT 0x7777
 #define POLY_POINT_SIZE 4
 //#define DEBUG_AVOIDPATH	//enable for avoidpath debugging
@@ -255,8 +258,6 @@
 };
 
 
-static Vertex *s_vertex_cur;	// FIXME: Avoid non-const global vars
-
 static Common::Point read_point(SegManager *segMan, reg_t list, int offset) {
 	SegmentRef list_r = segMan->dereference(list);
 	if (!list_r.isValid()) {
@@ -603,6 +604,8 @@
 	}
 }
 
+static Vertex *s_vertex_cur = 0;	// FIXME: Avoid non-const global vars
+
 static int vertex_compare(const void *a, const void *b) {
 	// Compares two vertices by angle (first) and distance (second) in relation
 	// to s_vertex_cur. The angle is relative to the horizontal line extending
@@ -815,6 +818,7 @@
 		Vertex *v1;
 
 		// Compute visibility of vertex_index[i]
+		assert(vertex_cur == s_vertex_cur);	// FIXME: We should be able to replace s_vertex_cur by vertex_cur
 		is_visible = visible(s_vertex_cur, s->vertex_index[i], s->vertex_index[i - 1], is_visible, intersected);
 
 		// Update visibility matrix
@@ -845,6 +849,8 @@
 		}
 	}
 
+	s_vertex_cur = 0;
+
 	return visVerts;
 }
 


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