mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-11 12:40:45 +00:00
Speichern funktioniert nun wieder. Das Menü spinnt aber noch
This commit is contained in:
parent
7fdf2a7c4d
commit
e4818d35d5
7 changed files with 17 additions and 18 deletions
|
@ -148,7 +148,7 @@ typedef struct
|
|||
//
|
||||
// non-gameserver infornamtion
|
||||
// FIXME: move this cinematic stuff into the cin_t structure
|
||||
FILE *cinematic_file;
|
||||
fileHandle_t cinematic_file;
|
||||
int cinematictime; // cls.realtime for first cinematic frame
|
||||
int cinematicframe;
|
||||
unsigned char cinematicpalette[768];
|
||||
|
|
|
@ -2131,7 +2131,7 @@ qboolean m_savevalid[MAX_SAVEGAMES];
|
|||
static void Create_Savestrings (void)
|
||||
{
|
||||
int i;
|
||||
FILE *f;
|
||||
fileHandle_t *f;
|
||||
char name[MAX_OSPATH];
|
||||
|
||||
for (i=0 ; i<MAX_SAVEGAMES ; i++)
|
||||
|
|
|
@ -600,7 +600,7 @@ struct sfx_s *S_RegisterSexedSound (entity_state_t *ent, char *base)
|
|||
int n;
|
||||
char *p;
|
||||
struct sfx_s *sfx;
|
||||
FILE *f;
|
||||
fileHandle_t *f;
|
||||
char model[MAX_QPATH];
|
||||
char sexedFilename[MAX_QPATH];
|
||||
char maleFilename[MAX_QPATH];
|
||||
|
|
|
@ -1706,9 +1706,9 @@ Reads the portal state from a savegame file
|
|||
and recalculates the area connections
|
||||
===================
|
||||
*/
|
||||
void CM_ReadPortalState (FILE *f)
|
||||
void CM_ReadPortalState (fileHandle_t f)
|
||||
{
|
||||
FS_Read (portalopen, sizeof(portalopen), (size_t)f);
|
||||
FS_Read (portalopen, sizeof(portalopen), f);
|
||||
FloodAreaConnections ();
|
||||
}
|
||||
|
||||
|
|
|
@ -670,7 +670,6 @@ FS_FRead(void *buffer, int size, int count, fileHandle_t f)
|
|||
tried = true;
|
||||
} else {
|
||||
/* Already tried once. */
|
||||
Com_Printf("FS_FRead: 0 bytes read from '%s'.\n", handle->name);
|
||||
return (size - remaining);
|
||||
}
|
||||
} else if (r == -1)
|
||||
|
|
|
@ -636,7 +636,6 @@ int CM_WriteAreaBits (byte *buffer, int area);
|
|||
qboolean CM_HeadnodeVisible (int headnode, byte *visbits);
|
||||
|
||||
void CM_WritePortalState (FILE *f);
|
||||
void CM_ReadPortalState (FILE *f);
|
||||
|
||||
/*
|
||||
==============================================================
|
||||
|
|
|
@ -303,23 +303,24 @@ SV_ReadLevelFile
|
|||
|
||||
==============
|
||||
*/
|
||||
void CM_ReadPortalState(fileHandle_t f);
|
||||
void SV_ReadLevelFile (void)
|
||||
{
|
||||
char name[MAX_OSPATH];
|
||||
FILE *f;
|
||||
fileHandle_t f;
|
||||
|
||||
Com_DPrintf("SV_ReadLevelFile()\n");
|
||||
|
||||
Com_sprintf (name, sizeof(name), "%s/save/current/%s.sv2", FS_Gamedir(), sv.name);
|
||||
Com_sprintf (name, sizeof(name), "save/current/%s.sv2", sv.name);
|
||||
FS_FOpenFile(name, &f, FS_READ);
|
||||
if (!f)
|
||||
{
|
||||
Com_Printf ("Failed to open %s\n", name);
|
||||
return;
|
||||
}
|
||||
FS_Read (sv.configstrings, sizeof(sv.configstrings), (size_t)f);
|
||||
FS_Read (sv.configstrings, sizeof(sv.configstrings), f);
|
||||
CM_ReadPortalState (f);
|
||||
FS_FCloseFile ((size_t)f);
|
||||
FS_FCloseFile (f);
|
||||
|
||||
Com_sprintf (name, sizeof(name), "%s/save/current/%s.sav", FS_Gamedir(), sv.name);
|
||||
ge->ReadLevel (name);
|
||||
|
@ -406,14 +407,14 @@ SV_ReadServerFile
|
|||
*/
|
||||
void SV_ReadServerFile (void)
|
||||
{
|
||||
FILE *f;
|
||||
fileHandle_t f;
|
||||
char name[MAX_OSPATH], string[128];
|
||||
char comment[32];
|
||||
char mapcmd[MAX_TOKEN_CHARS];
|
||||
|
||||
Com_DPrintf("SV_ReadServerFile()\n");
|
||||
|
||||
Com_sprintf (name, sizeof(name), "%s/save/current/server.ssv", FS_Gamedir());
|
||||
Com_sprintf (name, sizeof(name), "save/current/server.ssv");
|
||||
FS_FOpenFile(name, &f, FS_READ);
|
||||
if (!f)
|
||||
{
|
||||
|
@ -421,23 +422,23 @@ void SV_ReadServerFile (void)
|
|||
return;
|
||||
}
|
||||
// read the comment field
|
||||
FS_Read (comment, sizeof(comment), (size_t)f);
|
||||
FS_Read (comment, sizeof(comment), f);
|
||||
|
||||
// read the mapcmd
|
||||
FS_Read (mapcmd, sizeof(mapcmd), (size_t)f);
|
||||
FS_Read (mapcmd, sizeof(mapcmd), f);
|
||||
|
||||
// read all CVAR_LATCH cvars
|
||||
// these will be things like coop, skill, deathmatch, etc
|
||||
while (1)
|
||||
{
|
||||
if (!FS_FRead (name, 1, sizeof(name), (size_t)f))
|
||||
if (!FS_FRead (name, 1, sizeof(name), f))
|
||||
break;
|
||||
FS_Read (string, sizeof(string), (size_t)f);
|
||||
FS_Read (string, sizeof(string), f);
|
||||
Com_DPrintf ("Set %s = %s\n", name, string);
|
||||
Cvar_ForceSet (name, string);
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
FS_FCloseFile(f);
|
||||
|
||||
// start a new game fresh with new cvars
|
||||
SV_InitGame ();
|
||||
|
|
Loading…
Reference in a new issue