[openjk] 39/130: Remove wrappers and original code leftovers

Simon McVittie smcv at debian.org
Fri Oct 28 11:09:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 54412cde0e6c71fc24505be969a5b7f3e7c26d09
Author: bibendovsky <bibendovsky at hotmail.com>
Date:   Sat Jul 16 16:14:16 2016 +0300

    Remove wrappers and original code leftovers
---
 code/CMakeLists.txt               |   5 +-
 code/client/cl_main.cpp           |   1 -
 code/game/CMakeLists.txt          |   3 +
 code/game/Q3_Interface.cpp        |  10 ---
 code/game/Q3_Interface.h          |   2 -
 code/game/g_public.h              |   5 --
 code/game/g_shared.cpp            |  21 ++----
 code/game/g_shared.h              |   1 -
 code/icarus/IcarusInterface.h     |   2 -
 code/rd-common/tr_public.h        |   2 -
 code/server/sv_game.cpp           |   4 --
 code/server/sv_savegame.cpp       | 137 ++++++++++++++++++++++++++++----------
 codeJK2/game/CMakeLists.txt       |   4 ++
 codeJK2/game/g_shared.cpp         |  13 ----
 shared/qcommon/ojk_saved_game.cpp |   5 ++
 shared/qcommon/ojk_saved_game.h   |   3 +
 16 files changed, 123 insertions(+), 95 deletions(-)

diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 99cea2d..38525f3 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -281,10 +281,12 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 
 	set(SPEngineRendererFiles
 		"${SPDir}/rd-common/mdx_format.h"
+		"${SPDir}/rd-common/mdx_format.cpp"
 		"${SPDir}/rd-common/tr_public.h"
 		"${SPDir}/rd-common/tr_types.h"
 		)
