diff options
author | Eugene Sandulenko | 2013-12-28 12:08:40 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-12-28 14:17:49 +0200 |
commit | b42c8e157ec5da523fb0d813bf3e2a4d8573651d (patch) | |
tree | 5fb77307db53b8cbbf0c8f784830bea084c82b7f | |
parent | 08922cd3c46ba6a083baef02e146f8bf52ee5e1d (diff) | |
download | scummvm-rg350-b42c8e157ec5da523fb0d813bf3e2a4d8573651d.tar.gz scummvm-rg350-b42c8e157ec5da523fb0d813bf3e2a4d8573651d.tar.bz2 scummvm-rg350-b42c8e157ec5da523fb0d813bf3e2a4d8573651d.zip |
FULLPIPE: Implement scene11_dudeSwingCallback()
-rw-r--r-- | engines/fullpipe/constants.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene11.cpp | 50 |
2 files changed, 51 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index f9c96611e2..7fd97d22a9 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -515,8 +515,10 @@ namespace Fullpipe { #define QU_SC11_PUTBOOT2 2710 #define QU_SC11_RESTARTMAN 1134 #define QU_SWR_JUMPDOWN 1123 +#define SND_11_020 3704 #define SND_11_022 3706 #define SND_11_024 3708 +#define SND_11_031 5171 #define ST_BTS11_2 2707 #define ST_BTS11_ONE 2706 #define ST_KCH_0 1096 diff --git a/engines/fullpipe/scenes/scene11.cpp b/engines/fullpipe/scenes/scene11.cpp index 804a66b9d2..59720645d9 100644 --- a/engines/fullpipe/scenes/scene11.cpp +++ b/engines/fullpipe/scenes/scene11.cpp @@ -37,7 +37,55 @@ namespace Fullpipe { void scene11_dudeSwingCallback(int *arg) { - warning("STUB: scene11_dudeSwingCallback()"); + int oldarg = *arg; + + *arg = 45 - (int)(g_vars->scene11_var08 * -29.66666666666666); + + if (*arg < 1) + *arg = 1; + + if (*arg > 90) + *arg = 90; + + g_vars->scene11_var11 = (g_vars->scene11_var08 - g_vars->scene11_var09) * -490.0000000000001; + g_vars->scene11_var10 = g_vars->scene11_var11 * 0.0042 + g_vars->scene11_var10 - g_vars->scene11_var12 * (g_vars->scene11_var11 * 0.0042 + g_vars->scene11_var10); + g_vars->scene11_var08 = g_vars->scene11_var10 * 0.0042 + g_vars->scene11_var08; + + if (g_vars->scene11_var08 < -1.5) { + g_vars->scene11_var08 = 1.0004882812500000; + g_vars->scene11_var10 = 1.0; + g_vars->scene11_var11 = 1.0; + } + + if (g_vars->scene11_var08 > 1.5) { + g_vars->scene11_var08 = 1.9990234375; + g_vars->scene11_var10 = 1.0; + g_vars->scene11_var11 = 1.0; + } + + if (g_vars->scene11_var23 == *arg && 0.0 != g_vars->scene11_var10 && fabs(g_vars->scene11_var10) < 2.5) { + g_vars->scene11_var10 = 1.0; + g_vars->scene11_var11 = 1.0; + g_vars->scene11_var08 = g_vars->scene11_var09; + } + + g_vars->scene11_var15++; + + if (g_vars->scene11_var02) { + if (g_vars->scene11_var05 <= 720) { + g_vars->scene11_var05++; + + if (g_vars->scene11_var05 == 720) + g_vars->scene11_hint->_flags |= 4; + } + } + + if (oldarg - 45 >= 0 != *arg - 45 >= 0 && g_vars->scene11_var02) { + if (oldarg >= *arg) + g_fp->playSound(SND_11_031, 0); + else + g_fp->playSound(SND_11_020, 0); + } } void scene11_setupMusic() { |