aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes
diff options
context:
space:
mode:
authorColin Snover2017-11-15 16:24:37 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commitbb26bf7994420a8af3fd5e1c3a1b174448aefc5c (patch)
tree5fb930b752f2668f8cd2a120d89dffa96f608e51 /engines/fullpipe/scenes
parentca5a86e703d3fe72cc370845622097ee16f4d67e (diff)
downloadscummvm-rg350-bb26bf7994420a8af3fd5e1c3a1b174448aefc5c.tar.gz
scummvm-rg350-bb26bf7994420a8af3fd5e1c3a1b174448aefc5c.tar.bz2
scummvm-rg350-bb26bf7994420a8af3fd5e1c3a1b174448aefc5c.zip
FULLPIPE: Fix memory leaks and unnecessary indirect allocations in Motion and Sc2
Diffstat (limited to 'engines/fullpipe/scenes')
-rw-r--r--engines/fullpipe/scenes/scene04.cpp12
-rw-r--r--engines/fullpipe/scenes/scene09.cpp4
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp12
-rw-r--r--engines/fullpipe/scenes/scene25.cpp20
4 files changed, 24 insertions, 24 deletions
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index c899e46ab9..0d27313933 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -97,8 +97,8 @@ void scene04_initScene(Scene *sc) {
for (uint i = 0; i < kozsize; i++) {
kozmov->setDynamicPhaseIndex(i);
- if (kozmov->_framePosOffsets) {
- g_vars->scene04_jumpingKozyawki[i] = *kozmov->_framePosOffsets[kozmov->_currDynamicPhaseIndex];
+ if (kozmov->_framePosOffsets.size()) {
+ g_vars->scene04_jumpingKozyawki[i] = kozmov->_framePosOffsets[kozmov->_currDynamicPhaseIndex];
} else {
kozmov->_somePoint.x = 0;
kozmov->_somePoint.y = 0;
@@ -114,8 +114,8 @@ void scene04_initScene(Scene *sc) {
for (uint i = 0; i < kozsize; i++) {
kozmov->setDynamicPhaseIndex(i);
- if (kozmov->_framePosOffsets) {
- g_vars->scene04_jumpRotateKozyawki[i] = *kozmov->_framePosOffsets[kozmov->_currDynamicPhaseIndex];
+ if (kozmov->_framePosOffsets.size()) {
+ g_vars->scene04_jumpRotateKozyawki[i] = kozmov->_framePosOffsets[kozmov->_currDynamicPhaseIndex];
} else {
kozmov->_somePoint.x = 0;
kozmov->_somePoint.y = 0;
@@ -747,8 +747,8 @@ void sceneHandler04_kozMove(Movement *mov, int from, int to, Common::Point *poin
mov->setDynamicPhaseIndex(i);
Common::Point *p;
- if (mov->_framePosOffsets) {
- p = mov->_framePosOffsets[mov->_currDynamicPhaseIndex];
+ if (mov->_framePosOffsets.size()) {
+ p = &mov->_framePosOffsets[mov->_currDynamicPhaseIndex];
} else {
p = &mov->_somePoint;
p->x = 0;
diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp
index 169d06c331..eab6cf63ca 100644
--- a/engines/fullpipe/scenes/scene09.cpp
+++ b/engines/fullpipe/scenes/scene09.cpp
@@ -190,14 +190,14 @@ void sceneHandler09_spitterClick() {
if (g_vars->scene09_spitter->_flags & 4) {
PicAniInfo info;
- g_vars->scene09_spitter->getPicAniInfo(&info);
+ g_vars->scene09_spitter->getPicAniInfo(info);
g_vars->scene09_spitter->_messageQueueId = 0;
g_vars->scene09_spitter->changeStatics2(ST_PLV_SIT);
int x = g_vars->scene09_spitter->_ox - 10;
int y = g_vars->scene09_spitter->_oy + 145;
- g_vars->scene09_spitter->setPicAniInfo(&info);
+ g_vars->scene09_spitter->setPicAniInfo(info);
if (ABS(x - g_fp->_aniMan->_ox) > 1 || ABS(y - g_fp->_aniMan->_oy) > 1) {
MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, y, 1, ST_MAN_UP);
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index 9181bc7d65..3b6ff0745d 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -217,9 +217,9 @@ void scene18_initScene1(Scene *sc) {
g_vars->scene18_girlJumpY += newy;
for (uint i = 0; i < g_vars->scene18_swingers.size(); i++) {
- g_vars->scene18_swingers[i]->ani->getPicAniInfo(&info);
+ g_vars->scene18_swingers[i]->ani->getPicAniInfo(info);
sc->addStaticANIObject(g_vars->scene18_swingers[i]->ani, 1);
- g_vars->scene18_swingers[i]->ani->setPicAniInfo(&info);
+ g_vars->scene18_swingers[i]->ani->setPicAniInfo(info);
g_vars->scene18_swingers[i]->sx += newx;
g_vars->scene18_swingers[i]->sy += newy;
@@ -257,9 +257,9 @@ void scene18_initScene1(Scene *sc) {
g_fp->playSound(sndid, 1);
- g_vars->scene18_boy->getPicAniInfo(&info);
+ g_vars->scene18_boy->getPicAniInfo(info);
sc->addStaticANIObject(g_vars->scene18_boy, 1);
- g_vars->scene18_boy->setPicAniInfo(&info);
+ g_vars->scene18_boy->setPicAniInfo(info);
int x, y;
@@ -273,9 +273,9 @@ void scene18_initScene1(Scene *sc) {
g_vars->scene18_boy->setOXY(newx + x, newy + y);
- g_vars->scene18_girl->getPicAniInfo(&info);
+ g_vars->scene18_girl->getPicAniInfo(info);
sc->addStaticANIObject(g_vars->scene18_girl, 1);
- g_vars->scene18_girl->setPicAniInfo(&info);
+ g_vars->scene18_girl->setPicAniInfo(info);
if (g_vars->scene18_girl->_movement) {
x = g_vars->scene18_girl->_movement->_ox;
diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp
index 248049f757..6871f37adb 100644
--- a/engines/fullpipe/scenes/scene25.cpp
+++ b/engines/fullpipe/scenes/scene25.cpp
@@ -161,14 +161,14 @@ void sceneHandler25_enterMan() {
void sceneHandler25_enterTruba() {
PicAniInfo info;
- g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->getPicAniInfo(info);
g_fp->_aniMan->_messageQueueId = 0;
g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
int x = g_fp->_aniMan->_ox;
int y = g_fp->_aniMan->_oy;
- g_fp->_aniMan->setPicAniInfo(&info);
+ g_fp->_aniMan->setPicAniInfo(info);
int id = g_fp->_aniMan->_statics->_staticsId;
int qid = 0;
@@ -196,14 +196,14 @@ void sceneHandler25_saveEntrance(int value) {
void sceneHandler25_toLadder() {
PicAniInfo info;
- g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->getPicAniInfo(info);
g_fp->_aniMan->_messageQueueId = 0;
g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
int x = g_fp->_aniMan->_ox;
int y = g_fp->_aniMan->_oy;
- g_fp->_aniMan->setPicAniInfo(&info);
+ g_fp->_aniMan->setPicAniInfo(info);
int id = g_fp->_aniMan->_statics->_staticsId;
int qid = 0;
@@ -275,14 +275,14 @@ void sceneHandler25_sneeze() {
void sceneHandler25_rowShovel() {
PicAniInfo info;
- g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->getPicAniInfo(info);
g_fp->_aniMan->_messageQueueId = 0;
g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
int x = g_fp->_aniMan->_ox;
int y = g_fp->_aniMan->_oy;
- g_fp->_aniMan->setPicAniInfo(&info);
+ g_fp->_aniMan->setPicAniInfo(info);
int id = g_fp->_aniMan->_statics->_staticsId;
int qid = 0;
@@ -309,14 +309,14 @@ void sceneHandler25_rowShovel() {
void sceneHandler25_rowHand() {
PicAniInfo info;
- g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->getPicAniInfo(info);
g_fp->_aniMan->_messageQueueId = 0;
g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
int x = g_fp->_aniMan->_ox;
int y = g_fp->_aniMan->_oy;
- g_fp->_aniMan->setPicAniInfo(&info);
+ g_fp->_aniMan->setPicAniInfo(info);
int id = g_fp->_aniMan->_statics->_staticsId;
int qid = 0;
@@ -363,14 +363,14 @@ void sceneHandler25_tryWater() {
void sceneHandler25_tryRow(int obj) {
PicAniInfo info;
- g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->getPicAniInfo(info);
g_fp->_aniMan->_messageQueueId = 0;
g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000);
int x = g_fp->_aniMan->_ox;
int y = g_fp->_aniMan->_oy;
- g_fp->_aniMan->setPicAniInfo(&info);
+ g_fp->_aniMan->setPicAniInfo(info);
int qid = 0;