Skip to content

Conversation

@dengr1065
Copy link
Collaborator

This PR removes some more code that is no longer used in the game and code that doesn't do anything useful. Things covered in this PR:

  • Support for resource loading progress bar with web servers that don't include the Content-Length header (Electron sends the header)
  • Commented out code in a few places
  • Handling of contextloss event (it's ugly and cannot workaround the issue anyway)
  • Unused and redundant constants in globalConfig, IS_DEBUG etc.
  • Trailer macro recording and playback code (mods can do this better)
  • Reuse of the primary game canvas and redundant removal from DOM (simplifies the code)
  • Incorrectly named .d.ts files (using the .d.ts extension breaks generated declarations file)

Remove the canvas context loss handling as it was incorrect, simplify
the error conditions in makeOffscreenBuffer and remove commented out
code.
These files do not describe existing JS types and instead define their
own. Usage of .d.ts extension prevents these types from being emitted
when using emitDeclarationOnly, which affects generation of typings for
mod development.
Remove the check of URL beginning with data:image. This is an old API,
so leave other quirks as-is.
Remove globalConfig properties that are not used anywhere, simplify
mobile device detection (mostly unused for normal builds) and merge or
inline config constants where it makes sense.
Unlikely to be used and can be replicated with mods in a much better
way.
Remove lastCanvas/lastContext cache for reusing canvas as creating a new
canvas does not cause performance issue. Additionaly, remove smoothing
classes and buffer registration as they are not used anywhere. Finally,
remove redundant stageDestroyed calls in the InGameState.
@dengr1065 dengr1065 merged commit 7c8e115 into master Jun 19, 2025
1 check passed
@dengr1065 dengr1065 deleted the dengr1065/work-renderer branch July 21, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants