From c08a4fdba13319b1af96e120297d4aee792f360f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 2 Apr 2014 06:14:15 +0300 Subject: FULLPIPE: Implement sceneHandler29_shootRed() --- engines/fullpipe/constants.h | 2 +- engines/fullpipe/scenes/scene29.cpp | 71 ++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 2 deletions(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 8e3803be27..0d1db26669 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1305,8 +1305,8 @@ namespace Fullpipe { #define MV_PTR_MOVEFAST 2102 #define MV_SHG_HITASS 2151 #define MV_SHG_NORM 2117 -#define MV_SHG_NORM 2117 #define MV_SHR_HITASS 2152 +#define MV_SHR_NORM 2131 #define MV_STR1_SHOOT 2109 #define MV_STR2_SHOOT 2112 #define PIC_SC29_LTRUBA 2081 diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp index 5b14a3fb71..21454906d7 100644 --- a/engines/fullpipe/scenes/scene29.cpp +++ b/engines/fullpipe/scenes/scene29.cpp @@ -249,7 +249,76 @@ void sceneHandler29_shootGreen() { } void sceneHandler29_shootRed() { - warning("STUB: sceneHandler29_shootRed()"); + if (g_vars->scene29_var05.numBalls) { + int x = g_vars->scene29_shooter1->_ox - 101; + int y = g_vars->scene29_shooter1->_oy - 14; + StaticANIObject *ani = g_vars->scene29_var05.pHead->ani; + Ball *oldhead = g_vars->scene29_var05.pHead; + Ball *oldp0 = g_vars->scene29_var05.pHead->p0; + + g_vars->scene29_var05.pHead = g_vars->scene29_var05.pHead->p0; + + if (g_vars->scene29_var05.pHead) + oldp0->p1 = 0; + else + g_vars->scene29_var05.field_8 = 0; + + oldhead->p0 = g_vars->scene29_var05.pTail; + + g_vars->scene29_var05.pTail = oldhead; + g_vars->scene29_var05.numBalls--; + + if (!g_vars->scene29_var05.numBalls) { + g_vars->scene29_var05.numBalls = 0; + g_vars->scene29_var05.pTail = 0; + g_vars->scene29_var05.field_8 = 0; + g_vars->scene29_var05.pHead = 0; + + free(g_vars->scene29_var05.cPlex); + g_vars->scene29_var05.cPlex = 0; + } + + ani->show1(x, y, MV_SHR_NORM, 0); + ani->_priority = 5; + + Ball *runPtr = g_vars->scene29_var07.pTail; + Ball *lastP = g_vars->scene29_var07.field_8; + + if (!g_vars->scene29_var07.pTail) { + g_vars->scene29_var07.cPlex = (byte *)calloc(g_vars->scene29_var07.cPlexLen, sizeof(Ball)); + + byte *p1 = g_vars->scene29_var07.cPlex + (g_vars->scene29_var07.cPlexLen - 1) * sizeof(Ball); + + if (g_vars->scene29_var07.cPlexLen - 1 < 0) { + runPtr = g_vars->scene29_var07.pTail; + } else { + runPtr = g_vars->scene29_var07.pTail; + + for (int j = 0; j < g_vars->scene29_var07.cPlexLen; j++) { + ((Ball *)p1)->p1 = runPtr; + runPtr = (Ball *)p1; + + p1 -= sizeof(Ball); + } + + g_vars->scene29_var07.pTail = runPtr; + } + } + g_vars->scene29_var07.pTail = runPtr->p0; + runPtr->p1 = lastP; + runPtr->p0 = 0; + runPtr->ani = ani; + + g_vars->scene29_var07.numBalls++; + + if (g_vars->scene29_var07.field_8) { + g_vars->scene29_var07.field_8->p0 = runPtr; + g_vars->scene29_var07.field_8 = runPtr; + } else { + g_vars->scene29_var07.pHead = runPtr; + g_vars->scene29_var07.field_8 = runPtr; + } + } } void sceneHandler29_manJump() { -- cgit v1.2.3