[Scummvm-git-logs] scummvm master -> 733fc49637048ee0479e129dbdcd7e0f3b956f2b
mgerhardy
martin.gerhardy at gmail.com
Wed Nov 25 20:52:43 UTC 2020
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:
edc226ae8e TWINE: use Rect::contains
a9c3c7987f TWINE: removed unused parameters
733fc49637 TWINE: removed frequency parameter from playSample
Commit: edc226ae8e54890ca1be619671d8e1b7d6371eee
https://github.com/scummvm/scummvm/commit/edc226ae8e54890ca1be619671d8e1b7d6371eee
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-11-25T21:47:28+01:00
Commit Message:
TWINE: use Rect::contains
Changed paths:
engines/twine/input.cpp
diff --git a/engines/twine/input.cpp b/engines/twine/input.cpp
index 047c5e2294..d06c0473ce 100644
--- a/engines/twine/input.cpp
+++ b/engines/twine/input.cpp
@@ -161,8 +161,8 @@ bool Input::isMouseHovering(const Common::Rect &rect) const {
if (!_engine->cfgfile.Mouse) {
return false;
}
- Common::Point point = getMousePositions();
- return point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
+ const Common::Point &point = getMousePositions();
+ return rect.contains(point);
}
} // namespace TwinE
Commit: a9c3c7987f933990b336d82deaf148cdae4305b7
https://github.com/scummvm/scummvm/commit/a9c3c7987f933990b336d82deaf148cdae4305b7
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-11-25T21:47:28+01:00
Commit Message:
TWINE: removed unused parameters
Changed paths:
engines/twine/gamestate.cpp
engines/twine/interface.cpp
engines/twine/interface.h
engines/twine/menu.cpp
engines/twine/menuoptions.cpp
engines/twine/redraw.cpp
engines/twine/text.cpp
diff --git a/engines/twine/gamestate.cpp b/engines/twine/gamestate.cpp
index ef8b79b574..4ba2cf754d 100644
--- a/engines/twine/gamestate.cpp
+++ b/engines/twine/gamestate.cpp
@@ -469,7 +469,7 @@ void GameState::processGameoverAnimation() {
const int32 avg = _engine->_collision->getAverageValue(40000, 3200, 500, _engine->lbaTime - startLbaTime);
const int32 cdot = _engine->_screens->crossDot(1, 1024, 100, (_engine->lbaTime - startLbaTime) % 100);
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, 120, 120, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->_renderer->setCameraAngle(0, 0, 0, 0, -cdot, 0, avg);
_engine->_renderer->renderIsoModel(0, 0, 0, 0, 0, 0, gameOverPtr);
_engine->copyBlockPhys(rect);
@@ -479,7 +479,7 @@ void GameState::processGameoverAnimation() {
}
_engine->_sound->playSample(Samples::Explode, _engine->getRandomNumber(2000) + 3096);
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, 120, 120, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->_renderer->setCameraAngle(0, 0, 0, 0, 0, 0, 3200);
_engine->_renderer->renderIsoModel(0, 0, 0, 0, 0, 0, gameOverPtr);
_engine->copyBlockPhys(rect);
diff --git a/engines/twine/interface.cpp b/engines/twine/interface.cpp
index 3fed07a217..c5c7cca738 100644
--- a/engines/twine/interface.cpp
+++ b/engines/twine/interface.cpp
@@ -152,7 +152,7 @@ void Interface::drawLine(int32 startWidth, int32 startHeight, int32 endWidth, in
}
}
-void Interface::blitBox(const Common::Rect &rect, const Graphics::ManagedSurface &source, int32 leftDest, int32 topDest, Graphics::ManagedSurface &dest) {
+void Interface::blitBox(const Common::Rect &rect, const Graphics::ManagedSurface &source, Graphics::ManagedSurface &dest) {
int32 left = rect.left;
const int32 top = rect.top;
const int32 right = rect.right;
diff --git a/engines/twine/interface.h b/engines/twine/interface.h
index f0596c8258..3d43a5411d 100644
--- a/engines/twine/interface.h
+++ b/engines/twine/interface.h
@@ -69,11 +69,9 @@ public:
/**
* Blit button box from working buffer to front buffer
* @param source source screen buffer, in this case working buffer
- * @param leftDest start width to draw the button in destination buffer
- * @param topDest start height to draw the button in destination buffer
* @param dest destination screen buffer, in this case front buffer
*/
- void blitBox(const Common::Rect &rect, const Graphics::ManagedSurface &source, int32 leftDest, int32 topDest, Graphics::ManagedSurface &dest);
+ void blitBox(const Common::Rect &rect, const Graphics::ManagedSurface &source, Graphics::ManagedSurface &dest);
/**
* Draws inside buttons transparent area
* @param colorAdj index to adjust the transparent box color
diff --git a/engines/twine/menu.cpp b/engines/twine/menu.cpp
index 1f6c2c9b3e..a4ea267090 100644
--- a/engines/twine/menu.cpp
+++ b/engines/twine/menu.cpp
@@ -287,7 +287,7 @@ void Menu::drawButtonGfx(const MenuSettings *menuSettings, const Common::Rect &r
}
}
} else {
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, rect.left, rect.top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->_interface->drawTransparentBox(rect, 4);
}
diff --git a/engines/twine/menuoptions.cpp b/engines/twine/menuoptions.cpp
index c3e8e07c0b..ccb4d562d8 100644
--- a/engines/twine/menuoptions.cpp
+++ b/engines/twine/menuoptions.cpp
@@ -146,7 +146,7 @@ void MenuOptions::drawSelectableCharacter(int32 x, int32 y) {
if (selected) {
_engine->_interface->drawSplittedBox(rect, 91);
} else {
- _engine->_interface->blitBox(rect, _engine->workVideoBuffer, rect.left, rect.top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->_interface->drawTransparentBox(rect, 4);
}
diff --git a/engines/twine/redraw.cpp b/engines/twine/redraw.cpp
index 3d88bc1b4f..5903d32e00 100644
--- a/engines/twine/redraw.cpp
+++ b/engines/twine/redraw.cpp
@@ -158,7 +158,7 @@ void Redraw::blitBackgroundAreas() {
const Common::Rect *currentArea = currentRedrawList;
for (int32 i = 0; i < numOfRedrawBox; i++) {
- _engine->_interface->blitBox(*currentArea, _engine->workVideoBuffer, currentArea->left, currentArea->top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(*currentArea, _engine->workVideoBuffer, _engine->frontVideoBuffer);
currentArea++;
}
}
@@ -400,7 +400,7 @@ void Redraw::redrawEngineActions(int32 bgRedraw) { // fullRedraw
addRedrawArea(rect);
if (actor2->staticFlags.bIsBackgrounded && bgRedraw == 1) {
- _engine->_interface->blitBox(rect, _engine->frontVideoBuffer, _engine->_interface->textWindow.left, _engine->_interface->textWindow.top, _engine->workVideoBuffer);
+ _engine->_interface->blitBox(rect, _engine->frontVideoBuffer, _engine->workVideoBuffer);
}
}
}
@@ -487,10 +487,10 @@ void Redraw::redrawEngineActions(int32 bgRedraw) { // fullRedraw
_engine->_grid->drawOverSpriteActor(tmpX, tmpY, tmpZ);
}
- addRedrawArea(_engine->_interface->textWindow.left, _engine->_interface->textWindow.top, _engine->_interface->textWindow.right, _engine->_interface->textWindow.bottom);
+ addRedrawArea(_engine->_interface->textWindow);
if (actor2->staticFlags.bIsBackgrounded && bgRedraw == 1) {
- _engine->_interface->blitBox(_engine->_interface->textWindow, _engine->frontVideoBuffer, _engine->_interface->textWindow.left, _engine->_interface->textWindow.top, _engine->workVideoBuffer);
+ _engine->_interface->blitBox(_engine->_interface->textWindow, _engine->frontVideoBuffer, _engine->workVideoBuffer);
}
// show clipping area
diff --git a/engines/twine/text.cpp b/engines/twine/text.cpp
index 0115016152..b197e04252 100644
--- a/engines/twine/text.cpp
+++ b/engines/twine/text.cpp
@@ -283,7 +283,7 @@ int32 Text::getTextSize(const char *dialogue) { // SizeFont
}
void Text::initDialogueBox() { // InitDialWindow
- _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _dialTextBox.left, _dialTextBox.top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
if (drawTextBoxBackground) {
_engine->_menu->drawBox(_dialTextBox);
@@ -294,11 +294,11 @@ void Text::initDialogueBox() { // InitDialWindow
_engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
- _engine->_interface->blitBox(_dialTextBox, _engine->frontVideoBuffer, _dialTextBox.left, _dialTextBox.top, _engine->workVideoBuffer);
+ _engine->_interface->blitBox(_dialTextBox, _engine->frontVideoBuffer, _engine->workVideoBuffer);
}
void Text::initInventoryDialogueBox() { // SecondInitDialWindow
- _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _dialTextBox.left, _dialTextBox.top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
}
@@ -517,7 +517,7 @@ int Text::updateProgressiveText() {
return 0;
}
if (_progressiveTextNextPage) {
- _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _dialTextBox.left, _dialTextBox.top, _engine->frontVideoBuffer);
+ _engine->_interface->blitBox(_dialTextBox, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->copyBlockPhys(_dialTextBox);
_fadeInCharactersPos = 0;
_progressiveTextNextPage = false;
Commit: 733fc49637048ee0479e129dbdcd7e0f3b956f2b
https://github.com/scummvm/scummvm/commit/733fc49637048ee0479e129dbdcd7e0f3b956f2b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-11-25T21:47:28+01:00
Commit Message:
TWINE: removed frequency parameter from playSample
Changed paths:
engines/twine/actor.cpp
engines/twine/animations.cpp
engines/twine/extra.cpp
engines/twine/flamovies.cpp
engines/twine/gamestate.cpp
engines/twine/redraw.cpp
engines/twine/scene.cpp
engines/twine/script_move_v1.cpp
engines/twine/sound.cpp
engines/twine/sound.h
engines/twine/twine.cpp
diff --git a/engines/twine/actor.cpp b/engines/twine/actor.cpp
index 09d142ce86..601facf7e5 100644
--- a/engines/twine/actor.cpp
+++ b/engines/twine/actor.cpp
@@ -486,12 +486,12 @@ void Actor::processActorExtraBonus(int32 actorIdx) { // GiveExtraBonus
if (actor->dynamicFlags.bIsDead) {
_engine->_extra->addExtraBonus(actor->x, actor->y, actor->z, ANGLE_90, 0, bonusSprite, actor->bonusAmount);
// FIXME add constant for sample index
- _engine->_sound->playSample(Samples::ItemPopup, 4096, 1, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(Samples::ItemPopup, 1, actor->x, actor->y, actor->z, actorIdx);
} else {
const int32 angle = _engine->_movements->getAngleAndSetTargetActorDistance(actor->x, actor->z, _engine->_scene->sceneHero->x, _engine->_scene->sceneHero->z);
_engine->_extra->addExtraBonus(actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, 200, angle, bonusSprite, actor->bonusAmount);
// FIXME add constant for sample index
- _engine->_sound->playSample(Samples::ItemPopup, 4096, 1, actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, actorIdx);
+ _engine->_sound->playSample(Samples::ItemPopup, 1, actor->x, actor->y + actor->boudingBox.y.topRight, actor->z, actorIdx);
}
}
diff --git a/engines/twine/animations.cpp b/engines/twine/animations.cpp
index 02c5148fbb..da12906e49 100644
--- a/engines/twine/animations.cpp
+++ b/engines/twine/animations.cpp
@@ -475,18 +475,17 @@ void Animations::processAnimActions(int32 actorIdx) {
const int16 sampleIdx = stream.readSint16LE();
if (animPos == actor->animPosition) {
- _engine->_sound->playSample(sampleIdx, 4096, 1, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(sampleIdx, 1, actor->x, actor->y, actor->z, actorIdx);
}
break;
}
case ACTION_SAMPLE_FREQ: {
const int32 animPos = stream.readByte();
const int16 sampleIdx = stream.readSint16LE();
- int16 frequency = stream.readSint16LE();
+ /*int16 frequency = */stream.readSint16LE();
if (animPos == actor->animPosition) {
- frequency = _engine->getRandomNumber(frequency) + 4096 - (ABS(frequency) >> 1);
- _engine->_sound->playSample(sampleIdx, frequency, 1, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(sampleIdx, 1, actor->x, actor->y, actor->z, actorIdx);
}
break;
}
@@ -523,7 +522,7 @@ void Animations::processAnimActions(int32 actorIdx) {
const int16 repeat = stream.readSint16LE();
if (animPos == actor->animPosition) {
- _engine->_sound->playSample(sampleIdx, 0x1000, repeat, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(sampleIdx, repeat, actor->x, actor->y, actor->z, actorIdx);
}
break;
}
@@ -573,7 +572,7 @@ void Animations::processAnimActions(int32 actorIdx) {
const int32 animPos = stream.readByte();
if (animPos == actor->animPosition && (actor->brickSound & 0x0F0) != 0x0F0) {
const int16 sampleIdx = (actor->brickSound & 0x0F) + Samples::WalkFloorBegin;
- _engine->_sound->playSample(sampleIdx, _engine->getRandomNumber(1000) + 3596, 1, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(sampleIdx, 1, actor->x, actor->y, actor->z, actorIdx);
}
break;
}
@@ -581,7 +580,7 @@ void Animations::processAnimActions(int32 actorIdx) {
const int32 animPos = stream.readByte();
if (animPos == actor->animPosition && (actor->brickSound & 0x0F0) != 0x0F0) {
const int16 sampleIdx = (actor->brickSound & 0x0F) + Samples::WalkFloorBegin;
- _engine->_sound->playSample(sampleIdx, _engine->getRandomNumber(1000) + 3596, 1, actor->x, actor->y, actor->z, actorIdx);
+ _engine->_sound->playSample(sampleIdx, 1, actor->x, actor->y, actor->z, actorIdx);
}
break;
}
diff --git a/engines/twine/extra.cpp b/engines/twine/extra.cpp
index faa24db797..6c3ff35c9e 100644
--- a/engines/twine/extra.cpp
+++ b/engines/twine/extra.cpp
@@ -694,7 +694,7 @@ void Extra::processExtras() {
int32 angle = ClampAngle(tmpAngle - extra->angle);
if (angle > ToAngle(400) && angle < ToAngle(600)) {
- _engine->_sound->playSample(Samples::ItemFound, 4096, 1, _engine->_scene->sceneHero->x, _engine->_scene->sceneHero->y, _engine->_scene->sceneHero->z, 0);
+ _engine->_sound->playSample(Samples::ItemFound, 1, _engine->_scene->sceneHero->x, _engine->_scene->sceneHero->y, _engine->_scene->sceneHero->z, 0);
if (extraKey->info1 > 1) {
_engine->_renderer->projectPositionOnScreen(extraKey->x - _engine->_grid->cameraX, extraKey->y - _engine->_grid->cameraY, extraKey->z - _engine->_grid->cameraZ);
@@ -727,7 +727,7 @@ void Extra::processExtras() {
_engine->_movements->setActorAngle(0, extra->destZ, 50, &extra->trackActorMove);
if (actorIdx == _engine->_collision->checkExtraCollisionWithExtra(extra, _engine->_gameState->magicBallIdx)) {
- _engine->_sound->playSample(Samples::ItemFound, 4096, 1, _engine->_scene->sceneHero->x, _engine->_scene->sceneHero->y, _engine->_scene->sceneHero->z, 0);
+ _engine->_sound->playSample(Samples::ItemFound, 1, _engine->_scene->sceneHero->x, _engine->_scene->sceneHero->y, _engine->_scene->sceneHero->z, 0);
if (extraKey->info1 > 1) {
_engine->_renderer->projectPositionOnScreen(extraKey->x - _engine->_grid->cameraX, extraKey->y - _engine->_grid->cameraY, extraKey->z - _engine->_grid->cameraZ);
@@ -802,7 +802,7 @@ void Extra::processExtras() {
}
// if extra is magic ball
if (i == _engine->_gameState->magicBallIdx) {
- _engine->_sound->playSample(Samples::Hit, _engine->getRandomNumber(300) + 3946, 1, extra->x, extra->y, extra->z);
+ _engine->_sound->playSample(Samples::Hit, 1, extra->x, extra->y, extra->z);
// cant bounce with not magic points
if (_engine->_gameState->magicBallNumBounce <= 0) {
@@ -875,7 +875,7 @@ void Extra::processExtras() {
if ((extra->type & 0x20) && !(extra->type & 0x2)) {
// if hero touch extra
if (_engine->_collision->checkExtraCollisionWithActors(extra, -1) == 0) {
- _engine->_sound->playSample(Samples::ItemFound, 4096, 1, extra->x, extra->y, extra->z);
+ _engine->_sound->playSample(Samples::ItemFound, 1, extra->x, extra->y, extra->z);
if (extra->info1 > 1 && !_engine->_input->isActionActive(TwinEActionType::MoveBackward)) {
_engine->_renderer->projectPositionOnScreen(extra->x - _engine->_grid->cameraX, extra->y - _engine->_grid->cameraY, extra->z - _engine->_grid->cameraZ);
diff --git a/engines/twine/flamovies.cpp b/engines/twine/flamovies.cpp
index 68d7648f0e..31ef14cb6c 100644
--- a/engines/twine/flamovies.cpp
+++ b/engines/twine/flamovies.cpp
@@ -220,7 +220,7 @@ void FlaMovies::processFrame() {
sample.dummy = stream.readSByte();
sample.x = stream.readByte();
sample.y = stream.readByte();
- _engine->_sound->playFlaSample(sample.sampleNum, sample.freq, sample.repeat, sample.x, sample.y);
+ _engine->_sound->playFlaSample(sample.sampleNum, sample.repeat, sample.x, sample.y);
break;
}
case kStopSample: {
diff --git a/engines/twine/gamestate.cpp b/engines/twine/gamestate.cpp
index 4ba2cf754d..b4b936709d 100644
--- a/engines/twine/gamestate.cpp
+++ b/engines/twine/gamestate.cpp
@@ -478,7 +478,7 @@ void GameState::processGameoverAnimation() {
_engine->_system->delayMillis(15);
}
- _engine->_sound->playSample(Samples::Explode, _engine->getRandomNumber(2000) + 3096);
+ _engine->_sound->playSample(Samples::Explode);
_engine->_interface->blitBox(rect, _engine->workVideoBuffer, _engine->frontVideoBuffer);
_engine->_renderer->setCameraAngle(0, 0, 0, 0, 0, 0, 3200);
_engine->_renderer->renderIsoModel(0, 0, 0, 0, 0, 0, gameOverPtr);
diff --git a/engines/twine/redraw.cpp b/engines/twine/redraw.cpp
index 5903d32e00..6d94449ee2 100644
--- a/engines/twine/redraw.cpp
+++ b/engines/twine/redraw.cpp
@@ -315,7 +315,7 @@ void Redraw::redrawEngineActions(int32 bgRedraw) { // fullRedraw
if (_engine->lbaTime - extra->lifeTime > 35) {
extra->lifeTime = _engine->lbaTime;
extra->type &= 0xFBFF;
- _engine->_sound->playSample(Samples::ItemPopup, 4096, 1, extra->x, extra->y, extra->z);
+ _engine->_sound->playSample(Samples::ItemPopup, 1, extra->x, extra->y, extra->z);
}
} else {
if ((extra->type & 1) || (extra->type & 0x40) || (extra->actorIdx + extra->lifeTime - 150 < _engine->lbaTime) || (!((_engine->lbaTime + extra->lifeTime) & 8))) {
diff --git a/engines/twine/scene.cpp b/engines/twine/scene.cpp
index 050b38376e..5bcc2ea7ba 100644
--- a/engines/twine/scene.cpp
+++ b/engines/twine/scene.cpp
@@ -418,10 +418,10 @@ void Scene::processEnvironmentSound() {
const int16 sampleIdx = _sampleAmbiance[currentAmb];
if (sampleIdx != -1) {
- int16 decal = _sampleRound[currentAmb];
+ /*int16 decal = _sampleRound[currentAmb];*/
int16 repeat = _sampleRepeat[currentAmb];
- _engine->_sound->playSample(sampleIdx, (4096 + _engine->getRandomNumber(decal) - (decal / 2)), repeat, 110, -1, 110);
+ _engine->_sound->playSample(sampleIdx, repeat, 110, -1, 110);
break;
}
}
diff --git a/engines/twine/script_move_v1.cpp b/engines/twine/script_move_v1.cpp
index 6d2a0d1179..a25e8dfcb8 100644
--- a/engines/twine/script_move_v1.cpp
+++ b/engines/twine/script_move_v1.cpp
@@ -300,7 +300,7 @@ static int32 mWAIT_NUM_ANIM(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
static int32 mSAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- engine->_sound->playSample(sampleIdx, 4096, 1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
+ engine->_sound->playSample(sampleIdx, 1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
return 0;
}
@@ -520,9 +520,8 @@ static int32 mWAIT_DOOR(TwinEEngine *engine, MoveScriptContext &ctx) {
* @note Opcode @c 0x1B
*/
static int32 mSAMPLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
- int32 freq = engine->getRandomNumber(2048) + 2048;
int32 sampleIdx = ctx.stream.readSint16LE();
- engine->_sound->playSample(sampleIdx, freq, 1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
+ engine->_sound->playSample(sampleIdx, 1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
return 0;
}
@@ -533,7 +532,7 @@ static int32 mSAMPLE_RND(TwinEEngine *engine, MoveScriptContext &ctx) {
static int32 mSAMPLE_ALWAYS(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
if (!engine->_sound->isSamplePlaying(sampleIdx)) { // if its not playing
- engine->_sound->playSample(sampleIdx, 4096, -1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
+ engine->_sound->playSample(sampleIdx, -1, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
}
return 0;
}
@@ -588,7 +587,7 @@ static int32 mREPEAT_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
*/
static int32 mSIMPLE_SAMPLE(TwinEEngine *engine, MoveScriptContext &ctx) {
int32 sampleIdx = ctx.stream.readSint16LE();
- engine->_sound->playSample(sampleIdx, 4096, ctx.numRepeatSample, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
+ engine->_sound->playSample(sampleIdx, ctx.numRepeatSample, ctx.actor->x, ctx.actor->y, ctx.actor->z, ctx.actorIdx);
ctx.numRepeatSample = 1;
return 0;
}
diff --git a/engines/twine/sound.cpp b/engines/twine/sound.cpp
index ae3402069b..638c60886d 100644
--- a/engines/twine/sound.cpp
+++ b/engines/twine/sound.cpp
@@ -58,7 +58,7 @@ void Sound::setSamplePosition(int32 chan, int32 x, int32 y, int32 z) {
#endif
}
-void Sound::playFlaSample(int32 index, int32 frequency, int32 repeat, int32 x, int32 y) {
+void Sound::playFlaSample(int32 index, int32 repeat, int32 x, int32 y) {
if (!_engine->cfgfile.Sound) {
return;
}
@@ -79,7 +79,7 @@ void Sound::playFlaSample(int32 index, int32 frequency, int32 repeat, int32 x, i
playSample(channelIdx, index, sampPtr, sampSize, repeat, Resources::HQR_FLASAMP_FILE);
}
-void Sound::playSample(int32 index, int32 frequency, int32 repeat, int32 x, int32 y, int32 z, int32 actorIdx) {
+void Sound::playSample(int32 index, int32 repeat, int32 x, int32 y, int32 z, int32 actorIdx) {
if (!_engine->cfgfile.Sound) {
return;
}
diff --git a/engines/twine/sound.h b/engines/twine/sound.h
index 72d3ebfe60..c17a80e5e7 100644
--- a/engines/twine/sound.h
+++ b/engines/twine/sound.h
@@ -76,12 +76,11 @@ public:
/**
* Play FLA movie samples
* @param index sample index under flasamp.hqr file
- * @param frequency frequency used to play the sample
* @param repeat number of times to repeat the sample
* @param x unknown x variable
* @param y unknown y variable
*/
- void playFlaSample(int32 index, int32 frequency, int32 repeat, int32 x, int32 y);
+ void playFlaSample(int32 index, int32 repeat, int32 x, int32 y);
/** Update sample position in channel */
void setSamplePosition(int32 channelIdx, int32 x, int32 y, int32 z);
@@ -89,14 +88,13 @@ public:
/**
* Play samples
* @param index sample index under flasamp.hqr file
- * @param frequency frequency used to play the sample
* @param repeat number of times to repeat the sample
* @param x sound generating entity x position
* @param y sound generating entity y position
* @param z sound generating entity z position
* @param actorIdx
*/
- void playSample(int32 index, int32 frequency = 4096, int32 repeat = 1, int32 x = 128, int32 y = 128, int32 z = 128, int32 actorIdx = -1);
+ void playSample(int32 index, int32 repeat = 1, int32 x = 128, int32 y = 128, int32 z = 128, int32 actorIdx = -1);
/** Pause samples */
void pauseSamples();
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index bdbfd46dba..c28fc804c0 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -746,7 +746,7 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
_animations->initAnim(AnimationTypes::kLandDeath, 4, AnimationTypes::kStanding, 0);
actor->controlMode = ControlMode::kNoMove;
} else {
- _sound->playSample(Samples::Explode, getRandomNumber(2000) + 3096, 1, actor->x, actor->y, actor->z, a);
+ _sound->playSample(Samples::Explode, 1, actor->x, actor->y, actor->z, a);
if (a == _scene->mecaPinguinIdx) {
_extra->addExtraExplode(actor->x, actor->y, actor->z);
@@ -804,8 +804,7 @@ int32 TwinEEngine::runGameEngine() { // mainLoopInteration
actor->staticFlags.bCanDrown |= 0x10; // TODO: doesn't make sense
}
} else {
- const int32 rnd = getRandomNumber(2000) + 3096;
- _sound->playSample(Samples::Explode, rnd, 1, actor->x, actor->y, actor->z, a);
+ _sound->playSample(Samples::Explode, 1, actor->x, actor->y, actor->z, a);
if (actor->bonusParameter.cloverleaf || actor->bonusParameter.kashes || actor->bonusParameter.key || actor->bonusParameter.lifepoints || actor->bonusParameter.magicpoints) {
if (!actor->bonusParameter.unk1) {
_actor->processActorExtraBonus(a);
More information about the Scummvm-git-logs
mailing list