29-03-24, 16:27 | #1 |
Member
Joined: Apr 2018
Posts: 62
|
TR3 Sprites vs TR4 Sprites
Hey there!
I'm currently developing a tool to convert TR4 levels into TR3 format. Everything is running smoothly except for sprite conversion. The struct for the sprites: Code:
struct tr_sprite_texture // 16 bytes { uint16_t Tile; uint8_t x; uint8_t y; uint16_t Width; // (ActualWidth * 256) + 255 uint16_t Height; // (ActualHeight * 256) + 255 int16_t LeftSide; int16_t TopSide; int16_t RightSide; int16_t BottomSide; }; TR4 and TR5: x and y values are not used in this version. Additionally, formula for Width and Height is changed: now it’s (ActualWidth - 1) * 256 and (ActualHeight - 1) * 256 respectively. I've attempted a simple conversion formula, but the textures remain distorted/wrong: Code:
ushort actualWidthTR3 = (ushort)((actualWidthTR4 - 1) * 256 + 255); ushort actualHeightTR3 = (ushort)((actualHeightTR4 - 1) * 256 + 255); |
Bookmarks |
Thread Tools | |
|
|