Skip to content

Refactor LaserPositionUpdate as LaserDrawExt and further optimize it - #2336

Draft
DeathFishAtEase wants to merge 14 commits into
Phobos-developers:developfrom
DeathFishAtEase:ImproveLaserPositionUpdate
Draft

Refactor LaserPositionUpdate as LaserDrawExt and further optimize it#2336
DeathFishAtEase wants to merge 14 commits into
Phobos-developers:developfrom
DeathFishAtEase:ImproveLaserPositionUpdate

Conversation

@DeathFishAtEase

Copy link
Copy Markdown
Collaborator

Todo:

  • Refactor LaserPositionUpdate in the form of LaserDrawExt
  • Fix the bug where FLH calculation is incorrect when turning sideways after firing.
  • Confirm the coordination of Nuke with the built-in configuration rules in multi-map files.
    • Especially the issue of whether Nuke handling is correct in scenarios where built-in INI configuration changes occur while entering and exiting multiple maps in succession (e.g., consecutive levels).

DeathFishAtEase and others added 13 commits July 31, 2026 10:49
Pure relocation - the implementation is copied verbatim from
src/Misc/Hooks.LaserDraw.cpp, which keeps only the laser drawing and
Z-adjust hooks.
… a LaserDrawExt O(1) extension

LaserPositionUpdate looked up tracking data in a std::unordered_map on every
frame for every LaserDrawClass. The tracking data now lives in a LaserDrawExt
extension whose pointer is stored split across the two unused 16-bit padding
words of LaserDrawClass (align_22 @ 0x22, align_4A @ 0x4A), giving O(1) access
on the hot path. The extension follows the project Ext conventions (Body.h/cpp,
ExtContainer/ExtMap, TypeRegistry registration).
@DeathFishAtEase DeathFishAtEase added ❓Phobos bug Something isn't working properly Needs testing Bugfix This is a bugfix that does not need documentation beyond mention in changelog Skip Changelog PR does not need a changelog entry in docs/Whats-New.md Skip Docs PR does not need a documentation entry Skip Credits PR does not need a credits entry in CREDITS.md labels Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Coronia
Coronia requested a review from Starkku August 11, 2026 04:07
Comment thread src/Ext/LaserDraw/Hooks.cpp Outdated
#include <Helpers/Macro.h>
#include <Utilities/Patch.h>

static void NukeTrackingHooks()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

put this in Phobos::ApplyOptimizations() like all the other hook nuking functions

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This is a bugfix that does not need documentation beyond mention in changelog Needs testing ❓Phobos bug Something isn't working properly Skip Changelog PR does not need a changelog entry in docs/Whats-New.md Skip Credits PR does not need a credits entry in CREDITS.md Skip Docs PR does not need a documentation entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants