diff --git a/Makefile b/Makefile index 01261ec..eaa018b 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,20 @@ PREFIX = ./ BINARY=timesynk OBJS = main.o game.o context.o player.o tile.o map.o wall.o net/sockets.o helper.o CURSES_OBJS = interface/curses.o -SDL_OBJS = interface/sdl.o +SDL_OBJS = interface/sdl.o tiles/tiles.o DEBUG = -g CFLAGS = -Wall -c $(DEBUG) CURSES_LFLAGS = -lcurses XCURSES_LFLAGS = -lXCurses -SDL_LFLAGS = -lSDL +SDL_LFLAGS = -lSDL -lSDL_image LFLAGS = -Wall $(DEBUG) $(BINARY): $(OBJS) $(CURSES_OBJS) $(CC) $(OBJS) $(CURSES_OBJS) $(CURSES_LFLAGS) -o $(BINARY) sdl: tiles $(OBJS) $(SDL_OBJS) + ./pack_tiles + $(CC) $(CFLAGS) -c tiles/tiles.c $(CC) $(OBJS) $(SDL_OBJS) $(SDL_LFLAGS) -o $(BINARY) curses: $(OBJS) $(CURSES_OBJS) @@ -27,12 +29,14 @@ all: $(BINARY) clean: rm -f $(OBJS) $(CURSES_OBJS) $(SDL_OBJS) $(BINARY) + rm -f pack_tiles -binary_to_c: binary_to_c.c - $(CC) binary_to_c.c -o binary_to_c +pack_tiles: pack_tiles.c + $(CC) pack_tiles.c -o pack_tiles -tiles: binary_to_c - ./binary_to_c +tiles: pack_tiles + ./pack_tiles + $(CC) $(CFLAGS) -c tiles/tiles.c main.o: main.c stubs.h wall.h wall.c context.h interface/curses.c net/sockets.c $(CC) $(CFLAGS) -c main.c diff --git a/binary_to_c b/binary_to_c deleted file mode 100755 index 3671d84..0000000 Binary files a/binary_to_c and /dev/null differ diff --git a/binary_to_c.c b/binary_to_c.c deleted file mode 100644 index 9ef05f3..0000000 --- a/binary_to_c.c +++ /dev/null @@ -1,37 +0,0 @@ -#include - -void convert(char *file_name, char *var_name) { - int i, n; - unsigned char buffer[16]; - - FILE *infile=fopen(file_name, "r"); - - printf("unsigned char %s[] = { ", var_name); - while ((n = fread(buffer, 1, 16, infile))) - { - for (i = 0; i < n; i++) printf("0x%2.2x,", buffer[i]); - //printf("\n"); - } - printf(" };\n"); - printf("unsigned int %s_len = %i;\n", var_name, ftell(infile)); -} - -int main(int argc, char **argv) { - convert("tiles/qusqu.png", "player_tiles"); - /*int i, n; - unsigned char buffer[16]; - - FILE *infile=fopen(argv[1], "r"); - - printf("unsigned char %s[] = { ", argv[1]); - while ((n = fread(buffer, 1, 16, infile))) - { - for (i = 0; i < n; i++) printf("0x%2.2x,", buffer[i]); - //printf("\n"); - } - printf(" };\n"); - printf("unsigned int %s_len = %i;\n", argv[1], ftell(infile)); - return 0; - */ - return 0; -} diff --git a/game.c b/game.c index 263a88f..06cf67e 100644 --- a/game.c +++ b/game.c @@ -10,17 +10,24 @@ #include "display.h" #include "tile.h" #include "context.h" +#include "player.h" int gameInit() { + null_tile.tid = 0; + player.tid = 1; + player.id = 12; current_context = &walkContext; allocateMap(¤t_map, 32, 16); floodMap(¤t_map, TILE_REPLACE, FLOOR, STONE); - drawPath(¤t_map, TILE_REPLACE, FLOOR, WOOD, 0, 0, 9, 9); - drawPath(¤t_map, TILE_REPLACE, WALL, WOOD, 8, 0, 9, 9); - drawPath(¤t_map, TILE_REPLACE, WALL, STEEL, 9, 4, 6, 9); - drawPath(¤t_map, TILE_REPLACE, WALL, STONE, 4, 6, 14, 2); - replaceTile(¤t_map->matrix[2][2], WALL, WALL_STEEL); + gameMoveTile(&player, 2, 2); + drawPath(¤t_map, TILE_APPEND, WALL, STONE, 6, 1, 8, 12); + drawPath(¤t_map, TILE_APPEND, WALL, STONE, 12, 4, 7, 13); + + drawLine(¤t_map, TILE_APPEND, WALL, STONE, 0, 0, 31, 0); + drawLine(¤t_map, TILE_APPEND, WALL, STONE, 0, 15, 31, 15); + drawLine(¤t_map, TILE_APPEND, WALL, STONE, 0, 0, 0, 15); + drawLine(¤t_map, TILE_APPEND, WALL, STONE, 31, 0, 31, 15); return SUCCESS; } @@ -44,7 +51,7 @@ int gameCollision(target_x, target_y) { return 1; break; case FLOOR: - return 0; +// return 0; break; } debug_tile = debug_tile->next; @@ -52,6 +59,35 @@ int gameCollision(target_x, target_y) { return 0; } +void gameMoveTile(struct Tile *tile, int target_x, int target_y) { + // remove tile from chain and connect tile's neighbors to each other + if (tile->prev != NULL) { + if (tile->next != NULL) { + tile->prev->next = tile->next; + } else { + tile->prev->next = NULL; + } + } + if (tile->next != NULL) { + tile->next->prev = tile->prev; + } + // now add tile to the end of the target chain + struct Tile *target_loc; + target_loc = &(current_map->matrix[target_x][target_y]); + while (target_loc) { + if (!target_loc->next) { // last element + target_loc->next = tile; + tile->prev = target_loc; + tile->next = NULL; + break; + } + target_loc = target_loc->next; + } + // finally, update tile's x and y props + tile->x = target_x; + tile->y = target_y; +} + void gameUpdateTile(int x, int y) { display_map[x][y] = 2; } diff --git a/game.h b/game.h index 2da44c3..7780d46 100644 --- a/game.h +++ b/game.h @@ -21,5 +21,6 @@ void gameLoop(); void gameClose(); int gameCollision(int target_x, int target_y); +void gameMoveTile(struct Tile *tile, int target_x, int target_y); #endif diff --git a/interface/curses.c b/interface/curses.c index 785da2b..d686ea4 100644 --- a/interface/curses.c +++ b/interface/curses.c @@ -34,7 +34,7 @@ Acceptable attributes (from manpage, curs_attr): A_CHARTEXT Bit-mask to extract a character */ CursesTile ascii_walls[] = { - {'.', COLOR_WHITE, COLOR_BLACK, 0}, // 0=WALL_NULL +// {'.', COLOR_WHITE, COLOR_BLACK, 0}, // 0=WALL_NULL {'#', COLOR_WHITE, COLOR_BLACK, 0}, // 0=WALL_STONE {'#', COLOR_YELLOW, COLOR_BLACK, 0}, // 1=WALL_WOOD {'#', COLOR_WHITE, COLOR_BLACK, A_BOLD} // 2=WALL_STEEL @@ -94,7 +94,7 @@ void interfaceDraw() { step_y = player.y - 6; while (step_y < end_y) { //if (visible_matrix[step_x][step_y] & TILE_VISIBLE) { -if (step_x >= 0 && step_y >= 0 && step_x < current_map->width && step_y < current_map->height) { + if (step_x >= 0 && step_y >= 0 && step_x < current_map->width && step_y < current_map->height) { short tile_id = current_map->matrix[step_x][step_y].id; unsigned int type_id = current_map->matrix[step_x][step_y].tid; int color; @@ -112,10 +112,7 @@ if (step_x >= 0 && step_y >= 0 && step_x < current_map->width && step_y < curren attroff(COLOR_PAIR(color) | ascii_walls[tile_id].attr); break; } -} - //} else { - // mvwaddch(screen, step_y, step_x, '_'); - //} + } step_y++; // move down } step_x++; // move right diff --git a/interface/sdl.c b/interface/sdl.c index 0067190..aa895f1 100644 --- a/interface/sdl.c +++ b/interface/sdl.c @@ -1,6 +1,6 @@ //#if !defined (__APPLE__) #include -#include +#include //#endif #include "sdl.h" @@ -22,7 +22,18 @@ int interfaceInit() { SDL_WM_SetCaption(NAME, NULL); camera_surface = SDL_CreateRGBSurface(screen->flags, 512, 512, screen->format->BitsPerPixel, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); - player_image = IMG_Load_RW(SDL_RWFromMem(&player_png, player_png_len), 1); + player_spritesheet = IMG_Load_RW(SDL_RWFromMem(&player_images, player_images_length), 1); + wall_spritesheet = IMG_Load_RW(SDL_RWFromMem(&wall_images, wall_images_length), 1); + floor_spritesheet = IMG_Load_RW(SDL_RWFromMem(&floor_images, floor_images_length), 1); + shadow_spritesheet = IMG_Load_RW(SDL_RWFromMem(&shadow_images, shadow_images_length), 1); + int race, class; + SDL_Rect sprite_offset = {0, 0, TILE_WIDTH, TILE_HEIGHT}; + for (race = 0; race < TOTAL_RACES;race++) { + for(class = 0; class < TOTAL_CLASSES;class++) { + player_sprites[race][class] = SDL_CreateRGBSurface(screen->flags, 16, 32, screen->format->BitsPerPixel, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); + SDL_BlitSurface(player_spritesheet, &sprite_offset, player_sprites[race][class], NULL); + } + } // Fill our screen w/ black SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 32, 128, 64)); // Update! @@ -35,7 +46,6 @@ int interfaceInit() { void cameraDraw() { SDL_FillRect(camera_surface, NULL, SDL_MapRGB(camera_surface->format, 0, 0, 0)); SDL_Rect camera_rect = {0, 0, 512, 512}; - SDL_Rect player_rect = {player.x*TILE_WIDTH, player.y*TILE_WIDTH, TILE_WIDTH, TILE_HEIGHT}; int step_x = player.x - 12; int step_y = player.y - 12; int end_x = player.x + 12; @@ -43,22 +53,32 @@ void cameraDraw() { while (step_x < end_x) { step_y = player.y - 6; while (step_y < end_y) { - // draw our player in the "middle" layer - if (step_x == player.x && step_y == player.y) { - SDL_BlitSurface(player_image, NULL, camera_surface, &player_rect); - } // TODO: draw the layer immediately in front of the player at partial translucency if (step_x >= 0 && step_y >= 0 && step_x < current_map->width && step_y < current_map->height) { - short tile_id = current_map->matrix[step_x][step_y].id; - unsigned int type_id = current_map->matrix[step_x][step_y].tid; - SDL_Rect tile_rect = {step_x*TILE_WIDTH, step_y*TILE_WIDTH, TILE_WIDTH, TILE_HEIGHT}; - switch (type_id) { - case WALL: - SDL_FillRect(camera_surface, &tile_rect, SDL_MapRGB(camera_surface->format, 128, 128, 128)); - break; - case FLOOR: - //SDL_FillRect(camera_surface, &tile_rect, SDL_MapRGB(camera_surface->format, 32, 32, 32)); - break; + struct Tile *current_tile; + current_tile = &(current_map)->matrix[step_x][step_y]; + while(current_tile) { + int x_offset = current_tile->id / 16; // 16 tiles across in spritesheet + int y_offset = current_tile->id - (x_offset*16); + SDL_Rect sprite_offset = { x_offset*TILE_WIDTH, y_offset*TILE_HEIGHT, TILE_WIDTH, TILE_HEIGHT}; + SDL_Rect tile_rect = {step_x*TILE_WIDTH, step_y*TILE_WIDTH, TILE_WIDTH, TILE_HEIGHT}; + switch (current_tile->tid) { + case WALL: + SDL_BlitSurface(wall_spritesheet, &sprite_offset, camera_surface, &tile_rect); + break; + case FLOOR: + SDL_BlitSurface(floor_spritesheet, &sprite_offset, camera_surface, &tile_rect); + break; + case PLAYER: + y_offset = current_tile->id / TOTAL_CLASSES; + x_offset = current_tile->id - (y_offset*TOTAL_CLASSES); + sprite_offset.x = x_offset*TILE_WIDTH; + sprite_offset.y = y_offset*TILE_HEIGHT; + SDL_BlitSurface(shadow_spritesheet, NULL, camera_surface, &tile_rect); + SDL_BlitSurface(player_spritesheet, &sprite_offset, camera_surface, &tile_rect); + break; + } + current_tile = current_tile->next; } } step_y++; // move down diff --git a/interface/sdl.h b/interface/sdl.h index d2a514d..fc4452d 100644 --- a/interface/sdl.h +++ b/interface/sdl.h @@ -1,7 +1,12 @@ #ifndef SDL_H #define SDL_H +#include "../player.h" // for races/class totals SDL_Surface* screen; - SDL_Surface* player_image; // replace with players array + SDL_Surface* player_spritesheet; + SDL_Surface* shadow_spritesheet; + SDL_Surface* wall_spritesheet; + SDL_Surface* floor_spritesheet; + SDL_Surface* player_sprites[TOTAL_RACES][TOTAL_CLASSES]; SDL_Surface* camera_surface; SDL_Event event; #endif diff --git a/map.c b/map.c index fe907a3..cf56bfa 100644 --- a/map.c +++ b/map.c @@ -114,6 +114,13 @@ int allocateMap(struct Map** map, unsigned int width, unsigned int height) { (*map)->height = height; allocateMapTiles(&(*map)->matrix, width, height); + int x, y; + for (x=0;xmatrix[x][y].next = NULL; + (*map)->matrix[x][y].prev = NULL; + } + } return SUCCESS; } @@ -180,3 +187,21 @@ void drawPath(struct Map** map, unsigned int operation, unsigned int tid, short from_x += x_mod; } } + +void drawLine(struct Map** map, unsigned int operation, unsigned int tid, short id, unsigned int from_x, unsigned int from_y, unsigned int to_x, unsigned int to_y) { + int x_inc = (from_x-to_x < 0 ? -1 : 1); + int y_inc = (from_y-to_y < 0 ? -1 : 1); + while(1) { + if (operation == TILE_REPLACE) { + replaceTile(&(*map)->matrix[from_x][from_y], tid, id); + } else if (operation == TILE_APPEND) { + appendTile(&(*map)->matrix[from_x][from_y], tid, id); + } + if (from_x == to_x && from_y == to_y) + break; + if (from_x != to_x) + from_x += x_inc; + if (from_y != to_y) + from_y += y_inc; + } +} diff --git a/map.h b/map.h index 73e9e18..6e3a17f 100644 --- a/map.h +++ b/map.h @@ -29,6 +29,10 @@ void freeMap(struct Map **map); This function "walks" a path from from_x,from_y to to_x,to_y, populating each step with either a new tile or replacing the old one with a tile of tid and id. Note that Tile data is freed and the new tile's default properties are memcpy'd to a new malloc'd space. ***/ void drawPath(struct Map** map, unsigned int operation, unsigned int tid, short id, unsigned int from_x, unsigned int from_y, unsigned int to_x, unsigned int to_y); +/*** drawLine +This function simply draws a line from_x,from_y to to_x,to_y, populating each step with either a new tile or replacing the old one with a tile of tid and id. Note that Tile data is freed and the new tile's default properties are memcpy'd to a new malloc'd space. +***/ +void drawLine(struct Map** map, unsigned int operation, unsigned int tid, short id, unsigned int from_x, unsigned int from_y, unsigned int to_x, unsigned int to_y); /*** floodMap floodMap does as is expected - it floods a given map with the given tid and id, memcpy-ing the new tile's default data. Can replace or append the tile. ***/ diff --git a/pack_tiles.c b/pack_tiles.c new file mode 100644 index 0000000..f603cf9 --- /dev/null +++ b/pack_tiles.c @@ -0,0 +1,43 @@ +#include + +FILE *tiles_c; +FILE *tiles_h; + +void convert(char *file_name, char *var_name) { + int i, n; + unsigned char buffer[16]; + + FILE *infile=fopen(file_name, "r"); + + fprintf(tiles_c, "unsigned char %s[] = {\n", var_name); + while ((n = fread(buffer, 1, 16, infile))) + { + for (i = 0; i < n; i++) { + fprintf(tiles_c, "0x%2.2x,", buffer[i]); + } + } + fprintf(tiles_c, "\n};\n"); + fprintf(tiles_c, "unsigned int %s_length = %d;\n\n", var_name, ftell(infile)); + fprintf(tiles_h, "extern unsigned char %s[];\n", var_name); + fprintf(tiles_h, "extern unsigned int %s_length;\n\n", var_name); +} + +int main(int argc, char **argv) { + tiles_c = fopen("tiles/tiles.c", "w"); + tiles_h = fopen("tiles/tiles.h", "w"); + fprintf(tiles_h, "/** WARNING - THIS FILE IS AUTOGENERATED BY pack_tiles, EDITS TO THIS FILE MAY BE OVERWRITTEN **/\n"); + fprintf(tiles_c, "/** WARNING - THIS FILE IS AUTOGENERATED BY pack_tiles, EDITS TO THIS FILE MAY BE OVERWRITTEN **/\n"); + fprintf(tiles_h, "#ifndef TILES_H\n#define TILES_H\n"); + fprintf(tiles_h, "#define TILE_WIDTH 16\n#define TILE_HEIGHT 32\n"); + + convert("tiles/players.png", "player_images"); + convert("tiles/walls.png", "wall_images"); + convert("tiles/floors.png", "floor_images"); + convert("tiles/shadows.png", "shadow_images"); + + fprintf(tiles_h, "#endif\n"); + fclose(tiles_c); + fclose(tiles_h); + + return 0; +} diff --git a/player.c b/player.c index 9b9a9e3..7f407cf 100644 --- a/player.c +++ b/player.c @@ -16,52 +16,43 @@ void playerMove(int direction, int distance) { switch(direction) { case NORTH: if (!gameCollision(player.x, (player.y-distance))) { - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y -= distance; + gameMoveTile(&player, player.x, player.y-distance); } break; case NORTHWEST: if (!gameCollision(player.x-distance, (player.y-distance))) { - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y -= distance; - player.x -= distance; + gameMoveTile(&player, player.x-distance, player.y-distance); } break; case NORTHEAST: if (!gameCollision(player.x+distance, (player.y-distance))) { - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y -= distance; - player.x += distance; + gameMoveTile(&player, player.x+distance, player.y-distance); } break; case SOUTH: - if (!gameCollision(player.x, player.y+distance)) - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y += distance; + if (!gameCollision(player.x, player.y+distance)) { + gameMoveTile(&player, player.x, player.y+distance); + } break; case SOUTHWEST: if (!gameCollision(player.x-distance, player.y+distance)) { - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y += distance; - player.x -= distance; + gameMoveTile(&player, player.x-distance, player.y+distance); } break; case SOUTHEAST: if (!gameCollision(player.x+distance, player.y+distance)) { - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.y += distance; - player.x += distance; + gameMoveTile(&player, player.x+distance, player.y+distance); } break; case EAST: - if (!gameCollision(player.x+distance, player.y)) - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.x += distance; + if (!gameCollision(player.x+distance, player.y)) { + gameMoveTile(&player, player.x+distance, player.y); + } break; case WEST: - if (!gameCollision(player.x-distance, player.y)) - //gameUpdateTile(player.x, player.y); // set old pos to be redrawn - player.x -= distance; + if (!gameCollision(player.x-distance, player.y)) { + gameMoveTile(&player, player.x-distance, player.y); + } break; } } @@ -70,10 +61,11 @@ void playerLook(int x, int y) { char string[32]; struct Tile* debug_tile; if ((x < current_map->width && x >= 0) && (y < current_map->height && y >= 0)) { - if (current_map->matrix[x][y].tid != TILE_NULL) { + //if (current_map->matrix[x][y].tid != TILE_NULL) { + if (current_map->matrix[x][y].tid) { int chain_count = 0; debug_tile = ¤t_map->matrix[x][y]; - while(debug_tile) { + while(debug_tile != NULL) { //itoa(debug_tile->id, string, 10); //strcat(string, " "); strcat(string, "You see: "); diff --git a/player.h b/player.h index c9d1315..98e45a1 100644 --- a/player.h +++ b/player.h @@ -8,6 +8,21 @@ #define PLAYER_TUMBLE 3 #define PLAYER_LOOK 4 +#define TOTAL_RACES 5 +#define RACE_HUMAN 0 +#define RACE_MANITOU 1 +#define RACE_CAPRAN 2 +#define RACE_QUOSQOY 3 +#define RACE_QUOSQO 4 + +#define TOTAL_CLASSES 6 +#define CLASS_WARRIOR 0 +#define CLASS_WIZARD 1 +#define CLASS_PRIEST 2 +#define CLASS_ROGUE 3 +#define CLASS_RANGER 4 +#define CLASS_BARBARIAN 5 + typedef struct { char name[16]; } PlayerTile; @@ -16,10 +31,11 @@ typedef struct { int x; int y; } player_struct; -player_struct player; +//player_struct player; +//player_struct player; +struct Tile player; void (*player_commands[128]) (); // pointer to array of command functions -//void (*player_commands[128]) () = { NULL }; // pointer to array of command functions /** playerSetCommand This function ties a command function to a command id, as contained within the player_commands array. After tying a command to a function, a command can be directly called with the following syntax: diff --git a/tile.h b/tile.h index 30b39f3..dee4a36 100644 --- a/tile.h +++ b/tile.h @@ -24,6 +24,8 @@ struct Tile { void *data; // pointer to the Tile's actual data, preferably a struct }; +struct Tile null_tile; // FIXME: temporary solution to next and prev pointers + struct BasicTile { int collision; char name[16]; diff --git a/tiles.o b/tiles.o new file mode 100644 index 0000000..cc41db5 Binary files /dev/null and b/tiles.o differ diff --git a/tiles/floors.png b/tiles/floors.png new file mode 100644 index 0000000..6504b23 Binary files /dev/null and b/tiles/floors.png differ diff --git a/tiles/player.c b/tiles/player.c deleted file mode 100644 index 8549d9d..0000000 --- a/tiles/player.c +++ /dev/null @@ -1,28 +0,0 @@ -unsigned char player_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, - 0x02, 0x03, 0x00, 0x00, 0x00, 0x66, 0xe7, 0x10, 0x5f, 0x00, 0x00, 0x00, - 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, - 0x00, 0x09, 0x50, 0x4c, 0x54, 0x45, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xff, 0x0d, 0x52, 0xc8, 0x31, 0x00, 0x00, 0x00, 0x01, 0x74, - 0x52, 0x4e, 0x53, 0x00, 0x40, 0xe6, 0xd8, 0x66, 0x00, 0x00, 0x00, 0x01, - 0x62, 0x4b, 0x47, 0x44, 0x00, 0x88, 0x05, 0x1d, 0x48, 0x00, 0x00, 0x00, - 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, - 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, - 0x4d, 0x45, 0x07, 0xdd, 0x0a, 0x04, 0x03, 0x14, 0x24, 0xb7, 0x4d, 0xa7, - 0x7a, 0x00, 0x00, 0x00, 0x22, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x20, 0x6f, - 0x6e, 0x20, 0x61, 0x20, 0x4d, 0x61, 0x63, 0x87, 0xa8, 0x77, 0x43, 0x00, - 0x00, 0x00, 0x56, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0x60, 0x40, - 0x07, 0x4b, 0x80, 0x98, 0x29, 0x04, 0x48, 0x30, 0x4e, 0x01, 0x12, 0x9c, - 0xa1, 0x40, 0x42, 0x33, 0xd4, 0x81, 0x81, 0x41, 0x6b, 0x2a, 0x90, 0x60, - 0x05, 0x71, 0x99, 0x52, 0x40, 0xb2, 0x60, 0x25, 0x11, 0x40, 0x42, 0x6d, - 0x29, 0x90, 0x98, 0x0a, 0x92, 0x0d, 0x03, 0xa9, 0x8b, 0x04, 0x11, 0xa1, - 0xa8, 0xc4, 0xb2, 0xb4, 0x06, 0x06, 0x86, 0xa5, 0x53, 0x81, 0x04, 0xeb, - 0x54, 0xa0, 0x62, 0xd6, 0x54, 0x06, 0xec, 0x2c, 0xce, 0x48, 0x20, 0xa1, - 0x9a, 0x8a, 0xe4, 0x1a, 0x00, 0xa3, 0x7b, 0x13, 0x23, 0xd4, 0xd1, 0x1f, - 0x5d, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, - 0x82 -}; -unsigned int player_png_len = 289; diff --git a/tiles/player.png b/tiles/player.png deleted file mode 100644 index 8fbe7b6..0000000 Binary files a/tiles/player.png and /dev/null differ diff --git a/tiles/players.png b/tiles/players.png new file mode 100644 index 0000000..fac5d01 Binary files /dev/null and b/tiles/players.png differ diff --git a/tiles/qusqu.png b/tiles/qusqu.png deleted file mode 100644 index ca0bee1..0000000 Binary files a/tiles/qusqu.png and /dev/null differ diff --git a/tiles/shadows.png b/tiles/shadows.png new file mode 100644 index 0000000..c610314 Binary files /dev/null and b/tiles/shadows.png differ diff --git a/tiles/tiles.c b/tiles/tiles.c index 683bb53..4ee4504 100644 --- a/tiles/tiles.c +++ b/tiles/tiles.c @@ -1,2 +1,21 @@ -unsigned char player_png[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x20,0x08,0x02,0x00,0x00,0x00,0x94,0xeb,0x6f,0x9b,0x00,0x00,0x01,0x22,0x49,0x44,0x41,0x54,0x38,0x8d,0x95,0x54,0xcb,0x71,0x85,0x30,0x0c,0xdc,0x7d,0x43,0x19,0xd6,0x31,0x45,0xe4,0x4a,0x0f,0xd0,0x07,0x29,0x24,0x85,0x3c,0x7a,0x20,0xc7,0x14,0xf1,0x8e,0x52,0x1f,0xca,0xc1,0xcf,0x80,0x3f,0x10,0xd0,0x30,0x83,0x47,0xec,0x7a,0xb5,0xb6,0x04,0x55,0x15,0x77,0xe2,0x11,0x5f,0xdf,0x22,0x57,0x09,0xd7,0xa1,0x9b,0xc2,0x2d,0x0e,0xa7,0x2a,0xf5,0x75,0xea,0xaa,0x8b,0x08,0x79,0x05,0xfd,0xb0,0x4b,0x25,0x45,0xf4,0xd4,0x53,0x5e,0xe1,0x12,0x01,0x40,0xdc,0x7b,0xaf,0x10,0xc2,0xa1,0xab,0xc7,0xf9,0x7e,0x35,0xb3,0x6b,0xe2,0x66,0x02,0x90,0xc1,0x61,0x56,0x1e,0x40,0x83,0x10,0x82,0x8c,0x8b,0x03,0x78,0x92,0x83,0x0b,0x90,0xd1,0x1a,0x25,0xf1,0xc7,0xe3,0x62,0x5c,0x7c,0x66,0x29,0x52,0x12,0xea,0xa2,0x43,0x90,0x7d,0xb2,0x2c,0xc9,0x4c,0xd1,0x13,0x8b,0x03,0x40,0xcf,0x11,0xd0,0x5c,0xa1,0x24,0x84,0x10,0xdc,0x9d,0x24,0x00,0x77,0x07,0x60,0x96,0x5d,0x68,0x59,0x92,0x99,0x45,0x34,0x00,0x92,0xeb,0xfa,0x90,0xf0,0x6f,0x34,0x08,0xc5,0x48,0xfd,0xe6,0xbd,0x9c,0x79,0x90,0xf4,0xed,0xb9,0x4b,0x8e,0x00,0x44,0xd6,0x8d,0xba,0x1a,0xfd,0x06,0x55,0x21,0x22,0xaa,0x0a,0x55,0xbd,0x35,0xd6,0xed,0x5e,0x2a,0xc2,0x7d,0x5b,0x67,0xa6,0x4f,0xa4,0x66,0xc6,0x8e,0x4c,0x84,0x29,0xa1,0x8f,0x38,0x83,0xfb,0x58,0x2b,0x9c,0xc4,0x4c,0xc6,0xa3,0xbb,0xe4,0x01,0xc0,0x90,0x6c,0x9c,0x29,0xac,0xb7,0x41,0xbe,0x3d,0x98,0xe9,0xed,0xd6,0x68,0x94,0x14,0x0f,0x91,0xc4,0xa7,0xaa,0xa7,0x49,0x58,0xc7,0xa8,0x54,0x10,0x11,0x12,0xe4,0x46,0x8b,0xcf,0x1a,0x87,0x25,0x55,0x7d,0x9d,0xf2,0x77,0x7f,0xf7,0x7f,0xa2,0x3f,0x72,0x1c,0x31,0xd0,0xde,0x66,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, }; -unsigned int player_png_len = 347; +/** WARNING - THIS FILE IS AUTOGENERATED BY pack_tiles, EDITS TO THIS FILE MAY BE OVERWRITTEN **/ +unsigned char player_images[] = { +0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xa0,0x08,0x03,0x00,0x00,0x00,0xc4,0xae,0x99,0xbe,0x00,0x00,0x00,0x6f,0x50,0x4c,0x54,0x45,0x6d,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00,0x71,0x00,0x00,0xaa,0x41,0x00,0x00,0x1c,0x00,0x71,0x41,0x00,0x10,0x00,0x00,0xff,0x14,0x14,0x14,0x71,0x00,0x00,0x41,0x10,0x00,0x20,0x20,0x20,0x41,0x00,0xff,0xaa,0x00,0x00,0x41,0x20,0x00,0x2c,0x2c,0x2c,0xff,0x00,0x00,0x38,0x38,0x38,0x71,0x38,0x00,0x45,0x45,0x45,0x51,0x51,0x51,0xaa,0x55,0x00,0x61,0x61,0x61,0x55,0x55,0xff,0x71,0x71,0x71,0x00,0xaa,0x00,0x82,0x82,0x82,0x7d,0x7d,0xff,0xff,0x7d,0x00,0x00,0xbe,0xff,0xff,0xbe,0x00,0x7d,0xff,0x00,0x55,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0x55,0xff,0xff,0xff,0x48,0x6e,0x9b,0x02,0x00,0x00,0x00,0x01,0x74,0x52,0x4e,0x53,0x00,0x40,0xe6,0xd8,0x66,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xdd,0x0a,0x0f,0x06,0x22,0x1e,0x29,0x97,0xaa,0x57,0x00,0x00,0x03,0x44,0x49,0x44,0x41,0x54,0x68,0xde,0xed,0x9a,0x6b,0x7b,0xa2,0x30,0x10,0x85,0x33,0xc5,0x54,0xa1,0xd4,0xa5,0x61,0x03,0x55,0x56,0x58,0x52,0xfe,0xff,0x6f,0xdc,0x99,0x44,0xbc,0x7e,0x9d,0x63,0x9f,0xba,0x0c,0x3e,0xa0,0x5f,0xce,0xcb,0x99,0xc9,0x8d,0xa0,0x31,0xcf,0x13,0x9f,0x9f,0x60,0xfd,0xd5,0x0a,0x4a,0x18,0x57,0x58,0x07,0x63,0xb7,0xea,0x90,0xfa,0x9d,0xf7,0xbe,0x03,0x12,0xba,0x0e,0xab,0x2f,0x84,0x8e,0xb0,0x6d,0x88,0xe8,0xa7,0x03,0x4c,0x51,0x40,0xe5,0x9b,0xa6,0x28,0x9a,0x06,0x78,0xfb,0xdd,0xd8,0x34,0x1e,0x67,0xa2,0x28,0xc6,0xae,0x6b,0x81,0x00,0x2a,0xba,0xee,0x77,0xdb,0x02,0x01,0xd4,0xb5,0x6d,0x5b,0x11,0x8d,0x98,0xce,0x66,0x6d,0xd3,0xfa,0xb6,0xaa,0xac,0x24,0x0a,0x04,0x68,0x2a,0x0e,0xee,0xcf,0x2d,0x02,0xe0,0xad,0x33,0x8d,0xb5,0x5f,0xb6,0x91,0x44,0x21,0x46,0x6a,0x67,0x04,0xf0,0x97,0x13,0x85,0x01,0x38,0x39,0x6d,0x36,0x59,0xd6,0x34,0x30,0x03,0x51,0x5f,0x08,0x06,0x68,0x20,0x5a,0x68,0x40,0x00,0x31,0x90,0x00,0xa0,0xf1,0x88,0xc5,0x5f,0x18,0xf2,0x02,0x03,0xc4,0xfc,0x6f,0x50,0x45,0x48,0x06,0xe2,0x19,0x35,0x60,0x5b,0x9b,0xa5,0x8b,0x81,0x01,0x0c,0x14,0x60,0x4f,0x00,0x98,0x85,0x25,0xfe,0xc3,0xa0,0xab,0x0b,0x64,0x15,0x70,0x3e,0xc3,0x96,0xaa,0xe0,0xd5,0x2a,0x7a,0x31,0xfc,0x45,0xf4,0x85,0xbd,0x79,0xa4,0x03,0x38,0xc0,0xec,0xc1,0x4d,0xa8,0xae,0xb1,0x80,0x5a,0x1c,0x10,0xb0,0x9d,0x0a,0x80,0x08,0x48,0xb8,0x02,0x10,0xac,0x19,0x25,0x75,0x34,0x60,0xbf,0x47,0x01,0x52,0x95,0xf7,0x1c,0xa8,0xc1,0x9a,0xa0,0x80,0xfd,0x93,0x00,0x0c,0x1e,0x40,0x20,0xfd,0x33,0x00,0x35,0x1c,0x3d,0x02,0x60,0x70,0xdd,0xf8,0x59,0x00,0x69,0xb4,0x58,0x56,0xa0,0x77,0x33,0x4d,0x0d,0xd5,0xab,0xeb,0x5a,0x15,0x70,0xa7,0x87,0x33,0xf0,0x16,0xcf,0xde,0x39,0xa7,0xbd,0x7c,0x3e,0x7e,0x7b,0x93,0x2f,0x7e,0xf4,0xaa,0x00,0xba,0x05,0xb0,0x3e,0x79,0x5d,0x40,0x7d,0x09,0xf0,0x92,0x21,0xaf,0x6c,0x80,0x2e,0x6a,0xc0,0x3f,0x64,0x57,0x50,0x73,0xdd,0x70,0x93,0x22,0x32,0x6a,0x35,0xf8,0x95,0x16,0x0e,0x37,0x00,0xa3,0x08,0x58,0xdf,0x3c,0x23,0x71,0x8a,0xf2,0x7c,0x27,0xad,0xa8,0xcc,0x73,0x0d,0xfd,0xb5,0xa8,0xdb,0x8a,0x0f,0x9a,0x01,0x3e,0x1f,0x77,0x3b,0x26,0xe4,0x4e,0x07,0xc0,0x77,0x6f,0x25,0xa2,0x09,0x49,0x91,0x77,0xe3,0x2e,0xb6,0x23,0xef,0xb4,0x00,0x62,0xa0,0x4a,0x0f,0x4b,0x11,0x10,0xf5,0x4b,0x1d,0x80,0xb9,0x70,0x40,0x31,0x45,0x44,0x2e,0xea,0x97,0xc6,0x93,0x06,0x40,0x74,0x63,0x0d,0xcc,0xd1,0x01,0x47,0x29,0xfa,0xa5,0xc6,0x2c,0x36,0x03,0x24,0xce,0x00,0x53,0x4a,0x18,0x35,0x80,0x6c,0x9f,0xb9,0x23,0x80,0x53,0xe4,0xc8,0x6c,0x5e,0xf9,0x30,0xc6,0xa9,0xd4,0xc0,0x89,0x6c,0xdc,0xa0,0x8b,0x7a,0x6f,0x72,0xc9,0x84,0xa0,0x06,0x70,0x73,0x47,0x4b,0x00,0xf9,0xe6,0x4b,0xa7,0x94,0xa2,0xf5,0x3a,0xb5,0x7e,0x3a,0xad,0x4c,0xe2,0x89,0xf5,0x5d,0xae,0x52,0xe4,0x59,0xf4,0x54,0xe4,0x74,0x8a,0xfa,0xb9,0xca,0x1e,0x54,0x12,0x75,0xd2,0x0d,0x92,0x5e,0x9c,0x32,0x5d,0x69,0x5d,0x5e,0xa9,0x00,0x64,0x2c,0x8a,0x7a,0x25,0x9d,0xf5,0xd8,0x40,0x95,0x57,0xb9,0xca,0x68,0x2a,0x00,0x16,0x4f,0x80,0x39,0xca,0xf7,0xf7,0xcc,0xe5,0x99,0xce,0x78,0xcd,0x80,0x92,0xf3,0x74,0x09,0x78,0x67,0xfd,0xd7,0x75,0xa9,0x04,0x38,0x36,0xa1,0xf5,0x15,0x40,0xb4,0x33,0x4d,0xc0,0xed,0x86,0x8d,0xfc,0x78,0x55,0x5c,0x4f,0xdf,0x6d,0x6a,0xdd,0x23,0x55,0x3a,0xc3,0xb5,0x25,0x3d,0xc2,0xad,0xde,0x79,0x01,0x40,0xaa,0xfa,0xcf,0xf3,0x0c,0x53,0xa0,0xe5,0xd1,0x80,0x02,0x0f,0xc0,0x32,0x0a,0xd3,0x83,0x6b,0xdc,0x17,0xfd,0x23,0x5a,0x51,0x78,0x00,0x20,0x40,0x01,0xdb,0x6d,0x80,0x3a,0x08,0x7d,0xbf,0x0d,0x01,0x08,0xe8,0x39,0xb6,0x40,0x07,0x21,0x02,0x50,0x16,0xc4,0x01,0xf5,0x3d,0x6e,0x6c,0x65,0xc0,0x34,0x11,0x4d,0x13,0xb2,0xc8,0xd0,0x17,0x73,0x0f,0x01,0x44,0xc2,0x16,0x06,0x10,0x71,0x0e,0x94,0x89,0x82,0x08,0xfb,0xd2,0x86,0x08,0x4c,0x38,0x8b,0x87,0x00,0xe9,0x6b,0xf3,0x3b,0x21,0x06,0x60,0x86,0xbc,0x53,0x33,0xa5,0x30,0x11,0x18,0x00,0x77,0x80,0xa9,0xc1,0x11,0xb0,0x8d,0xbd,0xc1,0xfc,0x54,0x40,0x08,0x64,0x02,0x70,0x3e,0x90,0xfc,0xe3,0x5e,0xda,0x14,0xc7,0xa7,0x36,0x5a,0x5e,0x49,0x2c,0xb1,0xc4,0x12,0x4b,0x7c,0x77,0xfc,0x01,0xeb,0x7f,0x0c,0x1f,0xd8,0xfb,0x1f,0x86,0x03,0xd4,0xc3,0xc0,0xc7,0x01,0x9b,0xa3,0x01,0xac,0x1f,0x86,0x03,0x96,0xc0,0xf3,0xf9,0x01,0x3a,0xa3,0x4f,0x34,0x1d,0xd0,0x7f,0xbe,0x04,0x17,0x01,0xbb,0xe6,0x81,0xfe,0x69,0xce,0xb4,0xad,0x4f,0x41,0xe4,0x30,0x00,0x56,0xf6,0xde,0x11,0x0d,0x20,0xc0,0x9c,0xa3,0x01,0x5f,0x05,0xf3,0xb3,0x01,0xe0,0xad,0xf6,0x30,0xc8,0x07,0xdb,0xcd,0xbe,0xeb,0xe9,0xe2,0x1f,0x31,0x44,0x2f,0xdf,0x6e,0xb1,0xd3,0xe8,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, +}; +unsigned int player_images_length = 1069; + +unsigned char wall_images[] = { +0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x02,0x03,0x00,0x00,0x00,0x21,0x1c,0x40,0xf5,0x00,0x00,0x00,0x0c,0x50,0x4c,0x54,0x45,0x65,0x2d,0x67,0x00,0x00,0x00,0x45,0x45,0x45,0xff,0xff,0xff,0x98,0xd9,0x33,0xac,0x00,0x00,0x00,0x01,0x74,0x52,0x4e,0x53,0x00,0x40,0xe6,0xd8,0x66,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xdd,0x0a,0x0f,0x15,0x20,0x07,0x61,0xaa,0x7d,0x3c,0x00,0x00,0x00,0x90,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0xd2,0xb1,0x0d,0xc2,0x30,0x14,0x45,0x51,0x4b,0x88,0x8d,0xe8,0x81,0x19,0x08,0x14,0x19,0x21,0x23,0x30,0x08,0x91,0x52,0xa4,0x4b,0x22,0x7b,0x00,0x76,0x0a,0x53,0x30,0x03,0x7a,0x1d,0x3a,0xa7,0xff,0xb7,0xb0,0x5f,0x29,0x7f,0xe1,0x14,0xde,0x1f,0xf6,0x30,0x70,0xae,0xd1,0xf9,0xf5,0xf2,0x69,0x51,0xe0,0x95,0x06,0xd6,0x5b,0xcb,0x02,0xd3,0x18,0x06,0xfa,0x2d,0x0c,0x0c,0xcb,0xd2,0x67,0x81,0x36,0xaf,0x51,0xa0,0xb5,0x67,0xb6,0x83,0x56,0xc3,0x6f,0xcc,0x03,0x5b,0x1e,0x08,0xdf,0x60,0x6b,0x59,0x60,0x88,0x87,0x34,0x0b,0x4c,0x53,0x18,0x78,0xaf,0x61,0x60,0xaf,0xe1,0x0e,0x6a,0x3a,0xa4,0x7a,0x7f,0x64,0x81,0xae,0x1c,0xbb,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x0f,0xbe,0x25,0x1d,0x3c,0x06,0x64,0xdf,0xc4,0xaf,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, +}; +unsigned int wall_images_length = 278; + +unsigned char floor_images[] = { +0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x08,0x06,0x00,0x00,0x00,0x5c,0x72,0xa8,0x66,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xdd,0x0a,0x0f,0x15,0x34,0x30,0xf7,0xb9,0x0f,0x66,0x00,0x00,0x02,0x11,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0xdb,0x41,0x6e,0x02,0x31,0x0c,0x05,0x50,0x53,0x71,0x10,0x72,0x94,0xb9,0x18,0x87,0x99,0x8b,0x25,0x37,0x69,0x57,0x96,0x4c,0x04,0xa3,0x2e,0x9b,0xf4,0xbd,0x15,0x0c,0x62,0x33,0xd2,0xb7,0x1d,0x33,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xcd,0xed,0x3c,0xcf,0xef,0x31,0x46,0xf4,0xde,0xa3,0xb5,0xf6,0xab,0x2f,0x3d,0x1e,0x8f,0x18,0x63,0x44,0x44,0xc4,0xf3,0xf9,0xbc,0xb9,0x8d,0xb0,0xa6,0xaf,0x0c,0xf2,0xbb,0x90,0x47,0x44,0xf4,0xde,0x3f,0x86,0x1f,0x58,0xbc,0x00,0xf4,0xde,0x5f,0xba,0x7f,0x06,0x7f,0x0e,0x79,0x16,0x82,0x31,0xc6,0xc7,0xe2,0x00,0xac,0xe5,0x5e,0xc7,0xfe,0xda,0xdd,0x33,0xdc,0xf9,0x79,0x6b,0x4d,0xe0,0x61,0xb7,0x02,0x30,0x8f,0xfc,0x19,0xfe,0x77,0xfb,0x80,0xbc,0x36,0x17,0x07,0x60,0xd1,0x23,0x40,0xbe,0x18,0x63,0xbc,0x8c,0xfd,0x57,0x63,0x7e,0x6b,0x4d,0xf8,0x61,0xa7,0x02,0x90,0x61,0xcf,0xee,0x9f,0xc5,0x60,0x1e,0xfd,0x9d,0xff,0x61,0xf3,0x23,0x40,0x2d,0x08,0x59,0x04,0x72,0x3f,0xe0,0x17,0x00,0xd8,0x6c,0x02,0xc8,0x70,0x67,0xe0,0x6b,0x31,0xa8,0xe1,0x9f,0xa7,0x04,0x60,0x83,0x09,0x60,0xee,0xea,0xf3,0x2e,0xa0,0x86,0xff,0x38,0x0e,0x53,0x00,0xec,0x54,0x00,0xe6,0xad,0x7e,0x7d,0x7f,0x15,0x7e,0x7b,0x00,0xd8,0xa0,0x00,0xcc,0xe3,0x7c,0x7d,0x28,0x48,0xb7,0x87,0x8d,0x77,0x00,0xf5,0xbc,0x3f,0x6f,0xf8,0x73,0x2f,0x30,0xff,0x32,0x90,0xd7,0x8e,0xe3,0x70,0x07,0x61,0xe5,0x09,0xa0,0xfe,0x11,0xe8,0x5d,0xb7,0x9f,0xa7,0x83,0x7a,0x14,0x30,0x1d,0xc0,0xe2,0x05,0xa0,0x6e,0xf4,0x3d,0xe1,0x07,0xff,0xac,0x00,0xd4,0xb0,0x5f,0x05,0x7f,0x5e,0x0c,0x5a,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xac,0xe5,0x07,0x3c,0x99,0xbd,0xc6,0x5e,0x82,0x87,0x24,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, +}; +unsigned int floor_images_length = 626; + +unsigned char shadow_images[] = { +0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x20,0x08,0x06,0x00,0x00,0x00,0x1b,0x89,0xf8,0xcc,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,0x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xdd,0x0a,0x0f,0x16,0x17,0x3b,0xdc,0x84,0x1f,0xd6,0x00,0x00,0x00,0x26,0x49,0x44,0x41,0x54,0x48,0xc7,0x63,0x60,0x18,0x05,0xa3,0x60,0x14,0x8c,0x82,0x51,0x30,0x0a,0x46,0x01,0x55,0x01,0x23,0x0e,0xf1,0x06,0x4a,0x0c,0x68,0xa0,0x97,0x0b,0x1a,0x18,0x18,0x18,0x18,0x00,0xad,0x26,0x02,0x04,0xd1,0x96,0xc8,0xd6,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, +}; +unsigned int shadow_images_length = 135; + diff --git a/tiles/tiles.h b/tiles/tiles.h index 1ac7eb4..ee349f1 100644 --- a/tiles/tiles.h +++ b/tiles/tiles.h @@ -1,7 +1,18 @@ +/** WARNING - THIS FILE IS AUTOGENERATED BY pack_tiles, EDITS TO THIS FILE MAY BE OVERWRITTEN **/ #ifndef TILES_H #define TILES_H #define TILE_WIDTH 16 #define TILE_HEIGHT 32 -extern unsigned char player_png[]; -extern unsigned int player_png_len; -#endif \ No newline at end of file +extern unsigned char player_images[]; +extern unsigned int player_images_length; + +extern unsigned char wall_images[]; +extern unsigned int wall_images_length; + +extern unsigned char floor_images[]; +extern unsigned int floor_images_length; + +extern unsigned char shadow_images[]; +extern unsigned int shadow_images_length; + +#endif diff --git a/tiles/walls.png b/tiles/walls.png new file mode 100644 index 0000000..d5d19ad Binary files /dev/null and b/tiles/walls.png differ diff --git a/wall.c b/wall.c index bb39436..1017070 100644 --- a/wall.c +++ b/wall.c @@ -1,14 +1,14 @@ #include "wall.h" #include "tile.h" WallTile walls[] = { - { }, // 0 presumed to be empty + // { }, // 0 presumed to be empty { NO_PASS, "stone wall" }, // 1 { NO_PASS, "wood wall" }, // 2 { NO_PASS, "steel wall" } // 3 }; FloorTile floors[] = { - {}, +// {}, { PASS, "stone floor", 128}, { PASS, "wood floor", 32}, { PASS, "steel floor", 255} diff --git a/wall.h b/wall.h index c9762a4..4374539 100644 --- a/wall.h +++ b/wall.h @@ -4,14 +4,14 @@ #define MATERIAL_STONE 0 #define MATERIAL_WOOD 1 #define MATERIAL_STEEL 2 -#define WALL_NONE 0 -#define WALL_STONE 1 -#define WALL_WOOD 2 -#define WALL_STEEL 3 +//#define WALL_NONE 0 +#define WALL_STONE 0 +#define WALL_WOOD 1 +#define WALL_STEEL 2 -#define STONE 1 -#define WOOD 2 -#define STEEL 3 +#define STONE 0 +#define WOOD 1 +#define STEEL 2 typedef struct { int collision;