Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 29-03-24, 16:27   #1
TheBlueFox
Member
 
TheBlueFox's Avatar
 
Joined: Apr 2018
Posts: 62
Question 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;
};
According to the TRosettaStone:

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);
Any additional information will be appreciated!
TheBlueFox is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 20:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.