2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/main/menu.c,v $
|
|
|
|
* $Revision: 1.1.1.1 $
|
|
|
|
* $Author: zicodxx $
|
|
|
|
* $Date: 2006/03/17 19:43:27 $
|
|
|
|
*
|
|
|
|
* Inferno main menu.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef RCS
|
|
|
|
#pragma off (unreferenced)
|
|
|
|
static char rcsid[] = "$Id: menu.c,v 1.1.1.1 2006/03/17 19:43:27 zicodxx Exp $";
|
|
|
|
#pragma on (unreferenced)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "menu.h"
|
|
|
|
#include "inferno.h"
|
|
|
|
#include "game.h"
|
|
|
|
#include "gr.h"
|
|
|
|
#include "key.h"
|
|
|
|
#include "iff.h"
|
|
|
|
#include "u_mem.h"
|
|
|
|
#include "error.h"
|
|
|
|
#include "bm.h"
|
|
|
|
#include "screens.h"
|
|
|
|
#include "mono.h"
|
|
|
|
#include "joy.h"
|
|
|
|
#include "vecmat.h"
|
|
|
|
#include "effects.h"
|
|
|
|
#include "slew.h"
|
|
|
|
#include "gamemine.h"
|
|
|
|
#include "gamesave.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "args.h"
|
|
|
|
#include "newdemo.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "sounds.h"
|
|
|
|
#include "gameseq.h"
|
|
|
|
#include "text.h"
|
|
|
|
#include "gamefont.h"
|
|
|
|
#include "newmenu.h"
|
|
|
|
#include "network.h"
|
|
|
|
#include "scores.h"
|
|
|
|
#include "joydefs.h"
|
|
|
|
#include "playsave.h"
|
|
|
|
#include "multi.h"
|
|
|
|
#include "kconfig.h"
|
|
|
|
#include "titles.h"
|
|
|
|
#include "credits.h"
|
|
|
|
#include "texmap.h"
|
|
|
|
#include "polyobj.h"
|
|
|
|
#include "state.h"
|
|
|
|
#include "mission.h"
|
|
|
|
#include "songs.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include "reorder.h"
|
|
|
|
#include "d_glob.h"
|
|
|
|
#include "cfile.h"
|
|
|
|
#include "gauges.h"
|
|
|
|
#include "hudmsg.h" //for HUD_max_num_disp
|
|
|
|
#include "ipx.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EDITOR
|
|
|
|
#include "editor/editor.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void do_option(int select);
|
|
|
|
void do_detail_level_menu_custom(void);
|
|
|
|
void do_multi_player_menu();
|
|
|
|
void do_new_game_menu();
|
|
|
|
void do_load_game_menu();
|
2007-12-17 22:45:45 +00:00
|
|
|
void do_ip_manual_join_menu();
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
#define MENU_NEW_GAME 0
|
|
|
|
#define MENU_GAME 1
|
|
|
|
#define MENU_EDITOR 2
|
|
|
|
#define MENU_VIEW_SCORES 3
|
|
|
|
#define MENU_QUIT 4
|
|
|
|
#define MENU_LOAD_GAME 5
|
|
|
|
#define MENU_SAVE_GAME 6
|
|
|
|
#define MENU_DEMO_PLAY 8
|
|
|
|
#define MENU_LOAD_LEVEL 9
|
|
|
|
#define MENU_START_NETGAME 10
|
|
|
|
#define MENU_JOIN_NETGAME 11
|
|
|
|
#define MENU_CONFIG 13
|
|
|
|
#define MENU_REJOIN_NETGAME 14
|
|
|
|
#define MENU_DIFFICULTY 15
|
|
|
|
#define MENU_HELP 19
|
|
|
|
#define MENU_NEW_PLAYER 20
|
|
|
|
#ifdef NETWORK
|
|
|
|
#define MENU_MULTIPLAYER 21
|
|
|
|
#endif
|
|
|
|
#define MENU_SHOW_CREDITS 23
|
|
|
|
#define MENU_ORDER_INFO 24
|
|
|
|
#define MENU_PLAY_SONG 25
|
|
|
|
#ifdef NETWORK
|
2007-05-31 22:30:18 +00:00
|
|
|
#define MENU_START_IPX_NETGAME 26
|
|
|
|
#define MENU_JOIN_IPX_NETGAME 27
|
|
|
|
#define MENU_START_UDP_NETGAME 28 // UDP/IP support
|
|
|
|
#define MENU_JOIN_UDP_NETGAME 29
|
|
|
|
#define MENU_START_KALI_NETGAME 30 // Kali support
|
|
|
|
#define MENU_JOIN_KALI_NETGAME 31
|
2006-03-20 16:43:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//ADD_ITEM("Start netgame...", MENU_START_NETGAME, -1 );
|
|
|
|
//ADD_ITEM("Send net message...", MENU_SEND_NET_MESSAGE, -1 );
|
|
|
|
|
|
|
|
#define ADD_ITEM(t,value,key) do { m[num_options].type=NM_TYPE_MENU; m[num_options].text=t; menu_choice[num_options]=value;num_options++; } while (0)
|
|
|
|
|
|
|
|
extern int last_joy_time; //last time the joystick was used
|
|
|
|
#ifndef NDEBUG
|
|
|
|
/* extern int speedtest_on; adb: not found...*/
|
|
|
|
#define speedtest_on 0
|
|
|
|
#else
|
|
|
|
#define speedtest_on 0
|
|
|
|
#endif
|
|
|
|
|
2007-07-26 23:56:00 +00:00
|
|
|
extern void newmenu_close();
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
ubyte do_auto_demo = 1; // Flag used to enable auto demo starting in main menu.
|
|
|
|
int Player_default_difficulty; // Last difficulty level chosen by the player
|
|
|
|
int Auto_leveling_on = 0;
|
|
|
|
int Menu_draw_copyright = 0;
|
|
|
|
|
|
|
|
void autodemo_menu_check(int nitems, newmenu_item * items, int *last_key, int citem )
|
|
|
|
{
|
|
|
|
int curtime;
|
|
|
|
|
|
|
|
nitems = nitems;
|
|
|
|
items=items;
|
|
|
|
citem = citem;
|
|
|
|
|
|
|
|
// Don't allow them to hit ESC in the main menu.
|
|
|
|
if (*last_key==KEY_ESC) *last_key = 0;
|
|
|
|
|
|
|
|
if ( do_auto_demo ) {
|
|
|
|
curtime = timer_get_approx_seconds();
|
2007-10-18 14:44:02 +00:00
|
|
|
if ( (((keyd_time_when_last_pressed+i2f(45)) < curtime) && (!speedtest_on)) || GameArg.SysAutoDemo ) {
|
2006-03-20 16:43:15 +00:00
|
|
|
keyd_time_when_last_pressed = curtime; // Reset timer so that disk won't thrash if no demos.
|
|
|
|
newdemo_start_playback(NULL); // Randomly pick a file
|
|
|
|
if (Newdemo_state == ND_STATE_PLAYBACK) {
|
|
|
|
Function_mode = FMODE_GAME;
|
|
|
|
*last_key = -2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//static int First_time = 1;
|
|
|
|
static int main_menu_choice = 0;
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Create the main menu.
|
|
|
|
void create_main_menu(newmenu_item *m, int *menu_choice, int *callers_num_options)
|
|
|
|
{
|
|
|
|
int num_options;
|
|
|
|
|
|
|
|
#ifndef DEMO_ONLY
|
|
|
|
num_options = 0;
|
|
|
|
|
|
|
|
// // Move down to allow for space to display "Destination Saturn"
|
|
|
|
// if (Saturn) {
|
|
|
|
// int i;
|
|
|
|
//
|
|
|
|
// for (i=0; i<4; i++)
|
|
|
|
// ADD_ITEM("", 0, -1);
|
|
|
|
//
|
|
|
|
// if (First_time) {
|
|
|
|
// main_menu_choice = 4;
|
|
|
|
// First_time = 0;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
set_screen_mode (SCREEN_MENU);
|
|
|
|
|
|
|
|
ADD_ITEM(TXT_NEW_GAME,MENU_NEW_GAME,KEY_N);
|
|
|
|
|
|
|
|
ADD_ITEM(TXT_LOAD_GAME,MENU_LOAD_GAME,KEY_L);
|
|
|
|
#ifdef NETWORK
|
|
|
|
ADD_ITEM(TXT_MULTIPLAYER_,MENU_MULTIPLAYER,-1);
|
|
|
|
#endif
|
|
|
|
ADD_ITEM(TXT_OPTIONS_, MENU_CONFIG, -1 );
|
|
|
|
ADD_ITEM(TXT_CHANGE_PILOTS,MENU_NEW_PLAYER,unused);
|
|
|
|
ADD_ITEM(TXT_VIEW_DEMO,MENU_DEMO_PLAY,0);
|
|
|
|
ADD_ITEM(TXT_VIEW_SCORES,MENU_VIEW_SCORES,KEY_V);
|
|
|
|
#ifdef SHAREWARE
|
|
|
|
ADD_ITEM(TXT_ORDERING_INFO,MENU_ORDER_INFO,-1);
|
|
|
|
#endif
|
|
|
|
ADD_ITEM(TXT_CREDITS,MENU_SHOW_CREDITS,-1);
|
|
|
|
#endif
|
|
|
|
ADD_ITEM(TXT_QUIT,MENU_QUIT,KEY_Q);
|
|
|
|
|
|
|
|
#ifndef RELEASE
|
|
|
|
if (!(Game_mode & GM_MULTI )) {
|
|
|
|
//m[num_options].type=NM_TYPE_TEXT;
|
|
|
|
//m[num_options++].text=" Debug options:";
|
|
|
|
|
|
|
|
ADD_ITEM(" Load level...",MENU_LOAD_LEVEL ,KEY_N);
|
|
|
|
#ifdef EDITOR
|
|
|
|
ADD_ITEM(" Editor", MENU_EDITOR, KEY_E);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
ADD_ITEM( " Play song", MENU_PLAY_SONG, -1 );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
*callers_num_options = num_options;
|
|
|
|
}
|
|
|
|
|
|
|
|
//returns number of item chosen
|
|
|
|
int DoMenu()
|
|
|
|
{
|
|
|
|
|
|
|
|
int menu_choice[25];
|
|
|
|
newmenu_item m[25];
|
|
|
|
int num_options = 0;
|
|
|
|
|
|
|
|
if ( Players[Player_num].callsign[0]==0 ) {
|
|
|
|
RegisterPlayer();
|
|
|
|
return 0;
|
|
|
|
}
|
2007-03-31 21:39:48 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
create_main_menu(m, menu_choice, &num_options);
|
|
|
|
|
|
|
|
do {
|
|
|
|
keyd_time_when_last_pressed = timer_get_fixed_seconds(); // .. 20 seconds from now!
|
|
|
|
if (main_menu_choice < 0 ) main_menu_choice = 0;
|
|
|
|
Menu_draw_copyright = 1;
|
|
|
|
main_menu_choice = newmenu_do2(NULL, NULL, num_options, m, autodemo_menu_check, main_menu_choice, Menu_pcx_name);
|
|
|
|
if ( main_menu_choice > -1 ) do_option(menu_choice[main_menu_choice]);
|
|
|
|
create_main_menu(m, menu_choice, &num_options); // may have to change, eg, maybe selected pilot and no save games.
|
|
|
|
} while( Function_mode==FMODE_MENU );
|
|
|
|
|
|
|
|
// if (main_menu_choice != -2)
|
|
|
|
// do_auto_demo = 0; // No more auto demos
|
|
|
|
if ( Function_mode==FMODE_GAME )
|
|
|
|
gr_palette_fade_out( gr_palette, 32, 0 );
|
|
|
|
|
|
|
|
return main_menu_choice;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern void show_order_form(void); // John didn't want this in inferno.h so I just externed it.
|
|
|
|
|
|
|
|
//returns flag, true means quit menu
|
|
|
|
void do_option ( int select)
|
|
|
|
{
|
|
|
|
switch (select) {
|
|
|
|
case MENU_NEW_GAME:
|
|
|
|
do_new_game_menu();
|
|
|
|
break;
|
|
|
|
case MENU_GAME:
|
|
|
|
break;
|
|
|
|
case MENU_DEMO_PLAY:
|
|
|
|
{
|
|
|
|
char demo_file[16];
|
2007-02-06 15:03:10 +00:00
|
|
|
if (newmenu_get_filename( TXT_SELECT_DEMO, DEMO_DIR "*.dem", demo_file, 1 ))
|
|
|
|
newdemo_start_playback(demo_file);
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_LOAD_GAME:
|
|
|
|
state_restore_all(0);
|
|
|
|
break;
|
|
|
|
#ifdef EDITOR
|
|
|
|
case MENU_EDITOR:
|
|
|
|
Function_mode = FMODE_EDITOR;
|
|
|
|
init_cockpit();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case MENU_VIEW_SCORES:
|
|
|
|
gr_palette_fade_out( gr_palette,32,0 );
|
|
|
|
scores_view(-1);
|
|
|
|
break;
|
|
|
|
#ifdef SHAREWARE
|
|
|
|
case MENU_ORDER_INFO:
|
|
|
|
show_order_form();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case MENU_QUIT:
|
|
|
|
#ifdef EDITOR
|
|
|
|
if (! SafetyCheck()) break;
|
|
|
|
#endif
|
|
|
|
gr_palette_fade_out( gr_palette,32,0);
|
|
|
|
Function_mode = FMODE_EXIT;
|
|
|
|
break;
|
|
|
|
case MENU_NEW_PLAYER:
|
|
|
|
RegisterPlayer(); //1 == allow escape out of menu
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifndef RELEASE
|
|
|
|
|
|
|
|
case MENU_PLAY_SONG: {
|
|
|
|
int i;
|
|
|
|
char * m[MAX_SONGS];
|
|
|
|
|
|
|
|
for (i=0;i<MAX_SONGS;i++) {
|
|
|
|
m[i] = Songs[i].filename;
|
|
|
|
}
|
|
|
|
i = newmenu_listbox( "Select Song", MAX_SONGS, m, 1, NULL );
|
|
|
|
|
|
|
|
if ( i > -1 ) {
|
|
|
|
songs_play_song( i, 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MENU_LOAD_LEVEL: {
|
|
|
|
newmenu_item m;
|
|
|
|
char text[10]="";
|
|
|
|
int new_level_num;
|
|
|
|
|
|
|
|
m.type=NM_TYPE_INPUT; m.text_len = 10; m.text = text;
|
|
|
|
|
|
|
|
newmenu_do( NULL, "Enter level to load", 1, &m, NULL );
|
|
|
|
|
|
|
|
new_level_num = atoi(m.text);
|
|
|
|
|
|
|
|
if (new_level_num!=0 && new_level_num>=Last_secret_level && new_level_num<=Last_level) {
|
|
|
|
gr_palette_fade_out( gr_palette, 32, 0 );
|
|
|
|
StartNewGame(new_level_num);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NETWORK
|
2007-05-31 22:30:18 +00:00
|
|
|
case MENU_START_IPX_NETGAME:
|
|
|
|
case MENU_JOIN_IPX_NETGAME:
|
|
|
|
case MENU_START_KALI_NETGAME:
|
|
|
|
case MENU_JOIN_KALI_NETGAME:
|
|
|
|
switch (select & ~0x1) {
|
|
|
|
case MENU_START_IPX_NETGAME: ipx_set_driver("ipx"); break;
|
|
|
|
case MENU_START_KALI_NETGAME: ipx_set_driver("kali"); break;
|
|
|
|
default: Int3();
|
|
|
|
}
|
|
|
|
if ((select & 0x1) == 0) // MENU_START_*_NETGAME
|
2007-10-31 00:49:24 +00:00
|
|
|
{
|
|
|
|
ForceVersionCheck=0;
|
2007-05-31 22:30:18 +00:00
|
|
|
network_start_game();
|
2007-10-31 00:49:24 +00:00
|
|
|
}
|
2007-05-31 22:30:18 +00:00
|
|
|
else // MENU_JOIN_*_NETGAME
|
|
|
|
network_join_game();
|
2006-03-20 16:43:15 +00:00
|
|
|
break;
|
2007-05-31 22:30:18 +00:00
|
|
|
|
|
|
|
case MENU_START_UDP_NETGAME:
|
2007-12-17 22:45:45 +00:00
|
|
|
ipx_set_driver("udp");
|
2007-10-31 00:49:24 +00:00
|
|
|
ForceVersionCheck=1;
|
2007-05-31 22:30:18 +00:00
|
|
|
network_start_game();
|
2006-03-20 16:43:15 +00:00
|
|
|
break;
|
2007-05-31 22:30:18 +00:00
|
|
|
case MENU_JOIN_UDP_NETGAME:
|
2007-12-17 22:45:45 +00:00
|
|
|
ipx_set_driver("udp");
|
2006-03-20 16:43:15 +00:00
|
|
|
do_ip_manual_join_menu();
|
|
|
|
break;
|
|
|
|
case MENU_MULTIPLAYER:
|
|
|
|
do_multi_player_menu();
|
|
|
|
break;
|
|
|
|
#endif //NETWORK
|
|
|
|
case MENU_CONFIG:
|
|
|
|
do_options_menu();
|
|
|
|
break;
|
|
|
|
case MENU_SHOW_CREDITS:
|
|
|
|
gr_palette_fade_out( gr_palette,32,0);
|
|
|
|
credits_show();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Error("Unknown option %d in do_option",select);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int do_difficulty_menu()
|
|
|
|
{
|
|
|
|
int s;
|
|
|
|
newmenu_item m[5];
|
|
|
|
|
|
|
|
m[0].type=NM_TYPE_MENU; m[0].text=MENU_DIFFICULTY_TEXT(0);
|
|
|
|
m[1].type=NM_TYPE_MENU; m[1].text=MENU_DIFFICULTY_TEXT(1);
|
|
|
|
m[2].type=NM_TYPE_MENU; m[2].text=MENU_DIFFICULTY_TEXT(2);
|
|
|
|
m[3].type=NM_TYPE_MENU; m[3].text=MENU_DIFFICULTY_TEXT(3);
|
|
|
|
m[4].type=NM_TYPE_MENU; m[4].text=MENU_DIFFICULTY_TEXT(4);
|
|
|
|
|
|
|
|
s = newmenu_do1( NULL, TXT_DIFFICULTY_LEVEL, NDL, m, NULL, Difficulty_level);
|
|
|
|
|
|
|
|
if (s > -1 ) {
|
|
|
|
if (s != Difficulty_level)
|
|
|
|
{
|
|
|
|
Player_default_difficulty = s;
|
|
|
|
write_player_file();
|
|
|
|
}
|
|
|
|
Difficulty_level = s;
|
|
|
|
mprintf((0, "%s %s %i\n", TXT_DIFFICULTY_LEVEL, TXT_SET_TO, Difficulty_level));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Max_debris_objects, Max_objects_onscreen_detailed;
|
|
|
|
int Max_linear_depth_objects;
|
|
|
|
|
2006-10-06 14:41:31 +00:00
|
|
|
sbyte Object_complexity=2, Object_detail=2;
|
|
|
|
sbyte Wall_detail=2, Wall_render_depth=2, Debris_amount=2, SoundChannels = 2;
|
|
|
|
|
|
|
|
sbyte Render_depths[NUM_DETAIL_LEVELS-1] = { 6, 9, 12, 15, 20};
|
|
|
|
sbyte Max_perspective_depths[NUM_DETAIL_LEVELS-1] = { 1, 2, 3, 5, 8};
|
|
|
|
sbyte Max_linear_depths[NUM_DETAIL_LEVELS-1] = { 3, 5, 7, 10, 17};
|
|
|
|
sbyte Max_linear_depths_objects[NUM_DETAIL_LEVELS-1] = { 1, 2, 3, 5, 12};
|
|
|
|
sbyte Max_debris_objects_list[NUM_DETAIL_LEVELS-1] = { 2, 4, 7, 10, 15};
|
|
|
|
sbyte Max_objects_onscreen_detailed_list[NUM_DETAIL_LEVELS-1] = { 2, 4, 7, 10, 15};
|
|
|
|
sbyte Smts_list[NUM_DETAIL_LEVELS-1] = { 2, 4, 8, 16, 50}; // threshold for models to go to lower detail model, gets multiplied by obj->size
|
|
|
|
sbyte Max_sound_channels[NUM_DETAIL_LEVELS-1] = { 2, 4, 8, 12, 16};
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Set detail level based stuff.
|
|
|
|
// Note: Highest detail level (detail_level == NUM_DETAIL_LEVELS-1) is custom detail level.
|
|
|
|
void set_detail_level_parameters(int detail_level)
|
|
|
|
{
|
|
|
|
Assert((detail_level >= 0) && (detail_level < NUM_DETAIL_LEVELS));
|
|
|
|
|
|
|
|
if (detail_level < NUM_DETAIL_LEVELS-1) {
|
|
|
|
Render_depth = Render_depths[detail_level];
|
|
|
|
Max_perspective_depth = Max_perspective_depths[detail_level];
|
|
|
|
Max_linear_depth = Max_linear_depths[detail_level];
|
|
|
|
Max_linear_depth_objects = Max_linear_depths_objects[detail_level];
|
|
|
|
|
|
|
|
Max_debris_objects = Max_debris_objects_list[detail_level];
|
|
|
|
Max_objects_onscreen_detailed = Max_objects_onscreen_detailed_list[detail_level];
|
|
|
|
|
|
|
|
Simple_model_threshhold_scale = Smts_list[detail_level];
|
|
|
|
|
|
|
|
digi_set_max_channels( Max_sound_channels[ detail_level ] );
|
|
|
|
|
|
|
|
// Set custom menu defaults.
|
|
|
|
Object_complexity = detail_level;
|
|
|
|
Wall_render_depth = detail_level;
|
|
|
|
Object_detail = detail_level;
|
|
|
|
Wall_detail = detail_level;
|
|
|
|
Debris_amount = detail_level;
|
|
|
|
SoundChannels = detail_level;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void do_detail_level_menu(void)
|
|
|
|
{
|
|
|
|
int s;
|
|
|
|
newmenu_item m[7];
|
|
|
|
|
|
|
|
m[0].type=NM_TYPE_MENU; m[0].text=MENU_DETAIL_TEXT(0);
|
|
|
|
m[1].type=NM_TYPE_MENU; m[1].text=MENU_DETAIL_TEXT(1);
|
|
|
|
m[2].type=NM_TYPE_MENU; m[2].text=MENU_DETAIL_TEXT(2);
|
|
|
|
m[3].type=NM_TYPE_MENU; m[3].text=MENU_DETAIL_TEXT(3);
|
|
|
|
m[4].type=NM_TYPE_MENU; m[4].text=MENU_DETAIL_TEXT(4);
|
|
|
|
m[5].type=NM_TYPE_TEXT; m[5].text="";
|
|
|
|
m[6].type=NM_TYPE_MENU; m[6].text=MENU_DETAIL_TEXT(5);
|
|
|
|
|
|
|
|
s = newmenu_do1( NULL, TXT_DETAIL_LEVEL , NDL+2, m, NULL, Detail_level);
|
|
|
|
|
|
|
|
if (s > -1 ) {
|
|
|
|
switch (s) {
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
Detail_level = s;
|
|
|
|
mprintf((0, "Detail level set to %i\n", Detail_level));
|
|
|
|
set_detail_level_parameters(Detail_level);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
Detail_level = 5;
|
|
|
|
do_detail_level_menu_custom();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void do_detail_level_menu_custom_menuset(int nitems, newmenu_item * items, int *last_key, int citem )
|
|
|
|
{
|
|
|
|
nitems = nitems;
|
|
|
|
*last_key = *last_key;
|
|
|
|
citem = citem;
|
|
|
|
|
|
|
|
Object_complexity = items[0].value;
|
|
|
|
Object_detail = items[1].value;
|
|
|
|
Wall_detail = items[2].value;
|
|
|
|
Wall_render_depth = items[3].value;
|
|
|
|
Debris_amount = items[4].value;
|
|
|
|
SoundChannels = items[5].value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_custom_detail_vars(void)
|
|
|
|
{
|
|
|
|
Render_depth = Render_depths[Wall_render_depth];
|
|
|
|
|
|
|
|
Max_perspective_depth = Max_perspective_depths[Wall_detail];
|
|
|
|
Max_linear_depth = Max_linear_depths[Wall_detail];
|
|
|
|
|
|
|
|
Max_debris_objects = Max_debris_objects_list[Debris_amount];
|
|
|
|
|
|
|
|
Max_objects_onscreen_detailed = Max_objects_onscreen_detailed_list[Object_complexity];
|
|
|
|
Simple_model_threshhold_scale = Smts_list[Object_complexity];
|
|
|
|
Max_linear_depth_objects = Max_linear_depths_objects[Object_detail];
|
|
|
|
|
|
|
|
digi_set_max_channels( Max_sound_channels[ SoundChannels ] );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void do_detail_level_menu_custom(void)
|
|
|
|
{
|
|
|
|
int s=0;
|
|
|
|
newmenu_item m[7];
|
|
|
|
|
|
|
|
do {
|
|
|
|
m[0].type = NM_TYPE_SLIDER;
|
|
|
|
m[0].text = TXT_OBJ_COMPLEXITY;
|
|
|
|
m[0].value = Object_complexity;
|
|
|
|
m[0].min_value = 0;
|
|
|
|
m[0].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[1].type = NM_TYPE_SLIDER;
|
|
|
|
m[1].text = TXT_OBJ_DETAIL;
|
|
|
|
m[1].value = Object_detail;
|
|
|
|
m[1].min_value = 0;
|
|
|
|
m[1].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[2].type = NM_TYPE_SLIDER;
|
|
|
|
m[2].text = TXT_WALL_DETAIL;
|
|
|
|
m[2].value = Wall_detail;
|
|
|
|
m[2].min_value = 0;
|
|
|
|
m[2].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[3].type = NM_TYPE_SLIDER;
|
|
|
|
m[3].text = TXT_WALL_RENDER_DEPTH;
|
|
|
|
m[3].value = Wall_render_depth;
|
|
|
|
m[3].min_value = 0;
|
|
|
|
m[3].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[4].type = NM_TYPE_SLIDER;
|
|
|
|
m[4].text= TXT_DEBRIS_AMOUNT;
|
|
|
|
m[4].value = Debris_amount;
|
|
|
|
m[4].min_value = 0;
|
|
|
|
m[4].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[5].type = NM_TYPE_SLIDER;
|
|
|
|
m[5].text= TXT_SOUND_CHANNELS;
|
|
|
|
m[5].value = SoundChannels;
|
|
|
|
m[5].min_value = 0;
|
|
|
|
m[5].max_value = NDL-1;
|
|
|
|
|
|
|
|
m[6].type = NM_TYPE_TEXT;
|
|
|
|
m[6].text= TXT_LO_HI;
|
|
|
|
|
|
|
|
s = newmenu_do1( NULL, TXT_DETAIL_CUSTOM, 7, m, do_detail_level_menu_custom_menuset, s);
|
|
|
|
} while (s > -1);
|
|
|
|
|
|
|
|
set_custom_detail_vars();
|
|
|
|
}
|
|
|
|
|
2007-03-04 11:54:32 +00:00
|
|
|
extern char *get_level_file(int level_num);
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
void do_new_game_menu()
|
|
|
|
{
|
|
|
|
int new_level_num,player_highest_level;
|
|
|
|
|
|
|
|
#ifndef SHAREWARE
|
|
|
|
int n_missions = build_mission_list(0);
|
|
|
|
|
|
|
|
if (n_missions > 1) {
|
|
|
|
int new_mission_num,i, default_mission;
|
|
|
|
char * m[MAX_MISSIONS];
|
|
|
|
|
|
|
|
default_mission = 0;
|
|
|
|
for (i=0;i<n_missions;i++) {
|
|
|
|
m[i] = Mission_list[i].mission_name;
|
|
|
|
if ( !strcasecmp( m[i], config_last_mission ) )
|
|
|
|
default_mission = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
new_mission_num = newmenu_listbox1( "New Game\n\nSelect mission", n_missions, m, 1, default_mission, NULL );
|
|
|
|
|
|
|
|
if (new_mission_num == -1)
|
|
|
|
return; //abort!
|
|
|
|
|
|
|
|
strcpy(config_last_mission, m[new_mission_num] );
|
2007-05-14 13:38:44 +00:00
|
|
|
if (!load_mission(new_mission_num)) {
|
2007-03-04 11:54:32 +00:00
|
|
|
nm_messagebox( NULL, 1, TXT_OK, "Error loading Mission file");
|
2006-03-20 16:43:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
new_level_num = 1;
|
|
|
|
|
|
|
|
player_highest_level = get_highest_level();
|
|
|
|
|
|
|
|
if (player_highest_level > Last_level)
|
|
|
|
player_highest_level = Last_level;
|
2007-09-28 22:44:04 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
if (player_highest_level > 1) {
|
|
|
|
newmenu_item m[2];
|
|
|
|
char info_text[80];
|
|
|
|
char num_text[10];
|
|
|
|
int choice;
|
|
|
|
|
|
|
|
try_again:
|
|
|
|
sprintf(info_text,"%s %d",TXT_START_ANY_LEVEL, player_highest_level);
|
|
|
|
|
|
|
|
m[0].type=NM_TYPE_TEXT; m[0].text = info_text;
|
|
|
|
m[1].type=NM_TYPE_INPUT; m[1].text_len = 10; m[1].text = num_text;
|
|
|
|
|
|
|
|
strcpy(num_text,"1");
|
|
|
|
|
|
|
|
choice = newmenu_do( NULL, TXT_SELECT_START_LEV, 2, m, NULL );
|
|
|
|
|
|
|
|
if (choice==-1 || m[1].text[0]==0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
new_level_num = atoi(m[1].text);
|
|
|
|
|
|
|
|
if (!(new_level_num>0 && new_level_num<=player_highest_level)) {
|
|
|
|
m[0].text = TXT_ENTER_TO_CONT;
|
|
|
|
nm_messagebox( NULL, 1, TXT_OK, TXT_INVALID_LEVEL);
|
|
|
|
goto try_again;
|
|
|
|
}
|
|
|
|
}
|
2007-09-28 22:44:04 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
Difficulty_level = Player_default_difficulty;
|
|
|
|
|
|
|
|
if (!do_difficulty_menu())
|
|
|
|
return;
|
|
|
|
|
|
|
|
gr_palette_fade_out( gr_palette, 32, 0 );
|
|
|
|
|
|
|
|
#ifdef PSX_BUILD_TOOLS
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i=Last_secret_level; i<=Last_level; i++ ) {
|
|
|
|
if ( i!=0 )
|
|
|
|
StartNewGame(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
StartNewGame(new_level_num);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void do_load_game_menu()
|
|
|
|
{
|
|
|
|
newmenu_item m[N_SAVE_SLOTS];
|
|
|
|
char *saved_text[N_SAVE_SLOTS];
|
|
|
|
int i,choice;
|
|
|
|
|
|
|
|
get_game_list(saved_text);
|
|
|
|
|
|
|
|
for (i=0;i<N_SAVE_SLOTS;i++) {
|
|
|
|
|
|
|
|
if (saved_text[i][0]) {
|
|
|
|
m[i].type = NM_TYPE_MENU;
|
|
|
|
m[i].text = saved_text[i];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
m[i].type = NM_TYPE_TEXT;
|
|
|
|
m[i].text = TXT_EMPTY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
choice = newmenu_do( NULL, TXT_LOAD_GAME, N_SAVE_SLOTS, m, NULL );
|
|
|
|
|
|
|
|
if (choice != -1) {
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if ((ret=load_player_game(choice)) == EZERO)
|
|
|
|
ResumeSavedGame(Players[Player_num].level);
|
|
|
|
else {
|
|
|
|
newmenu_item m1[3];
|
|
|
|
|
|
|
|
m1[0].type = NM_TYPE_TEXT; m1[0].text = strerror(ret);
|
|
|
|
m1[1].type = NM_TYPE_TEXT; m1[1].text = "";
|
|
|
|
m1[2].type = NM_TYPE_TEXT; m1[2].text = TXT_ENTER_TO_CONT;
|
|
|
|
|
|
|
|
newmenu_do( NULL, TXT_ERR_LOADING_GAME, 3, m1, NULL );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void do_save_game_menu()
|
|
|
|
{
|
|
|
|
newmenu_item m[N_SAVE_SLOTS];
|
|
|
|
char *saved_text_ptrs[N_SAVE_SLOTS];
|
|
|
|
char menu_text[N_SAVE_SLOTS][GAME_NAME_LEN+1]; //+1 for terminating zero
|
|
|
|
int i,choice;
|
|
|
|
|
|
|
|
get_game_list(saved_text_ptrs);
|
|
|
|
|
|
|
|
for (i=0;i<N_SAVE_SLOTS;i++) {
|
|
|
|
|
|
|
|
strcpy(menu_text[i],saved_text_ptrs[i]);
|
|
|
|
|
|
|
|
m[i].type = NM_TYPE_INPUT_MENU;
|
|
|
|
m[i].text_len = GAME_NAME_LEN;
|
|
|
|
m[i].text = menu_text[i];
|
|
|
|
|
|
|
|
if (!menu_text[i][0])
|
|
|
|
strcpy(menu_text[i],TXT_EMPTY);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
choice = newmenu_do( NULL, TXT_SAVE_GAME_SLOTS, N_SAVE_SLOTS, m, NULL );
|
|
|
|
|
|
|
|
if (choice != -1) {
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if ((ret=save_player_game(choice,m[choice].text)) != EZERO)
|
|
|
|
nm_messagebox( NULL,1, TXT_CONTINUE,"%s\n%s\n\n", TXT_SAVE_ERROR, strerror(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
extern void GameLoop(int, int );
|
|
|
|
|
|
|
|
//added on 9/20/98 by Victor Rachels to attempt to add screen res change ingame
|
|
|
|
//Changed on 3/24/99 by Owen Evans to make it work =)
|
|
|
|
void change_res_poll()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void change_res()
|
|
|
|
{
|
2006-08-30 18:11:16 +00:00
|
|
|
newmenu_item m[12];
|
2006-03-20 16:43:15 +00:00
|
|
|
u_int32_t modes[12];
|
|
|
|
int i = 0, mc = 0, num_presets = 0;
|
|
|
|
char customres[16];
|
|
|
|
int fullscreenc;
|
|
|
|
u_int32_t screen_mode = 0;
|
|
|
|
int screen_width = 0;
|
|
|
|
int screen_height = 0;
|
2006-10-14 14:28:36 +00:00
|
|
|
SDL_Rect **sdlmode = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x200"; m[mc].value = (Game_screen_mode == SM(320,200)); m[mc].group = 0; modes[mc] = SM(320,200); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "640x480"; m[mc].value = (Game_screen_mode == SM(640,480)); m[mc].group = 0; modes[mc] = SM(640,480); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "320x400"; m[mc].value = (Game_screen_mode == SM(320,400)); m[mc].group = 0; modes[mc] = SM(320,400); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "640x400"; m[mc].value = (Game_screen_mode == SM(640,400)); m[mc].group = 0; modes[mc] = SM(640,400); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "800x600"; m[mc].value = (Game_screen_mode == SM(800,600)); m[mc].group = 0; modes[mc] = SM(800,600); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "1024x768"; m[mc].value = (Game_screen_mode == SM(1024,768)); m[mc].group = 0; modes[mc] = SM(1024,768); mc++;
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "1280x1024"; m[mc].value = (Game_screen_mode == SM(1280,1024)); m[mc].group = 0; modes[mc] = SM(1280,1024); mc++;
|
2006-08-30 18:11:16 +00:00
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "1600x1200"; m[mc].value = (Game_screen_mode == SM(1600,1200)); m[mc].group = 0; modes[mc] = SM(1600,1200); mc++;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
num_presets = mc;
|
2006-08-30 18:11:16 +00:00
|
|
|
m[mc].value=0; // make sure we count and reach the right selection
|
2006-03-20 16:43:15 +00:00
|
|
|
for (i = 0; i < mc; i++)
|
|
|
|
if (m[mc].value)
|
|
|
|
break;
|
|
|
|
|
|
|
|
m[mc].type = NM_TYPE_RADIO; m[mc].text = "custom:"; m[mc].value = (i == mc); m[mc].group = 0; modes[mc] = 0; mc++;
|
|
|
|
sprintf(customres, "%ix%i", SM_W(Game_screen_mode), SM_H(Game_screen_mode));
|
|
|
|
m[mc].type = NM_TYPE_INPUT; m[mc].text = customres; m[mc].text_len = 11; modes[mc] = 0; mc++;
|
|
|
|
fullscreenc = mc; m[mc].type = NM_TYPE_CHECK; m[mc].text = "Fullscreen"; m[mc].value = gr_check_fullscreen(); mc++;
|
|
|
|
|
|
|
|
i = newmenu_do1(NULL, "Screen Resolution", mc, m, &change_res_poll, 0);
|
|
|
|
|
|
|
|
if (m[fullscreenc].value != gr_check_fullscreen())
|
|
|
|
{
|
|
|
|
gr_toggle_fullscreen();
|
|
|
|
Game_screen_mode = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; (m[i].value == 0) && (i < num_presets); i++);
|
|
|
|
|
|
|
|
if (modes[i]==0)
|
|
|
|
{
|
|
|
|
char *h = strchr(customres, 'x');
|
|
|
|
if (!h)
|
|
|
|
return;
|
|
|
|
screen_mode = SM(atoi(customres), atoi(h+1));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
screen_mode = modes[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
screen_width = SM_W(screen_mode);
|
|
|
|
screen_height = SM_H(screen_mode);
|
2006-10-14 14:28:36 +00:00
|
|
|
|
2007-08-08 18:06:33 +00:00
|
|
|
if (Game_screen_mode == screen_mode)
|
|
|
|
return;
|
|
|
|
|
2006-10-14 14:28:36 +00:00
|
|
|
if (screen_width > sdlmode[0]->w || screen_height > sdlmode[0]->h) {
|
2007-03-26 08:20:46 +00:00
|
|
|
if (!nm_messagebox( TXT_WARNING, 2, "NO", "YES", "Could not verify selected\nscreen resolution.\nThe game may crash.\nDo you really want to proceed?" ))
|
|
|
|
return;
|
2006-10-14 14:28:36 +00:00
|
|
|
}
|
|
|
|
|
2007-08-08 18:06:33 +00:00
|
|
|
if (screen_width < 320 || screen_height < 200) {
|
|
|
|
nm_messagebox( TXT_WARNING, 1, "OK", "Entered resolution is too small.\nReverting ..." );
|
2007-07-26 23:56:00 +00:00
|
|
|
return;
|
2007-08-08 18:06:33 +00:00
|
|
|
}
|
2007-07-26 23:56:00 +00:00
|
|
|
|
|
|
|
newmenu_close();
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
Game_screen_mode = screen_mode;
|
2007-07-26 23:56:00 +00:00
|
|
|
set_screen_mode(SCREEN_MENU);
|
2007-04-05 13:23:44 +00:00
|
|
|
game_init_render_buffers(screen_width, screen_height, VR_NONE);
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
void sound_menuset(int nitems, newmenu_item * items, int *last_key, int citem )
|
|
|
|
{
|
|
|
|
nitems=nitems;
|
|
|
|
*last_key = *last_key;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
if ( Config_digi_volume != items[0].value ) {
|
|
|
|
Config_digi_volume = items[0].value;
|
|
|
|
digi_set_digi_volume( (Config_digi_volume*32768)/8 );
|
|
|
|
digi_play_sample_once( SOUND_DROP_BOMB, F1_0 );
|
|
|
|
}
|
|
|
|
if (Config_midi_volume != items[1].value ) {
|
|
|
|
Config_midi_volume = items[1].value;
|
|
|
|
digi_set_midi_volume( (Config_midi_volume*128)/8 );
|
|
|
|
}
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
citem++; //kill warning
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
void do_sound_menu()
|
2006-03-20 16:43:15 +00:00
|
|
|
{
|
2006-10-08 17:53:50 +00:00
|
|
|
newmenu_item m[4];
|
|
|
|
int i = 0;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
do {
|
|
|
|
m[0].type = NM_TYPE_SLIDER; m[0].text=TXT_FX_VOLUME; m[0].value=Config_digi_volume; m[0].min_value=0; m[0].max_value=8;
|
|
|
|
m[1].type =NM_TYPE_SLIDER; m[1].text=TXT_MUSIC_VOLUME; m[1].value=Config_midi_volume; m[1].min_value=0; m[1].max_value=8;
|
|
|
|
m[2].type = NM_TYPE_TEXT; m[2].text="";
|
|
|
|
m[3].type = NM_TYPE_CHECK; m[3].text=TXT_REVERSE_STEREO; m[3].value=Config_channels_reversed;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
i = newmenu_do1( NULL, "Sound Effects & Music", sizeof(m)/sizeof(*m), m, sound_menuset, i );
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
Config_channels_reversed = m[3].value;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
} while( i>-1 );
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
void options_menuset(int nitems, newmenu_item * items, int *last_key, int citem )
|
2006-03-20 16:43:15 +00:00
|
|
|
{
|
2006-10-08 17:53:50 +00:00
|
|
|
nitems=nitems;
|
2006-03-20 16:43:15 +00:00
|
|
|
*last_key = *last_key;
|
|
|
|
|
|
|
|
if ( citem==4) {
|
|
|
|
gr_palette_set_gamma(items[4].value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void do_options_menu()
|
|
|
|
{
|
2006-10-08 17:53:50 +00:00
|
|
|
newmenu_item m[11];
|
2006-03-20 16:43:15 +00:00
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
do {
|
2006-10-08 17:53:50 +00:00
|
|
|
m[ 0].type = NM_TYPE_MENU; m[ 0].text="Sound effects & music...";
|
|
|
|
m[ 1].type = NM_TYPE_TEXT; m[ 1].text="";
|
|
|
|
m[ 2].type = NM_TYPE_MENU; m[ 2].text=TXT_CONTROLS_;
|
|
|
|
m[ 3].type = NM_TYPE_TEXT; m[ 3].text="";
|
|
|
|
m[ 4].type = NM_TYPE_SLIDER;
|
|
|
|
m[ 4].text = TXT_BRIGHTNESS;
|
|
|
|
m[ 4].value = gr_palette_get_gamma();
|
|
|
|
m[ 4].min_value = 0;
|
|
|
|
m[ 4].max_value = 16;
|
|
|
|
|
|
|
|
m[ 5].type = NM_TYPE_MENU; m[ 5].text=TXT_DETAIL_LEVELS;
|
|
|
|
m[ 6].type = NM_TYPE_MENU; m[ 6].text="Screen resolution...";
|
|
|
|
|
|
|
|
m[ 7].type = NM_TYPE_TEXT; m[ 7].text="";
|
|
|
|
m[ 8].type = NM_TYPE_MENU; m[ 8].text="Primary autoselect ordering...";
|
|
|
|
m[ 9].type = NM_TYPE_MENU; m[ 9].text="Secondary autoselect ordering...";
|
|
|
|
m[10].type = NM_TYPE_CHECK; m[10].text="Ship auto-leveling";
|
|
|
|
m[10].value=Auto_leveling_on;
|
|
|
|
|
|
|
|
i = newmenu_do1( NULL, TXT_OPTIONS, sizeof(m)/sizeof(*m), m, options_menuset, i );
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2006-10-08 17:53:50 +00:00
|
|
|
switch(i) {
|
|
|
|
case 0: do_sound_menu(); break;
|
|
|
|
case 2: joydefs_config(); break;
|
|
|
|
case 5: do_detail_level_menu(); break;
|
|
|
|
case 6: change_res(); break;
|
|
|
|
case 8: reorder_primary(); break;
|
|
|
|
case 9: reorder_secondary(); break;
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
|
2006-09-29 21:42:06 +00:00
|
|
|
Auto_leveling_on = m[10].value;
|
2006-10-08 17:53:50 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
} while( i>-1 );
|
|
|
|
|
2006-04-21 13:55:30 +00:00
|
|
|
write_player_file();
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
2006-10-08 17:53:50 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
#ifdef NETWORK
|
|
|
|
void do_multi_player_menu()
|
|
|
|
{
|
2007-05-31 22:30:18 +00:00
|
|
|
int menu_choice[9];
|
|
|
|
newmenu_item m[9];
|
2006-03-20 16:43:15 +00:00
|
|
|
int choice = 0, num_options = 0;
|
|
|
|
int old_game_mode;
|
|
|
|
|
|
|
|
do {
|
|
|
|
old_game_mode = Game_mode;
|
|
|
|
num_options = 0;
|
|
|
|
|
2007-05-31 22:30:18 +00:00
|
|
|
#ifdef HAVE_NETIPX_IPX_H
|
|
|
|
ADD_ITEM("Start IPX Netgame", MENU_START_IPX_NETGAME, -1);
|
|
|
|
ADD_ITEM("Join IPX Netgame\n", MENU_JOIN_IPX_NETGAME, -1);
|
|
|
|
#endif //HAVE_NETIPX_IPX_H
|
|
|
|
ADD_ITEM("Start UDP/IP Netgame", MENU_START_UDP_NETGAME, -1);
|
|
|
|
ADD_ITEM("Join UDP/IP Netgame\n", MENU_JOIN_UDP_NETGAME, -1);
|
2006-03-20 16:43:15 +00:00
|
|
|
#ifdef __LINUX__
|
2007-05-31 22:30:18 +00:00
|
|
|
ADD_ITEM("Start Kali Netgame", MENU_START_KALI_NETGAME, -1);
|
|
|
|
ADD_ITEM("Join Kali Netgame", MENU_JOIN_KALI_NETGAME, -1);
|
|
|
|
#endif // __LINUX__
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
choice = newmenu_do1( NULL, TXT_MULTIPLAYER, num_options, m, NULL, choice );
|
|
|
|
|
2007-05-31 22:30:18 +00:00
|
|
|
if ( choice > -1 )
|
2006-03-20 16:43:15 +00:00
|
|
|
do_option(menu_choice[choice]);
|
|
|
|
|
|
|
|
if (old_game_mode != Game_mode)
|
2007-05-31 22:30:18 +00:00
|
|
|
break; // leave menu
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
} while( choice > -1 );
|
|
|
|
}
|
|
|
|
|
2007-12-17 22:45:45 +00:00
|
|
|
int ipx_udp_ConnectManual(char *addr);
|
2006-03-20 16:43:15 +00:00
|
|
|
void do_ip_manual_join_menu()
|
|
|
|
{
|
|
|
|
int menu_choice[3];
|
|
|
|
newmenu_item m[3];
|
2007-08-09 12:28:17 +00:00
|
|
|
int choice = 0, num_options = 0, j = 0;
|
2006-03-20 16:43:15 +00:00
|
|
|
int old_game_mode;
|
2007-08-09 12:28:17 +00:00
|
|
|
char buf[128]="";
|
|
|
|
|
|
|
|
if (GameArg.MplIpHostAddr) {
|
|
|
|
sprintf(buf,"%s",GameArg.MplIpHostAddr);
|
|
|
|
|
|
|
|
for (j=0; buf[j] != '\0'; j++) {
|
|
|
|
switch (buf[j]) {
|
|
|
|
case ' ':
|
|
|
|
buf[j] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
do {
|
|
|
|
old_game_mode = Game_mode;
|
|
|
|
num_options = 0;
|
|
|
|
|
2007-08-09 12:28:17 +00:00
|
|
|
m[num_options].type = NM_TYPE_INPUT; m[num_options].text=buf; m[num_options].text_len=128;menu_choice[num_options]=-1; num_options++;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
|
|
|
choice = newmenu_do1( NULL, "ENTER IP OR HOSTNAME", num_options, m, NULL, choice );
|
|
|
|
|
|
|
|
if ( choice > -1 ){
|
2007-12-17 22:45:45 +00:00
|
|
|
ipx_udp_ConnectManual(buf);
|
2006-03-20 16:43:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (old_game_mode != Game_mode)
|
|
|
|
break; // leave menu
|
|
|
|
} while( choice > -1 );
|
|
|
|
}
|
|
|
|
#endif
|