SCI: making pathfinding debug support also work in sci32 (though it just shows the path for 2.5 seconds there)
svn-id: r47888
This commit is contained in:
parent
e74bd30a2e
commit
00ac235331
6 changed files with 18 additions and 5 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "sci/engine/kernel.h"
|
||||
#include "sci/graphics/paint16.h"
|
||||
#include "sci/graphics/palette.h"
|
||||
#include "sci/graphics/screen.h"
|
||||
|
||||
#include "common/list.h"
|
||||
|
||||
|
@ -307,7 +308,7 @@ static void draw_line(EngineState *s, Common::Point p1, Common::Point p2, int ty
|
|||
p2.y = CLIP<int16>(p2.y, 0, height - 1);
|
||||
|
||||
assert(type >= 0 && type <= 3);
|
||||
s->_gfxPaint16->kernelGraphDrawLine(p1, p2, poly_colors[type], 255, 255);
|
||||
s->_gfxPaint->kernelGraphDrawLine(p1, p2, poly_colors[type], 255, 255);
|
||||
}
|
||||
|
||||
static void draw_point(EngineState *s, Common::Point p, int start, int width, int height) {
|
||||
|
@ -328,7 +329,8 @@ static void draw_point(EngineState *s, Common::Point p, int start, int width, in
|
|||
rect.right = CLIP<int16>(rect.right, 0, width - 1);
|
||||
|
||||
assert(start >= 0 && start <= 1);
|
||||
s->_gfxPaint16->kernelGraphFrameBox(rect, point_colors[start]);
|
||||
if (s->_gfxPaint16)
|
||||
s->_gfxPaint16->kernelGraphFrameBox(rect, point_colors[start]);
|
||||
}
|
||||
|
||||
static void draw_polygon(EngineState *s, reg_t polygon, int width, int height) {
|
||||
|
@ -1405,8 +1407,6 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) {
|
|||
}
|
||||
|
||||
if (Common::isDebugChannelEnabled(kDebugLevelAvoidPath)) {
|
||||
assert(s->_gui);
|
||||
|
||||
debug("[avoidpath] Pathfinding input:");
|
||||
draw_point(s, start, 1, width, height);
|
||||
draw_point(s, end, 0, width, height);
|
||||
|
@ -1417,7 +1417,10 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) {
|
|||
}
|
||||
|
||||
// Update the whole screen
|
||||
s->_gfxPaint16->kernelGraphUpdateBox(Common::Rect(0, 0, width - 1, height - 1), width > 320);
|
||||
s->_gfxScreen->copyToScreen();
|
||||
g_system->updateScreen();
|
||||
if (!s->_gfxPaint16)
|
||||
g_system->delayMillis(2500);
|
||||
}
|
||||
|
||||
PathfindingState *p = convert_polygon_set(s, poly_list, start, end, width, height, opt);
|
||||
|
|
|
@ -46,4 +46,7 @@ void GfxPaint::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, boo
|
|||
void GfxPaint::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle) {
|
||||
}
|
||||
|
||||
void GfxPaint::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
|
||||
}
|
||||
|
||||
} // End of namespace Sci
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
|
||||
virtual void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
|
||||
virtual void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
|
||||
virtual void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
|
||||
|
||||
private:
|
||||
};
|
||||
|
|
|
@ -74,4 +74,8 @@ void GfxPaint32::kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo,
|
|||
_screen->copyRectToScreen(celRect);
|
||||
}
|
||||
|
||||
void GfxPaint32::kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
|
||||
_screen->drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
|
||||
}
|
||||
|
||||
} // End of namespace Sci
|
||||
|
|
|
@ -44,6 +44,7 @@ public:
|
|||
|
||||
void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
|
||||
void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode, reg_t upscaledHiresHandle);
|
||||
void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
|
||||
|
||||
private:
|
||||
ResourceManager *_resMan;
|
||||
|
|
|
@ -176,6 +176,7 @@ Common::Error SciEngine::run() {
|
|||
_gamestate->_gfxAnimate = 0;
|
||||
_gamestate->_gfxControls = 0;
|
||||
_gamestate->_gfxMenu = 0;
|
||||
_gamestate->_gfxPaint16 = 0;
|
||||
_gamestate->_gfxPorts = 0;
|
||||
_gamestate->_gui = 0;
|
||||
_gamestate->_gui32 = new SciGui32(_gamestate, screen, palette, cache, cursor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue