Page 1 of 1

How is the "n_images" value calculated for a "dat_shpl_type" instance?

Posted: May 28th, 2022, 12:17 am
by dmitry_s
When I add an additional image/frame to a DAT file using the PR utility, the value of "n_images" does not change. As a workaround, I increment the value in the code for the corresponding "resource" variable value. Without the workaround the image associated for the frame does not get displayed.

The way I add a frame is by adding a line like this to the GUARD.DAT section of the "resources.xml" file and importing the change into the DAT file.

Code: Select all

<item value="785" path="dead alternate.bmp"/>
In the code it looks like the "n_images" file comes from the DAT file. I wonder why it is not getting incremented by the PR.
https://github.com/NagyD/SDLPoP/blob/96 ... 009.c#L493

Re: How is the "n_images" value calculated for a "dat_shpl_type" instance?

Posted: May 28th, 2022, 6:42 pm
by David
"n_images" comes from the first byte of the *.pal.more files.

PR does not increment it because it does not know anything about this byte.

Re: How is the "n_images" value calculated for a "dat_shpl_type" instance?

Posted: May 29th, 2022, 4:09 am
by dmitry_s
That worked. Thanks.