When I said mod support, I kinda meant like the kind of mods SMW currently has. I mean external graphics (cause it sounded like you were planning on an internal palette so I wanted to make sure you knew how much graphics/sound "mods" contributed to the community.getRGB
Here's my idea: instead of having the color-to-be-replaced be red, it should be an RGB color like [255, 0, 0] (or whatever that neon pink color was in the original). Then the game goes through each pixel, checks if it's that pink color, and then changes it to be red, blue, green, or yellow depending on the character's team.
Yeah that's... exactly what my existing system does that I am proposing (as far as logic, anyway. I use a graphics library myself)
The idea is simple. A 2D array of the existing palette.bmp. You would need to read up on what Java classes/functions are available to you to adapt the logic for your use. What I don't know is what kind of struct you would need to store pixel information if we cannot store the separate RGB values in one integer (the separate bits) like the graphics library I use.
ColorPalette is an array of integers where the seperate bits represent RGB information.
for (int k = 0; k < 37; k++) //reading colors from palette.bmp
for (int l = 0; l < 25; ++l) //reading colors from palette.bmp
// Assigns the colorPalette array
ColorPalette[l][k] = getpixel(Palette, l, k);
The following the code for accessing that array to compare the skins colors to the palette. Adaption will be a little different as my implementation is used for creating a fully recolored frame (for editing/displaying) The logic is still there though. My editor uses 16x16 skins instead of 32x32 ones, mind you.
newcol is simply an integer denoting which row of the the palette to display (since they are already ordered by condition)
void make_recolor(int newcol, BITMAP* frame, int x) //recolor individual frames
for (int k = 0; k < 16; k++) //y loop (of the skin frame)
for (int l = 0; l < 16; l++) //x loop (of the skin frame)
for (int i = 0; i < 25; i++) //for each pallete color length of one row in the palette)
color = getpixel(frame, l, k);
if (color == ColorPalette[i]) //if there is a match in the top, "input" row of colors in the palette
putpixel(Recolor, x+l, k, ColorPalette[i][newcol]); //recolor preview with the saw column, new row of the palette (as SMW and my editor do)
putpixel(Recolor, x+l, k, color); //no match -- draw existing color
edit:eww. our code tag is... gross
Big JM, would you kindly?
I think that mod support is a must, but that is something to think about down the road. The code to do mod support is going to be difficult to do, though, so it might not come around until much later.
Well, depending on our ability to perceive things down the road now, and making our code flexible, we won't need a huge overhaul, then