[Scummvm-cvs-logs] scummvm master -> a231d6c7d2a28a92830a347cee1654a97da4ca59
sev-
sev at scummvm.org
Wed Feb 5 23:00:36 CET 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7ece1b1ea6 FULLPIPE: Implement sceneHandler27_batSetColors()
ff50ea73bf FULLPIPE: Implement sceneHandler27_knockBats()
a231d6c7d2 FULLPIPE: Bugfix in scene27
Commit: 7ece1b1ea6e10e4f358d86cfdb741dfbfe30eaf3
https://github.com/scummvm/scummvm/commit/7ece1b1ea6e10e4f358d86cfdb741dfbfe30eaf3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-02-05T13:58:43-08:00
Commit Message:
FULLPIPE: Implement sceneHandler27_batSetColors()
Changed paths:
engines/fullpipe/constants.h
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index f61444e..92d6693 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -1105,6 +1105,8 @@ namespace Fullpipe {
#define SND_27_027 4128
#define SND_27_044 4687
#define ST_BTA_FALL 2054
+#define ST_BTA_HILITE 2052
+#define ST_BTA_NORM 2028
#define ST_DRV_VENT 1996
#define ST_MID_BROOM 2022
#define ST_MID_SPADE 3489
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 52dc42f..ef765be 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -366,8 +366,20 @@ void sceneHandler27_knockBats(int bat1, int bat2) {
warning("STUB: sceneHandler27_knockBats()");
}
-void sceneHandler27_batSetColors(int bat) {
- warning("STUB: sceneHandler27_batSetColors()");
+void sceneHandler27_batSetColors(int batn) {
+ Bat *bat = g_vars->scene27_bats[batn];
+
+ if (g_vars->scene27_hitZone->isPixelHitAtPos((int)bat->currX, (int)bat->currY) ) {
+ if (bat->ani->_statics->_staticsId == ST_BTA_NORM) {
+ if (!bat->ani->_movement)
+ bat->ani->_statics = bat->ani->getStaticsById(ST_BTA_HILITE);
+ }
+ } else {
+ if (bat->ani->_statics->_staticsId == ST_BTA_HILITE) {
+ if (!bat->ani->_movement)
+ bat->ani->_statics = bat->ani->getStaticsById(ST_BTA_NORM);
+ }
+ }
}
void sceneHandler27_calcWinArcade() {
Commit: ff50ea73bf98445faf30cfda2482d532ed5c2a38
https://github.com/scummvm/scummvm/commit/ff50ea73bf98445faf30cfda2482d532ed5c2a38
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-02-05T13:58:43-08:00
Commit Message:
FULLPIPE: Implement sceneHandler27_knockBats()
Changed paths:
engines/fullpipe/constants.h
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 92d6693..730dc71 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -1102,6 +1102,7 @@ namespace Fullpipe {
#define QU_DRV_GIVEVENT 2040
#define QU_MID_CLEANVENT 4583
#define QU_SC27_SHOWBET 3368
+#define SND_27_026 4127
#define SND_27_027 4128
#define SND_27_044 4687
#define ST_BTA_FALL 2054
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index ef765be..6ca0cb8 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -362,8 +362,56 @@ bool sceneHandler27_batCalcDistance(int bat1, int bat2) {
return sqrt(ax * ax * 0.25 + ay * ay) * 54.0 > sqrt(dx * dx + dy * dy);
}
-void sceneHandler27_knockBats(int bat1, int bat2) {
- warning("STUB: sceneHandler27_knockBats()");
+void sceneHandler27_knockBats(int bat1n, int bat2n) {
+ Bat *bat1 = g_vars->scene27_bats[bat1n];
+ Bat *bat2 = g_vars->scene27_bats[bat2n];
+
+ if (0.0 != bat1->power) {
+ double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ + atan2(bat2->currX - bat1->currX, bat2->currY - bat1->currY);
+ double rndCos = cos(rndF);
+ double rndSin = sin(rndF);
+
+ double pow1x = cos(bat1->field_10 - rndF) * (double)((int)(bat2->currX - bat1->currX) >= 0 ? 1 : -1) * bat1->power;
+ double pow1y = sin(bat1->field_10 - rndF) * (double)((int)(bat2->currY - bat1->currY) >= 0 ? 1 : -1) * bat1->power;
+
+ bat1->powerCos -= pow1x * 1.1;
+ bat1->powerSin -= pow1y * 1.1;
+
+ rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ + atan2(bat1->currX - bat2->currX, bat1->currY - bat2->currY));
+ double pow2x = cos(bat2->field_10 - rndF) * (double)((int)(bat1->currX - bat2->currX) >= 0 ? 1 : -1) * bat2->power;
+ double pow2y = sin(bat2->field_10 - rndF) * (double)((int)(bat1->currY - bat2->currY) >= 0 ? 1 : -1) * bat2->power;
+
+ bat2->powerCos -= pow2x * 1.1;
+ bat2->powerSin -= pow2y * 1.1;
+
+ double dy = bat1->currY - bat2->currY;
+ double dx = bat1->currX - bat2->currX;
+ double dist = (sqrt(rndSin * rndSin * 0.25 + rndCos * rndCos) * 54.0 - sqrt(dx * dx + dy * dy)) / cos(rndF - bat1->field_10);
+ bat1->currX -= cos(bat1->field_10) * (dist + 1.0);
+ bat1->currY -= sin(bat1->field_10) * (dist + 1.0);
+ bat1->powerCos += pow2x * 0.64;
+
+ if (bat1->currX <= 500.0)
+ bat1->powerSin = 0.0;
+ else
+ bat1->powerSin += pow2y * 0.64;
+
+ bat1->field_10 = atan2(bat1->powerCos, bat1->powerSin);
+ bat1->power = sqrt(bat1->powerCos * bat1->powerCos + bat1->powerSin * bat1->powerSin);
+ bat2->powerCos += pow1x * 0.64;
+
+ if (bat2->currX <= 500.0)
+ bat2->powerSin = 0;
+ else
+ bat2->powerSin += pow1y * 0.64;
+
+ bat2->field_10 = atan2(bat2->powerCos, bat2->powerSin);
+ bat2->power = sqrt(bat2->powerCos * bat2->powerCos + bat2->powerSin * bat2->powerSin);
+
+ g_fp->playSound(SND_27_026, 0);
+ }
}
void sceneHandler27_batSetColors(int batn) {
Commit: a231d6c7d2a28a92830a347cee1654a97da4ca59
https://github.com/scummvm/scummvm/commit/a231d6c7d2a28a92830a347cee1654a97da4ca59
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-02-05T13:58:44-08:00
Commit Message:
FULLPIPE: Bugfix in scene27
Changed paths:
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 6ca0cb8..1807266 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -33,6 +33,7 @@
#include "fullpipe/interaction.h"
#include "fullpipe/behavior.h"
+#define DBG 1
namespace Fullpipe {
@@ -243,6 +244,11 @@ void sceneHandler27_clickBat(ExCommand *cmd) {
int bx = g_vars->scene27_bat->_ox - 5;
int by = g_vars->scene27_bat->_oy - 71;
+#if DBG
+ sceneHandler27_throwBat();
+ return;
+#endif
+
if (ABS(bx - g_fp->_aniMan->_ox) > 1 || ABS(by - g_fp->_aniMan->_oy) > 1
|| g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, bx, by, 1, ST_MAN_RIGHT);
@@ -258,6 +264,9 @@ void sceneHandler27_clickBat(ExCommand *cmd) {
}
void sceneHandler27_maidSwab() {
+#if DBG
+ return;
+#endif
if (g_fp->getObjectState(sO_Maid) == g_fp->getObjectEnumState(sO_Maid, sO_WithSwab))
g_vars->scene27_maid->changeStatics2(ST_MID_SWAB);
}
@@ -343,8 +352,10 @@ bool sceneHandler27_batFallLogic(int batn) {
if (bat->currX - y > 15.0 || bat->ani->_statics->_staticsId == ST_BTA_FALL) {
bat->ani->_priority = 2020;
- g_vars->scene27_var07.remove_at(batn);
g_vars->scene27_var07.push_back(bat);
+
+ if (batn != g_vars->scene27_var07.size() - 1)
+ g_vars->scene27_var07.remove_at(batn);
} else if (!bat->ani->_movement) {
bat->ani->startAnim(MV_BTA_FALL, 0, -1);
}
More information about the Scummvm-git-logs
mailing list