- the config finally get saved.

Still with a few errors, though.
This commit is contained in:
Christoph Oelckers 2019-10-26 20:47:37 +02:00
parent 731671c401
commit db1a9a9363
7 changed files with 38 additions and 19 deletions

View File

@ -69,6 +69,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "view.h"
#include "warp.h"
#include "weapon.h"
#include "gameconfigfile.h"
#ifdef _WIN32
# include <shellapi.h>
@ -187,8 +188,8 @@ void ShutDown(void)
{
if (!in3dmode())
return;
CONFIG_WriteSetup(0);
netDeinitialize();
G_SaveConfig();
netDeinitialize();
sndTerm();
sfxTerm();
scrUnInit();
@ -211,7 +212,7 @@ void ShutDown(void)
void QuitGame(void)
{
ShutDown();
exit(0);
Bexit(0);
}
void PrecacheDude(spritetype *pSprite)
@ -2584,7 +2585,7 @@ GameInterface Interface = {
startwin_idle,
startwin_run,
G_DefaultDefFile,
G_DefFile
G_DefFile,
};
END_BLD_NS

View File

@ -627,7 +627,6 @@ int main(int argc, char *argv[])
// Just let the rest of the function execute.
r = exit.Reason();
}
G_SaveConfig();
startwin_close();
@ -1572,6 +1571,16 @@ int32_t videoSetMode(int32_t x, int32_t y, int32_t c, int32_t fs)
{
int32_t regrab = 0, ret;
// SDL's fullscreen is a deadly trap in the debugger.
#ifdef _DEBUG
if (fs)
{
fs = false;
x -= 10;
y -= 10;
}
#endif
if (called++)
{
assert(0);

View File

@ -424,7 +424,7 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
//AutomapBindings.ArchiveBindings (this);
#else
strcpy(subsection, "Bindings");
if (SetSection(section))
if (SetSection(section, true))
{
for (int i = 0; i < MAXBOUNDKEYS + MAXMOUSEBUTTONS; i++)
{
@ -436,11 +436,11 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
}
strncpy(subsection, "ConsoleAliases", sublen);
if (SetSection(section))
if (SetSection(section, true))
{
for (auto& symb : osd->symbptrs)
{
if (symb == NULL)
if (symb == NULL || symb->name == nullptr ||symb->help == nullptr)
break;
SetValueForKey(symb->name, symb->help);

View File

@ -43,6 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cmdline.h"
#include "palette.h"
#include "gamecvars.h"
#include "gameconfigfile.h"
#include "vfs.h"
@ -5796,8 +5797,8 @@ static void G_Cleanup(void)
void G_Shutdown(void)
{
CONFIG_WriteSetup(0);
S_SoundShutdown();
G_SaveConfig();
S_SoundShutdown();
S_MusicShutdown();
CONTROL_Shutdown();
KB_Shutdown();
@ -7176,7 +7177,9 @@ GameInterface Interface = {
startwin_puts,
startwin_settitle,
startwin_idle,
startwin_run
startwin_run,
G_DefaultDefFile,
G_DefFile,
};
END_DUKE_NS

View File

@ -43,6 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cmdline.h"
#include "palette.h"
#include "gamecvars.h"
#include "gameconfigfile.h"
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
@ -7147,8 +7148,8 @@ static void G_Cleanup(void)
void G_Shutdown(void)
{
CONFIG_WriteSetup(0);
S_SoundShutdown();
G_SaveConfig();
S_SoundShutdown();
S_MusicShutdown();
CONTROL_Shutdown();
KB_Shutdown();
@ -8623,6 +8624,9 @@ GameInterface Interface = {
startwin_puts,
startwin_settitle,
startwin_idle,
startwin_run
startwin_run,
G_DefaultDefFile,
G_DefFile,
};
END_RR_NS

View File

@ -5936,7 +5936,9 @@ GameInterface Interface = {
startwin_puts,
startwin_settitle,
startwin_idle,
startwin_run
startwin_run,
G_DefFile,
G_DefFile,
};
// vim:ts=4:sw=4:expandtab:

View File

@ -9,10 +9,10 @@
"Alt_Fire"
"Jump", "A", "KPad-"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Look_Up", "PgUp"
"Look_Down", "PgDn"
"Look_Left", "Insert"
"Look_Right", "Delete"
"Strafe_Left", ",", "KPad7"
"Strafe_Right", ".", "KPad9"
"Aim_Up", "Home"