|
|
@ -4,6 +4,11 @@
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "bomberclone.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "menu.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wformat-overflow"
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
|
|
|
|
|
|
|
|
|
|
|
/* launch the map options menu */
|
|
|
|
/* launch the map options menu */
|
|
|
|
void
|
|
|
|
void
|
|
|
|
mapmenu ()
|
|
|
|
mapmenu ()
|
|
|
@ -112,18 +117,18 @@ mapmenu ()
|
|
|
|
menuselect = -1;
|
|
|
|
menuselect = -1;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case (2): // Select Map
|
|
|
|
case (2): // Select Map
|
|
|
|
sprintf (pathname, "%s/maps", bman.datapath);
|
|
|
|
snprintf (pathname, LEN_PATHFILENAME, "%s/maps", bman.datapath);
|
|
|
|
mapname = menu_dir_select ("Select Map", pathname, DF_file);
|
|
|
|
mapname = menu_dir_select ("Select Map", pathname, DF_file);
|
|
|
|
if (mapname == NULL) {
|
|
|
|
if (mapname == NULL) {
|
|
|
|
map.map[0] = 0;
|
|
|
|
map.map[0] = 0;
|
|
|
|
map.map_selection = 2;
|
|
|
|
map.map_selection = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
sprintf (map.map, "%s/maps/%s", bman.datapath, mapname);
|
|
|
|
snprintf (map.map, LEN_PATHFILENAME, "%s/maps/%s", bman.datapath, mapname);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case (5): // Selected Tileset
|
|
|
|
case (5): // Selected Tileset
|
|
|
|
sprintf (pathname, "%s/tileset", bman.datapath);
|
|
|
|
snprintf (pathname, LEN_PATHFILENAME, "%s/tileset", bman.datapath);
|
|
|
|
mapname = menu_dir_select ("Select Tileset", pathname, DF_dir);
|
|
|
|
mapname = menu_dir_select ("Select Tileset", pathname, DF_dir);
|
|
|
|
if (mapname == NULL) {
|
|
|
|
if (mapname == NULL) {
|
|
|
|
map.tileset[0] = 0;
|
|
|
|
map.tileset[0] = 0;
|
|
|
@ -149,15 +154,11 @@ mapmenu ()
|
|
|
|
map.map_selection = selmt - &maptypes[0];
|
|
|
|
map.map_selection = selmt - &maptypes[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map.size.x = map.size.x | 1;
|
|
|
|
map.size.x = map.size.x | 1;
|
|
|
|
if (map.size.x < MIN_FIELDSIZE_X)
|
|
|
|
if (map.size.x < MIN_FIELDSIZE_X) map.size.x = MIN_FIELDSIZE_X;
|
|
|
|
map.size.x = MIN_FIELDSIZE_X;
|
|
|
|
if (map.size.x > MAX_FIELDSIZE_X) map.size.x = MAX_FIELDSIZE_X;
|
|
|
|
if (map.size.x > MAX_FIELDSIZE_X)
|
|
|
|
|
|
|
|
map.size.x = MAX_FIELDSIZE_X;
|
|
|
|
|
|
|
|
map.size.y = map.size.y | 1;
|
|
|
|
map.size.y = map.size.y | 1;
|
|
|
|
if (map.size.y < MIN_FIELDSIZE_Y)
|
|
|
|
if (map.size.y < MIN_FIELDSIZE_Y) map.size.y = MIN_FIELDSIZE_Y;
|
|
|
|
map.size.y = MIN_FIELDSIZE_Y;
|
|
|
|
if (map.size.y > MAX_FIELDSIZE_Y) map.size.y = MAX_FIELDSIZE_Y;
|
|
|
|
if (map.size.y > MAX_FIELDSIZE_Y)
|
|
|
|
|
|
|
|
map.size.y = MAX_FIELDSIZE_Y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_write ();
|
|
|
|
config_write ();
|
|
|
|
if (GT_MP_PTPM) net_send_servermode ();
|
|
|
|
if (GT_MP_PTPM) net_send_servermode ();
|
|
|
@ -169,6 +170,7 @@ mapmenu ()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define WIN_X 500
|
|
|
|
#define WIN_X 500
|
|
|
|
#define WIN_Y 350
|
|
|
|
#define WIN_Y 350
|
|
|
|
|
|
|
|
#define TEXTLEN 255
|
|
|
|
void
|
|
|
|
void
|
|
|
|
mapinfo ()
|
|
|
|
mapinfo ()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -177,7 +179,7 @@ mapinfo ()
|
|
|
|
int y,
|
|
|
|
int y,
|
|
|
|
eventstate,
|
|
|
|
eventstate,
|
|
|
|
done = 0;
|
|
|
|
done = 0;
|
|
|
|
char text[255];
|
|
|
|
char text[TEXTLEN];
|
|
|
|
|
|
|
|
|
|
|
|
// draw_menubox (WIN_X, WIN_Y);
|
|
|
|
// draw_menubox (WIN_X, WIN_Y);
|
|
|
|
|
|
|
|
|
|
|
@ -203,7 +205,7 @@ mapinfo ()
|
|
|
|
if (map.random_tileset)
|
|
|
|
if (map.random_tileset)
|
|
|
|
sprintf (text, "Random Tileset");
|
|
|
|
sprintf (text, "Random Tileset");
|
|
|
|
else
|
|
|
|
else
|
|
|
|
sprintf (text, "Tileset: %s", map.tileset);
|
|
|
|
snprintf (text, TEXTLEN, "Tileset: %s", map.tileset);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -211,7 +213,7 @@ mapinfo ()
|
|
|
|
|
|
|
|
|
|
|
|
/* Mapselection */
|
|
|
|
/* Mapselection */
|
|
|
|
if (map.map_selection == 0)
|
|
|
|
if (map.map_selection == 0)
|
|
|
|
sprintf (text, "Selected Map: %s", map.map);
|
|
|
|
snprintf (text, TEXTLEN, "Selected Map: %s", map.map);
|
|
|
|
else if (map.map_selection == 1)
|
|
|
|
else if (map.map_selection == 1)
|
|
|
|
sprintf (text, "Random Map");
|
|
|
|
sprintf (text, "Random Map");
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -223,14 +225,14 @@ mapinfo ()
|
|
|
|
y = y + 2 + (font[0].size.y << 1);
|
|
|
|
y = y + 2 + (font[0].size.y << 1);
|
|
|
|
|
|
|
|
|
|
|
|
/* Bomb Powerups */
|
|
|
|
/* Bomb Powerups */
|
|
|
|
sprintf (text, "Bomb Powerup: %d", map.bombs);
|
|
|
|
snprintf (text, TEXTLEN, "Bomb Powerup: %d", map.bombs);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
|
|
|
|
|
|
|
|
/* Trigger */
|
|
|
|
/* Trigger */
|
|
|
|
sprintf (text, "Trigger Specials: %d", map.sp_trigger);
|
|
|
|
snprintf (text, TEXTLEN, "Trigger Specials: %d", map.sp_trigger);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -238,14 +240,14 @@ mapinfo ()
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
|
|
|
|
|
|
|
|
/* Fire Powerups */
|
|
|
|
/* Fire Powerups */
|
|
|
|
sprintf (text, "Fire Powerup: %d", map.fire);
|
|
|
|
snprintf (text, TEXTLEN, "Fire Powerup: %d", map.fire);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
|
|
|
|
|
|
|
|
/* Push */
|
|
|
|
/* Push */
|
|
|
|
sprintf (text, "Push Specials: %d", map.sp_push);
|
|
|
|
snprintf (text, TEXTLEN, "Push Specials: %d", map.sp_push);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -253,14 +255,14 @@ mapinfo ()
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
|
|
|
|
|
|
|
|
/* Shoe Powerups */
|
|
|
|
/* Shoe Powerups */
|
|
|
|
sprintf (text, "Shoe Powerup: %d", map.shoes);
|
|
|
|
snprintf (text, TEXTLEN, "Shoe Powerup: %d", map.shoes);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
// font_draw (3 + x - (WIN_X / 2) ,1 + y, text, 0);
|
|
|
|
|
|
|
|
|
|
|
|
/* Row */
|
|
|
|
/* Row */
|
|
|
|
sprintf (text, "Row Specials: %d", map.sp_row);
|
|
|
|
snprintf (text, TEXTLEN, "Row Specials: %d", map.sp_row);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_draw (x , y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -269,7 +271,7 @@ mapinfo ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Mixed Powerups */
|
|
|
|
/* Mixed Powerups */
|
|
|
|
sprintf (text, "Mixed Powerup: %d", map.mixed);
|
|
|
|
snprintf (text, TEXTLEN, "Mixed Powerup: %d", map.mixed);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -284,7 +286,7 @@ mapinfo ()
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
y = y + 2 + font[0].size.y;
|
|
|
|
|
|
|
|
|
|
|
|
/* Death Powerups */
|
|
|
|
/* Death Powerups */
|
|
|
|
sprintf (text, "Death Powerup: %d", map.death);
|
|
|
|
snprintf (text, TEXTLEN, "Death Powerup: %d", map.death);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_setcolor (128,128,128,0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_draw (2 + x - (WIN_X / 2), y, text, 0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
|
// font_setcolor (255,255,255,0);
|
|
|
@ -323,6 +325,8 @@ mapinfo ()
|
|
|
|
|
|
|
|
|
|
|
|
#undef WIN_X
|
|
|
|
#undef WIN_X
|
|
|
|
#undef WIN_Y
|
|
|
|
#undef WIN_Y
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* change start settings for the game */
|
|
|
|
/* change start settings for the game */
|
|
|
|