//------------------------------------------------------------------------- /* Copyright (C) 1996, 2003 - 3D Realms Entertainment This file is part of Duke Nukem 3D version 1.5 - Atomic Edition Duke Nukem 3D is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Original Source: 1996 - Todd Replogle Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms */ //------------------------------------------------------------------------- #include #include #include #include #include #include #include #include "duke3d.h" #include "scriplib.h" #include "m_argv.h" #include "c_bind.h" // we load this in to get default button and key assignments // as well as setting up function mappings #include "_functio.h" // // Sound variables // int32 FXDevice; int32 MusicDevice; int32 FXVolume; int32 MusicVolume; int32 SoundToggle; int32 MusicToggle; int32 VoiceToggle; int32 AmbienceToggle; fx_blaster_config BlasterConfig; int32 NumVoices; int32 NumChannels; int32 NumBits; int32 MixRate; int32 MidiPort; int32 ReverseStereo; int32 ControllerType = controltype_keyboardandmouse; int32 MouseAiming; // // Screen variables // int32 ScreenMode; int32 ScreenWidth; int32 ScreenHeight; static char setupfilename[128]={SETUPFILENAME}; static int32 scripthandle; static int32 setupread=0; /* =================== = = CONFIG_GetSetupFilename = =================== */ #define MAXSETUPFILES 20 void CONFIG_GetSetupFilename( void ) { struct find_t fblock; char extension[10]; char * src; char * filenames[MAXSETUPFILES]; char * parm; int32 numfiles; int32 i; strcpy(setupfilename,SETUPFILENAME); // determine extension src = setupfilename + strlen(setupfilename) - 1; while (*src != '.') { src--; } strcpy (&extension[1],src); extension[0] = '*'; numfiles=0; if (_dos_findfirst(extension,0,&fblock)==0) { do { filenames[numfiles]=(char*)SafeMalloc(128); strcpy(filenames[numfiles],fblock.name); numfiles++; if (numfiles == MAXSETUPFILES) break; } while(!_dos_findnext(&fblock)); } parm = Args.CheckValue (SETUPNAMEPARM); if (parm!=0) { numfiles = 0; strcpy(setupfilename,parm); } if (numfiles>1) { int32 time; int32 oldtime; int32 count; Printf("\nMultiple Configuration Files Encountered\n"); Printf("========================================\n"); Printf("Please choose a configuration file from the following list by pressing its\n"); Printf("corresponding letter:\n"); for (i=0;i\n",'a'+(char)i,filenames[i]); } } Printf("\n"); Printf("(%s will be used if no selection is made within 10 seconds.)\n\n",SETUPFILENAME); //KB_FlushKeyboardQueue(); //KB_ClearKeysDown(); count = 9; oldtime = clock(); time=clock()+(10*CLOCKS_PER_SEC); while (clock()oldtime) { Printf("%ld seconds left. \r",count); fflush(stdout); oldtime = clock()+CLOCKS_PER_SEC; count--; } if (0/*KB_KeyWaiting()*/) { int32 ch = 0;//KB_Getch(); ch -='a'; if (ch>=0 && ch