-
+	source_group("renderer" FILES ${SPEngineRendererFiles})
+	set(SPEngineFiles ${SPEngineFiles} ${SPEngineRendererFiles})
 
 	# UI files
 	set(SPEngineUIFiles
@@ -308,6 +310,7 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 	set(SPEngineGhoul2Files
 		"${SPDir}/ghoul2/G2.h"
 		"${SPDir}/ghoul2/ghoul2_gore.h"
+		"${SPDir}/rd-common/ghoul2_shared.cpp"
 		)
 	source_group("ghoul2" FILES ${SPEngineGhoul2Files})
 	set(SPEngineFiles ${SPEngineFiles} ${SPEngineGhoul2Files})
diff --git a/code/client/cl_main.cpp b/code/client/cl_main.cpp
index b3ab567..d02fe0d 100644
--- a/code/client/cl_main.cpp
+++ b/code/client/cl_main.cpp
@@ -1143,7 +1143,6 @@ void CL_InitRef( void ) {
 	RIT(FS_Write);
 	RIT(FS_WriteFile);
 	RIT(Hunk_ClearToMark);
-	RIT(SG_Append);
 	RIT(SND_RegisterAudio_LevelLoadEnd);
 	//RIT(SV_PointContents);
 	RIT(SV_Trace);
diff --git a/code/game/CMakeLists.txt b/code/game/CMakeLists.txt
index 475d3e8..6a4cf1e 100644
--- a/code/game/CMakeLists.txt
+++ b/code/game/CMakeLists.txt
@@ -265,6 +265,9 @@ set(SPGameCommonFiles
 	"${SPDir}/qcommon/q_math.cpp"
 	"${SPDir}/qcommon/q_shared.cpp"
 	"${SPDir}/qcommon/q_shared.h"
+	"${SPDir}/rd-common/mdx_format.h"
+	"${SPDir}/rd-common/mdx_format.cpp"
+	"${SPDir}/rd-common/ghoul2_shared.cpp"
 	"${SharedDir}/qcommon/ojk_i_saved_game.h"
 	"${SharedDir}/qcommon/ojk_i_saved_game_fwd.h"
 	
diff --git a/code/game/Q3_Interface.cpp b/code/game/Q3_Interface.cpp
index 4ec336f..29d659e 100644
--- a/code/game/Q3_Interface.cpp
+++ b/code/game/Q3_Interface.cpp
@@ -11154,16 +11154,6 @@ void	CQuake3GameInterface::FreeVariable( const char *name )
 }
 
 //Save / Load functions
-int		CQuake3GameInterface::WriteSaveData( unsigned int chid, const void *data, int length )
-{
-	return gi.AppendToSaveGame( chid, data, length );
-}
-
-int		CQuake3GameInterface::ReadSaveData( unsigned int chid, void *address, int length, void **addressptr )
-{
-	return gi.ReadFromSaveGame( chid, address, length, addressptr );
-}
-
 ojk::ISavedGame* CQuake3GameInterface::get_saved_game()
 {
     return ::gi.saved_game;
diff --git a/code/game/Q3_Interface.h b/code/game/Q3_Interface.h
index 3bc97b1..ff2e22a 100644
--- a/code/game/Q3_Interface.h
+++ b/code/game/Q3_Interface.h
@@ -697,8 +697,6 @@ public:
 	void	FreeVariable( const char *name );
 
 	//Save / Load functions
-	int		WriteSaveData( unsigned int chid, const void *data, int length );
-	int		ReadSaveData( unsigned int chid, void *address, int length, void **addressptr = NULL );
 	int		LinkGame( int entID, int icarusID );
 
     ojk::ISavedGame* get_saved_game() override;
diff --git a/code/game/g_public.h b/code/game/g_public.h
index f0c21fa..b503c78 100644
--- a/code/game/g_public.h
+++ b/code/game/g_public.h
@@ -185,11 +185,6 @@ typedef struct {
 
 	// Savegame handling
 	//
-	qboolean	(*AppendToSaveGame)(unsigned int chid, const void *data, int length);
-
-	int			(*ReadFromSaveGame)(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr );
-	int			(*ReadFromSaveGameOptional)(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr );
-
     ojk::ISavedGame* saved_game;
 
 	// add commands to the console as if they were typed in
diff --git a/code/game/g_shared.cpp b/code/game/g_shared.cpp
index aa60cf0..9fe0920 100644
--- a/code/game/g_shared.cpp
+++ b/code/game/g_shared.cpp
@@ -272,7 +272,7 @@ void clientPersistant_t::sg_export(
     ojk::ISavedGame* saved_game) const
 {
     saved_game->write<int32_t>(connected);
-    saved_game->write<int32_t>(lastCommand);
+    saved_game->write<>(lastCommand);
     saved_game->write<int8_t>(netname);
     saved_game->write<int32_t>(maxHealth);
     saved_game->write<int32_t>(enterTime);
@@ -284,7 +284,7 @@ void clientPersistant_t::sg_import(
     ojk::ISavedGame* saved_game)
 {
     saved_game->read<int32_t>(connected);
-    saved_game->read<int32_t>(lastCommand);
+    saved_game->read<>(lastCommand);
     saved_game->read<int8_t>(netname);
     saved_game->read<int32_t>(maxHealth);
     saved_game->read<int32_t>(enterTime);
@@ -300,7 +300,7 @@ void gclient_s::sg_export(
     saved_game->write<>(pers);
     saved_game->write<>(sess);
     saved_game->write<int32_t>(lastCmdTime);
-    saved_game->write<int32_t>(usercmd);
+    saved_game->write<>(usercmd);
     saved_game->write<int32_t>(buttons);
     saved_game->write<int32_t>(oldbuttons);
     saved_game->write<int32_t>(latched_buttons);
@@ -365,7 +365,7 @@ void gclient_s::sg_import(
     saved_game->read<>(pers);
     saved_game->read<>(sess);
     saved_game->read<int32_t>(lastCmdTime);
-    saved_game->read<int32_t>(usercmd);
+    saved_game->read<>(usercmd);
     saved_game->read<int32_t>(buttons);
     saved_game->read<int32_t>(oldbuttons);
     saved_game->read<int32_t>(latched_buttons);
@@ -814,16 +814,3 @@ void gentity_t::sg_import(
     saved_game->read<int32_t>(forcePushTime);
     saved_game->read<int32_t>(forcePuller);
 }
-
-
-void CGhoul2Info_v::sg_export(
-    ojk::ISavedGame* saved_game) const
-{
-    saved_game->write<int32_t>(mItem);
-}
-
-void CGhoul2Info_v::sg_import(
-    ojk::ISavedGame* saved_game)
-{
-    saved_game->write<int32_t>(mItem);
-}
diff --git a/code/game/g_shared.h b/code/game/g_shared.h
index 133adc2..d1de2a3 100644
--- a/code/game/g_shared.h
+++ b/code/game/g_shared.h
@@ -358,7 +358,6 @@ typedef struct missionStats_s
 // MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData()
 //
 // !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
-#pragma pack(push, 4)
 typedef struct {
 	int				missionObjectivesShown;	// Number of times mission objectives have been updated
 	team_t			sessionTeam;
diff --git a/code/icarus/IcarusInterface.h b/code/icarus/IcarusInterface.h
index 71acf2b..c953db1 100644
--- a/code/icarus/IcarusInterface.h
+++ b/code/icarus/IcarusInterface.h
@@ -144,8 +144,6 @@ public:
 
 	// Save / Load functions
 
-	virtual int		WriteSaveData( unsigned int chid, const void *data, int length ) = 0;
-	virtual int		ReadSaveData( unsigned int chid, void *address, int length, void **addressptr = NULL )  = 0;
 	virtual int		LinkGame( int gameID, int icarusID ) = 0;
     virtual ojk::ISavedGame* get_saved_game() = 0;
 
diff --git a/code/rd-common/tr_public.h b/code/rd-common/tr_public.h
index 9b4e2f2..f14af68 100644
--- a/code/rd-common/tr_public.h
+++ b/code/rd-common/tr_public.h
@@ -112,8 +112,6 @@ typedef struct {
 															const int passEntityNum, const int contentmask,
 															const EG2_Collision eG2TraceType, const int useLod );
 
-	qboolean			(*SG_Append)						( unsigned int chid, const void *pvData, int iLength );
-
     ojk::ISavedGame* saved_game;
 
 	int					(*SV_PointContents)					( const vec3_t p, clipHandle_t model );
diff --git a/code/server/sv_game.cpp b/code/server/sv_game.cpp
index ec5296d..74ce6ad 100644
--- a/code/server/sv_game.cpp
+++ b/code/server/sv_game.cpp
@@ -930,10 +930,6 @@ void SV_InitGameProgs (void) {
 	import.FS_FreeFile = FS_FreeFile;
 	import.FS_GetFileList = FS_GetFileList;
 
-	import.AppendToSaveGame = SG_Append;
-	import.ReadFromSaveGame	= SG_Read;
-	import.ReadFromSaveGameOptional = SG_ReadOptional;
-
     import.saved_game = &ojk::SavedGame::get_instance();
 
 	import.AdjustAreaPortalState = SV_AdjustAreaPortalState;
diff --git a/code/server/sv_savegame.cpp b/code/server/sv_savegame.cpp
index b856df3..79b44d1 100644
--- a/code/server/sv_savegame.cpp
+++ b/code/server/sv_savegame.cpp
@@ -44,7 +44,11 @@ static char	saveGameComment[iSG_COMMENT_SIZE];
 //#define SG_PROFILE	// enable for debug save stats if you want
 
 int giSaveGameVersion;	// filled in when a savegame file is opened
+
+#if 0
 fileHandle_t fhSaveGame = 0;
+#endif
+
 SavedGameJustLoaded_e eSavedGameJustLoaded = eNO;
 qboolean qbSGReadIsTestOnly = qfalse;	// this MUST be left in this state
 char sLastSaveFileLoaded[MAX_QPATH]={0};
@@ -139,13 +143,14 @@ static const char *SG_AddSavePath( const char *psPathlessBaseName )
 	return sSaveName[i];
 }
 
-void SG_WipeSavegame( const char *psPathlessBaseName )
+void SG_WipeSavegame(
+    const char* psPathlessBaseName)
 {
-	const char *psLocalFilename  = SG_AddSavePath( psPathlessBaseName );
-
-	FS_DeleteUserGenFile( psLocalFilename );
+    ojk::SavedGame::remove(
+        psPathlessBaseName);
 }
 
+#if 0
 static qboolean SG_Move( const char *psPathlessBaseName_Src, const char *psPathlessBaseName_Dst )
 {
 	const char *psLocalFilename_Src = SG_AddSavePath( psPathlessBaseName_Src );
@@ -161,8 +166,9 @@ static qboolean SG_Move( const char *psPathlessBaseName_Src, const char *psPathl
 
 	return qtrue;
 }
+#endif
 
-
+#if 0
 qboolean gbSGWriteFailed = qfalse;
 
 static qboolean SG_Create( const char *psPathlessBaseName )
@@ -189,10 +195,12 @@ static qboolean SG_Create( const char *psPathlessBaseName )
 
 	return qtrue;
 }
+#endif
 
 // called from the ERR_DROP stuff just in case the error occured during loading of a saved game, because if
 //	we didn't do this then we'd run out of quake file handles after the 8th load fail...
 //
+#if 0
 void SG_Shutdown()
 {
 	if (fhSaveGame )
@@ -209,7 +217,25 @@ void SG_Shutdown()
 	extern qboolean gbAlreadyDoingLoad;
 					gbAlreadyDoingLoad = qfalse;
 }
+#else
+void SG_Shutdown()
+{
+    auto saved_game = &ojk::SavedGame::get_instance();
+
+    saved_game->close();
 
+    eSavedGameJustLoaded = eNO;
+    // important to do this if we ERR_DROP during loading, else next map you load after
+    // a bad save-file you'll arrive at dead :-)
+
+    // and this bit stops people messing up the laoder by repeatedly stabbing at the load key during loads...
+    //
+    extern qboolean gbAlreadyDoingLoad;
+    gbAlreadyDoingLoad = qfalse;
+}
+#endif
+
+#if 0
 qboolean SG_Close()
 {
 	assert( fhSaveGame );
@@ -239,8 +265,9 @@ qboolean SG_Close()
 	CompressMem_FreeScratchBuffer();
 	return qtrue;
 }
+#endif
 
-
+#if 0
 qboolean SG_Open( const char *psPathlessBaseName )
 {
 //	if ( fhSaveGame )		// hmmm...
@@ -280,6 +307,7 @@ qboolean SG_Open( const char *psPathlessBaseName )
 
 	return qtrue;
 }
+#endif
 
 // you should only call this when you know you've successfully opened a savegame, and you want to query for
 //	whether it's an old (street-copy) version, or a new (expansion-pack) version
@@ -1030,30 +1058,33 @@ static qboolean SG_ReadScreenshot(qboolean qbSetAsLoadingScreen, void *pvDest)
 }
 // Gets the savegame screenshot
 //
-qboolean SG_GetSaveImage( const char *psPathlessBaseName, void *pvAddress )
+qboolean SG_GetSaveImage(const char *psPathlessBaseName, void *pvAddress)
 {
-	if(!psPathlessBaseName)
-	{
-		return qfalse;
-	}
-
-	if (!SG_Open(psPathlessBaseName))
-	{
-		return qfalse;
-	}
+    if (!psPathlessBaseName)
+    {
+        return qfalse;
+    }
 
     auto saved_game = &ojk::SavedGame::get_instance();
 
+    if (!saved_game->open(psPathlessBaseName))
+    {
+        return qfalse;
+    }
+
     saved_game->read_chunk(
-        INT_ID('C','O','M','M'));
+        INT_ID('C', 'O', 'M', 'M'));
 
     saved_game->read_chunk(
-        INT_ID('C','M','T','M'));
+        INT_ID('C', 'M', 'T', 'M'));
+
+    auto bGotSaveImage = SG_ReadScreenshot(
+        qfalse,
+        pvAddress);
 
-	qboolean bGotSaveImage = SG_ReadScreenshot(qfalse, pvAddress);
+    saved_game->close();
 
-	SG_Close();
-	return bGotSaveImage;
+    return bGotSaveImage;
 }
 
 
@@ -1177,7 +1208,9 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
 		SG_StoreSaveGameComment(va("--> %s <--",psMapName));
 	}
 
-	if(!SG_Create( "current" ))
+    auto saved_game = &ojk::SavedGame::get_instance();
+
+	if(!saved_game->create( "current" ))
 	{
 		Com_Printf (GetString_FailedToOpenSaveGame("current",qfalse));//S_COLOR_RED "Failed to create savegame\n");
 		SG_WipeSavegame( "current" );
@@ -1194,8 +1227,6 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
 	SG_WriteScreenshot(qbAutosave, sMapCmd);
 #endif
 
-    auto saved_game = &ojk::SavedGame::get_instance();
-
     saved_game->write_chunk(
         INT_ID('M','P','C','M'),
         sMapCmd);
@@ -1220,8 +1251,12 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
 		SG_WriteServerConfigStrings();
 	}
 	ge->WriteLevel(qbAutosave);	// always done now, but ent saver only does player if auto
-	SG_Close();
-	if (gbSGWriteFailed)
+
+    auto is_write_failed = saved_game->is_write_failed();
+
+	saved_game->close();
+
+	if (is_write_failed)
 	{
 		Com_Printf (GetString_FailedToOpenSaveGame("current",qfalse));//S_COLOR_RED "Failed to write savegame!\n");
 		SG_WipeSavegame( "current" );
@@ -1229,7 +1264,13 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
 		return qfalse;
 	}
 
+#if 0
 	SG_Move( "current", psPathlessBaseName );
+#else
+    ojk::SavedGame::rename(
+        "current",
+        psPathlessBaseName);
+#endif
 
 
 	sv_testsave->integer = iPrevTestSave;
@@ -1249,7 +1290,9 @@ qboolean SG_ReadSavegame(const char *psPathlessBaseName)
 	Cvar_Set( "cg_missionstatusscreen", "0" );//reset if loading a game
 #endif
 
-	if (!SG_Open( psPathlessBaseName ))
+    auto saved_game = &ojk::SavedGame::get_instance();
+
+	if (!saved_game->open(psPathlessBaseName))
 	{
 		Com_Printf (GetString_FailedToOpenSaveGame(psPathlessBaseName, qtrue));//S_COLOR_RED "Failed to open savegame \"%s\"\n", psPathlessBaseName);
 		sv_testsave->integer = iPrevTestSave;
@@ -1265,8 +1308,6 @@ qboolean SG_ReadSavegame(const char *psPathlessBaseName)
 
 	// Read in all the server data...
 	//
-    auto saved_game = &ojk::SavedGame::get_instance();
-
     saved_game->read_chunk(
         INT_ID('C','O','M','M'),
         sComment);
@@ -1310,18 +1351,22 @@ qboolean SG_ReadSavegame(const char *psPathlessBaseName)
 	}
 	ge->ReadLevel(qbAutosave, qbLoadTransition);	// always done now, but ent reader only does player if auto
 
+#if 0
 	if(!SG_Close())
 	{
 		Com_Printf (GetString_FailedToOpenSaveGame(psPathlessBaseName,qfalse));//S_COLOR_RED "Failed to close savegame\n");
 		sv_testsave->integer = iPrevTestSave;
 		return qfalse;
 	}
+#else
+    saved_game->close();
+#endif
 
 	sv_testsave->integer = iPrevTestSave;
 	return qtrue;
 }
 
-
+#if 0
 int Compress_RLE(const byte *pIn, int iLength, byte *pOut)
 {
 	int iCount=0,iOutIndex=0;
@@ -1358,7 +1403,9 @@ int Compress_RLE(const byte *pIn, int iLength, byte *pOut)
 	}
 	return iOutIndex;
 }
+#endif
 
+#if 0
 void DeCompress_RLE(byte *pOut, const byte *pIn, int iDecompressedBytesRemaining)
 {
 	signed char count;
@@ -1381,7 +1428,9 @@ void DeCompress_RLE(byte *pOut, const byte *pIn, int iDecompressedBytesRemaining
 		iDecompressedBytesRemaining -= count;
 	}
 }
+#endif
 
+#if 0
 // simulate decompression over original data (but don't actually do it), to test de/compress validity...
 //
 qboolean Verify_RLE(const byte *pOut, const byte *pIn, int iDecompressedBytesRemaining)
@@ -1422,8 +1471,9 @@ qboolean Verify_RLE(const byte *pOut, const byte *pIn, int iDecompressedBytesRem
 
 	return qtrue;
 }
+#endif
 
-
+#if 0
 byte *gpbCompBlock = NULL;
 int   giCompBlockSize = 0;
 static void CompressMem_FreeScratchBuffer(void)
@@ -1435,7 +1485,9 @@ static void CompressMem_FreeScratchBuffer(void)
 	}
 	giCompBlockSize = 0;
 }
+#endif
 
+#if 0
 static byte *CompressMem_AllocScratchBuffer(int iSize)
 {
 	// only alloc new buffer if we need more than the existing one...
@@ -1450,7 +1502,9 @@ static byte *CompressMem_AllocScratchBuffer(int iSize)
 
 	return gpbCompBlock;
 }
+#endif
 
+#if 0
 // returns -1 for compression-not-worth-it, else compressed length...
 //
 int CompressMem(byte *pbData, int iLength, byte *&pbOut)
@@ -1478,15 +1532,17 @@ int CompressMem(byte *pbData, int iLength, byte *&pbOut)
 
 	return iOutputLength;
 }
