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

CHAMBER: Remove setjmp/longjmp usage #5656

Merged
merged 1 commit into from Feb 15, 2024
Merged

Conversation

kartiksharmakk
Copy link
Contributor

This PR removes the usage of setjmp/longjmp from chamber engine.

Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

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

Some cleanup and comments are required. Please, avoid recursion.

@@ -175,7 +173,9 @@ void gameLoop(byte *target) {

updateUndrawCursor(target);
refreshSpritesData();
runCommandKeepSp();
uint16 restart = runCommandKeepSp();
if (restart == 1 && g_vm->_shouldRestart)
Copy link
Member

Choose a reason for hiding this comment

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

I would avoid direct usage of magic constant 1. Please use instead something like

#define RUNCOMMAND_RESTART 1337

e.g. set some completely unusual number and assign it to a constant.

engines/chamber/kult.cpp Show resolved Hide resolved

return;
Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend removing this line. We need to unstub this function eventually.

@@ -1665,6 +1658,11 @@ uint16 SCR_3D_ActionsMenu(void) {

runCommand();

if (g_vm->_prioritycommand_1) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you please explain this logic in a comment here?

engines/chamber/script.cpp Show resolved Hide resolved
@sev-
Copy link
Member

sev- commented Feb 15, 2024

Thank you!

@sev- sev- merged commit 95d2648 into scummvm:master Feb 15, 2024
8 checks passed
@kartiksharmakk kartiksharmakk deleted the chamber branch February 16, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants