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

MACVENTURE: Fix/Refactor code to work with changes made in macgui and other parts of engine #3168

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

@DivyamAhuja
Copy link
Contributor

@DivyamAhuja DivyamAhuja commented Jul 18, 2021

No description provided.

@digitall
Copy link
Member

@digitall digitall commented Jul 18, 2021

@DivyamAhuja : Thanks for your contribution. Could you rebase this to remove the merge commit please?

@DivyamAhuja DivyamAhuja force-pushed the DivyamAhuja:macventure branch from def22ae to bd1c755 Jul 18, 2021

delete stream;
}
if (type == MacVenture::kInvWindow || type == MacVenture::kZoomDoc) {

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

Please use tabs here and format properly.

}

if (canHaveTitle) {
stream = _engine->getBorderFile(type, active);

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

I wonder why you are allocating a new stream for the same thing each time (at least judging from the diff I can see here)?

It should really be enough to do that once but reset it each time you use is for other stuff. Would also simplify the code because you can early opt-out if the stream is nullptr

@@ -723,7 +774,7 @@ void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSur
surface->frameRect(testBounds, kColorGreen);
}
}
Common::Point composePosition = Common::Point(border.leftOffset, border.topOffset);
Common::Point composePosition = Common::Point(0, 0);//border.leftOffset, border.topOffset);

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

the commented code can be removed.

@@ -844,7 +895,7 @@ void Gui::updateExit(ObjID obj) {
if (!_engine->isObjExit(obj)) {
return;
}
BorderBounds border = borderBounds(getWindowData(kExitsWindow).type);
//BorderBounds border = borderBounds(getWindowData(kExitsWindow).type);

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

same here and below - remove the commented code - that's basically what the version control system is giving us already.

Graphics::MacWindow *win = _wm.findWindowAtPoint(point);
if (win != nullptr) {
for (it = _windowData->begin(); it != _windowData->end(); it++) {
if ( win == findWindow(it->refcon) && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

formatting and typo in comment

@@ -1435,11 +1490,13 @@ void Gui::selectForDrag(Common::Point cursorPosition) {
if (ref == kNoWindow) {
return;
}

if(_engine->needsClickToContinue())

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

formatting


for (it = _windowStack.begin(); it != _windowStack.end(); it++) {
if ((*it)->getDimensions().contains(x, y)) {
win = reinterpret_cast<Graphics::MacWindow *> (*it);

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

formatting (space between > and ()


for (it = _windowStack.begin(); it != _windowStack.end(); it++) {
if ((*it)->getDimensions().contains(point)) {
win = reinterpret_cast<Graphics::MacWindow *> (*it);

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

formatting

@@ -271,12 +294,13 @@ const Graphics::Font &Gui::getCurrentFont() {
}

void Gui::bringToFront(WindowReference winID) {
findWindow(winID)->setActive(true);
_wm.setActiveWindow(findWindow(winID)->getId());
}

void Gui::setWindowTitle(WindowReference winID, Common::String string) {

This comment has been minimized.

@mgerhardy

mgerhardy Jul 18, 2021
Contributor

the title could get passed by const ref and not by value

@eriktorbjorn
Copy link
Member

@eriktorbjorn eriktorbjorn commented Jul 26, 2021

It's probably much too early for this, but... Something seems to not work quite correctly with the engine. I tried to reproduce this easter egg:

https://www.youtube.com/watch?v=Ptltp_RST1Y

But when I tried to use the torch (or anything else, for that matter) on the closed jar, the jar would open.

Two other things I noticed was that double-clicking on the exit boxes does nothing, and that if I click on an object it takes a while for it to register that I've released the mouse button and is not trying to drag the object around. In a game like Shadowgate, that kind of thing can easily be fatal.

But at least it works a lot better than it used to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants