[Scummvm-cvs-logs] scummvm master -> b0f792bc35e68a3cbb5e964dbdcb9761f98e1496
sev-
sev at scummvm.org
Sat Feb 22 22:06:08 CET 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b0f792bc35 FULLPIPE: Implement sceneHandler09_ballExplode()
Commit: b0f792bc35e68a3cbb5e964dbdcb9761f98e1496
https://github.com/scummvm/scummvm/commit/b0f792bc35e68a3cbb5e964dbdcb9761f98e1496
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-02-22T13:12:45-08:00
Commit Message:
FULLPIPE: Implement sceneHandler09_ballExplode()
Changed paths:
engines/fullpipe/constants.h
engines/fullpipe/scenes/scene09.cpp
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 01bb364..6adf202 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -604,6 +604,7 @@ namespace Fullpipe {
#define MV_MAN9_SHOOT 922
#define MV_VSN_CYCLE2 2987
#define PIC_SC9_LADDER_R 2700
+#define QU_SC9_BALLEXPLODE 938
#define QU_SC9_EATBALL 942
#define QU_TTA9_GOL 4937
#define SND_9_006 3650
diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp
index 6743795..9bff577 100644
--- a/engines/fullpipe/scenes/scene09.cpp
+++ b/engines/fullpipe/scenes/scene09.cpp
@@ -139,6 +139,7 @@ void scene09_initScene(Scene *sc) {
g_vars->scene09_var07.reset();
Ball *b9 = g_vars->scene09_var07.sub04(g_vars->scene09_var07.field_8, 0);
+
b9->ani = sc->getStaticANIObject1ById(ANI_BALL9, -1);
b9->ani->setAlpha(0xc8);
@@ -305,6 +306,7 @@ void sceneHandler09_eatBall() {
g_vars->scene09_flyingBall->hide();
Ball *ball = g_vars->scene09_balls.pHead;
+
if (ball) {
while (ball && ball->ani != g_vars->scene09_flyingBall)
ball = ball->p0;
@@ -462,7 +464,74 @@ void sceneHandler09_collideBall(Ball *ball) {
}
void sceneHandler09_ballExplode(Ball *ball) {
- warning("STUB: sceneHandler09_ballExplode()");
+ if (ball == g_vars->scene09_balls.pHead)
+ g_vars->scene09_balls.pHead = ball->p0;
+ else
+ ball->p1->p0 = ball->p0;
+
+ if (ball == g_vars->scene09_balls.field_8)
+ g_vars->scene09_balls.field_8 = ball->p1;
+ else
+ ball->p0->p1 = ball->p1;
+
+ ball->p0 = g_vars->scene09_balls.pTail;
+
+ g_vars->scene09_balls.pTail = ball;
+ g_vars->scene09_balls.numBalls--;
+
+ if (!g_vars->scene09_balls.numBalls) {
+ g_vars->scene09_balls.pTail = 0;
+ g_vars->scene09_balls.field_8 = 0;
+ g_vars->scene09_balls.pHead = 0;
+ free(g_vars->scene09_balls.cPlex);
+ g_vars->scene09_balls.cPlex = 0;
+ }
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC9_BALLEXPLODE), 0, 1);
+
+ mq->replaceKeyCode(-1, ball->ani->_okeyCode);
+
+ if (!mq->chain(ball->ani))
+ delete mq;
+
+ Ball *runPtr = g_vars->scene09_var07.pTail;
+ Ball *lastP = g_vars->scene09_var07.field_8;
+
+ if (!g_vars->scene09_var07.pTail) {
+ g_vars->scene09_var07.cPlex = (byte *)calloc(g_vars->scene09_var07.cPlexLen, sizeof(Ball));
+
+ byte *p1 = g_vars->scene09_var07.cPlex + (g_vars->scene09_var07.cPlexLen - 1) * sizeof(Ball);
+
+ if (g_vars->scene09_var07.cPlexLen - 1 < 0) {
+ runPtr = g_vars->scene09_var07.pTail;
+ } else {
+ runPtr = g_vars->scene09_var07.pTail;
+
+ for (int j = 0; j < g_vars->scene09_var07.cPlexLen; j++) {
+ ((Ball *)p1)->p1 = runPtr;
+ runPtr = (Ball *)p1;
+
+ p1 -= sizeof(Ball);
+ }
+
+ g_vars->scene09_var07.pTail = runPtr;
+ }
+ }
+
+ g_vars->scene09_var07.pTail = runPtr->p0;
+ runPtr->p1 = lastP;
+ runPtr->p0 = 0;
+ runPtr->ani = ball->ani;
+
+ g_vars->scene09_var07.numBalls++;
+
+ if (g_vars->scene09_var07.field_8) {
+ g_vars->scene09_var07.field_8->p0 = runPtr;
+ g_vars->scene09_var07.field_8 = runPtr;
+ } else {
+ g_vars->scene09_var07.pHead = runPtr;
+ g_vars->scene09_var07.field_8 = runPtr;
+ }
}
void sceneHandler09_checkHangerCollide() {
More information about the Scummvm-git-logs
mailing list