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

Fix: Missing TextIDs for MQ PAL and change lava size #3449

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Nov 26, 2023

MQ PAL had bad offsets for the messages making it not have the first 4 messages which are Adult trade GI messages and would crash. This address the offsets and adds some debug asserts to help catch when the first text ID is not found.

This also adds a little cleanup and tweaks to the recent KD lava changes. The main change is that one of the lava textures seemingly is "too large" from decomp. It has a size of 64x64 where as all other lava textures are 32x64. The original game code that operates on this lava texture only ever reads the first 2048 pixel values (which is 32x64). Looking at the png output of the 64x64 reveals that the data should have been more like 32x128, and the first half of the data matches the second half.

For texture pack makers, this texture really should just be 32x64 so they can make the "correct" looking texture image before packing.

The relevant part that shows only the first 2048 pixel values are read from the lava texture, where temp_s1 is sLavaFloorLavaTex

for (i = 0; i < 2048; i += 32) {
temp = sinf((((i / 32) + (s16)((arg2 * 50.0f) / 100.0f)) & 0x1F) * (M_PI / 16)) * arg3;
for (i2 = 0; i2 < 32; i2++) {
sp54[i + ((temp + i2) & 0x1F)] = temp_s1[i + i2];
}
}

There is also an offset fix for the lava textures on NMQ PAL where it was off by a few pixels.

Build Artifacts

@aMannus aMannus merged commit 717074f into HarbourMasters:develop-macready Nov 28, 2023
8 checks passed
@Archez Archez deleted the fix-mq-and-lava-offsets branch November 29, 2023 05:14
A-Green-Spoon pushed a commit to A-Green-Spoon/Shipwright that referenced this pull request Nov 30, 2023
…3449)

* Fix text offset for MQ pal and add text ID asserts

* correct lava texture size
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