Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIRECTOR: LINGO: Implement the beepOn property and remove their respective STUBs #4010

Merged
merged 1 commit into from Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions engines/director/events.cpp
Expand Up @@ -190,6 +190,10 @@ bool Movie::processEvent(Common::Event &event) {
// Even in D4, `the clickOn` uses the old "active" sprite instead of mouse sprite.
_currentClickOnSpriteId = sc->getActiveSpriteIDFromPos(pos);

if (!spriteId && _isBeepOn) {
g_lingo->func_beep(1);
}

if (spriteId > 0 && sc->_channels[spriteId]->_sprite->shouldHilite()) {
_currentHiliteChannelId = spriteId;
g_director->_wm->_hilitingWidget = true;
Expand Down
5 changes: 3 additions & 2 deletions engines/director/lingo/lingo-the.cpp
Expand Up @@ -377,7 +377,8 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d = g_lingo->_actorList;
break;
case kTheBeepOn:
getTheEntitySTUB(kTheBeepOn);
d.type = INT;
d.u.i = (int)g_director->getCurrentMovie()->_isBeepOn;
break;
case kTheButtonStyle:
d.type = INT;
Expand Down Expand Up @@ -936,7 +937,7 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
g_lingo->_actorList = d;
break;
case kTheBeepOn:
setTheEntitySTUB(kTheBeepOn);
g_director->getCurrentMovie()->_isBeepOn = (bool)d.u.i;
break;
case kTheButtonStyle:
if (d.asInt())
Expand Down
2 changes: 2 additions & 0 deletions engines/director/movie.cpp
Expand Up @@ -87,6 +87,8 @@ Movie::Movie(Window *window) {
_timeOutKeyDown = true;
_timeOutMouse = true;
_timeOutPlay = false;

_isBeepOn = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that beep is on by default, not off. Could you please check with the original?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the D4 Dictionary, beepOn is FALSE by default. I will check with basiliskII and update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the movie. beepOn is off by default in the original too

}

Movie::~Movie() {
Expand Down
2 changes: 2 additions & 0 deletions engines/director/movie.h
Expand Up @@ -168,6 +168,8 @@ class Movie {
bool _timeOutMouse;
bool _timeOutPlay;

bool _isBeepOn;

private:
Window *_window;
DirectorEngine *_vm;
Expand Down