Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 9:12 pm
All times are UTC + 0
Header can be incorrectly written for TD shape files
Moderators: stucuk
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Fri May 20, 2016 1:10 pm    Post subject:  Header can be incorrectly written for TD shape files Reply with quote  Mark this post and the followings unread

The header description for TD shape files is wrong, UnknownC is actually two words, MaxFrameSize and Flags.

If Flags is set to any odd number (such as if a large single frame file were created that wrote a value larger than a word can hold to UnknownC), then the game will assume that the shape has an internal palette and all reads within the file will be offset by 768 bytes.

Flags should always be set to 0 for TD shapes as none of the games support using the possible internal palette and MaxFrameSize should be set to the size of the largest frame in the file (as written to disk) though the games don't actually use it. UnknownA and B are X and Y positions, but are unused by the game and the values they hold in WW produced files are left over from the tool that made them and where the image was cropped from in a larger canvas.

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri May 20, 2016 2:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I've changed the latest revision with your data, although I have one doubt about the MaxFrameSize. Is it the size of the encoded frame or just width*height?

Back to top
View user's profile Send private message Visit poster's website Skype Account
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Fri May 20, 2016 2:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

Its the size of the encoded frame as written to disk IIRC. If it was just Width*Height then you wouldn't need the MaxFrameSize.

I think this field is left over from the WSA header as the TD shp format appears to have evolved from it. It is used in the WSA header and the fact its format wasn't properly understood is one of the reasons that there are hardly any working WSA encoders.

If you and interested in improving TD shp format support  have working XORDelta and LCW generation code to allow handling delta frames. The LCW code produces slightly smaller files than the current OS Shp Builder format80 encoder. Its in C++ however so it would need porting.

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri May 20, 2016 2:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, then. I guess that the latest revision should be correct then.

Regarding the LCW generation code for handling delta frames, I'm interested. But I won't be that fast to implement it, since I'm having some strict deadlines regarding my PhD thesis, which is why PPM's news are a bit quiet recently.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Blade
Cyborg Commando


Joined: 23 Dec 2003

PostPosted: Fri May 20, 2016 2:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

No problem, if you are interested in having a look over the code, you can find it posted at https://forums.cncnet.org/index.php?topic=4403.0

It would be nice to get a user friendly program able to produce fully compressed TD shp files, shapeset will do the job but it only handles pcx files and is command line only.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1816s ][ Queries: 11 (0.0085s) ][ Debug on ]