Hi all,
I have a weird problem. I've been working on a tool to convert u7 .shp files to windows .bmp. When I open up the newly generated bitmap file with paint the image is all screwed up, but when I load the same bitmap into a program I wrote it comes out fine (except for images that are screwed up anyways due to offsets being wrong, I believe). Any help would be greatly appreciated. Thanks.
-Beholder
U7 .shp files and bitmaps
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Re: U7 .shp files and bitmaps
hm, it might be useful to look at the code of Exult as Exult Studio already has the option to export frames from the shp files (frames might even be what makes Paint screw up) as png files.
Or even look at the code of shp2pcx in /tools of the exult code
Or even look at the code of shp2pcx in /tools of the exult code
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Re: U7 .shp files and bitmaps
From what you say it seems as if you're writting invalid bitmaps.
Re: U7 .shp files and bitmaps
does the program you wrote show other bitmap files fine??? Also.. try your bitmaps with another viewer as well.
Re: U7 .shp files and bitmaps
It would seem that I'm writing the bitmaps incorrectly. I don't understand what's wrong with it though. It's just the image buffer I think, because all of the header fields and the palette seem fine.
I calloc() the appropriate size of memory and double check to make sure it's right and then just set all of the bytes to 255. After writing it to file it still comes out weird. Can I post the parts of the code that seem to be the trouble? (it's not very big)
I calloc() the appropriate size of memory and double check to make sure it's right and then just set all of the bytes to 255. After writing it to file it still comes out weird. Can I post the parts of the code that seem to be the trouble? (it's not very big)
Re: U7 .shp files and bitmaps
Go read the bitmap specification. That format is evil, I know about it myself
The biggest problem I got is that all lines must be have a length multiple of 4 bytes. So add padding at the end of your lines.
The biggest problem I got is that all lines must be have a length multiple of 4 bytes. So add padding at the end of your lines.
Re: U7 .shp files and bitmaps
Wow, it is evil...That was it the whole time. Thanks!!!!! =)
(Beholder invented a few new swearing combos because of this)
-Beholder
(Beholder invented a few new swearing combos because of this)
-Beholder