View Single Post
  #21  
Old October 18th, 2024, 09:12 PM
MarkSheppard's Avatar

MarkSheppard MarkSheppard is online now
Lieutenant Colonel
 
Join Date: Jun 2005
Posts: 1,407
Thanks: 103
Thanked 641 Times in 427 Posts
MarkSheppard is on a distinguished road
Default Re: Next Generation SHP Viewer

I think I may have finally generated correct working SHP decompilation code. It correctly renders a lot of stuff including AOR and PG SHPs which did not render correctly before.

EDIT: It all comes down to the SHP header data.

xStart and yStart in the SHP Icon Headers are irrelevant in Steel Panthers; because everything always begins in the upper left corner of the SHP file, whether it's a screen image, button, or unit icon.

But in Age of Rifles; because of the extensive use of paperdolls with multiple SHP images overlaid over each other; some way of "offsetting" x/y had to be done:



AHA!

It's because Steel Panthers uses the xStart and yStart SHP header variables differently than other SSI programs -- in Steel Panthers, this is used to place the turret and hull offsets to place icons centered on the battlefield.

I need to go look deeper into Fred's code; to see if he had any flags that recognized a Steel Panthers SHP image and treated it differently than a "regular" SSI SHP

EDIT: I figured it out.

SHPs that are used in transparent "paper dolls" have POSITIVE numbers for xStart + yStart.

SHPs that use xStart + yStart to store centroid information for turret placement are NEGATIVE numbers; and this is how SSI differentiated between them, while maintaining compatibility

Last edited by MarkSheppard; October 18th, 2024 at 09:59 PM..
Reply With Quote
The Following 2 Users Say Thank You to MarkSheppard For This Useful Post: