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

Fix: [Emscripten] compile with exceptions enabled, as our AIs depend on it #8434

Merged
merged 2 commits into from Dec 25, 2020

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

Emscripten by default disables exceptions, as it is pretty expensive (it is not implemented in WASM yet, so they have to construct around it).
Our script framework heavily uses exceptions to work, but also our saveload code uses it. This means both were not always functioning as expected, and could crash the game completely.

Description

Compile with exceptions enabled, as our AIs depend on it

Also parts of the saveload code does, and some other places. This
does slow down builds, but for most computers this will not be
measurable. At least, the ones I had access to I could not find
a difference in FPS, mainly as that is heavily limited by the Hz
of the screens of the computer.

Either way, it is better to have a full functional game than a
fast one in my opinion

Additionally, muted the TIC/TOC warning the Emscripten build was throwing.

Limitations

  • Binary is slightly bigger (< 5% bigger)

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

…on it

Also parts of the saveload code does, and some other places. This
does slow down builds, but for most computers this will not be
measurable. At least, the ones I had access to I could not find
a difference in FPS, mainly as that is heavily limited by the Hz
of the screens of the computer.

Either way, it is better to have a full functional game than a
fast one in my opinion
Stop throwing a warning about this, as it is not likely we will
ever implement it.
@LordAro LordAro added the preview This PR is receiving preview builds label Dec 25, 2020
@DorpsGek DorpsGek temporarily deployed to preview-pr-8434 December 25, 2020 19:35 Inactive
@TrueBrain TrueBrain merged commit 6aef116 into OpenTTD:master Dec 25, 2020
@TrueBrain TrueBrain deleted the emscripten_fixes branch December 25, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview This PR is receiving preview builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants