From c77be11ccd81afb92e5f2e2620295fa65dc3124d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 13 Oct 2009 18:53:11 +0000 Subject: SCI: cleanup svn-id: r45040 --- engines/sci/engine/kernel.h | 3 +-- engines/sci/engine/kpathing.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 12003c650a..750a2b9a34 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -40,7 +40,6 @@ namespace Sci { 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 @@ enum SelectorInvocation { */ #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 diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 1df6b086ff..faba652f8a 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -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 @@ struct PathfindingState { }; -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 void fix_vertex_order(Polygon *polygon) { } } +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 @@ static VertexList *visible_vertices(PathfindingState *s, Vertex *vertex_cur) { 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 @@ static VertexList *visible_vertices(PathfindingState *s, Vertex *vertex_cur) { } } + s_vertex_cur = 0; + return visVerts; } -- cgit v1.2.3