[Scummvm-git-logs] scummvm master -> 92b22b4c8a8ad5caf7b258abc7074b4681af49d1
sev-
sev at scummvm.org
Fri Sep 9 19:33:08 CEST 2016
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:
4fc6f02331 FULLPIPE: Make calculation in scene27 more readable
7865308d5e FULLPIPE: Fix bat knocking in scene27
92b22b4c8a FULLPIPE: More debug output to scene27
Commit: 4fc6f0233111fa693c452917df08c2266f5affdd
https://github.com/scummvm/scummvm/commit/4fc6f0233111fa693c452917df08c2266f5affdd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-09T17:08:08+02:00
Commit Message:
FULLPIPE: Make calculation in scene27 more readable
Changed paths:
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index 21c8209..efbf4f7 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -338,7 +338,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(2, kDebugSceneLogic, "scene27: knockBats(%d, %d)", bat1n, bat2n);
if (0.0 != bat1->power) {
- double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ atan2(bat2->currY - bat1->currY, bat2->currX - bat1->currX);
double rndCos = cos(rndF);
double rndSin = sin(rndF);
@@ -354,7 +354,7 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat1 to: powerCos: %f powerSin: %f", bat1->powerCos, bat1->powerSin);
- rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.0000009155552842799158 - 0.015
+ rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ atan2(bat1->currY - bat2->currY, bat1->currX - bat2->currX));
double pow2x = cos(bat2->angle - rndF) * (double)((bat1->currX - bat2->currX) >= 0 ? 1 : -1) * bat2->power;
double pow2y = sin(bat2->angle - rndF) * (double)((bat1->currY - bat2->currY) >= 0 ? 1 : -1) * bat2->power;
Commit: 7865308d5e9cf6bf81712ef320e639443886f20c
https://github.com/scummvm/scummvm/commit/7865308d5e9cf6bf81712ef320e639443886f20c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-09T18:47:20+02:00
Commit Message:
FULLPIPE: Fix bat knocking in scene27
Changed paths:
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index efbf4f7..dce8959 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -337,14 +337,12 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(2, kDebugSceneLogic, "scene27: knockBats(%d, %d)", bat1n, bat2n);
- if (0.0 != bat1->power) {
+ if (bat1->power != 0.0) {
double rndF = (double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ atan2(bat2->currY - bat1->currY, bat2->currX - bat1->currX);
- double rndCos = cos(rndF);
- double rndSin = sin(rndF);
- double pow1x = cos(bat1->angle - rndF) * (double)((bat2->currX - bat1->currX) >= 0 ? 1 : -1) * bat1->power;
- double pow1y = sin(bat1->angle - rndF) * (double)((bat2->currY - bat1->currY) >= 0 ? 1 : -1) * bat1->power;
+ double pow1x = cos(bat1->angle - rndF) * ((bat2->currX - bat1->currX) >= 0 ? bat1->power : -bat1->power);
+ double pow1y = sin(bat1->angle - rndF) * ((bat2->currY - bat1->currY) >= 0 ? bat1->power : -bat1->power);
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat1 from: powerCos: %f powerSin: %f, power: %f, angle: %f",
bat1->powerCos, bat1->powerSin, bat1->power, bat1->angle);
@@ -354,10 +352,10 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat1 to: powerCos: %f powerSin: %f", bat1->powerCos, bat1->powerSin);
- rndF = ((double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
- + atan2(bat1->currY - bat2->currY, bat1->currX - bat2->currX));
- double pow2x = cos(bat2->angle - rndF) * (double)((bat1->currX - bat2->currX) >= 0 ? 1 : -1) * bat2->power;
- double pow2y = sin(bat2->angle - rndF) * (double)((bat1->currY - bat2->currY) >= 0 ? 1 : -1) * bat2->power;
+ double rndF2 = (double)g_fp->_rnd->getRandomNumber(32767) * 0.03 / 32767.0 - 0.015
+ + atan2(bat1->currY - bat2->currY, bat1->currX - bat2->currX);
+ double pow2x = cos(bat2->angle - rndF2) * ((bat1->currX - bat2->currX) >= 0 ? bat2->power : -bat2->power);
+ double pow2y = sin(bat2->angle - rndF2) * ((bat1->currY - bat2->currY) >= 0 ? bat2->power : -bat2->power);
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat2 from: powerCos: %f powerSin: %f, power: %f, angle: %f",
bat2->powerCos, bat2->powerSin, bat2->power, bat2->angle);
@@ -367,11 +365,14 @@ void sceneHandler27_knockBats(int bat1n, int bat2n) {
debugC(3, kDebugSceneLogic, "scene27: knockBats: bat2 to: powerCos: %f powerSin: %f", bat2->powerCos, bat2->powerSin);
+ double rndCos = cos(rndF);
+ double rndSin = sin(rndF);
+
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->angle);
- bat1->currX = (double)bat1->currX - cos(bat1->angle) * (dist + 1.0);
- bat1->currY = (double)bat1->currY - sin(bat1->angle) * (dist + 1.0);
+ bat1->currX = bat1->currX - cos(bat1->angle) * (dist + 1.0);
+ bat1->currY = bat1->currY - sin(bat1->angle) * (dist + 1.0);
bat1->powerCos += pow2x * 0.64;
Commit: 92b22b4c8a8ad5caf7b258abc7074b4681af49d1
https://github.com/scummvm/scummvm/commit/92b22b4c8a8ad5caf7b258abc7074b4681af49d1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-09T19:32:15+02:00
Commit Message:
FULLPIPE: More debug output to scene27
Changed paths:
engines/fullpipe/scenes/scene27.cpp
diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp
index dce8959..3589cc1 100644
--- a/engines/fullpipe/scenes/scene27.cpp
+++ b/engines/fullpipe/scenes/scene27.cpp
@@ -423,6 +423,8 @@ void sceneHandler27_batSetColors(int batn) {
}
void sceneHandler27_driverPushButton() {
+ debugC(2, kDebugSceneLogic, "scene27: driverPushButton");
+
if (g_fp->getObjectState(sO_Driver) == g_fp->getObjectEnumState(sO_Driver, sO_WithSteering)) {
g_vars->scene27_driver->changeStatics2(ST_DRV_VENT);
chainQueue(QU_DRV_PUSHBUTTON, 1);
@@ -537,6 +539,8 @@ void sceneHandler27_calcWinArcade() {
}
void sceneHandler27_regenBats() {
+ debugC(2, kDebugSceneLogic, "scene27: regenBats");
+
g_vars->scene27_wipeIsNeeded = false;
for (uint i = 0; i < g_vars->scene27_var07.size(); i++) {
@@ -639,6 +643,8 @@ int sceneHandler27(ExCommand *cmd) {
break;
case MSG_SC27_STARTWIPE:
+ debugC(2, kDebugSceneLogic, "scene27: STARTWIPE");
+
g_vars->scene27_wipeIsNeeded = true;
g_fp->playSound(SND_27_027, 0);
More information about the Scummvm-git-logs
mailing list