mirror of
https://github.com/ioquake/jedi-academy.git
synced 2025-02-02 02:41:22 +00:00
chids in savegames are 32 bits on disk so don't use long
This commit is contained in:
parent
5b9dda241c
commit
76fb0c6d6f
8 changed files with 29 additions and 29 deletions
|
@ -11058,12 +11058,12 @@ void CQuake3GameInterface::FreeVariable( const char *name )
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save / Load functions
|
//Save / Load functions
|
||||||
int CQuake3GameInterface::WriteSaveData( unsigned long chid, void *data, int length )
|
int CQuake3GameInterface::WriteSaveData( unsigned int chid, void *data, int length )
|
||||||
{
|
{
|
||||||
return gi.AppendToSaveGame( chid, data, length );
|
return gi.AppendToSaveGame( chid, data, length );
|
||||||
}
|
}
|
||||||
|
|
||||||
int CQuake3GameInterface::ReadSaveData( unsigned long chid, void *address, int length, void **addressptr )
|
int CQuake3GameInterface::ReadSaveData( unsigned int chid, void *address, int length, void **addressptr )
|
||||||
{
|
{
|
||||||
return gi.ReadFromSaveGame( chid, address, length, addressptr );
|
return gi.ReadFromSaveGame( chid, address, length, addressptr );
|
||||||
}
|
}
|
||||||
|
|
|
@ -673,8 +673,8 @@ public:
|
||||||
void FreeVariable( const char *name );
|
void FreeVariable( const char *name );
|
||||||
|
|
||||||
//Save / Load functions
|
//Save / Load functions
|
||||||
int WriteSaveData( unsigned long chid, void *data, int length );
|
int WriteSaveData( unsigned int chid, void *data, int length );
|
||||||
int ReadSaveData( unsigned long chid, void *address, int length, void **addressptr = NULL );
|
int ReadSaveData( unsigned int chid, void *address, int length, void **addressptr = NULL );
|
||||||
int LinkGame( int entID, int icarusID );
|
int LinkGame( int entID, int icarusID );
|
||||||
|
|
||||||
// Access functions
|
// Access functions
|
||||||
|
|
|
@ -481,7 +481,7 @@ static void EnumerateField(const save_field_t *pField, const byte *pbBase)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EnumerateFields(const save_field_t *pFields, const byte *pbData, unsigned long ulChid, int iLen)
|
static void EnumerateFields(const save_field_t *pFields, const byte *pbData, unsigned int ulChid, int iLen)
|
||||||
{
|
{
|
||||||
strList = new list<sstring_t>;
|
strList = new list<sstring_t>;
|
||||||
|
|
||||||
|
@ -622,11 +622,11 @@ static void EvaluateField(const save_field_t *pField, byte *pbBase, byte *pbOrig
|
||||||
|
|
||||||
|
|
||||||
// copy of function in sv_savegame
|
// copy of function in sv_savegame
|
||||||
static LPCSTR SG_GetChidText(unsigned long chid)
|
static LPCSTR SG_GetChidText(unsigned int chid)
|
||||||
{
|
{
|
||||||
static char chidtext[5];
|
static char chidtext[5];
|
||||||
|
|
||||||
*(unsigned long *)chidtext = BigLong(chid);
|
*(unsigned int *)chidtext = BigLong(chid);
|
||||||
chidtext[4] = 0;
|
chidtext[4] = 0;
|
||||||
|
|
||||||
return chidtext;
|
return chidtext;
|
||||||
|
@ -705,7 +705,7 @@ static void SG_ConvertRetailSaberinfoToNewSaberinfo( void *sabData, saberInfo_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EvaluateFields(const save_field_t *pFields, byte *pbData, byte *pbOriginalRefData, unsigned long ulChid, int iSize, qboolean bOkToSizeMisMatch)
|
static void EvaluateFields(const save_field_t *pFields, byte *pbData, byte *pbOriginalRefData, unsigned int ulChid, int iSize, qboolean bOkToSizeMisMatch)
|
||||||
{
|
{
|
||||||
int iReadSize = gi.ReadFromSaveGame(ulChid, pbData, bOkToSizeMisMatch?0:iSize);
|
int iReadSize = gi.ReadFromSaveGame(ulChid, pbData, bOkToSizeMisMatch?0:iSize);
|
||||||
|
|
||||||
|
|
|
@ -120,8 +120,8 @@ public:
|
||||||
|
|
||||||
// Save / Load functions
|
// Save / Load functions
|
||||||
|
|
||||||
virtual int WriteSaveData( unsigned long chid, void *data, int length ) = 0;
|
virtual int WriteSaveData( unsigned int chid, void *data, int length ) = 0;
|
||||||
virtual int ReadSaveData( unsigned long chid, void *address, int length, void **addressptr = NULL ) = 0;
|
virtual int ReadSaveData( unsigned int chid, void *address, int length, void **addressptr = NULL ) = 0;
|
||||||
virtual int LinkGame( int gameID, int icarusID ) = 0;
|
virtual int LinkGame( int gameID, int icarusID ) = 0;
|
||||||
|
|
||||||
// Access functions
|
// Access functions
|
||||||
|
|
|
@ -1274,8 +1274,8 @@ Writes the portal state to a savegame file
|
||||||
===================
|
===================
|
||||||
*/
|
*/
|
||||||
//
|
//
|
||||||
qboolean SG_Append(unsigned long chid, const void *data, int length);
|
qboolean SG_Append(unsigned int chid, const void *data, int length);
|
||||||
int SG_Read(unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
int SG_Read(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
||||||
|
|
||||||
void CM_WritePortalState ()
|
void CM_WritePortalState ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1224,8 +1224,8 @@ Writes the portal state to a savegame file
|
||||||
*/
|
*/
|
||||||
// having to proto this stuff again here is crap, but wtf?...
|
// having to proto this stuff again here is crap, but wtf?...
|
||||||
//
|
//
|
||||||
qboolean SG_Append(unsigned long chid, const void *data, int length);
|
qboolean SG_Append(unsigned int chid, const void *data, int length);
|
||||||
int SG_Read(unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
int SG_Read(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
||||||
|
|
||||||
void CM_WritePortalState ()
|
void CM_WritePortalState ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -299,9 +299,9 @@ qboolean SV_TryLoadTransition( const char *mapname );
|
||||||
qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave);
|
qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave);
|
||||||
qboolean SG_ReadSavegame(const char *psPathlessBaseName);
|
qboolean SG_ReadSavegame(const char *psPathlessBaseName);
|
||||||
void SG_WipeSavegame(const char *psPathlessBaseName);
|
void SG_WipeSavegame(const char *psPathlessBaseName);
|
||||||
qboolean SG_Append(unsigned long chid, const void *data, int length);
|
qboolean SG_Append(unsigned int chid, const void *data, int length);
|
||||||
int SG_Read (unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
int SG_Read (unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
||||||
int SG_ReadOptional (unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
int SG_ReadOptional (unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr = NULL);
|
||||||
void SG_Shutdown();
|
void SG_Shutdown();
|
||||||
void SG_TestSave(void);
|
void SG_TestSave(void);
|
||||||
//
|
//
|
||||||
|
|
|
@ -116,15 +116,15 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef map<unsigned long, CChid> CChidInfo_t;
|
typedef map<unsigned int, CChid> CChidInfo_t;
|
||||||
CChidInfo_t save_info;
|
CChidInfo_t save_info;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LPCSTR SG_GetChidText(unsigned long chid)
|
LPCSTR SG_GetChidText(unsigned int chid)
|
||||||
{
|
{
|
||||||
static char chidtext[5];
|
static char chidtext[5];
|
||||||
|
|
||||||
*(unsigned long *)chidtext = BigLong(chid);
|
*(unsigned int *)chidtext = BigLong(chid);
|
||||||
chidtext[4] = 0;
|
chidtext[4] = 0;
|
||||||
|
|
||||||
return chidtext;
|
return chidtext;
|
||||||
|
@ -1573,16 +1573,16 @@ int SG_Write(const void * chid, const int bytesize, fileHandle_t fhSaveGame)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
qboolean SG_Append(unsigned long chid, const void *pvData, int iLength)
|
qboolean SG_Append(unsigned int chid, const void *pvData, int iLength)
|
||||||
{
|
{
|
||||||
unsigned int uiCksum;
|
unsigned int uiCksum;
|
||||||
unsigned int uiSaved;
|
unsigned int uiSaved;
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
int i;
|
int i;
|
||||||
unsigned long *pTest;
|
unsigned int *pTest;
|
||||||
|
|
||||||
pTest = (unsigned long *) pvData;
|
pTest = (unsigned int *) pvData;
|
||||||
for (i=0; i<iLength/4; i++, pTest++)
|
for (i=0; i<iLength/4; i++, pTest++)
|
||||||
{
|
{
|
||||||
assert(*pTest != 0xfeeefeee);
|
assert(*pTest != 0xfeeefeee);
|
||||||
|
@ -1823,11 +1823,11 @@ int SG_Seek( fileHandle_t fhSaveGame, long offset, int origin )
|
||||||
//
|
//
|
||||||
// function doesn't return if error (uses ERR_DROP), unless "qbSGReadIsTestOnly == qtrue", then NZ return = success
|
// function doesn't return if error (uses ERR_DROP), unless "qbSGReadIsTestOnly == qtrue", then NZ return = success
|
||||||
//
|
//
|
||||||
static int SG_Read_Actual(unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr, qboolean bChunkIsOptional)
|
static int SG_Read_Actual(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr, qboolean bChunkIsOptional)
|
||||||
{
|
{
|
||||||
unsigned int uiLoadedCksum, uiCksum;
|
unsigned int uiLoadedCksum, uiCksum;
|
||||||
unsigned int uiLoadedLength;
|
unsigned int uiLoadedLength;
|
||||||
unsigned long ulLoadedChid;
|
unsigned int ulLoadedChid;
|
||||||
unsigned int uiLoaded;
|
unsigned int uiLoaded;
|
||||||
char sChidText1[MAX_QPATH];
|
char sChidText1[MAX_QPATH];
|
||||||
char sChidText2[MAX_QPATH];
|
char sChidText2[MAX_QPATH];
|
||||||
|
@ -1979,12 +1979,12 @@ static int SG_Read_Actual(unsigned long chid, void *pvAddress, int iLength, void
|
||||||
return iLength;
|
return iLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SG_Read(unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
|
int SG_Read(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
|
||||||
{
|
{
|
||||||
return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qfalse ); // qboolean bChunkIsOptional
|
return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qfalse ); // qboolean bChunkIsOptional
|
||||||
}
|
}
|
||||||
|
|
||||||
int SG_ReadOptional(unsigned long chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
|
int SG_ReadOptional(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
|
||||||
{
|
{
|
||||||
return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qtrue); // qboolean bChunkIsOptional
|
return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qtrue); // qboolean bChunkIsOptional
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue