Skip to content

Conversation

@zohassadar
Copy link
Collaborator

orientationToSpriteTable is used to map the spawnId to the arbitrary sprite ID for the next piece. Reordering the sprites to match the game's piece ID order and reusing tetriminoTypeFromOrientation, this table can be removed.

spawnOrientationFromOrientation may have been created in development when the RNG produced the orientation ID instead of the piece ID, but random spawn orientations weren't desired. As it's currently being used to convert the spawn ID to the same spawn ID, it can be removed.

Reduces PRG usage by 38 bytes

orientationToSpriteTable is used to map the spawnId to the arbitrary sprite ID
for the next piece.  Reordering the sprites to match the game's piece ID order
and reusing tetriminoTypeFromOrientation, this table can be removed.

spawnOrientationFromOrientation may have been created in development when the
RNG produced the orientation ID instead of the piece ID, but random spawn
orientations weren't desired.  As it's currently being used to convert the spawn
ID to the same spawn ID, it can be removed.

Reduces PRG usage by 38 bytes
@kirjavascript
Copy link
Owner

awesome change!

so this is only a change to sprite rendering? the order of the pieces in debug mode will remain the same, etc?

@zohassadar
Copy link
Collaborator Author

Yeah only the next piece sprites are affected, they've been placed in proper TJZOSLI order

@kirjavascript kirjavascript merged commit d28bd74 into kirjavascript:master Jan 30, 2025
@zohassadar zohassadar deleted the remove_legacy_tables branch January 31, 2025 00:20
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