+#endif
 
+#if 0
 //pass through function
 int SG_Write(const void * chid, const int bytesize, fileHandle_t fhSaveGame)
 {
 		return FS_Write( chid, bytesize, fhSaveGame);
 }
+#endif
 
-
-
+#if 0
 qboolean SG_Append(unsigned int chid, const void *pvData, int iLength)
 {
 	unsigned int	uiCksum;
@@ -1573,21 +1629,24 @@ qboolean SG_Append(unsigned int chid, const void *pvData, int iLength)
 
 	return qtrue;
 }
+#endif
 
+#if 0
 //pass through function
 int SG_ReadBytes(void * chid, int bytesize, fileHandle_t fhSaveGame)
 {
 	return FS_Read( chid, bytesize, fhSaveGame);
 }
+#endif
 
-
+#if 0
 int SG_Seek( fileHandle_t fhSaveGame, long offset, int origin )
 {
 	return FS_Seek(fhSaveGame, offset, origin);
 }
+#endif
 
-
-
+#if 0
 // Pass in pvAddress (or NULL if you want memory to be allocated)
 //	if pvAddress==NULL && ppvAddressPtr == NULL then the block is discarded/skipped.
 //
@@ -1750,17 +1809,21 @@ static int SG_Read_Actual(unsigned int chid, void *pvAddress, int iLength, void
 
 	return iLength;
 }
