#169780 - Bozebo - Mon Aug 03, 2009 3:10 pm
Hi. I am really struggling getting my sprite import system to work.
I am aware than the overall code is rather limiting, but I just need to make a basic breakout game for uni and I need to be able to load in the sprites and combine their palettes into the shared palette.
Firstly, you can download my code. (uses devkitPro, included).
Or just the code if don't want to waste 56MB on devkitPro.
I had sprites working when I was just testing the pacman sprite tutorial ;)
In an attempt to debug it I added some lines of code in main.cpp which fill the palette with a gradient from black to white, repeated to fill. Through that I am rather sure the issue is with the importSprite function in sprites.h, the second half of which checks to see if the colour for each pixel is already in the shared palette, and if so changes the OEMData value to that, if not it finds the first 0 - after transparent and black which are always pos 0 and 1 in the array - and puts it in there, and updates the position in OEMData.
I am fully aware that adding too many sprites would overload the palette and/or OEMData (especially if the sprites are not first known), so don't flame me for that ^_^ it is just a basic system so I can procure a sample game.
I have scoured my code and I cannot find out what the issue is, I have been working on this on and off for weeks. Can anybody help?
I am aware than the overall code is rather limiting, but I just need to make a basic breakout game for uni and I need to be able to load in the sprites and combine their palettes into the shared palette.
Firstly, you can download my code. (uses devkitPro, included).
Or just the code if don't want to waste 56MB on devkitPro.
I had sprites working when I was just testing the pacman sprite tutorial ;)
In an attempt to debug it I added some lines of code in main.cpp which fill the palette with a gradient from black to white, repeated to fill. Through that I am rather sure the issue is with the importSprite function in sprites.h, the second half of which checks to see if the colour for each pixel is already in the shared palette, and if so changes the OEMData value to that, if not it finds the first 0 - after transparent and black which are always pos 0 and 1 in the array - and puts it in there, and updates the position in OEMData.
I am fully aware that adding too many sprites would overload the palette and/or OEMData (especially if the sprites are not first known), so don't flame me for that ^_^ it is just a basic system so I can procure a sample game.
I have scoured my code and I cannot find out what the issue is, I have been working on this on and off for weeks. Can anybody help?