Skip to content

ShipInit and move ValueViewer rendering out of src#5039

Merged
aMannus merged 1 commit intoHarbourMasters:developfrom
Archez:shipinit-move-valueviewer
Feb 12, 2025
Merged

ShipInit and move ValueViewer rendering out of src#5039
aMannus merged 1 commit intoHarbourMasters:developfrom
Archez:shipinit-move-valueviewer

Conversation

@Archez
Copy link
Contributor

@Archez Archez commented Feb 11, 2025

Uses ShipInit to register and move the ValueViewer rendering to the game state update hook (which places the value viewer draw at the end of the display buffers).

Also cleaned up some left over references for the collision viewer draw method.

Build Artifacts

COND_HOOK(OnGameFrameUpdate, CVAR_VALUE, []() { ValueViewer_SetupDraw(); });
}

RegisterShipInitFunc initFunc(RegisterValueViewerHooks, { CVAR_NAME });
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe to do this outside of the draw loop?

Copy link
Contributor Author

@Archez Archez Feb 11, 2025

Choose a reason for hiding this comment

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

Its not outside the draw loop, OnGameFrameUpdate is executed before drawing is finished.

image

Which is essentially equivalent to where the value viewer draw was added before (from the code diff), so in terms of the Gfx buffer it is setup nearly identically (+/- an extra pair of OPEN/CLOSE_DISPS).

Copy link
Contributor

Choose a reason for hiding this comment

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

perfect, appreciate the thoroughness

@aMannus aMannus merged commit 0ce9807 into HarbourMasters:develop Feb 12, 2025
5 checks passed
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.

4 participants