Rescomp problem

SGDK only sub forum

Moderator: Stef

Post Reply
Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Rescomp problem

Post by Kuroto » Sun Mar 23, 2014 11:57 pm

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:

Image

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

Stef
Very interested
Posts: 3045
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Mar 24, 2014 9:23 am

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.

bastien
Very interested
Posts: 208
Joined: Mon Jun 25, 2007 7:19 pm
Location: Besançon,France
Contact:

Post by bastien » Mon Mar 24, 2014 12:34 pm

Try to up your palette entries to 256 that should works

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 4:40 pm

Hi Stef,

Here you go: BMP version - PNG version

The BMP version will raise that error, and with the PNG version, rescomp just crashes...

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 4:46 pm

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))
Image

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 7:53 pm

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 :)

Stef
Very interested
Posts: 3045
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Mar 24, 2014 9:05 pm

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).
Last edited by Stef on Mon Mar 24, 2014 9:27 pm, edited 1 time in total.

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 9:26 pm

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.

Stef
Very interested
Posts: 3045
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Mar 24, 2014 9:27 pm

Yeah i just realized that, i edited my previous message ;)

Stef
Very interested
Posts: 3045
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Mar 24, 2014 9:36 pm

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

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 9:49 pm

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

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Mon Mar 24, 2014 10:51 pm

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

Stef
Very interested
Posts: 3045
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Tue Mar 25, 2014 8:35 am

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).

Kuroto
Interested
Posts: 46
Joined: Sat Mar 02, 2013 4:34 pm

Post by Kuroto » Wed Mar 26, 2014 7:01 pm

Stef,

The new Rescomp version works perfectly :)

Here's the result. The bird sprite is of course animated :)

Image

Post Reply