-
Notifications
You must be signed in to change notification settings - Fork 22
Decomp InitDungeonInit #235
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
Conversation
d02ce55 to
fb74272
Compare
src/dungeon_init.c
Outdated
| switch (dungeon_idx) { | ||
| default: | ||
| break; | ||
| case 0x26: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dungeon IDs in these switch statements correspond with the dungeon_id enum in enums.h, so let's swap those out here. 0x26 is DUNGEON_HIDDEN_LAND, for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this, but I didn't want to give the impression that a dungeon index is the same as a dungeon ID.
They're closely linked, and there's a mapping table between index and id here: DUNGEON_SWAP_ID_TABLE.
What makes this even more tricky is that, in practice, the indexes are the same as the IDs, apart from 212 - 219 (inclusive), and the indexes referenced in this PR are always the same as the IDs.
I'm happy to use the ID enum if you feel this is the way to go. I've also asked AI how to use macros to define an ID enum and an index enum from a single source but it was messy. Suggestions are welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, tricky. If defining multiple enums from one source is messy, then we can go the old-fashioned way and define a new dungeon_index enum separately from dungeon_id, with most of the data copied aside from IDs 212-219. You can leave a comment in the new enum mentioning the difference between it and dungeon_id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thank you.
303c74e to
404f722
Compare
No description provided.