Page 1 of 1
Rescomp problem
Posted: Sun Mar 23, 2014 11:57 pm
by Kuroto
Hi,
I'm having a few issues with rescomp at the moment.
If I want to use the SPRITE function in my gfx.res file, like so:
Code: Select all
IMAGE gamelogo "res/logo2.png" -1
IMAGE bgcity "res/city.png" -1
SPRITE flappy_sprite "res/flapspr2.bmp" 6 6 -1 5
(including an empty line on the end)
I get the following error:
Code: Select all
Packed with APLIB, original size = 3456 compressed to 452 (13.0787 %)
Resource: SPRITE flappy_sprite "res/flapspr2.bmp" 6 6 -1 5
--> executing plugin SPRITE...
Error: Image res/flapspr2.bmp use color index >= 64
IMAGE resource require image with a maximum of 64 colors.
make: *** [gfx.s] Error 1
rm gfx.s
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I did check the amount of colors, and i'm using the same palette as I use in logo2.png and city.png.
I tried using both .bmp and .png files.
This is the palette i'm using:
I even tried using the "remove unused colors" function in mtPaint, but when I save it then, rescomp just crashes...
Any ideas?
Thanks in advance!
-Steve
Posted: Mon Mar 24, 2014 9:23 am
by Stef
Indeed that should work. Is it possible to post a link of your image somewhere ? I would like to understand why rescomp is complaining.
Also the rescomp crash is not expected as well, it would be nice to have all the problematic images so i can fix it

rescomp currently only support 4bpp or 8bpp BMP or PNG images but i guess that is the format you are using.
Posted: Mon Mar 24, 2014 12:34 pm
by bastien
Try to up your palette entries to 256 that should works
Posted: Mon Mar 24, 2014 4:40 pm
by Kuroto
Hi Stef,
Here you go:
BMP version -
PNG version
The BMP version will raise that error, and with the PNG version, rescomp just crashes...
Posted: Mon Mar 24, 2014 4:46 pm
by Kuroto
Oh, and this is what i get when trying to compile using a .png file:
Code: Select all
compressed 2455 -> 277 bytes (71% done)
compressed 3456 -> 452 bytes (100% done)
compressed 3456 -> 452 bytes (13%) in 0.00 seconds
make: *** [gfx.s] Error 255
rm gfx.s
Process terminated with status 2 (1 minute(s), 6 second(s))
0 error(s), 0 warning(s) (1 minute(s), 6 second(s))

Posted: Mon Mar 24, 2014 7:53 pm
by Kuroto
I think i might have found the problem.
Normally, i use Photoshop with a Genesis palette to create my images. Then i save it to PNG, open it in mtPaint to tweak it (the palette, etc) and save it again.
However, if you save it using compression, it'll raise the error and/or crash.
I just saved it without compression, opened it in mtPaint, resaved it with the right palette, and now it works

Posted: Mon Mar 24, 2014 9:05 pm
by Stef
Ok, i was just trying to find out the issue with the BMP file and i discovered that the file does indeed contains a single pixel with value set to 0xD0 (file offset = 101503) so it explains why the file did not worked ! I guess one of the tool used to save the file had corrupted it...
I will check the PNG file now, as even compressed it should not crash :-/
Edit: Oh the PNG had the same issue ! a single pixel set to 0xD0, same address... oh weird as again the header file reference a 16 entry palette only. It looks like you used a software which generate corrupted images :-/
I also fixed a very stupid issue in rescomp with empty animation detection

I will upload it soon (directly on SVN).
Posted: Mon Mar 24, 2014 9:26 pm
by Kuroto
I should note that I created a whole new PNG file, so it's possible that the PNG I created earlier might contain that same pixel.
Posted: Mon Mar 24, 2014 9:27 pm
by Stef
Yeah i just realized that, i edited my previous message

Posted: Mon Mar 24, 2014 9:36 pm
by Stef
Ok, i uploaded a new version :
http://sgdk.googlecode.com/svn/trunk/bin/rescomp.exe
Just in case if you experience some issues with sprite resource.
I tried to improve ad provide more format support to BMP file, i hope i did not broke anything :p
Posted: Mon Mar 24, 2014 9:49 pm
by Kuroto
Stef wrote:It looks like you used a software which generate corrupted images :-/
I also fixed a very stupid issue in rescomp with empty animation detection

I will upload it soon (directly on SVN).
Probably Photoshop then. It kind of sucks for pixeling. :p
Posted: Mon Mar 24, 2014 10:51 pm
by Kuroto
Stef,
This might be a dumb question, but is there a way i can "fix" those broken PNG's?
I tried copying part of the content to a new PNG file, but it keeps giving me issues.
Or do i have to recreate the whole sprite sheet?
Thanks in advance!
-Steve
Posted: Tue Mar 25, 2014 8:35 am
by Stef
Actually i used gimp to edit it, just converted to RGB then back to indexed mode, saved and it's done. Final image was ok.
But you should use the last version i uploaded as i fixed an issue with empty sprite detection (which was giving error with your images).
Posted: Wed Mar 26, 2014 7:01 pm
by Kuroto
Stef,
The new Rescomp version works perfectly
Here's the result. The bird sprite is of course animated
