From c5cf806f8276786017bd69e61a2db1c014ec52ce Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 21 Feb 2006 10:22:37 +0000 Subject: Removed the "extra bars/nodes" code, since nothing ever added the extra bars or nodes. Removed the path-plotting debugging code, since the line-drawing function has been a stub for the past few years, as far as I can tell. Similar code was removed from the BS2 router long ago, so this could be a first tiny step towards bringing them together. svn-id: r20805 --- engines/sword1/logic.cpp | 2 - engines/sword1/router.cpp | 142 ---------------------------------------------- engines/sword1/router.h | 13 +---- 3 files changed, 3 insertions(+), 154 deletions(-) diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 27108e9e51..0b789559e0 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -87,7 +87,6 @@ void Logic::initialize(void) { _screen->useTextManager(_textMan); _textRunning = _speechRunning = false; _speechFinished = true; - _router->resetExtraData(); } void Logic::newScreen(uint32 screen) { @@ -1390,7 +1389,6 @@ int Logic::fnWalk(Object *cpt, int32 id, int32 x, int32 y, int32 dir, int32 stan int32 routeRes = _router->routeFinder(id, cpt, x, y, dir); if (id == PLAYER) { - _router->resetExtraData(); if ((routeRes == 1) || (routeRes == 2)) { _scriptVars[MEGA_ON_GRID] = 0; _scriptVars[REROUTE_GEORGE] = 0; diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index d8a2cf3c95..68f8ca6756 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -68,13 +68,10 @@ namespace Sword1 { #define SLOW_IN 3 #define SLOW_OUT 7 #define ROUTE_END_FLAG 255 -//#define PLOT_PATHS 1 -#undef PLOT_PATHS Router::Router(ObjectMan *pObjMan, ResMan *pResMan) { _objMan = pObjMan; _resMan = pResMan; - _numExtraBars = _numExtraNodes = 0; nnodes = nbars = 0; _playerTargetX = _playerTargetY = _playerTargetDir = _playerTargetStance = 0; diagonalx = diagonaly = 0; @@ -402,19 +399,6 @@ int32 Router::SmoothestPath() } while ((steps == 0) && (i < 4)); -#ifdef PLOT_PATHS // plot the best path - if (steps != 0) - { - i = 0; - do - { - RouteLine(smoothPath[i].x, smoothPath[i].y, smoothPath[i+1].x, smoothPath[i+1].y, 228); - i = i + 1; - } - while (i < steps); - } -#endif - if (steps == 0) { /*Tdebug("BestTurns failed %d %d %d %d",route[p].x, route[p].y, route[p + 1].x, route[p + 1].y); @@ -1537,9 +1521,6 @@ int32 Router::SolidWalkAnimator(WalkData *walkAnim) { if (!Check(modularPath[i].x, modularPath[i].y, modularPath[i+1].x, modularPath[i+1].y)) p=0; -#ifdef PLOT_PATHS - RouteLine(modularPath[i].x, modularPath[i].y, modularPath[i+1].x, modularPath[i+1].y, 227); -#endif i += 1; } while (i