//------------------------------------------------------------------------- /* 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 aint32_t 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 "duke3d.h" #include "scriplib.h" #include "../../Engine/src/build.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_t FXDevice; int32_t MusicDevice; int32_t FXVolume; int32_t MusicVolume; int32_t SoundToggle; int32_t MusicToggle; int32_t VoiceToggle; int32_t AmbienceToggle; int32_t OpponentSoundToggle; // xduke to toggle opponent's sounds on/off in DM (duke 1.3d scheme) fx_blaster_config BlasterConfig; int32_t NumVoices; int32_t NumChannels; int32_t NumBits; int32_t MixRate; int32_t MidiPort; int32_t ReverseStereo; int32_t ControllerType; int32_t MouseAiming = 0; int32_t BFullScreen = 0; // // Screen variables // int32 ScreenMode=2; int32 ScreenWidth = LCD_WIDTH; int32 ScreenHeight = LCD_HEIGHT; // // Mouse variables // int32 mouseSensitivity_X; int32 mouseSensitivity_Y; static char setupfilename[512] = "/.rockbox/duke3d/duke3d.cfg"; static int32 scripthandle; static int32 setupread=0; /* =================== = = CONFIG_GetSetupFilename = =================== */ #define MAXSETUPFILES 20 void CONFIG_GetSetupFilename( void ) { int32 i; setupfilename[0] = '\0'; // Are we trying to load a mod? #if 0 if(getGameDir()[0] != '\0'){ FILE *fp = NULL; //Yes sprintf(setupfilename, "%s/%s", getGameDir(), SETUPFILENAME); // let's make sure it's actually there fp = fopen(setupfilename, "r"); if(fp) fclose(fp); else{ // It doesn't exist, so revert to the main one. printf("Config file: %s does not exist, using main config.\n", setupfilename); sprintf(setupfilename, "%s", SETUPFILENAME); } }else{ #endif //No sprintf(setupfilename, "%s/%s", getGameDir(), SETUPFILENAME); //} printf("Using Setup file: '%s'\n",setupfilename); // i=clock()+(3*CLOCKS_PER_SEC/4); // while (clock()63 || mouseSensitivity_X < 0) mouseSensitivity_X = 15; // FIX_00014: Added Y cursor setup for mouse sensitivity in the menus // Copy Sensitivity_X into Sensitivity_Y in case it is not set. mouseSensitivity_Y = mouseSensitivity_X; SCRIPT_GetNumber( scripthandle, "Controls","MouseSensitivity_Y_Rancid",&mouseSensitivity_Y); if(mouseSensitivity_Y>63 || mouseSensitivity_Y < 0) mouseSensitivity_Y = 15; } /* =================== = = CONFIG_SetupGamePad = =================== */ void CONFIG_SetupGamePad( int32 scripthandle ) { int32 i; char str[80]; char temp[80]; int32 function; for (i=0;i>1, i&1); SCRIPT_PutString(scripthandle, "Controls", (char *)tempbuf, (MouseDigitalAxeMapping[i>>1][i&1]!=-1)?CONFIG_FunctionNumToName(MouseDigitalAxeMapping[i>>1][i&1]):""); } for(i=0; i