snes: make pcx_to_compressed_tilemap take palette argument

This commit is contained in:
Vince Weaver 2013-01-25 17:20:47 -05:00
parent 81e592bd31
commit 60997734cb
1 changed files with 9 additions and 4 deletions

View File

@ -37,8 +37,8 @@ static int rgb2bgr(int r,int g, int b) {
static char symbol_name[BUFSIZ]="temp";
#define MAX_TILE_X 32
#define MAX_TILE_Y 32
#define MAX_TILE_X 64
#define MAX_TILE_Y 64
#define MAX_PLANES_DIV2 4
#define Y_SIZE 8
@ -49,8 +49,9 @@ static unsigned short
static unsigned short temp_tile[Y_SIZE][MAX_PLANES_DIV2];
static int total_tiles=0;
static int compressed_tiles=0;
static int max_planes=8;
static int max_planes=8;
static int palette=0;
/* File already open */
static int vmwLoadPCX(int pcx_fd) {
@ -176,7 +177,7 @@ static int vmwLoadPCX(int pcx_fd) {
}
int v=0,h=0,o=0,pal=0,found_tile=0,found=0,match;
int v=0,h=0,o=0,pal=palette,found_tile=0,found=0,match;
/* see if the new tile matches an existing one */
@ -353,6 +354,10 @@ int main(int argc, char **argv) {
max_planes=atoi(argv[2]);
}
if (argc>3) {
palette=atoi(argv[3]);
}
/* read from stdin */
result=vmwLoadPCX(fileno(stdin));