Skip to content

Macro-ify access to pauseCtx->playerSegment regions#2693

Open
Thar0 wants to merge 2 commits intozeldaret:mainfrom
Thar0:pause-player-segment
Open

Macro-ify access to pauseCtx->playerSegment regions#2693
Thar0 wants to merge 2 commits intozeldaret:mainfrom
Thar0:pause-player-segment

Conversation

@Thar0
Copy link
Collaborator

@Thar0 Thar0 commented Jan 27, 2026

Using macros to indicate which region in the player segment is being accessed makes the memory layout more obvious and indicates the intended level of memory ownership, particularly in the case of the texture image at the start of the segment.

Using macros to indicate which region in the player segment is being
accessed makes the memory layout more obvious and indicates the
intended level of memory ownership, particularly in the case of the
texture image at the start of the segment.

size = gObjectTable[OBJECT_GAMEPLAY_KEEP].vromEnd - gObjectTable[OBJECT_GAMEPLAY_KEEP].vromStart;
ptr = segment + PAUSE_EQUIP_BUFFER_SIZE;
ptr = PAUSE_PLAYER_SEGMENT_GAMEPLAY_KEEP(segment);
Copy link
Contributor

@mzxrules mzxrules Jan 28, 2026

Choose a reason for hiding this comment

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

With all this abstraction, it is no longer clear to the reader that GAMEPLAY_KEEP is being truncated.

Also, another notable thing here is that because OBJECT_GAMEPLAY_KEEP is compressed, the full segment needs to be loaded in first, then overwritten.


#define PAUSE_EQUIP_BUFFER_SIZE sizeof(u16[PAUSE_EQUIP_PLAYER_HEIGHT][PAUSE_EQUIP_PLAYER_WIDTH])
// The pause player segment consists of:
// PAUSE_PLAYER_RENDER_TEX_SIZE RGBA16 texture / framebuffer for rendering the player into
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// PAUSE_PLAYER_RENDER_TEX_SIZE RGBA16 texture / framebuffer for rendering the player into
// PAUSE_PLAYER_SEGMENT_TEX_SIZE RGBA16 texture / framebuffer for rendering the player into

not sure which name you preferred, either sounds fine

@Dragorn421 Dragorn421 requested a review from mzxrules February 14, 2026 18:09
@Dragorn421 Dragorn421 added the Waiting for author There are requested changes that have not been addressed label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting for author There are requested changes that have not been addressed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants