Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify foliage rendering #7366

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Simplify foliage rendering #7366

merged 1 commit into from
Aug 28, 2024

Conversation

glebm
Copy link
Collaborator

@glebm glebm commented Aug 24, 2024

During ReencodeDungeonCels, extracts floor tile foliage into a triangle with the floor frame and a separate 16-px tall TransparentSquare.

This means that the floor frames are now always triangles and the foliage can be rendered directly without masking.

Dungeon graphics sizes:

Map Frames Foliage frames Byte size Before PR After PR
Town 3,803 41 2,317,832 2,242,056 2,242,190
L1 1,119 11 738,836 721,604 721,110
L4 1,091 6 603,140 584,500 584,242

RG99 binary size reduced by ~4 KiB: 2,426,380 bytes -> 2,421,388 bytes

@glebm glebm force-pushed the extract-foliage branch 4 times, most recently from bc87e0e to 9d1ed7c Compare August 24, 2024 15:13
@glebm glebm marked this pull request as ready for review August 24, 2024 15:13
@glebm glebm enabled auto-merge (rebase) August 24, 2024 15:13
@glebm glebm requested a review from AJenbo August 24, 2024 16:00
@glebm glebm force-pushed the extract-foliage branch 4 times, most recently from 6a5a7d4 to f60659b Compare August 26, 2024 09:33
@AJenbo
Copy link
Member

AJenbo commented Aug 26, 2024

uh, this has a conflict now :o

@glebm
Copy link
Collaborator Author

glebm commented Aug 27, 2024

Rebased

During `ReencodeDungeonCels`, extracts floor tile foliage into
a triangle with the floor frame and a separate 16-px tall `TransparentSquare`.

This means that the floor frames are now always triangles and
the foliage can be rendered directly without masking.

Dungeon graphics sizes:

Map  | Frames | Foliage frames | Byte size  | Before PR | After PR
-----|--------|---------------:|-----------:|----------:|----------:
Town |  3,803 |             41 | 2,317,832  | 2,242,056 | 2,242,190
L1   |  1,119 |             11 |   738,836  |   721,604 |   721,110
L4   |  1,091 |              6 |   603,140  |   584,500 |   584,242

RG99 binary size reduced by ~4 KiB: 2,426,380 bytes -> 2,421,388 bytes
@glebm glebm merged commit 2580cd7 into diasurgical:master Aug 28, 2024
22 checks passed
@AJenbo
Copy link
Member

AJenbo commented Aug 28, 2024

Nice to have it split the data like this, also good to have the comments to explain what it's doing.

@glebm glebm deleted the extract-foliage branch August 28, 2024 23:36
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