123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089 |
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
- #include <stdio.h>
- #include <errno.h>
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- #ifdef _MSC_VER
- #include <io.h>
- #endif
- #include <fcntl.h>
- #include <sys/stat.h>
- #include "doomstat.h"
- #include "m_argv.h"
- #include "g_game.h"
- #include "m_menu.h"
- #include "am_map.h"
- #include "w_wad.h"
- #include "i_system.h"
- #include "i_sound.h"
- #include "i_video.h"
- #include "v_video.h"
- #include "hu_stuff.h"
- #include "st_stuff.h"
- #include "dstrings.h"
- #include "m_misc.h"
- #include "s_sound.h"
- #include "sounds.h"
- #include "i_joy.h"
- #include "lprintf.h"
- #include "d_main.h"
- #include "r_draw.h"
- #include "r_demo.h"
- #include "r_fps.h"
- static inline void I_BeginRead(void) {}
- static inline void I_EndRead(void) {}
- boolean M_WriteFile(char const *name, void *source, int length)
- {
- FILE *fp;
- errno = 0;
- if (!(fp = fopen(name, "wb")))
- return 0;
- I_BeginRead();
- length = fwrite(source, 1, length, fp) == (size_t)length;
- fclose(fp);
- I_EndRead();
- if (!length)
- remove(name);
- return length;
- }
- int M_ReadFile(char const *name, byte **buffer)
- {
- FILE *fp;
- if ((fp = fopen(name, "rb")))
- {
- size_t length;
- I_BeginRead();
- fseek(fp, 0, SEEK_END);
- length = ftell(fp);
- fseek(fp, 0, SEEK_SET);
- *buffer = Z_Malloc(length, PU_STATIC, 0);
- if (fread(*buffer, 1, length, fp) == length)
- {
- fclose(fp);
- I_EndRead();
- return length;
- }
- fclose(fp);
- }
-
- return -1;
- }
- int usemouse;
- boolean precache = true;
- extern int mousebfire;
- extern int mousebstrafe;
- extern int mousebforward;
- extern int displaywidth;
- extern int displayheight;
- extern int viewwidth;
- extern int viewheight;
- #ifdef GL_DOOM
- extern int gl_nearclip;
- extern int gl_colorbuffer_bits;
- extern int gl_depthbuffer_bits;
- extern const char *gl_tex_filter_string;
- extern const char *gl_tex_format_string;
- extern int gl_drawskys;
- extern int gl_sortsprites;
- extern int gl_use_paletted_texture;
- extern int gl_use_shared_texture_palette;
- extern int gl_sprite_offset;
- #endif
- extern int realtic_clock_rate;
- extern int tran_filter_pct;
- extern int screenblocks;
- extern int showMessages;
- #ifndef DJGPP
- int mus_pause_opt;
- bool mus_on = true;
- #endif
- extern const char* chat_macros[];
- extern int endoom_mode;
- extern const char* S_music_files[];
- int map_point_coordinates;
- default_t defaults[] =
- {
- {"Misc settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"default_compatibility_level",{(int*)&default_compatibility_level,NULL},
- {-1,NULL},-1,MAX_COMPATIBILITY_LEVEL-1,
- def_int,ss_none,NULL,NULL},
- {"realtic_clock_rate",{&realtic_clock_rate,NULL},{100,NULL},0,UL,
- def_int,ss_none,NULL,NULL},
- {"max_player_corpse", {&bodyquesize,NULL}, {32,NULL},-1,UL,
- def_int,ss_none,NULL,NULL},
- {"flashing_hom",{&flashing_hom,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"demo_insurance",{&default_demo_insurance,NULL},{2,NULL},0,2,
- def_int,ss_none,NULL,NULL},
- {"endoom_mode", {&endoom_mode,NULL},{5,NULL},0,7,
- def_hex, ss_none,NULL,NULL},
- {"level_precache",{(int*)&precache,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"demo_smoothturns", {&demo_smoothturns,NULL}, {0,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"demo_smoothturnsfactor", {&demo_smoothturnsfactor,NULL}, {6,NULL},1,SMOOTH_PLAYING_MAXFACTOR,
- def_int,ss_stat,NULL,NULL},
- {"Files",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
-
- {"wadfile_1",{NULL,&wad_files[0]},{0,""},UL,UL,def_str,ss_none,NULL,NULL},
- {"wadfile_2",{NULL,&wad_files[1]},{0,""},UL,UL,def_str,ss_none,NULL,NULL},
- {"dehfile_1",{NULL,&deh_files[0]},{0,""},UL,UL,def_str,ss_none,NULL,NULL},
- {"dehfile_2",{NULL,&deh_files[1]},{0,""},UL,UL,def_str,ss_none,NULL,NULL},
- {"Game settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"default_skill",{&defaultskill,NULL},{3,NULL},1,5,
- def_int,ss_none,NULL,NULL},
- {"weapon_recoil",{&default_weapon_recoil,NULL},{0,NULL},0,1,
- def_bool,ss_weap, &weapon_recoil,NULL},
-
- {"doom_weapon_toggles",{&doom_weapon_toggles,NULL}, {1,NULL}, 0, 1,
- def_bool, ss_weap,NULL,NULL},
- {"player_bobbing",{&default_player_bobbing,NULL},{1,NULL},0,1,
- def_bool,ss_weap, &player_bobbing,NULL},
- {"monsters_remember",{&default_monsters_remember,NULL},{1,NULL},0,1,
- def_bool,ss_enem, &monsters_remember,NULL},
-
- {"monster_infighting",{&default_monster_infighting,NULL}, {1,NULL}, 0, 1,
- def_bool, ss_enem, &monster_infighting,NULL},
- {"monster_backing",{&default_monster_backing,NULL}, {0,NULL}, 0, 1,
- def_bool, ss_enem, &monster_backing,NULL},
- {"monster_avoid_hazards",{&default_monster_avoid_hazards,NULL}, {1,NULL}, 0, 1,
- def_bool, ss_enem, &monster_avoid_hazards,NULL},
- {"monkeys",{&default_monkeys,NULL}, {0,NULL}, 0, 1,
- def_bool, ss_enem, &monkeys,NULL},
- {"monster_friction",{&default_monster_friction,NULL}, {1,NULL}, 0, 1,
- def_bool, ss_enem, &monster_friction,NULL},
- {"help_friends",{&default_help_friends,NULL}, {1,NULL}, 0, 1,
- def_bool, ss_enem, &help_friends,NULL},
- {"allow_pushers",{&default_allow_pushers,NULL},{1,NULL},0,1,
- def_bool,ss_weap, &allow_pushers,NULL},
- {"variable_friction",{&default_variable_friction,NULL},{1,NULL},0,1,
- def_bool,ss_weap, &variable_friction,NULL},
- #ifdef DOGS
- {"player_helpers",{&default_dogs}, {0}, 0, 3,
- def_bool, ss_enem },
- {"friend_distance",{&default_distfriend}, {128}, 0, 999,
- def_int, ss_enem, &distfriend},
- {"dog_jumping",{&default_dog_jumping}, {1}, 0, 1,
- def_bool, ss_enem, &dog_jumping},
- #endif
-
- {"sts_always_red",{&sts_always_red,NULL},{1,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"sts_pct_always_gray",{&sts_pct_always_gray,NULL},{0,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"sts_traditional_keys",{&sts_traditional_keys,NULL},{0,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"show_messages",{&showMessages,NULL},{1,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"autorun",{&autorun,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"Compatibility settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"comp_zombie",{&default_comp[comp_zombie],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_zombie],NULL},
- {"comp_infcheat",{&default_comp[comp_infcheat],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_infcheat],NULL},
- {"comp_stairs",{&default_comp[comp_stairs],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_stairs],NULL},
- {"comp_telefrag",{&default_comp[comp_telefrag],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_telefrag],NULL},
- {"comp_dropoff",{&default_comp[comp_dropoff],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_dropoff],NULL},
- {"comp_falloff",{&default_comp[comp_falloff],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_falloff],NULL},
- {"comp_staylift",{&default_comp[comp_staylift],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_staylift],NULL},
- {"comp_doorstuck",{&default_comp[comp_doorstuck],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_doorstuck],NULL},
- {"comp_pursuit",{&default_comp[comp_pursuit],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_pursuit],NULL},
- {"comp_vile",{&default_comp[comp_vile],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_vile],NULL},
- {"comp_pain",{&default_comp[comp_pain],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_pain],NULL},
- {"comp_skull",{&default_comp[comp_skull],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_skull],NULL},
- {"comp_blazing",{&default_comp[comp_blazing],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_blazing],NULL},
- {"comp_doorlight",{&default_comp[comp_doorlight],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_doorlight],NULL},
- {"comp_god",{&default_comp[comp_god],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_god],NULL},
- {"comp_skymap",{&default_comp[comp_skymap],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_skymap],NULL},
- {"comp_floors",{&default_comp[comp_floors],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_floors],NULL},
- {"comp_model",{&default_comp[comp_model],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_model],NULL},
- {"comp_zerotags",{&default_comp[comp_zerotags],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_zerotags],NULL},
- {"comp_moveblock",{&default_comp[comp_moveblock],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_moveblock],NULL},
- {"comp_sound",{&default_comp[comp_sound],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_sound],NULL},
- {"comp_666",{&default_comp[comp_666],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_666],NULL},
- {"comp_soul",{&default_comp[comp_soul],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_soul],NULL},
- {"comp_maskedanim",{&default_comp[comp_maskedanim],NULL},{0,NULL},0,1,def_bool,ss_comp,&comp[comp_maskedanim],NULL},
- {"Sound settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"sound_card",{&snd_card,NULL},{-1,NULL},-1,7,
- def_int,ss_none,NULL,NULL},
- {"music_card",{&mus_card,NULL},{-1,NULL},-1,9,
- def_int,ss_none,NULL,NULL},
- {"pitched_sounds",{&pitched_sounds,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"samplerate",{&snd_samplerate,NULL},{22050,NULL},11025,48000, def_int,ss_none,NULL,NULL},
- {"sfx_volume",{&snd_SfxVolume,NULL},{8,NULL},0,15, def_int,ss_none,NULL,NULL},
- {"music_volume",{&snd_MusicVolume,NULL},{8,NULL},0,15, def_int,ss_none,NULL,NULL},
- {"mus_pause_opt",{&mus_pause_opt,NULL},{2,NULL},0,2,
- def_int, ss_none,NULL,NULL},
- {"snd_channels",{&default_numChannels,NULL},{8,NULL},1,32,
- def_int,ss_none,NULL,NULL},
- {"Video settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- #ifdef GL_DOOM
- #ifdef _MSC_VER
- {"videomode",{NULL, &default_videomode},{0,"gl"},UL,UL,def_str,ss_none},
- #else
- {"videomode",{NULL, &default_videomode},{0,"8"},UL,UL,def_str,ss_none,NULL,NULL},
- #endif
- #else
- {"videomode",{NULL, &default_videomode},{0,"8"},UL,UL,def_str,ss_none},
- #endif
-
- {"screen_width",{&desired_screenwidth,NULL},{640,NULL}, 320, MAX_SCREENWIDTH,
- def_int,ss_none,NULL,NULL},
- {"screen_height",{&desired_screenheight,NULL},{480,NULL},200,MAX_SCREENHEIGHT,
- def_int,ss_none,NULL,NULL},
- {"use_fullscreen",{&use_fullscreen,NULL},{1,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- #ifndef DISABLE_DOUBLEBUFFER
- {"use_doublebuffer",{&use_doublebuffer},{1},0,1,
- def_bool,ss_none},
- #endif
- #ifdef IPHONE
- {"translucency",{&default_translucency,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- #else
- {"translucency",{&default_translucency},{1},0,1,
- def_bool,ss_none},
- #endif
- {"tran_filter_pct",{&tran_filter_pct,NULL},{66,NULL},0,100,
- def_int,ss_none,NULL,NULL},
- {"screenblocks",{&screenblocks,NULL},{10,NULL},3,11,
- def_int,ss_none,NULL,NULL},
- {"usegamma",{&usegamma,NULL},{3,NULL},0,4,
- def_int,ss_none,NULL,NULL},
- {"uncapped_framerate", {&movement_smooth,NULL}, {0,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"filter_wall",{(int*)&drawvars.filterwall,NULL},{RDRAW_FILTER_POINT,NULL},
- RDRAW_FILTER_POINT, RDRAW_FILTER_ROUNDED, def_int,ss_none,NULL,NULL},
- {"filter_floor",{(int*)&drawvars.filterfloor,NULL},{RDRAW_FILTER_POINT,NULL},
- RDRAW_FILTER_POINT, RDRAW_FILTER_ROUNDED, def_int,ss_none,NULL,NULL},
- {"filter_sprite",{(int*)&drawvars.filtersprite,NULL},{RDRAW_FILTER_POINT,NULL},
- RDRAW_FILTER_POINT, RDRAW_FILTER_ROUNDED, def_int,ss_none,NULL,NULL},
- {"filter_z",{(int*)&drawvars.filterz,NULL},{RDRAW_FILTER_POINT,NULL},
- RDRAW_FILTER_POINT, RDRAW_FILTER_LINEAR, def_int,ss_none,NULL,NULL},
- {"filter_patch",{(int*)&drawvars.filterpatch,NULL},{RDRAW_FILTER_POINT,NULL},
- RDRAW_FILTER_POINT, RDRAW_FILTER_ROUNDED, def_int,ss_none,NULL,NULL},
- {"filter_threshold",{(int*)&drawvars.mag_threshold,NULL},{49152,NULL},
- 0, UL, def_int,ss_none,NULL,NULL},
- {"sprite_edges",{(int*)&drawvars.sprite_edges,NULL},{RDRAW_MASKEDCOLUMNEDGE_SQUARE,NULL},
- RDRAW_MASKEDCOLUMNEDGE_SQUARE, RDRAW_MASKEDCOLUMNEDGE_SLOPED, def_int,ss_none,NULL,NULL},
- {"patch_edges",{(int*)&drawvars.patch_edges,NULL},{RDRAW_MASKEDCOLUMNEDGE_SQUARE,NULL},
- RDRAW_MASKEDCOLUMNEDGE_SQUARE, RDRAW_MASKEDCOLUMNEDGE_SLOPED, def_int,ss_none,NULL,NULL},
- #ifdef GL_DOOM
- {"OpenGL settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"gl_nearclip",{&gl_nearclip,NULL},{5,NULL},0,UL,
- def_int,ss_none,NULL,NULL},
- {"gl_colorbuffer_bits",{&gl_colorbuffer_bits,NULL},{16,NULL},16,32,
- def_int,ss_none,NULL,NULL},
- {"gl_depthbuffer_bits",{&gl_depthbuffer_bits,NULL},{16,NULL},16,32,
- def_int,ss_none,NULL,NULL},
- {"gl_tex_filter_string", {NULL,&gl_tex_filter_string}, {0,"GL_LINEAR"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"gl_tex_format_string", {NULL,&gl_tex_format_string}, {0,"GL_RGB5_A1"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"gl_drawskys",{&gl_drawskys,NULL},{1,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"gl_sortsprites",{&gl_sortsprites,NULL},{1,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"gl_use_paletted_texture",{&gl_use_paletted_texture,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"gl_use_shared_texture_palette",{&gl_use_shared_texture_palette,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- #ifdef GL_DOOM
- {"gl_sprite_offset",{&gl_sprite_offset,NULL},{0,NULL}, 0, 5,
- def_int,ss_none,NULL,NULL},
- #endif
- #endif
- {"Mouse settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"use_mouse",{&usemouse,NULL},{1,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
-
- {"mouse_sensitivity_horiz",{&mouseSensitivity_horiz,NULL},{10,NULL},0,UL,
- def_int,ss_none,NULL,NULL},
-
- {"mouse_sensitivity_vert",{&mouseSensitivity_vert,NULL},{10,NULL},0,UL,
- def_int,ss_none,NULL,NULL},
-
- {"mouseb_fire",{&mousebfire,NULL},{0,NULL},-1,MAX_MOUSEB,
- def_int,ss_keys,NULL,NULL},
- {"mouseb_strafe",{&mousebstrafe,NULL},{1,NULL},-1,MAX_MOUSEB,
- def_int,ss_keys,NULL,NULL},
- {"mouseb_forward",{&mousebforward,NULL},{2,NULL},-1,MAX_MOUSEB,
- def_int,ss_keys,NULL,NULL},
-
- {"Key bindings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"key_right", {&key_right,NULL}, {KEYD_RIGHTARROW,NULL},
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_left", {&key_left,NULL}, {KEYD_LEFTARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_up", {&key_up,NULL}, {KEYD_UPARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_down", {&key_down,NULL}, {KEYD_DOWNARROW,NULL},
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_right", {&key_menu_right,NULL}, {KEYD_RIGHTARROW,NULL},
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_left", {&key_menu_left,NULL}, {KEYD_LEFTARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_up", {&key_menu_up,NULL}, {KEYD_UPARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_down", {&key_menu_down,NULL}, {KEYD_DOWNARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_backspace",{&key_menu_backspace,NULL}, {KEYD_BACKSPACE,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_escape", {&key_menu_escape,NULL}, {KEYD_ESCAPE,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_menu_enter", {&key_menu_enter,NULL}, {KEYD_ENTER,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_strafeleft", {&key_strafeleft,NULL}, {',',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_straferight", {&key_straferight,NULL}, {'.',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_fire", {&key_fire,NULL}, {KEYD_RCTRL,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_use", {&key_use,NULL}, {' ',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_strafe", {&key_strafe,NULL}, {KEYD_RALT,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_speed", {&key_speed,NULL}, {KEYD_RSHIFT,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_savegame", {&key_savegame,NULL}, {KEYD_F2,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_loadgame", {&key_loadgame,NULL}, {KEYD_F3,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_soundvolume", {&key_soundvolume,NULL}, {KEYD_F4,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_hud", {&key_hud,NULL}, {KEYD_F5,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_quicksave", {&key_quicksave,NULL}, {KEYD_F6,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_endgame", {&key_endgame,NULL}, {KEYD_F7,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_messages", {&key_messages,NULL}, {KEYD_F8,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_quickload", {&key_quickload,NULL}, {KEYD_F9,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_quit", {&key_quit,NULL}, {KEYD_F10,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_gamma", {&key_gamma,NULL}, {KEYD_F11,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_spy", {&key_spy,NULL}, {KEYD_F12,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_pause", {&key_pause,NULL}, {KEYD_PAUSE,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_autorun", {&key_autorun,NULL}, {KEYD_CAPSLOCK,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_chat", {&key_chat,NULL}, {'t',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_backspace", {&key_backspace,NULL}, {KEYD_BACKSPACE,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_enter", {&key_enter,NULL}, {KEYD_ENTER,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map", {&key_map,NULL}, {KEYD_TAB,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_right", {&key_map_right,NULL}, {KEYD_RIGHTARROW,NULL},
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_left", {&key_map_left,NULL}, {KEYD_LEFTARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_up", {&key_map_up,NULL}, {KEYD_UPARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_down", {&key_map_down,NULL}, {KEYD_DOWNARROW,NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_zoomin", {&key_map_zoomin,NULL}, {'=',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_zoomout", {&key_map_zoomout,NULL}, {'-',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_gobig", {&key_map_gobig,NULL}, {'0',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_follow", {&key_map_follow,NULL}, {'f',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_mark", {&key_map_mark,NULL}, {'m',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_clear", {&key_map_clear,NULL}, {'c',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_grid", {&key_map_grid,NULL}, {'g',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_rotate", {&key_map_rotate,NULL}, {'r',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_map_overlay", {&key_map_overlay,NULL}, {'o',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_reverse", {&key_reverse,NULL}, {'/',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_zoomin", {&key_zoomin,NULL}, {'=',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_zoomout", {&key_zoomout,NULL}, {'-',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_chatplayer1", {&destination_keys[0],NULL}, {'g',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
-
- {"key_chatplayer2", {&destination_keys[1],NULL}, {'i',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_chatplayer3", {&destination_keys[2],NULL}, {'b',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_chatplayer4", {&destination_keys[3],NULL}, {'r',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapontoggle",{&key_weapontoggle,NULL}, {'0',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon1", {&key_weapon1,NULL}, {'1',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon2", {&key_weapon2,NULL}, {'2',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon3", {&key_weapon3,NULL}, {'3',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon4", {&key_weapon4,NULL}, {'4',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon5", {&key_weapon5,NULL}, {'5',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon6", {&key_weapon6,NULL}, {'6',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon7", {&key_weapon7,NULL}, {'7',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon8", {&key_weapon8,NULL}, {'8',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"key_weapon9", {&key_weapon9,NULL}, {'9',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
-
- {"key_screenshot", {&key_screenshot,NULL}, {'*',NULL} ,
- 0,MAX_KEY,def_key,ss_keys,NULL,NULL},
- {"Joystick settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"use_joystick",{&usejoystick,NULL},{0,NULL},0,2,
- def_int,ss_none,NULL,NULL},
- {"joy_left",{&joyleft,NULL},{0,NULL}, UL,UL,def_int,ss_none,NULL,NULL},
- {"joy_right",{&joyright,NULL},{0,NULL},UL,UL,def_int,ss_none,NULL,NULL},
- {"joy_up", {&joyup,NULL}, {0,NULL}, UL,UL,def_int,ss_none,NULL,NULL},
- {"joy_down",{&joydown,NULL},{0,NULL}, UL,UL,def_int,ss_none,NULL,NULL},
- {"joyb_fire",{&joybfire,NULL},{0,NULL},0,UL,
- def_int,ss_keys,NULL,NULL},
- {"joyb_strafe",{&joybstrafe,NULL},{1,NULL},0,UL,
- def_int,ss_keys,NULL,NULL},
- {"joyb_speed",{&joybspeed,NULL},{2,NULL},0,UL,
- def_int,ss_keys,NULL,NULL},
- {"joyb_use",{&joybuse,NULL},{3,NULL},0,UL,
- def_int,ss_keys,NULL,NULL},
- {"Chat macros",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"chatmacro0", {0,&chat_macros[0]}, {0,HUSTR_CHATMACRO0},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro1", {0,&chat_macros[1]}, {0,HUSTR_CHATMACRO1},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro2", {0,&chat_macros[2]}, {0,HUSTR_CHATMACRO2},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro3", {0,&chat_macros[3]}, {0,HUSTR_CHATMACRO3},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro4", {0,&chat_macros[4]}, {0,HUSTR_CHATMACRO4},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro5", {0,&chat_macros[5]}, {0,HUSTR_CHATMACRO5},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro6", {0,&chat_macros[6]}, {0,HUSTR_CHATMACRO6},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro7", {0,&chat_macros[7]}, {0,HUSTR_CHATMACRO7},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro8", {0,&chat_macros[8]}, {0,HUSTR_CHATMACRO8},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"chatmacro9", {0,&chat_macros[9]}, {0,HUSTR_CHATMACRO9},UL,UL,
- def_str,ss_chat,NULL,NULL},
- {"Automap settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
-
-
- {"mapcolor_back", {&mapcolor_back,NULL}, {247,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_grid", {&mapcolor_grid,NULL}, {104,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_wall", {&mapcolor_wall,NULL}, {23,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_fchg", {&mapcolor_fchg,NULL}, {55,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_cchg", {&mapcolor_cchg,NULL}, {215,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_clsd", {&mapcolor_clsd,NULL}, {208,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_rkey", {&mapcolor_rkey,NULL}, {175,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_bkey", {&mapcolor_bkey,NULL}, {204,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_ykey", {&mapcolor_ykey,NULL}, {231,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_rdor", {&mapcolor_rdor,NULL}, {175,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_bdor", {&mapcolor_bdor,NULL}, {204,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_ydor", {&mapcolor_ydor,NULL}, {231,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_tele", {&mapcolor_tele,NULL}, {119,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_secr", {&mapcolor_secr,NULL}, {252,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_exit", {&mapcolor_exit,NULL}, {0,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_unsn", {&mapcolor_unsn,NULL}, {104,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_flat", {&mapcolor_flat,NULL}, {88,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_sprt", {&mapcolor_sprt,NULL}, {112,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_item", {&mapcolor_item,NULL}, {231,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_hair", {&mapcolor_hair,NULL}, {208,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_sngl", {&mapcolor_sngl,NULL}, {208,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_me", {&mapcolor_me,NULL}, {112,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_enemy", {&mapcolor_enemy,NULL}, {177,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
- {"mapcolor_frnd", {&mapcolor_frnd,NULL}, {112,NULL},0,255,
- def_colour,ss_auto,NULL,NULL},
-
- {"map_secret_after", {&map_secret_after,NULL}, {0,NULL},0,1,
- def_bool,ss_auto,NULL,NULL},
- {"map_point_coord", {&map_point_coordinates,NULL}, {0,NULL},0,1,
- def_bool,ss_auto,NULL,NULL},
-
- {"automapmode", {(int*)&automapmode,NULL}, {0,NULL}, 0, 31,
- def_hex,ss_none,NULL,NULL},
- {"Heads-up display settings",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
-
- {"hudcolor_titl", {&hudcolor_titl,NULL}, {5,NULL},0,9,
- def_int,ss_auto,NULL,NULL},
- {"hudcolor_xyco", {&hudcolor_xyco,NULL}, {3,NULL},0,9,
- def_int,ss_auto,NULL,NULL},
- {"hudcolor_mesg", {&hudcolor_mesg,NULL}, {6,NULL},0,9,
- def_int,ss_mess,NULL,NULL},
- {"hudcolor_chat", {&hudcolor_chat,NULL}, {5,NULL},0,9,
- def_int,ss_mess,NULL,NULL},
- {"hudcolor_list", {&hudcolor_list,NULL}, {5,NULL},0,9,
- def_int,ss_mess,NULL,NULL},
- {"hud_msg_lines", {&hud_msg_lines,NULL}, {1,NULL},1,16,
- def_int,ss_mess,NULL,NULL},
- {"hud_list_bgon", {&hud_list_bgon,NULL}, {0,NULL},0,1,
- def_bool,ss_mess,NULL,NULL},
- {"hud_distributed",{&hud_distributed,NULL},{0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"health_red", {&health_red,NULL} , {25,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"health_yellow", {&health_yellow,NULL}, {50,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"health_green", {&health_green,NULL} , {100,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"armor_red", {&armor_red,NULL} , {25,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"armor_yellow", {&armor_yellow,NULL} , {50,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"armor_green", {&armor_green,NULL} , {100,NULL},0,200,
- def_int,ss_stat,NULL,NULL},
- {"ammo_red", {&ammo_red,NULL} , {25,NULL},0,100,
- def_int,ss_stat,NULL,NULL},
- {"ammo_yellow", {&ammo_yellow,NULL} , {50,NULL},0,100,
- def_int,ss_stat,NULL,NULL},
-
- {"hud_active", {&hud_active,NULL}, {2,NULL},0,2,
- def_int,ss_none,NULL,NULL},
-
- {"hud_displayed", {&hud_displayed,NULL}, {0,NULL},0,1,
- def_bool,ss_none,NULL,NULL},
- {"hud_nosecrets", {&hud_nosecrets,NULL}, {0,NULL},0,1,
- def_bool,ss_stat,NULL,NULL},
- {"Weapon preferences",{NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
-
- {"weapon_choice_1", {&weapon_preferences[0][0],NULL}, {6,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_2", {&weapon_preferences[0][1],NULL}, {9,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_3", {&weapon_preferences[0][2],NULL}, {4,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_4", {&weapon_preferences[0][3],NULL}, {3,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_5", {&weapon_preferences[0][4],NULL}, {2,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_6", {&weapon_preferences[0][5],NULL}, {8,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_7", {&weapon_preferences[0][6],NULL}, {5,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_8", {&weapon_preferences[0][7],NULL}, {7,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
- {"weapon_choice_9", {&weapon_preferences[0][8],NULL}, {1,NULL}, 0,9,
- def_int,ss_weap,NULL,NULL},
-
- {"Music", {NULL,NULL},{0,NULL},UL,UL,def_none,ss_none,NULL,NULL},
- {"mus_e1m1", {0,&S_music_files[mus_e1m1]}, {0,"e1m1.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m2", {0,&S_music_files[mus_e1m2]}, {0,"e1m2.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m3", {0,&S_music_files[mus_e1m3]}, {0,"e1m3.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m4", {0,&S_music_files[mus_e1m4]}, {0,"e1m4.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m5", {0,&S_music_files[mus_e1m5]}, {0,"e1m5.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m6", {0,&S_music_files[mus_e1m6]}, {0,"e1m6.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m7", {0,&S_music_files[mus_e1m7]}, {0,"e1m7.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m8", {0,&S_music_files[mus_e1m8]}, {0,"e1m8.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e1m9", {0,&S_music_files[mus_e1m9]}, {0,"e1m9.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m1", {0,&S_music_files[mus_e2m1]}, {0,"e2m1.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m2", {0,&S_music_files[mus_e2m2]}, {0,"e2m2.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m3", {0,&S_music_files[mus_e2m3]}, {0,"e2m3.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m4", {0,&S_music_files[mus_e2m4]}, {0,"e2m4.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m5", {0,&S_music_files[mus_e2m5]}, {0,"e1m7.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m6", {0,&S_music_files[mus_e2m6]}, {0,"e2m6.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m7", {0,&S_music_files[mus_e2m7]}, {0,"e2m7.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m8", {0,&S_music_files[mus_e2m8]}, {0,"e2m8.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e2m9", {0,&S_music_files[mus_e2m9]}, {0,"e3m1.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m1", {0,&S_music_files[mus_e3m1]}, {0,"e3m1.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m2", {0,&S_music_files[mus_e3m2]}, {0,"e3m2.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m3", {0,&S_music_files[mus_e3m3]}, {0,"e3m3.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m4", {0,&S_music_files[mus_e3m4]}, {0,"e1m8.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m5", {0,&S_music_files[mus_e3m5]}, {0,"e1m7.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m6", {0,&S_music_files[mus_e3m6]}, {0,"e1m6.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m7", {0,&S_music_files[mus_e3m7]}, {0,"e2m7.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m8", {0,&S_music_files[mus_e3m8]}, {0,"e3m8.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_e3m9", {0,&S_music_files[mus_e3m9]}, {0,"e1m9.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_inter", {0,&S_music_files[mus_inter]}, {0,"e2m3.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_intro", {0,&S_music_files[mus_intro]}, {0,"intro.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_bunny", {0,&S_music_files[mus_bunny]}, {0,"bunny.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_victor", {0,&S_music_files[mus_victor]}, {0,"victor.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_introa", {0,&S_music_files[mus_introa]}, {0,"intro.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_runnin", {0,&S_music_files[mus_runnin]}, {0,"runnin.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_stalks", {0,&S_music_files[mus_stalks]}, {0,"stalks.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_countd", {0,&S_music_files[mus_countd]}, {0,"countd.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_betwee", {0,&S_music_files[mus_betwee]}, {0,"betwee.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_doom", {0,&S_music_files[mus_doom]}, {0,"doom.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_the_da", {0,&S_music_files[mus_the_da]}, {0,"the_da.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_shawn", {0,&S_music_files[mus_shawn]}, {0,"shawn.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_ddtblu", {0,&S_music_files[mus_ddtblu]}, {0,"ddtblu.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_in_cit", {0,&S_music_files[mus_in_cit]}, {0,"in_cit.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_dead", {0,&S_music_files[mus_dead]}, {0,"dead.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_stlks2", {0,&S_music_files[mus_stlks2]}, {0,"stalks.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_theda2", {0,&S_music_files[mus_theda2]}, {0,"the_da.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_doom2", {0,&S_music_files[mus_doom2]}, {0,"doom.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_ddtbl2", {0,&S_music_files[mus_ddtbl2]}, {0,"ddtblu.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_runni2", {0,&S_music_files[mus_runni2]}, {0,"runnin.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_dead2", {0,&S_music_files[mus_dead2]}, {0,"dead.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_stlks3", {0,&S_music_files[mus_stlks3]}, {0,"stalks.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_romero", {0,&S_music_files[mus_romero]}, {0,"romero.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_shawn2", {0,&S_music_files[mus_shawn2]}, {0,"shawn.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_messag", {0,&S_music_files[mus_messag]}, {0,"messag.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_count2", {0,&S_music_files[mus_count2]}, {0,"countd.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_ddtbl3", {0,&S_music_files[mus_ddtbl3]}, {0,"ddtblu.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_ampie", {0,&S_music_files[mus_ampie]}, {0,"ampie.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_theda3", {0,&S_music_files[mus_theda3]}, {0,"the_da.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_adrian", {0,&S_music_files[mus_adrian]}, {0,"adrian.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_messg2", {0,&S_music_files[mus_messg2]}, {0,"messag.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_romer2", {0,&S_music_files[mus_romer2]}, {0,"romero.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_tense", {0,&S_music_files[mus_tense]}, {0,"tense.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_shawn3", {0,&S_music_files[mus_shawn3]}, {0,"shawn.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_openin", {0,&S_music_files[mus_openin]}, {0,"openin.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_evil", {0,&S_music_files[mus_evil]}, {0,"evil.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_ultima", {0,&S_music_files[mus_ultima]}, {0,"ultima.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_read_m", {0,&S_music_files[mus_read_m]}, {0,"read_m.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_dm2ttl", {0,&S_music_files[mus_dm2ttl]}, {0,"dm2ttl.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- {"mus_dm2int", {0,&S_music_files[mus_dm2int]}, {0,"dm2int.mp3"},UL,UL,
- def_str,ss_none,NULL,NULL},
- };
- int numdefaults;
- static const char* defaultfile;
- void M_SaveDefaults (void)
- {
- int i;
- FILE* f;
- f = fopen (defaultfile, "w");
- if (!f)
- return;
-
- fprintf(f,"# Doom config file\n");
- fprintf(f,"# Format:\n");
- fprintf(f,"# variable value\n");
- for (i = 0 ; i < numdefaults ; i++) {
- if (defaults[i].type == def_none) {
-
- fprintf(f, "\n# %s\n", defaults[i].name);
- } else
-
- if (!IS_STRING(defaults[i]))
- {
-
-
- if (defaults[i].type == def_hex)
- fprintf (f,"%-25s 0x%x\n",defaults[i].name,*(defaults[i].location.pi));
- else
- fprintf (f,"%-25s %5i\n",defaults[i].name,*(defaults[i].location.pi));
- }
- else
- {
- fprintf (f,"%-25s \"%s\"\n",defaults[i].name,*(defaults[i].location.ppsz));
- }
- }
- fclose (f);
- }
- struct default_s *M_LookupDefault(const char *name)
- {
- int i;
- for (i = 0 ; i < numdefaults - 1 ; i++)
- if ((defaults[i].type != def_none) && !strcmp(name, defaults[i].name))
- return &defaults[i];
- I_Error("M_LookupDefault: %s not found",name);
- return NULL;
- }
- #define NUMCHATSTRINGS 10
- void M_LoadDefaults (void)
- {
- int i;
- int len;
- FILE* f;
- char def[80];
- char strparm[100];
- char* newstring = NULL;
- int parm;
- boolean isstring;
-
- numdefaults = sizeof(defaults)/sizeof(defaults[0]);
- for (i = 0 ; i < numdefaults ; i++) {
- if (defaults[i].location.ppsz)
- *defaults[i].location.ppsz = strdup(defaults[i].defaultvalue.psz);
- if (defaults[i].location.pi)
- *defaults[i].location.pi = defaults[i].defaultvalue.i;
- }
-
- i = M_CheckParm ("-config");
- if (i && i < myargc-1)
- defaultfile = myargv[i+1];
- else {
- const char* exedir = I_DoomExeDir();
- defaultfile = malloc(PATH_MAX+1);
-
- #if ((defined GL_DOOM) && (defined _MSC_VER))
- #define PRBOOM_GL_OR_PR "gl"
- #else
- #define PRBOOM_GL_OR_PR "pr"
- #endif
- #ifdef HAVE_SNPRINTF
- snprintf((char *)defaultfile, PATH_MAX,
- "%s%s%sboom.cfg", exedir, HasTrailingSlash(exedir) ? "" : "/", PRBOOM_GL_OR_PR );
- #else
- sprintf ((char *)defaultfile,
- "%s%s%sboom.cfg", exedir, HasTrailingSlash(exedir) ? "" : "/", PRBOOM_GL_OR_PR );
- #endif
- }
- lprintf (LO_CONFIRM, " default file: %s\n",defaultfile);
-
- f = fopen (defaultfile, "r");
- if (f)
- {
- while (!feof(f))
- {
- isstring = false;
- if (fscanf (f, "%79s %[^\n]\n", def, strparm) == 2)
- {
-
- if (!isalnum(def[0]))
- continue;
- if (strparm[0] == '"') {
-
- isstring = true;
- len = strlen(strparm);
- newstring = (char *) malloc(len);
- strparm[len-1] = 0;
- strcpy(newstring, strparm+1);
- } else if ((strparm[0] == '0') && (strparm[1] == 'x')) {
-
- sscanf(strparm+2, "%x", &parm);
- } else {
- sscanf(strparm, "%i", &parm);
-
- }
- for (i = 0 ; i < numdefaults ; i++)
- if ((defaults[i].type != def_none) && !strcmp(def, defaults[i].name))
- {
-
- if (isstring != IS_STRING(defaults[i])) {
- lprintf(LO_WARN, "M_LoadDefaults: Type mismatch reading %s\n", defaults[i].name);
- continue;
- }
- if (!isstring)
- {
-
- if ((defaults[i].minvalue==UL || defaults[i].minvalue<=parm) &&
- (defaults[i].maxvalue==UL || defaults[i].maxvalue>=parm))
- *(defaults[i].location.pi) = parm;
- }
- else
- {
- free((char*)*(defaults[i].location.ppsz));
- *(defaults[i].location.ppsz) = newstring;
- }
- break;
- }
- }
- }
- fclose (f);
- }
-
- }
- void M_DoScreenShot (const char* fname)
- {
- if (I_ScreenShot(fname) != 0)
- doom_printf("M_ScreenShot: Error writing screenshot\n");
- }
- #ifndef SCREENSHOT_DIR
- #define SCREENSHOT_DIR "."
- #endif
- #ifdef HAVE_LIBPNG
- #define SCREENSHOT_EXT ".png"
- #else
- #define SCREENSHOT_EXT ".bmp"
- #endif
- void M_ScreenShot(void)
- {
- static int shot;
- char lbmname[PATH_MAX + 1];
- int startshot;
- if (!access(SCREENSHOT_DIR,2))
- {
- startshot = shot;
- do {
- sprintf(lbmname,"%s/doom%02d" SCREENSHOT_EXT, SCREENSHOT_DIR, shot++);
- } while (!access(lbmname,0) && (shot != startshot) && (shot < 10000));
- if (access(lbmname,0))
- {
- S_StartSound(NULL,gamemode==commercial ? sfx_radio : sfx_tink);
- M_DoScreenShot(lbmname);
- return;
- }
- }
- doom_printf ("M_ScreenShot: Couldn't create screenshot");
- return;
- }
|