mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Incorporate some use of Bfflush(NULL) in hopes to alleviate Wii configuration saving concerns.
git-svn-id: https://svn.eduke32.com/eduke32@2725 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
59fa419506
commit
19d9d0a71e
5 changed files with 21 additions and 11 deletions
|
@ -486,6 +486,7 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
|
|||
# define Bstat stat
|
||||
# define Bfopen fopen
|
||||
# define Bfclose fclose
|
||||
# define Bfflush fflush
|
||||
# define Bfeof feof
|
||||
# define Bfgetc fgetc
|
||||
# define Brewind rewind
|
||||
|
|
|
@ -8852,6 +8852,8 @@ static int32_t osdcmd_quit(const osdfuncparm_t *parm)
|
|||
ExtUnInit();
|
||||
uninitengine();
|
||||
|
||||
Bfflush(NULL);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -784,7 +784,7 @@ int32_t CONFIG_ReadSetup(void)
|
|||
void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_settings.cfg
|
||||
{
|
||||
int32_t i;
|
||||
FILE *fp;
|
||||
BFILE *fp;
|
||||
char *ptr = Bstrdup(setupfilename);
|
||||
char tempbuf[128];
|
||||
|
||||
|
@ -792,36 +792,36 @@ void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_settings.cfg
|
|||
Bsprintf(tempbuf, "settings.cfg");
|
||||
else Bsprintf(tempbuf, "%s_settings.cfg", strtok(ptr, "."));
|
||||
|
||||
fp = fopen(tempbuf, "wt");
|
||||
fp = Bfopen(tempbuf, "wt");
|
||||
|
||||
if (fp)
|
||||
{
|
||||
symbol_t *symb;
|
||||
|
||||
fprintf(fp,"// this file automatically generated by EDuke32\n");
|
||||
fprintf(fp,"// these settings take precedence over your main cfg file\n");
|
||||
fprintf(fp,"// do not modify if you lack common sense\n");
|
||||
Bfprintf(fp,"// this file automatically generated by EDuke32\n");
|
||||
Bfprintf(fp,"// these settings take precedence over your main cfg file\n");
|
||||
Bfprintf(fp,"// do not modify if you lack common sense\n");
|
||||
|
||||
fprintf(fp,"unbindall\n");
|
||||
Bfprintf(fp,"unbindall\n");
|
||||
|
||||
for (i=0; i<MAXBOUNDKEYS; i++)
|
||||
if (KeyBindings[i].cmd[0] && KeyBindings[i].key)
|
||||
fprintf(fp,"bind \"%s\"%s \"%s\"\n",KeyBindings[i].key,KeyBindings[i].repeat?"":" norepeat",KeyBindings[i].cmd);
|
||||
Bfprintf(fp,"bind \"%s\"%s \"%s\"\n",KeyBindings[i].key,KeyBindings[i].repeat?"":" norepeat",KeyBindings[i].cmd);
|
||||
|
||||
for (i=0; i<MAXMOUSEBUTTONS; i++)
|
||||
if (MouseBindings[i].cmd[0])
|
||||
fprintf(fp,"bind \"%s\"%s \"%s\"\n",MouseBindings[i].key,MouseBindings[i].repeat?"":" norepeat",MouseBindings[i].cmd);
|
||||
Bfprintf(fp,"bind \"%s\"%s \"%s\"\n",MouseBindings[i].key,MouseBindings[i].repeat?"":" norepeat",MouseBindings[i].cmd);
|
||||
|
||||
for (symb=symbols; symb!=NULL; symb=symb->next)
|
||||
if (symb->func == (void *)OSD_ALIAS)
|
||||
fprintf(fp,"alias \"%s\" \"%s\"\n", symb->name, symb->help);
|
||||
Bfprintf(fp,"alias \"%s\" \"%s\"\n", symb->name, symb->help);
|
||||
|
||||
/* for (i = 0; i < sizeof(cvar)/sizeof(cvarmappings); i++)
|
||||
if (!(cvar[i].type&CVAR_NOSAVE))
|
||||
fprintf(fp,"%s \"%d\"\n",cvar[i].name,*(int32_t*)cvar[i].var);
|
||||
Bfprintf(fp,"%s \"%d\"\n",cvar[i].name,*(int32_t*)cvar[i].var);
|
||||
*/
|
||||
OSD_WriteCvars(fp);
|
||||
fclose(fp);
|
||||
Bfclose(fp);
|
||||
if (!Bstrcmp(setupfilename, SETUPFILENAME))
|
||||
OSD_Printf("Wrote settings.cfg\n");
|
||||
else OSD_Printf("Wrote %s_settings.cfg\n",ptr);
|
||||
|
@ -1019,6 +1019,7 @@ void CONFIG_WriteSetup(uint32_t flags)
|
|||
SCRIPT_Free(ud.config.scripthandle);
|
||||
OSD_Printf("Wrote %s\n",setupfilename);
|
||||
CONFIG_WriteBinds();
|
||||
Bfflush(NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2136,6 +2136,8 @@ void G_GameExit(const char *msg)
|
|||
|
||||
uninitgroupfile();
|
||||
|
||||
Bfflush(NULL);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -9494,6 +9496,7 @@ void G_Shutdown(void)
|
|||
KB_Shutdown();
|
||||
uninitengine();
|
||||
G_Cleanup();
|
||||
Bfflush(NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -9771,6 +9774,8 @@ static void G_Startup(void)
|
|||
tilesizx[MIRROR] = tilesizy[MIRROR] = 0;
|
||||
|
||||
screenpeek = myconnectindex;
|
||||
|
||||
Bfflush(NULL);
|
||||
}
|
||||
|
||||
void G_UpdatePlayerFromMenu(void)
|
||||
|
|
|
@ -3088,6 +3088,7 @@ dodefault:
|
|||
"helixhorned@gmail.com.\n\n"
|
||||
"Thank you!\n");
|
||||
vm.flags |= VMFLAG_ERROR;
|
||||
Bfflush(NULL);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue