diff options
author | Colin Snover | 2017-11-12 13:43:42 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2017-11-18 22:35:12 +0100 |
commit | 88a2eaba93a454562b99bd59f797533b9f6b4848 (patch) | |
tree | fb3211337eab804ec349add0783193d42b52123f /engines/fullpipe/scenes | |
parent | 136223026ecb4569bbd425ed586eb7de42979c9f (diff) | |
download | scummvm-rg350-88a2eaba93a454562b99bd59f797533b9f6b4848.tar.gz scummvm-rg350-88a2eaba93a454562b99bd59f797533b9f6b4848.tar.bz2 scummvm-rg350-88a2eaba93a454562b99bd59f797533b9f6b4848.zip |
FULLPIPE: Make dimensions/coordinate getters pure functions
Diffstat (limited to 'engines/fullpipe/scenes')
-rw-r--r-- | engines/fullpipe/scenes/scene04.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene06.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene08.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene25.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/scenes/sceneDbg.cpp | 7 |
5 files changed, 14 insertions, 23 deletions
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 0e5040097c..228fc77aae 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -1003,9 +1003,7 @@ void sceneHandler04_springWobble() { } } - Common::Point point; - - int oldpos = g_vars->scene04_spring->getCurrDimensions(point)->y - oldDynIndex; + int oldpos = g_vars->scene04_spring->getCurrDimensions().y - oldDynIndex; if (g_vars->scene04_dynamicPhaseIndex) { if (!g_vars->scene04_spring->_movement) @@ -1017,7 +1015,7 @@ void sceneHandler04_springWobble() { } if (g_vars->scene04_dynamicPhaseIndex != oldDynIndex) { - sceneHandler04_bottleUpdateObjects(oldpos - (g_vars->scene04_spring->getCurrDimensions(point)->y - g_vars->scene04_dynamicPhaseIndex)); + sceneHandler04_bottleUpdateObjects(oldpos - (g_vars->scene04_spring->getCurrDimensions().y - g_vars->scene04_dynamicPhaseIndex)); } } @@ -1316,8 +1314,6 @@ void sceneHandler04_testPlank(ExCommand *ex) { } void sceneHandler04_updateBottle() { - Common::Point point; - int yoff; if (g_vars->scene04_hand->_movement) @@ -1325,7 +1321,7 @@ void sceneHandler04_updateBottle() { else yoff = g_vars->scene04_hand->_oy; - int newy = g_vars->scene04_hand->getSomeXY(point)->y + yoff + 140; + int newy = g_vars->scene04_hand->getSomeXY().y + yoff + 140; sceneHandler04_bottleUpdateObjects(newy - g_vars->scene04_spring->_oy); diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp index a6d93b69bd..4e003c6954 100644 --- a/engines/fullpipe/scenes/scene06.cpp +++ b/engines/fullpipe/scenes/scene06.cpp @@ -437,23 +437,23 @@ void sceneHandler06_catchBall() { if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPFW) { if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 5) { - g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex); + point = g_vars->scene06_mumsy->_movement->calcSomeXY(0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex); point.x = -point.x; point.y = -point.y; } else { - g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1, -1); + point = g_vars->scene06_mumsy->_movement->calcSomeXY(1, -1); g_vars->scene06_mumsyPos++; } } else if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPBK) { if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 4) { - g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex); + point = g_vars->scene06_mumsy->_movement->calcSomeXY(0, g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex); point.x = -point.x; point.y = -point.y; } else { - g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1, -1); + point = g_vars->scene06_mumsy->_movement->calcSomeXY(1, -1); g_vars->scene06_mumsyPos--; } diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp index 24b23c1506..00f8f93354 100644 --- a/engines/fullpipe/scenes/scene08.cpp +++ b/engines/fullpipe/scenes/scene08.cpp @@ -193,9 +193,7 @@ int sceneHandler08_calcOffset(int off, int flag) { } void sceneHandler08_pushCallback(int *par) { - Common::Point point; - - int y = g_fp->_aniMan->_oy + g_fp->_aniMan->getSomeXY(point)->y; + int y = g_fp->_aniMan->_oy + g_fp->_aniMan->getSomeXY().y; if (g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) y -= 25; @@ -253,7 +251,7 @@ void sceneHandler08_airMoves() { int y = g_fp->_aniMan->_oy; Common::Point point; - if (703 - g_fp->_aniMan->getSomeXY(point)->y - y < 150) { + if (703 - g_fp->_aniMan->getSomeXY().y - y < 150) { if (g_fp->_aniMan->_statics) { if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) { y -= 25; @@ -358,7 +356,7 @@ void sceneHandler08_calcFlight() { if (g_vars->scene08_manOffsetY < g_vars->scene08_stairsOffset) g_vars->scene08_manOffsetY = g_vars->scene08_stairsOffset; - y = y + g_fp->_aniMan->getSomeXY(point)->y; + y = y + g_fp->_aniMan->getSomeXY().y; if (g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) y -= 25; diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp index 83a0ee0a72..8323e3d705 100644 --- a/engines/fullpipe/scenes/scene25.cpp +++ b/engines/fullpipe/scenes/scene25.cpp @@ -441,7 +441,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa if (flag) { if (ani->_movement) { - ani->_movement->calcSomeXY(point, 0, ani->_movement->_currDynamicPhaseIndex); + point = ani->_movement->calcSomeXY(0, ani->_movement->_currDynamicPhaseIndex); newx = point.x; aniY = ani->_oy - point.y; } @@ -478,7 +478,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa newy = pnty; } - ani->getMovementById(ex->_messageNum)->calcSomeXY(point, 0, -1); + point = ani->getMovementById(ex->_messageNum)->calcSomeXY(0, -1); pntx += point.x; pnty += point.y; } diff --git a/engines/fullpipe/scenes/sceneDbg.cpp b/engines/fullpipe/scenes/sceneDbg.cpp index 2ba59778ba..4d061e603c 100644 --- a/engines/fullpipe/scenes/sceneDbg.cpp +++ b/engines/fullpipe/scenes/sceneDbg.cpp @@ -48,11 +48,8 @@ GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) { PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i]; if (x >= pic->_ox && y >= pic->_oy) { - Common::Point point; - - pic->getDimensions(&point); - - if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector) + const Dims dims = pic->getDimensions(); + if (x <= pic->_ox + dims.x && y <= pic->_oy + dims.y && pic != g_vars->selector) return pic; } } |