2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
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
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
#include "ns.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "compat.h"
|
|
|
|
#include "renderlayer.h"
|
2019-08-31 09:08:38 +00:00
|
|
|
#include "_control.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "build.h"
|
|
|
|
#include "cache1d.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "control.h"
|
|
|
|
#include "exhumed.h"
|
|
|
|
#include "typedefs.h"
|
2019-11-26 15:37:47 +00:00
|
|
|
#include "view.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <string>
|
2019-11-13 20:06:48 +00:00
|
|
|
//#include <io.h>
|
2019-08-26 03:59:14 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2019-08-26 03:59:14 +00:00
|
|
|
int32_t useprecache;
|
|
|
|
|
|
|
|
void CONFIG_SetDefaults()
|
|
|
|
{
|
2019-08-31 09:08:38 +00:00
|
|
|
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;
|
|
|
|
|
2019-09-19 02:12:24 +00:00
|
|
|
FXVolume = 255;
|
|
|
|
MusicVolume = 255;
|
|
|
|
NumBits = 16;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2019-11-24 09:03:19 +00:00
|
|
|
int CONFIG_ReadSetup(void)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-11-24 09:03:19 +00:00
|
|
|
CONFIG_SetDefaults();
|
|
|
|
if (ScreenBPP < 8) ScreenBPP = 32;
|
|
|
|
return 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-31 09:08:38 +00:00
|
|
|
void CONFIG_WriteSettings(void) // save binds and aliases to <cfgname>_settings.cfg
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-11-24 09:03:19 +00:00
|
|
|
}
|
2019-08-31 09:08:38 +00:00
|
|
|
|
2019-11-24 09:03:19 +00:00
|
|
|
END_PS_NS
|