-
Notifications
You must be signed in to change notification settings - Fork 41
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
level: read animated textures in TRX #2400
Conversation
This renames the animated texture struct and GBUF details and moves the definition to TRX output.
This uses the same structured approach for animated textures as TR1.
Download the built assets for this pull request: |
8bcf42c
to
0abfec0
Compare
src/tr1/game/level.c
Outdated
size_t end_position = VFile_GetPos(file) | ||
+ m_LevelInfo.anim_texture_range_count * sizeof(int16_t); | ||
const int32_t data_size = VFile_ReadS32(file); | ||
size_t end_position = VFile_GetPos(file) + data_size * sizeof(int16_t); |
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.
Nitpick: const
src/tr2/game/level.c
Outdated
sizeof(int16_t) * num_ranges, GBUF_ANIMATING_TEXTURE_RANGES); | ||
VFile_Read(file, g_AnimTextureRanges, sizeof(int16_t) * num_ranges); | ||
const int32_t data_size = VFile_ReadS32(file); | ||
size_t end_position = VFile_GetPos(file) + data_size * sizeof(int16_t); |
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.
Nitpick: const
Output_InitialiseAnimatedTextures(num_ranges); | ||
Level_ReadAnimatedTextureRanges(num_ranges, file); | ||
|
||
VFile_SetPos(file, end_position); |
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.
Hmm isn't this function identical to TR1?
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.
It is, we also have others more or less identical like objects and static meshes. But TR1 currently has the extra injection counts in some others; I'm hoping eventually we can get everything common shifted to the TRX reader. So with that difference, I was thinking it'd be cleaner for now to keep the similar base private functions in the two level modules and just move the common "intensive" reading out to TRX.
But equally, I'm happy to shift the identical ones over now if that's preferred overall.
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.
No it's OK to keep them around, whichever is more comfortable for you 😌
0abfec0
to
0a3c9f5
Compare
This shifts animated texture reading to TRX.
0a3c9f5
to
b826c60
Compare
Checklist
Description
This gets TR2 using the same structured animated texture approach as TR1, and shifts reading the data to TRX. Each game still animates in its own output module because of slight differences there in tick handling.