raze/source/exhumed/src/config.cpp

107 lines
2.5 KiB
C++
Raw Normal View History

//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 sirlemonhead, Nuke.YKT
This file is part of PCExhumed.
PCExhumed is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
2019-11-23 23:04:15 +00:00
#include "ns.h"
#include "compat.h"
#include "renderlayer.h"
#include "_control.h"
#include "build.h"
#include "cache1d.h"
#include "keyboard.h"
#include "control.h"
#include "exhumed.h"
#include "typedefs.h"
#include "view.h"
#include "config.h"
#include <string>
2019-11-13 20:06:48 +00:00
//#include <io.h>
#include <stdio.h>
#include <time.h>
BEGIN_PS_NS
ud_setup_t gSetup;
int lMouseSens = 32;
unsigned int dword_1B82E0 = 0;
int32_t FXVolume;
int32_t MusicVolume;
int32_t MidiPort;
int32_t NumBits;
int32_t ReverseStereo;
int32_t MusicDevice;
int32_t FXDevice;
int32_t ControllerType;
int32_t scripthandle;
int32_t setupread;
2019-08-27 06:08:18 +00:00
// TODO: implement precaching toggle
int32_t useprecache;
void CONFIG_SetDefaults()
{
scripthandle = -1;
# if defined RENDERTYPESDL && SDL_MAJOR_VERSION > 1
uint32_t inited = SDL_WasInit(SDL_INIT_VIDEO);
if (inited == 0)
SDL_Init(SDL_INIT_VIDEO);
else if (!(inited & SDL_INIT_VIDEO))
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_DisplayMode dm;
if (SDL_GetDesktopDisplayMode(0, &dm) == 0)
{
gSetup.xdim = dm.w;
gSetup.ydim = dm.h;
}
else
# endif
{
gSetup.xdim = 1024;
gSetup.ydim = 768;
}
// currently settings.cfg is only read after the startup window launches the game,
// and rereading binds might be fickle so just enable this
gSetup.forcesetup = 1;
gSetup.noautoload = 1;
gSetup.fullscreen = 1;
FXVolume = 255;
MusicVolume = 255;
NumBits = 16;
}
2019-11-24 09:03:19 +00:00
int CONFIG_ReadSetup(void)
{
2019-11-24 09:03:19 +00:00
CONFIG_SetDefaults();
if (ScreenBPP < 8) ScreenBPP = 32;
return 0;
}
void CONFIG_WriteSettings(void) // save binds and aliases to <cfgname>_settings.cfg
{
2019-11-24 09:03:19 +00:00
}
2019-11-24 09:03:19 +00:00
END_PS_NS