diff --git a/data/levels/level403.dat b/data/levels/level403.dat index db9c3d9..10c8cdc 100644 --- a/data/levels/level403.dat +++ b/data/levels/level403.dat @@ -16,7 +16,8 @@ monsters 1 34 16 1 27 28 1 32 20 -132 30 13 488 224 488 472 +132 30 13 488 224 488 224 488 472 +23 36 12 endmonsters exitdir 1 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,0,0,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, diff --git a/data/levels/level405.dat b/data/levels/level405.dat index 8407e31..688156a 100644 --- a/data/levels/level405.dat +++ b/data/levels/level405.dat @@ -36,8 +36,8 @@ monsters 16 31 6 16 5 8 16 35 17 -132 8 18 136 304 239 304 -132 31 18 504 304 371 304 +132 8 18 136 304 136 304 239 304 +132 31 18 504 304 504 304 371 304 endmonsters exitdir 1 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, @@ -47,9 +47,9 @@ exitdir 1 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,58,58,58,58,58,58,58,58,58,57, +57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,62,62,62,62,62,62,62,62,62,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,58,58,58,58,58,58,58,58,58,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, +57,62,62,62,62,62,62,62,62,62,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, diff --git a/data/levels/level406.dat b/data/levels/level406.dat index f4f6308..0f73c5f 100644 --- a/data/levels/level406.dat +++ b/data/levels/level406.dat @@ -36,34 +36,34 @@ monsters 15 11 21 endmonsters exitdir 1 -57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,0,0,0,0,0,57, +57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,56,53,53,53,53,53,53,56, +57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,53,53,53,53,53,53,56, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,58,58,58,58,58,58,58,58,58,58,60,0,0,57, -57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,57,57,57,57,57,57,57,57,57,57,57,0,0,57, +57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,56,56,56,56,56,56,56,56,56,56,56,0,0,57, +57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,56,56,56,56,56,56,56,56,56,56,56,0,0,57, 57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,45,45,45,45,45,45,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,0,0,0,0,61,0,0,0,0,0,0,0,59,58,58,58,58,58,58,58,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,0,0,0,61,61,61,0,0,0,0,0,0,57,57,57,57,57,57,57,57,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,61,61,61,61,61,61,61,61,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,61,0,0,0,0,61,61,61,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, +57,0,0,0,0,56,0,0,0,0,0,0,0,56,56,56,56,56,56,56,56,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, +57,0,0,0,56,56,56,0,0,0,0,0,0,56,56,56,56,56,56,56,56,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, +57,56,56,56,56,56,56,56,56,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, +57,56,0,0,0,0,56,56,56,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,67,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,0,0,0,0,0,67,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, 57,0,30,0,0,0,0,67,67,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57, -57,56,56,15,15,15,15,15,15,15,15,15,15,15,56,56,56,56,56,56,56,56,56,56,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,57, -57,57,56,15,15,15,15,15,15,15,15,15,15,15,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, +57,56,56,15,15,15,15,15,15,15,15,15,15,15,56,56,56,56,56,56,56,56,56,56,56,56,56,56,58,58,58,58,58,58,58,58,58,58,58,57, +57,57,56,15,15,15,15,15,15,15,15,15,15,15,56,56,56,56,56,56,56,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,57,57,57,57, 57,57,56,15,15,15,15,15,15,15,15,15,15,15,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, 57,57,56,15,15,15,15,15,15,15,15,15,15,15,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, 57,57,56,15,15,65,67,67,67,67,66,15,15,15,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, 57,57,56,56,56,56,67,67,67,67,56,56,56,56,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, -57,57,57,57,57,56,67,67,67,67,56,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, -57,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,57, -57,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,57, -57,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,57, -57,65,65,65,65,65,65,65,65,65,65,65,65,65,15,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,67,57, -57,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,67,67,57, -57,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,67,67,67,67,67,67,57, +56,56,56,56,56,56,67,67,67,67,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, +56,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,56, +56,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,56, +56,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,56, +56,65,65,65,65,65,65,65,65,65,65,65,65,65,15,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,67,56, +56,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,67,67,67,67,67,67,56, +56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,67,67,67,67,67,67,56, layer2 diff --git a/data/levels/level412.dat b/data/levels/level412.dat index 63332f6..4c8a2ac 100644 --- a/data/levels/level412.dat +++ b/data/levels/level412.dat @@ -1,4 +1,4 @@ -bgfile kitchen1.png +bgfile kitchen3.png bg 0 hurryup 30 help diff --git a/data/levels/level42.dat b/data/levels/level42.dat index 9b557f0..bdfe4e4 100644 --- a/data/levels/level42.dat +++ b/data/levels/level42.dat @@ -1,4 +1,4 @@ -bgfile kitchen2.png +bgfile kitchen3.png bg 0 hurryup 30 help @@ -27,9 +27,9 @@ monsters 16 5 22 1 29 23 1 7 23 -132 6 20 104 336 536 336 -132 37 17 600 288 34 288 -132 31 14 504 240 137 240 +132 6 20 104 336 104 336 536 336 +132 37 17 600 288 600 288 34 288 +132 31 14 504 240 504 240 137 240 endmonsters exitdir 1 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, @@ -57,9 +57,9 @@ exitdir 1 57,57,57,57,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,57,57,57,57, 57,57,57,57,57,58,0,0,0,0,0,0,0,0,0,0,59,58,58,58,58,58,60,0,0,0,0,0,0,0,0,0,0,0,58,57,57,57,57,57, 57,57,57,57,57,57,58,58,58,58,58,58,58,58,58,58,57,57,57,57,57,57,57,58,58,58,58,58,58,58,58,58,58,58,57,57,57,57,57,57, -57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, -57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, -57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, -57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, +57,25,25,25,25,25,57,57,25,25,25,25,57,57,57,57,25,57,57,25,25,25,25,57,57,25,57,57,25,57,57,25,57,57,57,25,57,57,25,57, +57,57,57,24,57,57,57,57,24,57,57,57,25,57,57,57,24,57,57,24,57,57,57,57,57,24,25,25,57,57,57,24,25,25,25,24,57,57,24,57, +57,57,57,24,57,57,57,57,24,25,25,25,57,57,57,57,24,57,57,24,57,57,57,57,57,24,57,24,57,57,57,57,57,24,57,57,57,57,57,57, +57,57,57,24,57,57,57,57,24,57,57,57,25,57,57,57,24,57,57,24,25,25,25,57,57,24,57,57,25,57,57,57,57,24,57,57,57,57,25,57, 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57, layer2 diff --git a/defs.h b/defs.h index e6d3bf6..0adb1d1 100644 --- a/defs.h +++ b/defs.h @@ -6,6 +6,8 @@ /* files */ #define FILE_LEVELMAP "map.dat" +#define FILE_TILEDEFS "tiledefs.dat" +#define DIR_LEVELS "levels" /* Macros */ diff --git a/edit.c b/edit.c index 0dddcf5..b87a2da 100644 --- a/edit.c +++ b/edit.c @@ -27,7 +27,6 @@ int selsprite = -1; int modified = B_FALSE; // has the current level been modified since last save? -int curworld = 1; int curlevelnum; int skipto = -1; @@ -166,7 +165,7 @@ int main (int argc, char **argv) { } /* init tiles */ - if (loadtiletypes("green.tiles")) { + if (loadtiletypes(FILE_TILEDEFS)) { printf("Cannot initialise tiles\n"); exit(1); } @@ -206,7 +205,7 @@ int main (int argc, char **argv) { state = LS_EDIT; - if (loadlevel(curworld,curlevelnum, B_TRUE)) { + if (loadlevel(curlevelnum, B_TRUE)) { return 1; } @@ -603,7 +602,7 @@ int main (int argc, char **argv) { if (toggletimer == 0) { if (curlevelnum < (numlevels-1)) { curlevelnum++; - loadlevel(curworld, curlevelnum, B_TRUE); + loadlevel(curlevelnum, B_TRUE); draweditorlevel(); drawsprites(); toggletimer = 30; @@ -617,7 +616,7 @@ int main (int argc, char **argv) { if (toggletimer == 0) { if (curlevelnum > 1) { curlevelnum--; - loadlevel(curworld, curlevelnum, B_TRUE); + loadlevel(curlevelnum, B_TRUE); draweditorlevel(); drawsprites(); toggletimer = 30; @@ -662,7 +661,7 @@ int main (int argc, char **argv) { /* SAVE LEVEL */ if (keys[SDLK_s]) { if (modified) { - savelevel(curworld,curlevelnum); + savelevel(curlevelnum); setmod(B_FALSE); } } @@ -977,7 +976,7 @@ void drawpalette(void) { } -int savelevel(int wnum, int lnum) { +int savelevel(int lnum) { FILE *f; int x,y; char filename[BUFLEN]; @@ -985,7 +984,7 @@ int savelevel(int wnum, int lnum) { sprite_t *s; - sprintf(filename,"%s/world%d/%s",datadir,wnum,levelentry[lnum].filename); + sprintf(filename,"%s/%s/%s",datadir,DIR_LEVELS,levelentry[lnum].filename); f = fopen(filename,"wt"); if (!f) { diff --git a/edit.h b/edit.h index 6c88360..609f4a1 100644 --- a/edit.h +++ b/edit.h @@ -46,7 +46,7 @@ void draweditortile(SDL_Surface *where, int x, int y); void drawtilehint(SDL_Surface *where, tiletype_t *tt, double x, double y); void drawpalette(void); void drawsprites(void); -int savelevel(int wnum, int lnum); +int savelevel(int lnum); void cleanup(void); void usage(void); void clearlevel(void); diff --git a/rc.c b/rc.c index b4d2c5a..df70b21 100644 --- a/rc.c +++ b/rc.c @@ -128,7 +128,6 @@ int gtime = 0; int fpsticks = 0; int fpsstart = 0; -int curworld; int curlevelnum; int skipto = -1; // which level to skip to level_t *curlevel; @@ -321,7 +320,7 @@ int main (int argc, char **argv) { } /* init tiles */ - if (loadtiletypes("green.tiles")) { + if (loadtiletypes(FILE_TILEDEFS)) { printf("Cannot initialise tiles\n"); exit(1); } @@ -1114,9 +1113,9 @@ void nextlevel(void) { // load next level data if (haspowerupany(PW_PHONE) && !isbosslevel(curlevelnum)) { // don't add monsters - loadlevel(curworld,curlevelnum, B_FALSE); + loadlevel(curlevelnum, B_FALSE); } else { - loadlevel(curworld,curlevelnum, B_TRUE); + loadlevel(curlevelnum, B_TRUE); } // remmeber layer 2 in case we replace it with water @@ -9680,7 +9679,6 @@ void startgame(void) { // initial variables curlevelnum = 1; - curworld = 1; // TODO: REMOVE THIS musicplaying = B_FALSE; levelcompletetime = -1; oldlevelcomplete = -1; @@ -9755,13 +9753,6 @@ void startgame(void) { } - // pre-load initial level -/* - if (loadlevel(curworld,curlevelnum, B_TRUE)) { - exit(1); - } -*/ - // more initial variables if (player) { makeinvuln(player); diff --git a/shared.c b/shared.c index 6334e96..5224812 100644 --- a/shared.c +++ b/shared.c @@ -20,7 +20,7 @@ #include "shared.h" -int loadlevel(int wnum, int lnum, int wantmonsters) { +int loadlevel(int lnum, int wantmonsters) { FILE *f; int x,y; int xx,yy; @@ -49,12 +49,11 @@ int loadlevel(int wnum, int lnum, int wantmonsters) { - printf("Loading level %d-%d...",wnum,lnum); + printf("Loading level %d-%d (seq %d) %s...",getworld(lnum), getlevel(lnum), lnum,levelentry[lnum].filename); - sprintf(filename,"%s/world%d/%s",datadir,wnum,levelentry[lnum].filename); + sprintf(filename,"%s/%s/%s",datadir,DIR_LEVELS,levelentry[lnum].filename); //filename = levelentry[lnum].filename; - //sprintf(filename, "world%d/level%d.dat",wnum,lnum); f = fopen(filename,"rt"); if (!f) { printf("can't open level file %s\n",filename); @@ -83,7 +82,6 @@ int loadlevel(int wnum, int lnum, int wantmonsters) { if (level->animtiles) free(level->animtiles); level->id = levelentry[lnum].id; - //sprintf(level->name, "Level %d-%d",wnum,lnum); sprintf(level->name, "%s",levelentry[lnum].desc); level->prev = NULL; level->next = NULL; diff --git a/shared.h b/shared.h index 4a4c124..1dd96a1 100644 --- a/shared.h +++ b/shared.h @@ -5,7 +5,7 @@ #include "defs.h" /* functions */ -int loadlevel(int wnum, int lnum, int wantmonsters); +int loadlevel(int lnum, int wantmonsters); void setdefaults(sprite_t *s); int loadtiletypes(char *filename); sprite_t *addsprite(int id,int x, int y, char *name);