+#endif
 
+#if 0
 int SG_Read(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
 {
 	return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qfalse );	// qboolean bChunkIsOptional
 }
+#endif
 
+#if 0
 int SG_ReadOptional(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPtr /* = NULL */)
 {
 	return SG_Read_Actual(chid, pvAddress, iLength, ppvAddressPtr, qtrue);		// qboolean bChunkIsOptional
 }
-
+#endif
 
 void SG_TestSave(void)
 {
diff --git a/codeJK2/game/CMakeLists.txt b/codeJK2/game/CMakeLists.txt
index 4412aa1..f471406 100644
--- a/codeJK2/game/CMakeLists.txt
+++ b/codeJK2/game/CMakeLists.txt
@@ -26,6 +26,7 @@ set(JK2SPGameDefines ${SharedDefines} "JK2_MODE" "SP_GAME")
 set(JK2SPGameIncludeDirectories
 	"${JK2SPDir}"
 	"${JK2SPDir}/game"
+	"${SPDir}"
 	"${SharedDir}"
 	"${GSLIncludeDirectory}"
 	)
@@ -238,6 +239,9 @@ set(JK2SPGameCommonFiles
 	"${SPDir}/qcommon/q_shared.cpp"
 	"${SPDir}/qcommon/q_shared.h"
 	"${SPDir}/qcommon/strippublic.h"
+	"${SPDir}/rd-common/ghoul2_shared.cpp"
+	"${SPDir}/rd-common/mdx_format.h"
+	"${SPDir}/rd-common/mdx_format.cpp"
 	"${SharedDir}/qcommon/ojk_i_saved_game.h"
 	"${SharedDir}/qcommon/ojk_i_saved_game_fwd.h"
 
diff --git a/codeJK2/game/g_shared.cpp b/codeJK2/game/g_shared.cpp
index b0b1d5b..b53b8db 100644
--- a/codeJK2/game/g_shared.cpp
+++ b/codeJK2/game/g_shared.cpp
@@ -800,16 +800,3 @@ void gentity_s::sg_import(
     saved_game->read<int32_t>(forcePushTime);
     saved_game->read<int32_t>(forcePuller);
 }
-
-
-void CGhoul2Info_v::sg_export(
-    ojk::ISavedGame* saved_game) const
-{
-    saved_game->write<int32_t>(mItem);
-}
-
-void CGhoul2Info_v::sg_import(
-    ojk::ISavedGame* saved_game)
-{
-    saved_game->read<int32_t>(mItem);
-}
diff --git a/shared/qcommon/ojk_saved_game.cpp b/shared/qcommon/ojk_saved_game.cpp
index be098f8..328cc5b 100644
--- a/shared/qcommon/ojk_saved_game.cpp
+++ b/shared/qcommon/ojk_saved_game.cpp
@@ -499,6 +499,11 @@ void SavedGame::raw_write(
     io_buffer_offset_ = new_buffer_size;
 }
 
+bool SavedGame::is_write_failed() const
+{
+    return is_write_failed_;
+}
+
 const SavedGame::Buffer& SavedGame::get_buffer() const
 {
     return io_buffer_;
diff --git a/shared/qcommon/ojk_saved_game.h b/shared/qcommon/ojk_saved_game.h
index 6bb31e8..d975411 100644
--- a/shared/qcommon/ojk_saved_game.h
+++ b/shared/qcommon/ojk_saved_game.h
@@ -86,6 +86,9 @@ public:
     using ISavedGame::write;
 
 
+    bool is_write_failed() const;
+
+
     // Returns an I/O buffer.
     const Buffer& get_buffer() const override;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list