Welcome! Log In Create A New Profile

Advanced

libwiisprite Image loading problem

Posted by martinmonkey777 
libwiisprite Image loading problem
August 07, 2008 12:04PM
Hey,
I'm using libwiisprite and I'm trying to load an image from an array of characters using raw2c
like this:
if(image.LoadImage(image) != IMG_LOAD_ERROR_NONE)exit(0);
So far, I've gotten this to work with very very few sprites. All the images I've tested are in .png format and i made absolutely sure that i did everything right, but I can still only get this to work with a few sprites. I think it's the image editor i am using... if anyone else got this method to work, what did you use to edit the sprite?
Re: libwiisprite Image loading problem
August 07, 2008 12:11PM
raw2c creates an array of unsigned constant chars, is the name of this array image? if not that is most likely your problem, also make sure you actually include the file with this information so that the program can load it into memory.
Re: libwiisprite Image loading problem
August 07, 2008 01:05PM
Yes image is the array of characters. And yes i made very sure that i included everything. The program compiles and runs fine, but when the program gets to that line, it exits because the reading has failed
Re: libwiisprite Image loading problem
August 07, 2008 01:06PM
Are you sure? Instead of exiting make it print some text with a number specific to that line, also known as an error code to make sure.
Re: libwiisprite Image loading problem
August 07, 2008 01:22PM
Good idea.
But it turns out that it definitely is that line =/
Re: libwiisprite Image loading problem
August 07, 2008 01:26PM
Try converting another image of the same format and seeing if that works, also if you try encoding the same image again and loading it, sometimes these programs have hiccups along the line somewhere.
Re: libwiisprite Image loading problem
August 07, 2008 01:28PM
Have you gotten this to work?
If so, what editor/image converter did you use
Re: libwiisprite Image loading problem
August 07, 2008 01:30PM
It works fine for me, i use raw2c to convert it into a constant array of unsigned char's. If you can't get it working from there, show the part of source that is giving you the problem.
Re: libwiisprite Image loading problem
August 07, 2008 01:40PM
Found out my problem.
I think my raw2c must have been out of date or not working properly or something.
I tried out the GRRLIB converter and it works perfectly
Thanks for the help XD

Edit: No, it wasn't even raw2c, I'm just retarded. I completely forgot the image width and height have to be divisible by 4. -smacks forehead-



Edited 1 time(s). Last edit at 08/08/2008 03:52AM by martinmonkey777.
Re: libwiisprite Image loading problem
August 10, 2008 05:39PM
You should verify that the correct overload is called, LoadImage(const unsigned char* path, IMG_LOAD_TYPE loadtype = IMG_LOAD_TYPE_BUFFER)
Pass the loadtype explity just in case.
Sorry, only registered users may post in this forum.

Click here to login