[openjk] 66/130: SG: Rename classes and files
Simon McVittie
smcv at debian.org
Fri Oct 28 11:09:19 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 3179f7741d399ceff3372f943e6240bb35f9d47d
Author: bibendovsky <bibendovsky at hotmail.com>
Date: Sun Aug 7 17:45:00 2016 +0300
SG: Rename classes and files
---
code/CMakeLists.txt | 10 +-
code/cgame/FxScheduler.cpp | 14 +-
code/cgame/FxScheduler.h | 4 +-
code/cgame/cg_main.cpp | 14 +-
code/client/cl_main.cpp | 4 +-
code/game/CMakeLists.txt | 6 +-
code/game/G_Timer.cpp | 22 +--
code/game/Q3_Interface.cpp | 48 +++----
code/game/Q3_Interface.h | 2 +-
code/game/ai.h | 8 +-
code/game/b_public.h | 8 +-
code/game/bg_public.h | 8 +-
code/game/g_local.h | 12 +-
code/game/g_main.cpp | 18 +--
code/game/g_objectives.cpp | 10 +-
code/game/g_public.h | 4 +-
code/game/g_roff.cpp | 18 +--
code/game/g_savegame.cpp | 58 ++++----
code/game/g_shared.h | 40 +++---
code/game/g_vehicles.h | 16 +--
code/game/ghoul2_shared.h | 24 ++--
code/icarus/IcarusImplementation.cpp | 30 ++--
code/icarus/IcarusInterface.h | 2 +-
code/qcommon/cm_load.cpp | 16 +--
code/qcommon/q_shared.h | 42 +++---
code/rd-common/mdx_format.h | 4 +-
code/rd-common/tr_public.h | 2 +-
code/rd-vanilla/CMakeLists.txt | 6 +-
code/rd-vanilla/G2_misc.cpp | 54 +++----
code/server/sv_game.cpp | 4 +-
code/server/sv_savegame.cpp | 154 ++++++++++----------
codeJK2/cgame/cg_main.cpp | 14 +-
codeJK2/game/CMakeLists.txt | 6 +-
codeJK2/game/G_Timer.cpp | 22 +--
codeJK2/game/Q3_Registers.cpp | 46 +++---
codeJK2/game/ai.h | 8 +-
codeJK2/game/anims.h | 4 +-
codeJK2/game/b_public.h | 8 +-
codeJK2/game/bg_public.h | 8 +-
codeJK2/game/g_local.h | 8 +-
codeJK2/game/g_main.cpp | 18 +--
codeJK2/game/g_objectives.cpp | 10 +-
codeJK2/game/g_public.h | 2 +-
codeJK2/game/g_roff.cpp | 18 +--
codeJK2/game/g_savegame.cpp | 56 ++++----
codeJK2/game/g_shared.h | 44 +++---
codeJK2/icarus/Instance.cpp | 50 +++----
codeJK2/icarus/Sequence.cpp | 60 ++++----
codeJK2/icarus/Sequencer.cpp | 42 +++---
codeJK2/icarus/TaskManager.cpp | 92 ++++++------
codeJK2/icarus/interface.h | 2 +-
...{ojk_i_saved_game_file.h => ojk_i_saved_game.h} | 24 ++--
...{ojk_saved_game_file.cpp => ojk_saved_game.cpp} | 72 +++++-----
.../{ojk_saved_game_file.h => ojk_saved_game.h} | 31 ++--
..._game_file_helper.h => ojk_saved_game_helper.h} | 160 ++++++++++-----------
...le_helper_fwd.h => ojk_saved_game_helper_fwd.h} | 22 +--
56 files changed, 744 insertions(+), 745 deletions(-)
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 4fbb89c..70154d6 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -174,11 +174,11 @@ if(BuildSPEngine OR BuildJK2SPEngine)
"${SPDir}/qcommon/timing.h"
"${SPDir}/qcommon/MiniHeap.h"
- "${SharedDir}/qcommon/ojk_i_saved_game_file.h"
- "${SharedDir}/qcommon/ojk_saved_game_file.h"
- "${SharedDir}/qcommon/ojk_saved_game_file.cpp"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper_fwd.h"
+ "${SharedDir}/qcommon/ojk_i_saved_game.h"
+ "${SharedDir}/qcommon/ojk_saved_game.h"
+ "${SharedDir}/qcommon/ojk_saved_game.cpp"
+ "${SharedDir}/qcommon/ojk_saved_game_helper.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper_fwd.h"
"${SharedDir}/qcommon/ojk_scope_guard.h"
${SharedCommonFiles}
diff --git a/code/cgame/FxScheduler.cpp b/code/cgame/FxScheduler.cpp
index aa8d637..8c9613e 100644
--- a/code/cgame/FxScheduler.cpp
+++ b/code/cgame/FxScheduler.cpp
@@ -41,7 +41,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "qcommon/safe/string.h"
#include <cmath>
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
CFxScheduler theFxScheduler;
@@ -110,10 +110,10 @@ void CFxScheduler::LoadSave_Read()
Clean(); // need to get rid of old pre-cache handles, or it thinks it has some older effects when it doesn't
g_vstrEffectsNeededPerSlot.clear(); // jic
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('F', 'X', 'L', 'E'),
::gLoopedEffectArray);
@@ -124,7 +124,7 @@ void CFxScheduler::LoadSave_Read()
{
char sFX_Filename[MAX_QPATH];
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('F', 'X', 'F', 'N'),
sFX_Filename);
@@ -134,12 +134,12 @@ void CFxScheduler::LoadSave_Read()
void CFxScheduler::LoadSave_Write()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// bsave the data we need...
//
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('F', 'X', 'L', 'E'),
mLoopedEffectArray);
@@ -174,7 +174,7 @@ void CFxScheduler::LoadSave_Write()
// write out this string...
//
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('F', 'X', 'F', 'N'),
sFX_Filename);
}
diff --git a/code/cgame/FxScheduler.h b/code/cgame/FxScheduler.h
index ea7266b..b5572ae 100644
--- a/code/cgame/FxScheduler.h
+++ b/code/cgame/FxScheduler.h
@@ -412,7 +412,7 @@ struct SLoopedEffect
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(mId);
saved_game.write<int32_t>(mBoltInfo);
@@ -424,7 +424,7 @@ struct SLoopedEffect
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(mId);
saved_game.read<int32_t>(mBoltInfo);
diff --git a/code/cgame/cg_main.cpp b/code/cgame/cg_main.cpp
index 58331c7..725c9ce 100644
--- a/code/cgame/cg_main.cpp
+++ b/code/cgame/cg_main.cpp
@@ -28,7 +28,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#include "../qcommon/sstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
//NOTENOTE: Be sure to change the mirrored code in g_shared.h
typedef std::map< sstring_t, unsigned char > namePrecache_m;
@@ -1907,28 +1907,28 @@ static void CG_GameStateReceived( void ) {
void CG_WriteTheEvilCGHackStuff()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'P', 'S', 'L'),
::cg.forcepowerSelect);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('I', 'V', 'S', 'L'),
::cg.inventorySelect);
}
void CG_ReadTheEvilCGHackStuff()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'P', 'S', 'L'),
::gi_cg_forcepowerSelect);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('I', 'V', 'S', 'L'),
::gi_cg_inventorySelect);
diff --git a/code/client/cl_main.cpp b/code/client/cl_main.cpp
index 3be1fd3..d02fe0d 100644
--- a/code/client/cl_main.cpp
+++ b/code/client/cl_main.cpp
@@ -32,7 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../ghoul2/G2.h"
#include "qcommon/stringed_ingame.h"
#include "sys/sys_loadlib.h"
-#include "qcommon/ojk_saved_game_file.h"
+#include "qcommon/ojk_saved_game.h"
#define RETRANSMIT_TIMEOUT 3000 // time between connection packet retransmits
@@ -1181,7 +1181,7 @@ void CL_InitRef( void ) {
rit.SV_PointContents = SV_PointContents;
- rit.saved_game = &ojk::SavedGameFile::get_instance();
+ rit.saved_game = &ojk::SavedGame::get_instance();
ret = GetRefAPI( REF_API_VERSION, &rit );
diff --git a/code/game/CMakeLists.txt b/code/game/CMakeLists.txt
index 9fa65ce..8000d20 100644
--- a/code/game/CMakeLists.txt
+++ b/code/game/CMakeLists.txt
@@ -261,9 +261,9 @@ set(SPGameCommonFiles
"${SPDir}/qcommon/q_shared.cpp"
"${SPDir}/qcommon/q_shared.h"
"${SPDir}/rd-common/mdx_format.h"
- "${SharedDir}/qcommon/ojk_i_saved_game_file.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper_fwd.h"
+ "${SharedDir}/qcommon/ojk_i_saved_game.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper_fwd.h"
"${SharedDir}/qcommon/ojk_scope_guard.h"
${SharedCommonFiles}
)
diff --git a/code/game/G_Timer.cpp b/code/game/G_Timer.cpp
index b16fabc..90b5e3b 100644
--- a/code/game/G_Timer.cpp
+++ b/code/game/G_Timer.cpp
@@ -22,7 +22,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#include "../Rufl/hstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
#define MAX_GTIMERS 16384
@@ -159,7 +159,7 @@ void TIMER_Save( void )
int j;
gentity_t *ent;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
for ( j = 0, ent = &g_entities[0]; j < MAX_GENTITIES; j++, ent++ )
@@ -175,7 +175,7 @@ void TIMER_Save( void )
}
//Write out the timer information
- sgfh.write_chunk<uint8_t>(
+ saved_game.write_chunk<uint8_t>(
INT_ID('T', 'I', 'M', 'E'),
numTimers);
@@ -191,13 +191,13 @@ void TIMER_Save( void )
assert( length < 1024 );//This will cause problems when loading the timer if longer
//Write out the id string
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('T', 'M', 'I', 'D'),
timerID,
length);
//Write out the timer data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'D', 'T', 'A'),
time);
@@ -217,14 +217,14 @@ void TIMER_Load( void )
int j;
gentity_t *ent;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
for ( j = 0, ent = &g_entities[0]; j < MAX_GENTITIES; j++, ent++ )
{
unsigned char numTimers;
- sgfh.read_chunk<uint8_t>(
+ saved_game.read_chunk<uint8_t>(
INT_ID('T', 'I', 'M', 'E'),
numTimers);
@@ -237,13 +237,13 @@ void TIMER_Load( void )
assert (sizeof(g_timers[0]->time) == sizeof(time) );//make sure we're reading the same size as we wrote
//Read the id string and time
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('T', 'M', 'I', 'D'));
auto sg_buffer_data = static_cast<const char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
- const auto sg_buffer_size = sgfh.get_buffer_size();
+ const auto sg_buffer_size = saved_game.get_buffer_size();
std::uninitialized_copy_n(
sg_buffer_data,
@@ -252,7 +252,7 @@ void TIMER_Load( void )
tempBuffer[sg_buffer_size] = '\0';
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'D', 'T', 'A'),
time);
diff --git a/code/game/Q3_Interface.cpp b/code/game/Q3_Interface.cpp
index d8b9ae4..5f8a5f6 100644
--- a/code/game/Q3_Interface.cpp
+++ b/code/game/Q3_Interface.cpp
@@ -40,7 +40,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "wp_saber.h"
#include "g_vehicles.h"
#include "g_navigator.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern cvar_t *com_buildScript;
@@ -7208,10 +7208,10 @@ void CQuake3GameInterface::VariableSaveFloats( varFloat_m &fmap )
{
int numFloats = fmap.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'V', 'A', 'R'),
numFloats);
@@ -7222,17 +7222,17 @@ void CQuake3GameInterface::VariableSaveFloats( varFloat_m &fmap )
int idSize = strlen( ((*vfi).first).c_str() );
//Save out the real data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'I', 'D', 'L'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('F', 'I', 'D', 'S'),
((*vfi).first).c_str(),
idSize);
//Save out the float value
- sgfh.write_chunk<float>(
+ saved_game.write_chunk<float>(
INT_ID('F', 'V', 'A', 'L'),
(*vfi).second);
}
@@ -7248,10 +7248,10 @@ void CQuake3GameInterface::VariableSaveStrings( varString_m &smap )
{
int numStrings = smap.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'V', 'A', 'R'),
numStrings);
@@ -7262,11 +7262,11 @@ void CQuake3GameInterface::VariableSaveStrings( varString_m &smap )
int idSize = strlen( ((*vsi).first).c_str() );
//Save out the real data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'I', 'D', 'L'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'I', 'D', 'S'),
((*vsi).first).c_str(),
idSize);
@@ -7274,11 +7274,11 @@ void CQuake3GameInterface::VariableSaveStrings( varString_m &smap )
//Save out the string value
idSize = strlen( ((*vsi).second).c_str() );
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'V', 'S', 'Z'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'V', 'A', 'L'),
((*vsi).second).c_str(),
idSize);
@@ -7311,10 +7311,10 @@ void CQuake3GameInterface::VariableLoadFloats( varFloat_m &fmap )
int numFloats;
char tempBuffer[1024];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'V', 'A', 'R'),
numFloats);
@@ -7322,11 +7322,11 @@ void CQuake3GameInterface::VariableLoadFloats( varFloat_m &fmap )
{
int idSize;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'I', 'D', 'L'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('F', 'I', 'D', 'S'),
tempBuffer,
idSize);
@@ -7335,7 +7335,7 @@ void CQuake3GameInterface::VariableLoadFloats( varFloat_m &fmap )
float val;
- sgfh.read_chunk<float>(
+ saved_game.read_chunk<float>(
INT_ID('F', 'V', 'A', 'L'),
val);
@@ -7356,10 +7356,10 @@ void CQuake3GameInterface::VariableLoadStrings( int type, varString_m &fmap )
char tempBuffer[1024];
char tempBuffer2[1024];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'V', 'A', 'R'),
numFloats);
@@ -7367,22 +7367,22 @@ void CQuake3GameInterface::VariableLoadStrings( int type, varString_m &fmap )
{
int idSize;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'I', 'D', 'L'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'I', 'D', 'S'),
tempBuffer,
idSize);
tempBuffer[ idSize ] = 0;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'V', 'S', 'Z'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'V', 'A', 'L'),
tempBuffer2,
idSize);
@@ -11166,7 +11166,7 @@ void CQuake3GameInterface::FreeVariable( const char *name )
}
//Save / Load functions
-ojk::ISavedGameFile* CQuake3GameInterface::get_saved_game_file()
+ojk::ISavedGame* CQuake3GameInterface::get_saved_game_file()
{
return ::gi.saved_game;
}
diff --git a/code/game/Q3_Interface.h b/code/game/Q3_Interface.h
index 1f36f13..9f7c7b8 100644
--- a/code/game/Q3_Interface.h
+++ b/code/game/Q3_Interface.h
@@ -699,7 +699,7 @@ public:
//Save / Load functions
int LinkGame( int entID, int icarusID );
- ojk::ISavedGameFile* get_saved_game_file() override;
+ ojk::ISavedGame* get_saved_game_file() override;
// Access functions
int CreateIcarus( int entID);
diff --git a/code/game/ai.h b/code/game/ai.h
index b7739de..dc3e533 100644
--- a/code/game/ai.h
+++ b/code/game/ai.h
@@ -125,7 +125,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(number);
saved_game.write<int32_t>(waypoint);
@@ -134,7 +134,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(number);
saved_game.read<int32_t>(waypoint);
@@ -168,7 +168,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(numGroup);
saved_game.write<int32_t>(processed);
@@ -190,7 +190,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(numGroup);
saved_game.read<int32_t>(processed);
diff --git a/code/game/b_public.h b/code/game/b_public.h
index d8d7971..f10e76f 100644
--- a/code/game/b_public.h
+++ b/code/game/b_public.h
@@ -159,7 +159,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(aggression);
saved_game.write<int32_t>(aim);
@@ -182,7 +182,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(aggression);
saved_game.read<int32_t>(aim);
@@ -384,7 +384,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(timeOfDeath);
saved_game.write<int32_t>(touchedByPlayer);
@@ -506,7 +506,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(timeOfDeath);
saved_game.read<int32_t>(touchedByPlayer);
diff --git a/code/game/bg_public.h b/code/game/bg_public.h
index a016416..1a884f2 100644
--- a/code/game/bg_public.h
+++ b/code/game/bg_public.h
@@ -466,7 +466,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<uint16_t>(firstFrame);
saved_game.write<uint16_t>(numFrames);
@@ -476,7 +476,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<uint16_t>(firstFrame);
saved_game.read<uint16_t>(numFrames);
@@ -548,7 +548,7 @@ typedef struct animevent_s
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(eventType);
saved_game.write<int16_t>(modelOnly);
@@ -559,7 +559,7 @@ typedef struct animevent_s
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(eventType);
saved_game.read<int16_t>(modelOnly);
diff --git a/code/game/g_local.h b/code/game/g_local.h
index 2bca16f..4f1a64c 100644
--- a/code/game/g_local.h
+++ b/code/game/g_local.h
@@ -100,7 +100,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(filename);
saved_game.write<>(animations);
@@ -112,7 +112,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(filename);
saved_game.read<>(animations);
@@ -187,7 +187,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(position);
saved_game.write<float>(radius);
@@ -202,7 +202,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(position);
saved_game.read<float>(radius);
@@ -302,7 +302,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(clients);
saved_game.write<int32_t>(maxclients);
@@ -324,7 +324,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(clients);
saved_game.read<int32_t>(maxclients);
diff --git a/code/game/g_main.cpp b/code/game/g_main.cpp
index b6dc728..428f4d9 100644
--- a/code/game/g_main.cpp
+++ b/code/game/g_main.cpp
@@ -36,7 +36,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../ghoul2/ghoul2_gore.h"
//rww - RAGDOLL_END
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern void WP_SaberLoadParms( void );
extern qboolean G_PlayerSpawned( void );
@@ -107,20 +107,20 @@ qboolean PInUse(unsigned int entNum)
void WriteInUseBits()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<uint32_t>(
+ saved_game.write_chunk<uint32_t>(
INT_ID('I', 'N', 'U', 'S'),
::g_entityInUseBits);
}
void ReadInUseBits()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<uint32_t>(
+ saved_game.read_chunk<uint32_t>(
INT_ID('I', 'N', 'U', 'S'),
::g_entityInUseBits);
@@ -2121,10 +2121,10 @@ extern qboolean player_locked;
void G_LoadSave_WriteMiscData()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('L', 'C', 'K', 'D'),
::player_locked);
}
@@ -2133,10 +2133,10 @@ void G_LoadSave_WriteMiscData()
void G_LoadSave_ReadMiscData()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('L', 'C', 'K', 'D'),
::player_locked);
}
diff --git a/code/game/g_objectives.cpp b/code/game/g_objectives.cpp
index 5d61462..5073cf8 100644
--- a/code/game/g_objectives.cpp
+++ b/code/game/g_objectives.cpp
@@ -29,7 +29,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define G_OBJECTIVES_CPP
#include "objectives.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
qboolean missionInfo_Updated;
@@ -60,10 +60,10 @@ OBJ_SaveMissionObjectives
*/
void OBJ_SaveMissionObjectives( gclient_t *client )
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('O', 'B', 'J', 'T'),
client->sess.mission_objectives);
}
@@ -90,10 +90,10 @@ OBJ_LoadMissionObjectives
*/
void OBJ_LoadMissionObjectives( gclient_t *client )
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('O', 'B', 'J', 'T'),
client->sess.mission_objectives);
}
diff --git a/code/game/g_public.h b/code/game/g_public.h
index 2051b32..b553e2e 100644
--- a/code/game/g_public.h
+++ b/code/game/g_public.h
@@ -26,7 +26,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// g_public.h -- game module information visible to server
-#include "qcommon/ojk_i_saved_game_file.h"
+#include "qcommon/ojk_i_saved_game.h"
#define GAME_API_VERSION 8
@@ -190,7 +190,7 @@ typedef struct {
// Savegame handling
//
- ojk::ISavedGameFile* saved_game;
+ ojk::ISavedGame* saved_game;
// add commands to the console as if they were typed in
// for map changing, etc
diff --git a/code/game/g_roff.cpp b/code/game/g_roff.cpp
index 2c70b5f..49fe7d6 100644
--- a/code/game/g_roff.cpp
+++ b/code/game/g_roff.cpp
@@ -25,7 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "Q3_Interface.h"
#include "../cgame/cg_local.h"
#include "g_functions.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
// The list of precached ROFFs
roff_list_t roffs[MAX_ROFFS];
@@ -651,11 +651,11 @@ void G_SaveCachedRoffs()
{
int i, len;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// Write out the number of cached ROFFs
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('R', 'O', 'F', 'F'),
::num_roffs);
@@ -665,11 +665,11 @@ void G_SaveCachedRoffs()
// Dump out the string length to make things a bit easier on the other end...heh heh.
len = strlen( roffs[i].fileName ) + 1;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'L', 'E', 'N'),
len);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('R', 'S', 'T', 'R'),
roffs[i].fileName,
len);
@@ -688,22 +688,22 @@ void G_LoadCachedRoffs()
int i, count, len;
char buffer[MAX_QPATH];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// Get the count of goodies we need to revive
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('R', 'O', 'F', 'F'),
count);
// Now bring 'em back to life
for ( i = 0; i < count; i++ )
{
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'L', 'E', 'N'),
len);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('R', 'S', 'T', 'R'),
buffer,
len);
diff --git a/code/game/g_savegame.cpp b/code/game/g_savegame.cpp
index ea5e3a9..cc16c1f 100644
--- a/code/game/g_savegame.cpp
+++ b/code/game/g_savegame.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "objectives.h"
#include "../cgame/cg_camera.h"
#include "../qcommon/sstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern void OBJ_LoadTacticalInfo(void);
@@ -188,10 +188,10 @@ static char *GetStringPtr(int iStrlen, char *psOriginal/*may be NULL*/)
assert(iStrlen+1<=(int)sizeof(sString));
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S','T','R','G'),
sString,
iStrlen);
@@ -529,24 +529,24 @@ static void EnumerateFields(
}
}
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// save out raw data...
//
- sgfh.reset_buffer();
+ saved_game.reset_buffer();
src_instance->sg_export(
- sgfh);
+ saved_game);
- sgfh.write_chunk(
+ saved_game.write_chunk(
ulChid);
// save out any associated strings..
//
for (const auto& it : strList)
{
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'T', 'R', 'G'),
it.c_str(),
static_cast<int>(it.length() + 1));
@@ -803,26 +803,26 @@ static void EvaluateFields(
{
auto& instance = *pbData;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
if (ulChid != INT_ID('G', 'C', 'L', 'I'))
{
- sgfh.read_chunk(
+ saved_game.read_chunk(
ulChid,
instance);
}
else
{
- if (!sgfh.try_read_chunk(
+ if (!saved_game.try_read_chunk(
ulChid,
instance))
{
RetailGClient retail_client;
- sgfh.reset_buffer_offset();
+ saved_game.reset_buffer_offset();
- if (sgfh.try_read(
+ if (saved_game.try_read(
retail_client))
{
copy_retail_gclient_to_current(
@@ -903,10 +903,10 @@ static void WriteGEntities(qboolean qbAutosave)
}
}
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('N', 'M', 'E', 'D'),
iCount);
@@ -916,7 +916,7 @@ static void WriteGEntities(qboolean qbAutosave)
if ( ent->inuse)
{
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('E', 'D', 'N', 'M'),
i);
@@ -949,7 +949,7 @@ static void WriteGEntities(qboolean qbAutosave)
if (tempEnt.parms)
{
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('P', 'A', 'R', 'M'),
*ent->parms);
}
@@ -981,7 +981,7 @@ static void WriteGEntities(qboolean qbAutosave)
//
static int iBlah = 1234;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('I', 'C', 'O', 'K'),
iBlah);
}
@@ -996,10 +996,10 @@ static void ReadGEntities(qboolean qbAutosave)
int iCount;
int i;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('N', 'M', 'E', 'D'),
iCount);
@@ -1008,7 +1008,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
int iEntIndex;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('E', 'D', 'N', 'M'),
iEntIndex);
@@ -1123,7 +1123,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
parms_t tempParms;
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('P', 'A', 'R', 'M'),
tempParms);
@@ -1176,7 +1176,7 @@ static void ReadGEntities(qboolean qbAutosave)
// the scary ghoul2 stuff... (fingers crossed)
//
{
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('G', 'H', 'L', '2'));
gi.G2API_LoadGhoul2Models(pEnt->ghoul2, nullptr);
@@ -1243,7 +1243,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
static int iBlah = 1234;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('I', 'C', 'O', 'K'),
iBlah);
}
@@ -1283,17 +1283,17 @@ void WriteLevel(qboolean qbAutosave)
//
static int iDONE = 1234;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('D', 'O', 'N', 'E'),
iDONE);
}
void ReadLevel(qboolean qbAutosave, qboolean qbLoadTransition)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
if ( qbLoadTransition )
@@ -1322,7 +1322,7 @@ void ReadLevel(qboolean qbAutosave, qboolean qbLoadTransition)
ReadLevelLocals(); // level_locals_t level
//Read & throw away objective info
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('O', 'B', 'J', 'T'));
}
else
@@ -1357,7 +1357,7 @@ void ReadLevel(qboolean qbAutosave, qboolean qbLoadTransition)
//
static int iDONE = 1234;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('D', 'O', 'N', 'E'),
iDONE);
}
diff --git a/code/game/g_shared.h b/code/game/g_shared.h
index be3cf2e..e86103d 100644
--- a/code/game/g_shared.h
+++ b/code/game/g_shared.h
@@ -123,7 +123,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(infoValid);
saved_game.write<int8_t>(name);
@@ -145,7 +145,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(infoValid);
saved_game.read<int8_t>(name);
@@ -290,7 +290,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(legsModelName);
saved_game.write<int8_t>(torsoModelName);
@@ -347,7 +347,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(legsModelName);
saved_game.read<int8_t>(torsoModelName);
@@ -449,7 +449,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(state);
saved_game.write<int32_t>(captures);
@@ -465,7 +465,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(state);
saved_game.read<int32_t>(captures);
@@ -490,14 +490,14 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(display);
saved_game.write<int32_t>(status);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(display);
saved_game.read<int32_t>(status);
@@ -528,7 +528,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(secretsFound);
saved_game.write<int32_t>(totalSecrets);
@@ -547,7 +547,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(secretsFound);
saved_game.read<int32_t>(totalSecrets);
@@ -587,7 +587,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(missionObjectivesShown);
saved_game.write<int32_t>(sessionTeam);
@@ -596,7 +596,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(missionObjectivesShown);
saved_game.read<int32_t>(sessionTeam);
@@ -622,7 +622,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(connected);
saved_game.write<>(lastCommand);
@@ -636,7 +636,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(connected);
saved_game.read<>(lastCommand);
@@ -792,7 +792,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<>(ps);
saved_game.write<>(pers);
@@ -858,7 +858,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<>(ps);
saved_game.read<>(pers);
@@ -939,13 +939,13 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(parm);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(parm);
}
@@ -1282,7 +1282,7 @@ Ghoul2 Insert End
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<>(s);
saved_game.write<int32_t>(client);
@@ -1471,7 +1471,7 @@ Ghoul2 Insert End
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<>(s);
saved_game.read<int32_t>(client);
diff --git a/code/game/g_vehicles.h b/code/game/g_vehicles.h
index 7e4845a..ce36437 100644
--- a/code/game/g_vehicles.h
+++ b/code/game/g_vehicles.h
@@ -468,7 +468,7 @@ struct Muzzle
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(m_vMuzzlePos);
saved_game.write<float>(m_vMuzzleDir);
@@ -478,7 +478,7 @@ struct Muzzle
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(m_vMuzzlePos);
saved_game.read<float>(m_vMuzzleDir);
@@ -524,7 +524,7 @@ typedef struct
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(linked);
saved_game.write<int32_t>(ammo);
@@ -533,7 +533,7 @@ typedef struct
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(linked);
saved_game.read<int32_t>(ammo);
@@ -557,7 +557,7 @@ typedef struct
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(ammo);
saved_game.write<int32_t>(lastAmmoInc);
@@ -567,7 +567,7 @@ typedef struct
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(ammo);
saved_game.read<int32_t>(lastAmmoInc);
@@ -694,7 +694,7 @@ struct Vehicle_t
void Vehicle_t::sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(m_pPilot);
saved_game.write<int32_t>(m_iPilotTime);
@@ -741,7 +741,7 @@ struct Vehicle_t
}
void Vehicle_t::sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(m_pPilot);
saved_game.read<int32_t>(m_iPilotTime);
diff --git a/code/game/ghoul2_shared.h b/code/game/ghoul2_shared.h
index 2a77e20..8cf64dd 100644
--- a/code/game/ghoul2_shared.h
+++ b/code/game/ghoul2_shared.h
@@ -60,7 +60,7 @@ surfaceInfo_t():
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(offFlags);
saved_game.write<int32_t>(surface);
@@ -71,7 +71,7 @@ surfaceInfo_t():
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(offFlags);
saved_game.read<int32_t>(surface);
@@ -216,7 +216,7 @@ boneInfo_t():
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(boneNumber);
saved_game.write<>(matrix);
@@ -292,7 +292,7 @@ boneInfo_t():
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(boneNumber);
saved_game.read<>(matrix);
@@ -382,7 +382,7 @@ struct boltInfo_t{
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(boneNumber);
saved_game.write<int32_t>(surfaceNumber);
@@ -391,7 +391,7 @@ struct boltInfo_t{
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(boneNumber);
saved_game.read<int32_t>(surfaceNumber);
@@ -516,7 +516,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(mModelindex);
@@ -544,7 +544,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(mModelindex);
@@ -723,13 +723,13 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(mItem);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(mItem);
}
@@ -764,7 +764,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(mDistance);
saved_game.write<int32_t>(mEntityNum);
@@ -781,7 +781,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(mDistance);
saved_game.read<int32_t>(mEntityNum);
diff --git a/code/icarus/IcarusImplementation.cpp b/code/icarus/IcarusImplementation.cpp
index 7ba36bc..2fe169a 100644
--- a/code/icarus/IcarusImplementation.cpp
+++ b/code/icarus/IcarusImplementation.cpp
@@ -33,7 +33,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
#define STL_ITERATE( a, b ) for ( a = b.begin(); a != b.end(); ++a )
#define STL_INSERT( a, b ) a.insert( a.end(), b );
@@ -539,13 +539,13 @@ int CIcarus::Save()
IGameInterface* game = IGameInterface::GetGame(m_flavor);
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
game->get_saved_game_file());
//Save out a ICARUS save block header with the ICARUS version
double version = ICARUS_VERSION;
- sgfh.write_chunk<double>(
+ saved_game.write_chunk<double>(
INT_ID('I', 'C', 'A', 'R'),
version);
@@ -571,7 +571,7 @@ int CIcarus::Save()
}
// Write out the buffer with all our collected data.
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('I', 'S', 'E', 'Q'),
m_byBuffer,
static_cast<int>(m_ulBufferCurPos));
@@ -688,7 +688,7 @@ int CIcarus::Load()
IGameInterface* game = IGameInterface::GetGame(m_flavor);
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
game->get_saved_game_file());
//Clear out any old information
@@ -697,7 +697,7 @@ int CIcarus::Load()
//Check to make sure we're at the ICARUS save block
double version;
- sgfh.read_chunk<double>(
+ saved_game.read_chunk<double>(
INT_ID('I', 'C', 'A', 'R'),
version);
@@ -710,13 +710,13 @@ int CIcarus::Load()
}
// Read into the buffer all our data.
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('I','S','E','Q'));
auto sg_buffer_data = static_cast<const unsigned char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
- const auto sg_buffer_size = sgfh.get_buffer_size();
+ const auto sg_buffer_size = saved_game.get_buffer_size();
std::uninitialized_copy_n(
sg_buffer_data,
@@ -810,10 +810,10 @@ void CIcarus::BufferWrite( void *pSrcData, unsigned long ulNumBytesToWrite )
{ // Write out the buffer with all our collected data so far...
IGameInterface::GetGame()->DebugPrint( IGameInterface::WL_ERROR, "BufferWrite: Out of buffer space, Flushing." );
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
IGameInterface::GetGame()->get_saved_game_file());
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('I', 'S', 'E', 'Q'),
m_byBuffer,
static_cast<int>(m_ulBufferCurPos));
@@ -840,16 +840,16 @@ void CIcarus::BufferRead( void *pDstBuff, unsigned long ulNumBytesToRead )
IGameInterface::GetGame()->DebugPrint( IGameInterface::WL_ERROR, "BufferRead: Buffer underflow, Looking for new block." );
// Read in the next block.
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
IGameInterface::GetGame()->get_saved_game_file());
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('I', 'S', 'E', 'Q'));
auto sg_buffer_data = static_cast<const unsigned char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
- const auto sg_buffer_size = sgfh.get_buffer_size();
+ const auto sg_buffer_size = saved_game.get_buffer_size();
std::uninitialized_copy_n(
sg_buffer_data,
diff --git a/code/icarus/IcarusInterface.h b/code/icarus/IcarusInterface.h
index 26265c1..9c9d451 100644
--- a/code/icarus/IcarusInterface.h
+++ b/code/icarus/IcarusInterface.h
@@ -145,7 +145,7 @@ public:
// Save / Load functions
virtual int LinkGame( int gameID, int icarusID ) = 0;
- virtual ojk::ISavedGameFile* get_saved_game_file() = 0;
+ virtual ojk::ISavedGame* get_saved_game_file() = 0;
// Access functions
diff --git a/code/qcommon/cm_load.cpp b/code/qcommon/cm_load.cpp
index 459ead7..80886cf 100644
--- a/code/qcommon/cm_load.cpp
+++ b/code/qcommon/cm_load.cpp
@@ -24,8 +24,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// cmodel.c -- model loading
#include "cm_local.h"
-#include "qcommon/ojk_saved_game_file.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game.h"
+#include "qcommon/ojk_saved_game_helper.h"
#ifdef BSPC
void SetPlaneSignbits (cplane_t *out) {
@@ -1217,10 +1217,10 @@ int SG_Read(unsigned int chid, void *pvAddress, int iLength, void **ppvAddressPt
void CM_WritePortalState()
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('P', 'R', 'T', 'S'),
::cmg.areaPortals,
::cmg.numAreas * ::cmg.numAreas);
@@ -1236,10 +1236,10 @@ and recalculates the area connections
*/
void CM_ReadPortalState()
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('P', 'R', 'T', 'S'),
::cmg.areaPortals,
::cmg.numAreas * ::cmg.numAreas);
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 96cadd8..a79f6ad 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -162,7 +162,7 @@ float FloatSwap( const float *f );
#include "qcommon/q_platform.h"
-#include "qcommon/ojk_saved_game_file_helper_fwd.h"
+#include "qcommon/ojk_saved_game_helper_fwd.h"
// ================================================================
@@ -1233,7 +1233,7 @@ typedef struct cplane_s {
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(normal);
saved_game.write<float>(dist);
@@ -1243,7 +1243,7 @@ typedef struct cplane_s {
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(normal);
saved_game.read<float>(dist);
@@ -1286,7 +1286,7 @@ Ghoul2 Insert End
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(allsolid);
saved_game.write<int8_t>(startsolid);
@@ -1300,7 +1300,7 @@ Ghoul2 Insert End
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(allsolid);
saved_game.read<int8_t>(startsolid);
@@ -1585,7 +1585,7 @@ typedef struct
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(inAction);
saved_game.write<int32_t>(duration);
@@ -1598,7 +1598,7 @@ typedef struct
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(inAction);
saved_game.read<int32_t>(duration);
@@ -1640,7 +1640,7 @@ typedef struct
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(active);
saved_game.write<int32_t>(color);
@@ -1656,7 +1656,7 @@ typedef struct
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(active);
saved_game.read<int32_t>(color);
@@ -1961,7 +1961,7 @@ typedef struct
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(name);
saved_game.write<int32_t>(fullName);
@@ -2042,7 +2042,7 @@ typedef struct
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(name);
saved_game.read<int32_t>(fullName);
@@ -2243,7 +2243,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(name);
saved_game.write<int32_t>(fullName);
@@ -2275,7 +2275,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(name);
saved_game.read<int32_t>(fullName);
@@ -2652,7 +2652,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(commandTime);
saved_game.write<int32_t>(pm_type);
@@ -2821,7 +2821,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(commandTime);
saved_game.read<int32_t>(pm_type);
@@ -3047,7 +3047,7 @@ typedef struct usercmd_s {
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(serverTime);
saved_game.write<int32_t>(buttons);
@@ -3061,7 +3061,7 @@ typedef struct usercmd_s {
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(serverTime);
saved_game.read<int32_t>(buttons);
@@ -3099,7 +3099,7 @@ typedef struct {// !!!!!!!!!!! LOADSAVE-affecting struct !!!!!!!!!!
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(trType);
saved_game.write<int32_t>(trTime);
@@ -3109,7 +3109,7 @@ typedef struct {// !!!!!!!!!!! LOADSAVE-affecting struct !!!!!!!!!!
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(trType);
saved_game.read<int32_t>(trTime);
@@ -3205,7 +3205,7 @@ Ghoul2 Insert End
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(number);
saved_game.write<int32_t>(eType);
@@ -3261,7 +3261,7 @@ Ghoul2 Insert End
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(number);
saved_game.read<int32_t>(eType);
diff --git a/code/rd-common/mdx_format.h b/code/rd-common/mdx_format.h
index 14e4c16..29bca78 100644
--- a/code/rd-common/mdx_format.h
+++ b/code/rd-common/mdx_format.h
@@ -164,13 +164,13 @@ typedef struct {
#ifdef __cplusplus
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(matrix);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(matrix);
}
diff --git a/code/rd-common/tr_public.h b/code/rd-common/tr_public.h
index 7af64cb..f14af68 100644
--- a/code/rd-common/tr_public.h
+++ b/code/rd-common/tr_public.h
@@ -112,7 +112,7 @@ typedef struct {
const int passEntityNum, const int contentmask,
const EG2_Collision eG2TraceType, const int useLod );
- ojk::ISavedGameFile* saved_game;
+ ojk::ISavedGame* saved_game;
int (*SV_PointContents) ( const vec3_t p, clipHandle_t model );
diff --git a/code/rd-vanilla/CMakeLists.txt b/code/rd-vanilla/CMakeLists.txt
index 08f06ed..b947b99 100644
--- a/code/rd-vanilla/CMakeLists.txt
+++ b/code/rd-vanilla/CMakeLists.txt
@@ -78,9 +78,9 @@ if(BuildSPRdVanilla OR BuildJK2SPRdVanilla)
"${SPDir}/qcommon/q_math.cpp"
"${SPDir}/qcommon/q_shared.cpp"
"${SPDir}/qcommon/q_shared.h"
- "${SharedDir}/qcommon/ojk_i_saved_game_file.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper_fwd.h"
+ "${SharedDir}/qcommon/ojk_i_saved_game.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper_fwd.h"
"${SharedDir}/qcommon/ojk_scope_guard.h"
${SharedCommonFiles}
)
diff --git a/code/rd-vanilla/G2_misc.cpp b/code/rd-vanilla/G2_misc.cpp
index cb85f4e..069b8ab 100644
--- a/code/rd-vanilla/G2_misc.cpp
+++ b/code/rd-vanilla/G2_misc.cpp
@@ -48,7 +48,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include <float.h>
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
#ifdef _G2_GORE
#include "../ghoul2/ghoul2_gore.h"
@@ -1784,10 +1784,10 @@ const auto BONE_SAVE_BLOCK_SIZE = static_cast<int>(sizeof(SgBoneInfo));
void G2_SaveGhoul2Models(
CGhoul2Info_v& ghoul2)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::ri.saved_game);
- sgfh.reset_buffer();
+ saved_game.reset_buffer();
// is there anything to save?
if (!ghoul2.IsValid() || ghoul2.size() == 0)
@@ -1795,14 +1795,14 @@ void G2_SaveGhoul2Models(
const int zero_size = 0;
#ifdef JK2_MODE
- sgfh.write<int32_t>(
+ saved_game.write<int32_t>(
zero_size);
- sgfh.write_chunk_and_size<int32_t>(
+ saved_game.write_chunk_and_size<int32_t>(
INT_ID('G', 'L', '2', 'S'),
INT_ID('G', 'H', 'L', '2'));
#else
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('G', 'H', 'L', '2'),
zero_size); //write out a zero buffer
#endif // JK2_MODE
@@ -1814,61 +1814,61 @@ void G2_SaveGhoul2Models(
// save out how many ghoul2 models we have
auto model_count = ghoul2.size();
- sgfh.write<int32_t>(
+ saved_game.write<int32_t>(
model_count);
for (decltype(model_count) i = 0; i < model_count; ++i)
{
// first save out the ghoul2 details themselves
ghoul2[i].sg_export(
- sgfh);
+ saved_game);
// save out how many surfaces we have
auto surface_count = ghoul2[i].mSlist.size();
- sgfh.write<int32_t>(
+ saved_game.write<int32_t>(
surface_count);
// now save the all the surface list info
for (decltype(surface_count) x = 0; x < surface_count; ++x)
{
ghoul2[i].mSlist[x].sg_export(
- sgfh);
+ saved_game);
}
// save out how many bones we have
auto bone_count = ghoul2[i].mBlist.size();
- sgfh.write<int32_t>(
+ saved_game.write<int32_t>(
bone_count);
// now save the all the bone list info
for (decltype(bone_count) x = 0; x < bone_count; ++x)
{
ghoul2[i].mBlist[x].sg_export(
- sgfh);
+ saved_game);
}
// save out how many bolts we have
auto bolt_count = ghoul2[i].mBltlist.size();
- sgfh.write<int32_t>(
+ saved_game.write<int32_t>(
bolt_count);
// lastly save the all the bolt list info
for (decltype(bolt_count) x = 0; x < bolt_count; ++x)
{
ghoul2[i].mBltlist[x].sg_export(
- sgfh);
+ saved_game);
}
}
#ifdef JK2_MODE
- sgfh.write_chunk_and_size<int32_t>(
+ saved_game.write_chunk_and_size<int32_t>(
INT_ID('G', 'L', '2', 'S'),
INT_ID('G', 'H', 'L', '2'));
#else
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('G', 'H', 'L', '2'));
#endif // JK2_MODE
}
@@ -1880,18 +1880,18 @@ void G2_LoadGhoul2Model(
{
static_cast<void>(buffer);
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::ri.saved_game);
// first thing, lets see how many ghoul2 models we have, and resize our buffers accordingly
int model_count = 0;
#ifdef JK2_MODE
- if (sgfh.get_buffer_size() > 0)
+ if (saved_game.get_buffer_size() > 0)
{
#endif // JK2_MODE
- sgfh.read<int32_t>(
+ saved_game.read<int32_t>(
model_count);
#ifdef JK2_MODE
@@ -1919,7 +1919,7 @@ void G2_LoadGhoul2Model(
// load the ghoul2 info from the buffer
ghoul2[i].sg_import(
- sgfh);
+ saved_game);
if (ghoul2[i].mModelindex != -1 && ghoul2[i].mFileName[0])
{
@@ -1932,7 +1932,7 @@ void G2_LoadGhoul2Model(
// give us enough surfaces to load up the data
auto surface_count = 0;
- sgfh.read<int32_t>(
+ saved_game.read<int32_t>(
surface_count);
ghoul2[i].mSlist.resize(surface_count);
@@ -1941,13 +1941,13 @@ void G2_LoadGhoul2Model(
for (decltype(surface_count) x = 0; x < surface_count; ++x)
{
ghoul2[i].mSlist[x].sg_import(
- sgfh);
+ saved_game);
}
// give us enough bones to load up the data
auto bone_count = 0;
- sgfh.read<int32_t>(
+ saved_game.read<int32_t>(
bone_count);
ghoul2[i].mBlist.resize(
@@ -1957,13 +1957,13 @@ void G2_LoadGhoul2Model(
for (decltype(bone_count) x = 0; x < bone_count; ++x)
{
ghoul2[i].mBlist[x].sg_import(
- sgfh);
+ saved_game);
}
// give us enough bolts to load up the data
auto bolt_count = 0;
- sgfh.read<int32_t>(
+ saved_game.read<int32_t>(
bolt_count);
ghoul2[i].mBltlist.resize(
@@ -1973,9 +1973,9 @@ void G2_LoadGhoul2Model(
for (decltype(bolt_count) x = 0; x < bolt_count; ++x)
{
ghoul2[i].mBltlist[x].sg_import(
- sgfh);
+ saved_game);
}
}
- sgfh.ensure_all_data_read();
+ saved_game.ensure_all_data_read();
}
diff --git a/code/server/sv_game.cpp b/code/server/sv_game.cpp
index 65b2d6a..4f70799 100644
--- a/code/server/sv_game.cpp
+++ b/code/server/sv_game.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "server.h"
#include "../client/vmachine.h"
#include "../client/client.h"
-#include "qcommon/ojk_saved_game_file.h"
+#include "qcommon/ojk_saved_game.h"
/*#include "..\renderer\tr_local.h"
#include "..\renderer\tr_WorldEffects.h"*/
/*
@@ -944,7 +944,7 @@ void SV_InitGameProgs (void) {
import.FS_FreeFile = FS_FreeFile;
import.FS_GetFileList = FS_GetFileList;
- import.saved_game = &ojk::SavedGameFile::get_instance();
+ import.saved_game = &ojk::SavedGame::get_instance();
import.AdjustAreaPortalState = SV_AdjustAreaPortalState;
import.AreasConnected = CM_AreasConnected;
diff --git a/code/server/sv_savegame.cpp b/code/server/sv_savegame.cpp
index 02deab7..c0de632 100644
--- a/code/server/sv_savegame.cpp
+++ b/code/server/sv_savegame.cpp
@@ -37,8 +37,8 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include <map>
-#include "qcommon/ojk_saved_game_file.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game.h"
+#include "qcommon/ojk_saved_game_helper.h"
static char saveGameComment[iSG_COMMENT_SIZE];
@@ -112,7 +112,7 @@ static const char *GetString_FailedToOpenSaveGame(const char *psFilename, qboole
void SG_WipeSavegame(
const char* psPathlessBaseName)
{
- ojk::SavedGameFile::remove(
+ ojk::SavedGame::remove(
psPathlessBaseName);
}
@@ -121,7 +121,7 @@ void SG_WipeSavegame(
//
void SG_Shutdown()
{
- auto& saved_game = ojk::SavedGameFile::get_instance();
+ auto& saved_game = ojk::SavedGame::get_instance();
saved_game.close();
@@ -398,10 +398,10 @@ void SV_SaveGame_f(void)
//---------------
static void WriteGame(qboolean autosave)
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('G', 'A', 'M', 'E'),
autosave);
@@ -419,7 +419,7 @@ static void WriteGame(qboolean autosave)
memset(s,0,sizeof(s));
Cvar_VariableStringBuffer( sCVARNAME_PLAYERSAVE, s, sizeof(s) );
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('C', 'V', 'S', 'V'),
s);
@@ -428,7 +428,7 @@ static void WriteGame(qboolean autosave)
memset(s,0,sizeof(s));
Cvar_VariableStringBuffer( "playerammo", s, sizeof(s) );
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('A', 'M', 'M', 'O'),
s);
@@ -437,7 +437,7 @@ static void WriteGame(qboolean autosave)
memset(s,0,sizeof(s));
Cvar_VariableStringBuffer( "playerinv", s, sizeof(s) );
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('I', 'V', 'T', 'Y'),
s);
@@ -446,7 +446,7 @@ static void WriteGame(qboolean autosave)
memset(s,0,sizeof(s));
Cvar_VariableStringBuffer( "playerfplvl", s, sizeof(s) );
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('F', 'P', 'L', 'V'),
s);
}
@@ -456,10 +456,10 @@ static qboolean ReadGame (void)
{
qboolean qbAutoSave;
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('G', 'A', 'M', 'E'),
qbAutoSave);
@@ -471,7 +471,7 @@ static qboolean ReadGame (void)
//
memset(s,0,sizeof(s));
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'V', 'S', 'V'),
s);
@@ -481,7 +481,7 @@ static qboolean ReadGame (void)
//
memset(s,0,sizeof(s));
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('A', 'M', 'M', 'O'),
s);
@@ -491,7 +491,7 @@ static qboolean ReadGame (void)
//
memset(s,0,sizeof(s));
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('I', 'V', 'T', 'Y'),
s);
@@ -501,7 +501,7 @@ static qboolean ReadGame (void)
//
memset(s,0,sizeof(s));
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('F', 'P', 'L', 'V'),
s);
@@ -524,8 +524,8 @@ void SG_WriteCvars(void)
cvar_t *var;
int iCount = 0;
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
// count the cvars...
//
@@ -544,7 +544,7 @@ void SG_WriteCvars(void)
// store count...
//
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('C', 'V', 'C', 'N'),
iCount);
@@ -561,12 +561,12 @@ void SG_WriteCvars(void)
continue;
}
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('C', 'V', 'A', 'R'),
var->name,
static_cast<int>(strlen(var->name) + 1));
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('V', 'A', 'L', 'U'),
var->string,
static_cast<int>(strlen(var->string) + 1));
@@ -579,27 +579,27 @@ void SG_ReadCvars()
std::string psName;
const char* psValue;
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('C', 'V', 'C', 'N'),
iCount);
for (int i = 0; i < iCount; ++i)
{
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'V', 'A', 'R'));
psName = reinterpret_cast<const char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('V', 'A', 'L', 'U'));
psValue = reinterpret_cast<const char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
::Cvar_Set(psName.c_str(), psValue);
}
@@ -607,8 +607,8 @@ void SG_ReadCvars()
void SG_WriteServerConfigStrings()
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
int iCount = 0;
int i; // not in FOR statement in case compiler goes weird by reg-optimising it then failing to get the address later
@@ -626,7 +626,7 @@ void SG_WriteServerConfigStrings()
}
}
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('C', 'S', 'C', 'N'),
iCount);
@@ -638,11 +638,11 @@ void SG_WriteServerConfigStrings()
{
if (sv.configstrings[i] && strlen(sv.configstrings[i]))
{
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('C', 'S', 'I', 'N'),
i);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('C', 'S', 'D', 'A'),
::sv.configstrings[i],
static_cast<int>(strlen(::sv.configstrings[i]) + 1));
@@ -671,10 +671,10 @@ void SG_ReadServerConfigStrings( void )
//
int iCount;
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('C', 'S', 'C', 'N'),
iCount);
@@ -685,15 +685,15 @@ void SG_ReadServerConfigStrings( void )
int iIndex;
const char *psName;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('C', 'S', 'I', 'N'),
iIndex);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'S', 'D', 'A'));
psName = reinterpret_cast<const char*>(
- sgfh.get_buffer_data());
+ saved_game.get_buffer_data());
Com_DPrintf( "Cfg str %d = %s\n",iIndex, psName);
@@ -709,8 +709,8 @@ static unsigned int SG_UnixTimestamp ( const time_t& t )
static void SG_WriteComment(qboolean qbAutosave, const char *psMapName)
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
char sComment[iSG_COMMENT_SIZE];
@@ -723,14 +723,14 @@ static void SG_WriteComment(qboolean qbAutosave, const char *psMapName)
Q_strncpyz(sComment,saveGameComment, sizeof(sComment));
}
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('C', 'O', 'M', 'M'),
sComment);
// Add Date/Time/Map stamp
unsigned int timestamp = SG_UnixTimestamp (time (NULL));
- sgfh.write_chunk<uint32_t>(
+ saved_game.write_chunk<uint32_t>(
INT_ID('C', 'M', 'T', 'M'),
timestamp);
@@ -752,9 +752,9 @@ int SG_GetSaveGameComment(
{
auto ret = 0;
- auto& saved_game = ojk::SavedGameFile::get_instance();
+ auto& saved_game = ojk::SavedGame::get_instance();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
&saved_game);
if (!saved_game.open(
@@ -765,7 +765,7 @@ int SG_GetSaveGameComment(
bool is_succeed = true;
- is_succeed = sgfh.try_read_chunk(
+ is_succeed = saved_game.try_read_chunk(
INT_ID('C', 'O', 'M', 'M'),
sComment,
iSG_COMMENT_SIZE);
@@ -776,7 +776,7 @@ int SG_GetSaveGameComment(
{
unsigned int fileTime = 0;
- is_succeed = sgfh.try_read_chunk<uint32_t>(
+ is_succeed = saved_game.try_read_chunk<uint32_t>(
INT_ID('C', 'M', 'T', 'M'),
fileTime);
@@ -792,21 +792,21 @@ int SG_GetSaveGameComment(
{
size_t iScreenShotLength;
- is_succeed = sgfh.try_read_chunk<uint32_t>(
+ is_succeed = saved_game.try_read_chunk<uint32_t>(
INT_ID('S', 'H', 'L', 'N'),
iScreenShotLength);
}
if (is_succeed)
{
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'H', 'O', 'T'));
}
#endif
if (is_succeed)
{
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('M', 'P', 'C', 'M'),
sMapName,
iSG_MAPCMD_SIZE);
@@ -845,14 +845,14 @@ static qboolean SG_ReadScreenshot(qboolean qbSetAsLoadingScreen, void *pvDest)
{
qboolean bReturn = qfalse;
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
// get JPG screenshot data length...
//
size_t iScreenShotLength = 0;
- sgfh.read_chunk<uint32_t>(
+ saved_game.read_chunk<uint32_t>(
INT_ID('S', 'H', 'L', 'N'),
iScreenShotLength);
@@ -863,7 +863,7 @@ static qboolean SG_ReadScreenshot(qboolean qbSetAsLoadingScreen, void *pvDest)
//
// now read the JPG data...
//
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'H', 'O', 'T'),
pJPGData,
static_cast<int>(iScreenShotLength));
@@ -906,20 +906,20 @@ qboolean SG_GetSaveImage(const char *psPathlessBaseName, void *pvAddress)
return qfalse;
}
- auto& saved_game = ojk::SavedGameFile::get_instance();
+ auto& saved_game = ojk::SavedGame::get_instance();
if (!saved_game.open(psPathlessBaseName))
{
return qfalse;
}
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
&saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'O', 'M', 'M'));
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'M', 'T', 'M'));
auto bGotSaveImage = SG_ReadScreenshot(
@@ -934,8 +934,8 @@ qboolean SG_GetSaveImage(const char *psPathlessBaseName, void *pvAddress)
static void SG_WriteScreenshot(qboolean qbAutosave, const char *psMapName)
{
- ojk::SavedGameFileHelper sgfh(
- &ojk::SavedGameFile::get_instance());
+ ojk::SavedGameHelper saved_game(
+ &ojk::SavedGame::get_instance());
byte *pbRawScreenShot = NULL;
byte *byBlank = NULL;
@@ -981,11 +981,11 @@ static void SG_WriteScreenshot(qboolean qbAutosave, const char *psMapName)
if ( qbAutosave )
delete[] byBlank;
- sgfh.write_chunk<uint32_t>(
+ saved_game.write_chunk<uint32_t>(
INT_ID('S','H','L','N'),
iJPGDataSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S','H','O','T'),
pJPGData,
static_cast<int>(iJPGDataSize));
@@ -1053,7 +1053,7 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
SG_StoreSaveGameComment(va("--> %s <--",psMapName));
}
- auto& saved_game = ojk::SavedGameFile::get_instance();
+ auto& saved_game = ojk::SavedGame::get_instance();
if(!saved_game.create( "current" ))
{
@@ -1064,7 +1064,7 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
}
//END JLF
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
&saved_game);
char sMapCmd[iSG_MAPCMD_SIZE]={0};
@@ -1075,7 +1075,7 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
SG_WriteScreenshot(qbAutosave, sMapCmd);
#endif
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('M', 'P', 'C', 'M'),
sMapCmd);
@@ -1087,11 +1087,11 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
//
if (!qbAutosave)
{
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'E'),
::sv.time);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'R'),
::sv.timeResidual);
@@ -1112,7 +1112,7 @@ qboolean SG_WriteSavegame(const char *psPathlessBaseName, qboolean qbAutosave)
return qfalse;
}
- ojk::SavedGameFile::rename(
+ ojk::SavedGame::rename(
"current",
psPathlessBaseName);
@@ -1132,9 +1132,9 @@ qboolean SG_ReadSavegame(
"0");
#endif
- auto& saved_game = ojk::SavedGameFile::get_instance();
+ auto& saved_game = ojk::SavedGame::get_instance();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
&saved_game);
const auto iPrevTestSave = ::sv_testsave->integer;
@@ -1177,7 +1177,7 @@ qboolean SG_ReadSavegame(
// Read in all the server data...
//
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'O', 'M', 'M'),
sComment);
@@ -1185,7 +1185,7 @@ qboolean SG_ReadSavegame(
"Reading: %s\n",
sComment);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('C', 'M', 'T', 'M'));
#ifdef JK2_MODE
@@ -1193,7 +1193,7 @@ qboolean SG_ReadSavegame(
qtrue);
#endif
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('M', 'P', 'C', 'M'),
sMapCmd);
@@ -1214,11 +1214,11 @@ qboolean SG_ReadSavegame(
//
if (!qbAutosave)
{
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'E'),
::sv.time);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'R'),
::sv.timeResidual);
diff --git a/codeJK2/cgame/cg_main.cpp b/codeJK2/cgame/cg_main.cpp
index 0ca1e91..bab258d 100644
--- a/codeJK2/cgame/cg_main.cpp
+++ b/codeJK2/cgame/cg_main.cpp
@@ -28,7 +28,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../../code/client/vmachine.h"
#include "../../code/qcommon/sstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
//NOTENOTE: Be sure to change the mirrored code in g_shared.h
typedef std::map< sstring_t, unsigned char, std::less<sstring_t>, std::allocator< unsigned char > > namePrecache_m;
@@ -1640,28 +1640,28 @@ Ghoul2 Insert End
void CG_WriteTheEvilCGHackStuff(void)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'P', 'S', 'L'),
::cg.forcepowerSelect);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('I', 'V', 'S', 'L'),
::cg.inventorySelect);
}
void CG_ReadTheEvilCGHackStuff(void)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'P', 'S', 'L'),
::gi_cg_forcepowerSelect);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('I', 'V', 'S', 'L'),
::gi_cg_inventorySelect);
diff --git a/codeJK2/game/CMakeLists.txt b/codeJK2/game/CMakeLists.txt
index d450ead..c56ca0f 100644
--- a/codeJK2/game/CMakeLists.txt
+++ b/codeJK2/game/CMakeLists.txt
@@ -233,9 +233,9 @@ set(JK2SPGameCommonFiles
"${SPDir}/qcommon/q_shared.h"
"${SPDir}/qcommon/strippublic.h"
"${SPDir}/rd-common/mdx_format.h"
- "${SharedDir}/qcommon/ojk_i_saved_game_file.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper.h"
- "${SharedDir}/qcommon/ojk_saved_game_file_helper_fwd.h"
+ "${SharedDir}/qcommon/ojk_i_saved_game.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper.h"
+ "${SharedDir}/qcommon/ojk_saved_game_helper_fwd.h"
"${SharedDir}/qcommon/ojk_scope_guard.h"
${SharedCommonFiles}
)
diff --git a/codeJK2/game/G_Timer.cpp b/codeJK2/game/G_Timer.cpp
index 855b932..5b95ee1 100644
--- a/codeJK2/game/G_Timer.cpp
+++ b/codeJK2/game/G_Timer.cpp
@@ -23,7 +23,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#include "../../code/Rufl/hstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
#define MAX_GTIMERS 16384
@@ -165,7 +165,7 @@ void TIMER_Save( void )
int j;
gentity_t *ent;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
for ( j = 0, ent = &g_entities[0]; j < MAX_GENTITIES; j++, ent++ )
@@ -181,7 +181,7 @@ void TIMER_Save( void )
}
//Write out the timer information
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'E'),
numTimers);
@@ -197,17 +197,17 @@ void TIMER_Save( void )
assert( length < 1024 );//This will cause problems when loading the timer if longer
//Write out the string size and data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'S', 'L', 'N'),
length);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('T', 'S', 'N', 'M'),
timerID,
length);
//Write out the timer data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'D', 'T', 'A'),
time);
@@ -227,14 +227,14 @@ void TIMER_Load( void )
int j;
gentity_t *ent;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
for ( j = 0, ent = &g_entities[0]; j < MAX_GENTITIES; j++, ent++ )
{
int numTimers;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'I', 'M', 'E'),
numTimers);
@@ -250,7 +250,7 @@ void TIMER_Load( void )
assert (sizeof(g_timers[0]->time) == sizeof(time) );//make sure we're reading the same size as we wrote
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'S', 'L', 'N'),
length);
@@ -260,14 +260,14 @@ void TIMER_Load( void )
}
//Read the id and time
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('T', 'S', 'N', 'M'),
tempBuffer,
length);
tempBuffer[length] = '\0';
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'D', 'T', 'A'),
time);
diff --git a/codeJK2/game/Q3_Registers.cpp b/codeJK2/game/Q3_Registers.cpp
index 10b4109..760632c 100644
--- a/codeJK2/game/Q3_Registers.cpp
+++ b/codeJK2/game/Q3_Registers.cpp
@@ -24,7 +24,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#include "Q3_Registers.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern void Q3_DebugPrint( int level, const char *format, ... );
@@ -290,10 +290,10 @@ void Q3_VariableSaveFloats( varFloat_m &fmap )
{
int numFloats = fmap.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'V', 'A', 'R'),
numFloats);
@@ -304,17 +304,17 @@ void Q3_VariableSaveFloats( varFloat_m &fmap )
int idSize = strlen( ((*vfi).first).c_str() );
//Save out the real data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('F', 'I', 'D', 'L'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('F', 'I', 'D', 'S'),
((*vfi).first).c_str(),
idSize);
//Save out the float value
- sgfh.write_chunk<float>(
+ saved_game.write_chunk<float>(
INT_ID('F', 'V', 'A', 'L'),
(*vfi).second);
}
@@ -330,10 +330,10 @@ void Q3_VariableSaveStrings( varString_m &smap )
{
int numStrings = smap.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'V', 'A', 'R'),
numStrings);
@@ -344,11 +344,11 @@ void Q3_VariableSaveStrings( varString_m &smap )
int idSize = strlen( ((*vsi).first).c_str() );
//Save out the real data
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'I', 'D', 'L'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'I', 'D', 'S'),
((*vsi).first).c_str(),
idSize);
@@ -356,11 +356,11 @@ void Q3_VariableSaveStrings( varString_m &smap )
//Save out the string value
idSize = strlen( ((*vsi).second).c_str() );
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'V', 'S', 'Z'),
idSize);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'V', 'A', 'L'),
((*vsi).second).c_str(),
idSize);
@@ -393,10 +393,10 @@ void Q3_VariableLoadFloats( varFloat_m &fmap )
int numFloats;
char tempBuffer[1024];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'V', 'A', 'R'),
numFloats);
@@ -404,11 +404,11 @@ void Q3_VariableLoadFloats( varFloat_m &fmap )
{
int idSize;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('F', 'I', 'D', 'L'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('F', 'I', 'D', 'S'),
tempBuffer,
idSize);
@@ -417,7 +417,7 @@ void Q3_VariableLoadFloats( varFloat_m &fmap )
float val;
- sgfh.read_chunk<float>(
+ saved_game.read_chunk<float>(
INT_ID('F', 'V', 'A', 'L'),
val);
@@ -438,10 +438,10 @@ void Q3_VariableLoadStrings( int type, varString_m &fmap )
char tempBuffer[1024];
char tempBuffer2[1024];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'V', 'A', 'R'),
numFloats);
@@ -449,22 +449,22 @@ void Q3_VariableLoadStrings( int type, varString_m &fmap )
{
int idSize;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'I', 'D', 'L'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'I', 'D', 'S'),
tempBuffer,
idSize);
tempBuffer[ idSize ] = 0;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'V', 'S', 'Z'),
idSize);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'V', 'A', 'L'),
tempBuffer2,
idSize);
diff --git a/codeJK2/game/ai.h b/codeJK2/game/ai.h
index 746ec90..337cfc0 100644
--- a/codeJK2/game/ai.h
+++ b/codeJK2/game/ai.h
@@ -115,7 +115,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(number);
saved_game.write<int32_t>(waypoint);
@@ -124,7 +124,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(number);
saved_game.read<int32_t>(waypoint);
@@ -158,7 +158,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(numGroup);
saved_game.write<int32_t>(processed);
@@ -180,7 +180,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(numGroup);
saved_game.read<int32_t>(processed);
diff --git a/codeJK2/game/anims.h b/codeJK2/game/anims.h
index 7cbd679..c941430 100644
--- a/codeJK2/game/anims.h
+++ b/codeJK2/game/anims.h
@@ -1410,7 +1410,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(filename);
saved_game.write<>(animations);
@@ -1420,7 +1420,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(filename);
saved_game.read<>(animations);
diff --git a/codeJK2/game/b_public.h b/codeJK2/game/b_public.h
index 9256b41..b0a73b1 100644
--- a/codeJK2/game/b_public.h
+++ b/codeJK2/game/b_public.h
@@ -140,7 +140,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(aggression);
saved_game.write<int32_t>(aim);
@@ -163,7 +163,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(aggression);
saved_game.read<int32_t>(aim);
@@ -346,7 +346,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(timeOfDeath);
saved_game.write<int32_t>(touchedByPlayer);
@@ -451,7 +451,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(timeOfDeath);
saved_game.read<int32_t>(touchedByPlayer);
diff --git a/codeJK2/game/bg_public.h b/codeJK2/game/bg_public.h
index 74b30e2..50bba40 100644
--- a/codeJK2/game/bg_public.h
+++ b/codeJK2/game/bg_public.h
@@ -452,7 +452,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(firstFrame);
saved_game.write<int32_t>(numFrames);
@@ -462,7 +462,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(firstFrame);
saved_game.read<int32_t>(numFrames);
@@ -483,7 +483,7 @@ typedef struct animsounds_s
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(keyFrame);
saved_game.write<int32_t>(soundIndex);
@@ -492,7 +492,7 @@ typedef struct animsounds_s
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(keyFrame);
saved_game.read<int32_t>(soundIndex);
diff --git a/codeJK2/game/g_local.h b/codeJK2/game/g_local.h
index 9156fcc..0e5d78e 100644
--- a/codeJK2/game/g_local.h
+++ b/codeJK2/game/g_local.h
@@ -144,7 +144,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<float>(position);
saved_game.write<float>(radius);
@@ -158,7 +158,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<float>(position);
saved_game.read<float>(radius);
@@ -249,7 +249,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(clients);
saved_game.write<int32_t>(maxclients);
@@ -271,7 +271,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(clients);
saved_game.read<int32_t>(maxclients);
diff --git a/codeJK2/game/g_main.cpp b/codeJK2/game/g_main.cpp
index 1196bb8..1b19c4b 100644
--- a/codeJK2/game/g_main.cpp
+++ b/codeJK2/game/g_main.cpp
@@ -35,7 +35,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "objectives.h"
#include "../cgame/cg_local.h" // yeah I know this is naughty, but we're shipping soon...
#include "time.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern CNavigator navigator;
@@ -90,20 +90,20 @@ qboolean PInUse2(gentity_t *ent)
void WriteInUseBits()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<uint32_t>(
+ saved_game.write_chunk<uint32_t>(
INT_ID('I', 'N', 'U', 'S'),
::g_entityInUseBits);
}
void ReadInUseBits()
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<uint32_t>(
+ saved_game.read_chunk<uint32_t>(
INT_ID('I', 'N', 'U', 'S'),
::g_entityInUseBits);
@@ -1489,10 +1489,10 @@ extern qboolean player_locked;
void G_LoadSave_WriteMiscData(void)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('L', 'C', 'K', 'D'),
::player_locked);
}
@@ -1501,10 +1501,10 @@ void G_LoadSave_WriteMiscData(void)
void G_LoadSave_ReadMiscData(void)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('L', 'C', 'K', 'D'),
::player_locked);
}
diff --git a/codeJK2/game/g_objectives.cpp b/codeJK2/game/g_objectives.cpp
index 52629b8..34e258b 100644
--- a/codeJK2/game/g_objectives.cpp
+++ b/codeJK2/game/g_objectives.cpp
@@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#define G_OBJECTIVES_CPP
#include "objectives.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
qboolean missionInfo_Updated;
@@ -62,10 +62,10 @@ OBJ_SaveMissionObjectives
*/
void OBJ_SaveMissionObjectives( gclient_t *client )
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('O', 'B', 'J', 'T'),
client->sess.mission_objectives);
}
@@ -92,10 +92,10 @@ OBJ_LoadMissionObjectives
*/
void OBJ_LoadMissionObjectives( gclient_t *client )
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('O', 'B', 'J', 'T'),
client->sess.mission_objectives);
}
diff --git a/codeJK2/game/g_public.h b/codeJK2/game/g_public.h
index 224af07..e5e3313 100644
--- a/codeJK2/game/g_public.h
+++ b/codeJK2/game/g_public.h
@@ -174,7 +174,7 @@ typedef struct {
// Savegame handling
//
- ojk::ISavedGameFile* saved_game;
+ ojk::ISavedGame* saved_game;
// add commands to the console as if they were typed in
// for map changing, etc
diff --git a/codeJK2/game/g_roff.cpp b/codeJK2/game/g_roff.cpp
index fcdde07..72aa981 100644
--- a/codeJK2/game/g_roff.cpp
+++ b/codeJK2/game/g_roff.cpp
@@ -25,7 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_local.h"
#include "g_roff.h"
#include "g_icarus.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
// The list of precached ROFFs
roff_list_t roffs[MAX_ROFFS];
@@ -626,11 +626,11 @@ void G_SaveCachedRoffs()
{
int i, len;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// Write out the number of cached ROFFs
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('R', 'O', 'F', 'F'),
::num_roffs);
@@ -640,11 +640,11 @@ void G_SaveCachedRoffs()
// Dump out the string length to make things a bit easier on the other end...heh heh.
len = strlen( roffs[i].fileName ) + 1;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'L', 'E', 'N'),
len);
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('R', 'S', 'T', 'R'),
::roffs[i].fileName,
len);
@@ -663,22 +663,22 @@ void G_LoadCachedRoffs()
int i, count, len;
char buffer[MAX_QPATH];
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// Get the count of goodies we need to revive
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('R', 'O', 'F', 'F'),
count);
// Now bring 'em back to life
for ( i = 0; i < count; i++ )
{
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'L', 'E', 'N'),
len);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('R', 'S', 'T', 'R'),
buffer,
len);
diff --git a/codeJK2/game/g_savegame.cpp b/codeJK2/game/g_savegame.cpp
index f5cb58d..cd0ee50 100644
--- a/codeJK2/game/g_savegame.cpp
+++ b/codeJK2/game/g_savegame.cpp
@@ -33,7 +33,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "../cgame/cg_camera.h"
#include "g_icarus.h"
#include "../../code/qcommon/sstring.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
extern void OBJ_LoadTacticalInfo(void);
@@ -184,10 +184,10 @@ char *GetStringPtr(int iStrlen, char *psOriginal/*may be NULL*/)
assert(iStrlen+1<=(int)sizeof(sString));
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'T', 'R', 'G'),
sString,
iStrlen);
@@ -470,24 +470,24 @@ static void EnumerateFields(
}
}
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
// save out raw data...
//
- sgfh.reset_buffer();
+ saved_game.reset_buffer();
src_instance->sg_export(
- sgfh);
+ saved_game);
- sgfh.write_chunk(
+ saved_game.write_chunk(
ulChid);
// save out any associated strings..
//
for (const auto& it : strList)
{
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'T', 'R', 'G'),
it.c_str(),
static_cast<int>(it.length() + 1));
@@ -601,10 +601,10 @@ static void EvaluateFields(
T* pbOriginalRefData,
unsigned int ulChid)
{
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- if (!sgfh.try_read_chunk(
+ if (!saved_game.try_read_chunk(
ulChid,
*pbData))
{
@@ -678,10 +678,10 @@ static void WriteGEntities(qboolean qbAutosave)
}
}
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('N', 'M', 'E', 'D'),
iCount);
@@ -691,7 +691,7 @@ static void WriteGEntities(qboolean qbAutosave)
if ( ent->inuse)
{
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('E', 'D', 'N', 'M'),
i);
@@ -724,7 +724,7 @@ static void WriteGEntities(qboolean qbAutosave)
if (tempEnt.parms)
{
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('P', 'A', 'R', 'M'),
*ent->parms);
}
@@ -750,7 +750,7 @@ static void WriteGEntities(qboolean qbAutosave)
//
static int iBlah = 1234;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('I', 'C', 'O', 'K'),
iBlah);
}
@@ -765,10 +765,10 @@ static void ReadGEntities(qboolean qbAutosave)
int iCount;
int i;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('N', 'M', 'E', 'D'),
iCount);
@@ -777,7 +777,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
int iEntIndex;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('E', 'D', 'N', 'M'),
iEntIndex);
@@ -879,7 +879,7 @@ static void ReadGEntities(qboolean qbAutosave)
{
parms_t tempParms;
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('P', 'A', 'R', 'M'),
tempParms);
@@ -908,11 +908,11 @@ static void ReadGEntities(qboolean qbAutosave)
{
#ifdef JK2_MODE
// Skip GL2 data size
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('G', 'L', '2', 'S'));
#endif // JK2_MODE
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('G', 'H', 'L', '2'));
gi.G2API_LoadGhoul2Models(
@@ -977,7 +977,7 @@ static void ReadGEntities(qboolean qbAutosave)
//
static int iBlah = 1234;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('I', 'C', 'O', 'K'),
iBlah);
}
@@ -1016,10 +1016,10 @@ void WriteLevel(qboolean qbAutosave)
//
static int iDONE = 1234;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('D', 'O', 'N', 'E'),
iDONE);
}
@@ -1044,10 +1044,10 @@ void ReadLevel(qboolean qbAutosave, qboolean qbLoadTransition)
EvaluateFields(savefields_gClient, &junkClient, &level.clients[0], INT_ID('G','C','L','I'));
//Read & throw away objective info
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('O', 'B', 'J', 'T'));
ReadLevelLocals(); // level_locals_t level
@@ -1082,10 +1082,10 @@ void ReadLevel(qboolean qbAutosave, qboolean qbLoadTransition)
//
static int iDONE = 1234;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
::gi.saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('D', 'O', 'N', 'E'),
iDONE);
}
diff --git a/codeJK2/game/g_shared.h b/codeJK2/game/g_shared.h
index c84d292..5c07ce7 100644
--- a/codeJK2/game/g_shared.h
+++ b/codeJK2/game/g_shared.h
@@ -154,7 +154,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(infoValid);
saved_game.write<int8_t>(name);
@@ -177,7 +177,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(infoValid);
saved_game.read<int8_t>(name);
@@ -221,7 +221,7 @@ typedef struct modelInfo_s
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(modelIndex);
saved_game.write<float>(customRGB);
@@ -229,7 +229,7 @@ typedef struct modelInfo_s
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(modelIndex);
saved_game.read<float>(customRGB);
@@ -336,7 +336,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<>(legsModel);
saved_game.write<int8_t>(legsModelName);
@@ -388,7 +388,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<>(legsModel);
saved_game.read<int8_t>(legsModelName);
@@ -485,7 +485,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(state);
saved_game.write<int32_t>(captures);
@@ -501,7 +501,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(state);
saved_game.read<int32_t>(captures);
@@ -526,14 +526,14 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(display);
saved_game.write<int32_t>(status);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(display);
saved_game.read<int32_t>(status);
@@ -562,7 +562,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(secretsFound);
saved_game.write<int32_t>(totalSecrets);
@@ -581,7 +581,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(secretsFound);
saved_game.read<int32_t>(totalSecrets);
@@ -621,7 +621,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(missionObjectivesShown);
saved_game.write<int32_t>(sessionTeam);
@@ -630,7 +630,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(missionObjectivesShown);
saved_game.read<int32_t>(sessionTeam);
@@ -657,7 +657,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int32_t>(connected);
saved_game.write<>(lastCommand);
@@ -672,7 +672,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int32_t>(connected);
saved_game.read<>(lastCommand);
@@ -804,7 +804,7 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<>(ps);
saved_game.write<>(pers);
@@ -866,7 +866,7 @@ public:
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<>(ps);
saved_game.read<>(pers);
@@ -938,13 +938,13 @@ public:
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<int8_t>(parm);
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<int8_t>(parm);
}
@@ -1266,7 +1266,7 @@ Ghoul2 Insert End
void sg_export(
- ojk::SavedGameFileHelper& saved_game) const
+ ojk::SavedGameHelper& saved_game) const
{
saved_game.write<>(s);
saved_game.write<int32_t>(client);
@@ -1447,7 +1447,7 @@ Ghoul2 Insert End
}
void sg_import(
- ojk::SavedGameFileHelper& saved_game)
+ ojk::SavedGameHelper& saved_game)
{
saved_game.read<>(s);
saved_game.read<int32_t>(client);
diff --git a/codeJK2/icarus/Instance.cpp b/codeJK2/icarus/Instance.cpp
index 463e095..a3b4ebe 100644
--- a/codeJK2/icarus/Instance.cpp
+++ b/codeJK2/icarus/Instance.cpp
@@ -29,7 +29,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "instance.h"
#include <assert.h>
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
// Instance
@@ -304,10 +304,10 @@ int ICARUS_Instance::SaveSequenceIDTable( void )
//Save out the number of sequences to follow
int numSequences = m_sequences.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('#', 'S', 'E', 'Q'),
numSequences);
@@ -326,7 +326,7 @@ int ICARUS_Instance::SaveSequenceIDTable( void )
idTable[itr++] = (*sqi)->GetID();
}
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'T', 'B'),
idTable,
numSequences);
@@ -368,10 +368,10 @@ int ICARUS_Instance::SaveSequencers( void )
//Save out the number of sequences to follow
int numSequencers = m_sequencers.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('#', 'S', 'Q', 'R'),
numSequencers);
@@ -395,10 +395,10 @@ int ICARUS_Instance::SaveSignals( void )
{
int numSignals = m_signals.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('I', 'S', 'I', 'G'),
numSignals);
@@ -414,12 +414,12 @@ int ICARUS_Instance::SaveSignals( void )
int length = strlen( name ) + 1;
//Save out the string size
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'I', 'G', '#'),
length);
//Write out the string
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('S', 'I', 'G', 'N'),
name,
length);
@@ -439,10 +439,10 @@ int ICARUS_Instance::Save( void )
//Save out a ICARUS save block header with the ICARUS version
double version = ICARUS_VERSION;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.write_chunk<double>(
+ saved_game.write_chunk<double>(
INT_ID('I', 'C', 'A', 'R'),
version);
@@ -458,7 +458,7 @@ int ICARUS_Instance::Save( void )
if ( SaveSequencers() == false )
return false;
- sgfh.write_chunk<double>(
+ saved_game.write_chunk<double>(
INT_ID('I', 'E', 'N', 'D'),
version);
@@ -475,10 +475,10 @@ int ICARUS_Instance::LoadSignals( void )
{
int numSignals;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('I', 'S', 'I', 'G'),
numSignals);
@@ -488,14 +488,14 @@ int ICARUS_Instance::LoadSignals( void )
int length;
//Get the size of the string
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'I', 'G', '#'),
length);
assert( length < (int)sizeof( buffer ) );
//Get the string
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('S', 'I', 'G', 'N'),
buffer,
length);
@@ -538,11 +538,11 @@ int ICARUS_Instance::LoadSequences( void )
CSequence *sequence;
int numSequences;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
//Get the number of sequences to read in
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('#', 'S', 'E', 'Q'),
numSequences);
@@ -552,7 +552,7 @@ int ICARUS_Instance::LoadSequences( void )
return false;
//Load the sequencer ID table
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'T', 'B'),
idTable,
numSequences);
@@ -590,11 +590,11 @@ int ICARUS_Instance::LoadSequencers( void )
CSequencer *sequencer;
int numSequencers;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
//Get the number of sequencers to load
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('#', 'S', 'Q', 'R'),
numSequencers);
@@ -626,10 +626,10 @@ int ICARUS_Instance::Load( void )
//Check to make sure we're at the ICARUS save block
double version;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_interface->saved_game);
- sgfh.read_chunk<double>(
+ saved_game.read_chunk<double>(
INT_ID('I', 'C', 'A', 'R'),
version);
@@ -661,7 +661,7 @@ int ICARUS_Instance::Load( void )
return false;
}
- sgfh.read_chunk<double>(
+ saved_game.read_chunk<double>(
INT_ID('I', 'E', 'N', 'D'),
version);
diff --git a/codeJK2/icarus/Sequence.cpp b/codeJK2/icarus/Sequence.cpp
index 0267997..ba43675 100644
--- a/codeJK2/icarus/Sequence.cpp
+++ b/codeJK2/icarus/Sequence.cpp
@@ -28,7 +28,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "icarus.h"
#include <assert.h>
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
CSequence::CSequence( void )
{
@@ -343,27 +343,27 @@ int CSequence::SaveCommand( CBlock *block )
int numMembers, bID, size;
CBlockMember *bm;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Save out the block ID
bID = block->GetBlockID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'L', 'I', 'D'),
bID);
//Save out the block's flags
flags = block->GetFlags();
- sgfh.write_chunk<uint8_t>(
+ saved_game.write_chunk<uint8_t>(
INT_ID('B', 'F', 'L', 'G'),
flags);
//Save out the number of members to read
numMembers = block->GetNumMembers();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'N', 'U', 'M'),
numMembers);
@@ -374,21 +374,21 @@ int CSequence::SaveCommand( CBlock *block )
//Save the block id
bID = bm->GetID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'M', 'I', 'D'),
bID);
//Save out the data size
size = bm->GetSize();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'S', 'I', 'Z'),
size);
//Save out the raw data
auto raw_data = static_cast<const uint8_t*>(bm->GetData());
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('B', 'M', 'E', 'M'),
raw_data,
size);
@@ -409,25 +409,25 @@ int CSequence::Save( void )
block_l::iterator bi;
int id;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Save the parent (by GUID)
id = ( m_parent != NULL ) ? m_parent->GetID() : -1;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'P', 'I', 'D'),
id);
//Save the return (by GUID)
id = ( m_return != NULL ) ? m_return->GetID() : -1;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'R', 'I', 'D'),
id);
//Save the number of children
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'N', 'C', 'H'),
m_numChildren);
@@ -436,23 +436,23 @@ int CSequence::Save( void )
{
id = (*ci)->GetID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'C', 'H', 'D'),
id);
}
//Save flags
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'F', 'L', 'G'),
m_flags);
//Save iterations
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'I', 'T', 'R'),
m_iterations);
//Save the number of commands
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'N', 'M', 'C'),
m_numCommands);
@@ -482,25 +482,25 @@ int CSequence::Load( void )
int bID, bSize;
void *bData;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Get the parent sequence
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'P', 'I', 'D'),
id);
m_parent = ( id != -1 ) ? m_owner->GetSequence( id ) : NULL;
//Get the return sequence
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'R', 'I', 'D'),
id);
m_return = ( id != -1 ) ? m_owner->GetSequence( id ) : NULL;
//Get the number of children
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'N', 'C', 'H'),
m_numChildren);
@@ -508,7 +508,7 @@ int CSequence::Load( void )
for ( i = 0; i < m_numChildren; i++ )
{
//Get the child sequence ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'C', 'H', 'D'),
id);
@@ -525,19 +525,19 @@ int CSequence::Load( void )
//Get the sequence flags
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'F', 'L', 'G'),
m_flags);
//Get the number of iterations
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'I', 'T', 'R'),
m_iterations);
int numCommands;
//Get the number of commands
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'N', 'M', 'C'),
numCommands);
@@ -545,7 +545,7 @@ int CSequence::Load( void )
for ( i = 0; i < numCommands; i++ )
{
//Get the block ID and create a new container
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'L', 'I', 'D'),
id);
@@ -554,26 +554,26 @@ int CSequence::Load( void )
block->Create( id );
//Read the block's flags
- sgfh.read_chunk<uint8_t>(
+ saved_game.read_chunk<uint8_t>(
INT_ID('B', 'F', 'L', 'G'),
flags);
block->SetFlags( flags );
//Get the number of block members
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'N', 'U', 'M'),
numMembers);
for ( int j = 0; j < numMembers; j++ )
{
//Get the member ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'M', 'I', 'D'),
bID);
//Get the member size
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'S', 'I', 'Z'),
bSize);
@@ -582,7 +582,7 @@ int CSequence::Load( void )
return false;
//Get the actual raw data
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('B', 'M', 'E', 'M'),
static_cast<uint8_t*>(bData),
bSize);
diff --git a/codeJK2/icarus/Sequencer.cpp b/codeJK2/icarus/Sequencer.cpp
index 487b7dc..b8f6b2b 100644
--- a/codeJK2/icarus/Sequencer.cpp
+++ b/codeJK2/icarus/Sequencer.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "g_shared.h"
#include "assert.h"
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
// Sequencer
@@ -2332,16 +2332,16 @@ int CSequencer::Save( void )
//Get the number of sequences to save out
numSequences = m_sequences.size();
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_ie->saved_game);
//Save out the owner sequence
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'R', 'E'),
m_ownerID);
//Write out the number of sequences we need to read
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'R', '#'),
numSequences);
@@ -2350,7 +2350,7 @@ int CSequencer::Save( void )
{
id = (*si)->GetID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'R', 'I'),
id);
}
@@ -2361,7 +2361,7 @@ int CSequencer::Save( void )
//Save out the task sequences mapping the name to the GUIDs
numTasks = m_taskSequences.size();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'T', '#'),
numTasks);
@@ -2370,33 +2370,33 @@ int CSequencer::Save( void )
//Save the task group's ID
id = ((*ti).first)->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'T', 'I', 'D'),
id);
//Save the sequence's ID
id = ((*ti).second)->GetID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'S', 'I', 'D'),
id);
}
int curGroupID = ( m_curGroup == NULL ) ? -1 : m_curGroup->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'C', 'T'),
curGroupID);
//Output the number of commands
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', '#', 'C'),
m_numCommands); //FIXME: This can be reconstructed
//Output the ID of the current sequence
id = ( m_curSequence != NULL ) ? m_curSequence->GetID() : -1;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('S', 'Q', 'C', 'S'),
id);
@@ -2413,11 +2413,11 @@ int CSequencer::Load( void )
{
int i;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_ie->saved_game);
//Get the owner of this sequencer
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'R', 'E'),
m_ownerID);
@@ -2429,14 +2429,14 @@ int CSequencer::Load( void )
int numSequences, seqID, taskID, numTasks;
//Get the number of sequences to read
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'R', '#'),
numSequences);
//Read in all the sequences
for ( i = 0; i < numSequences; i++ )
{
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'R', 'I'),
seqID);
@@ -2455,7 +2455,7 @@ int CSequencer::Load( void )
m_taskManager->Load();
//Get the number of tasks in the map
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'T', '#'),
numTasks);
@@ -2463,12 +2463,12 @@ int CSequencer::Load( void )
for ( i = 0; i < numTasks; i++ )
{
//Read in the task's ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'T', 'I', 'D'),
taskID);
//Read in the sequence's ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'S', 'I', 'D'),
seqID);
@@ -2487,19 +2487,19 @@ int CSequencer::Load( void )
int curGroupID;
//Get the current task group
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'C', 'T'),
curGroupID);
m_curGroup = ( curGroupID == -1 ) ? NULL : m_taskManager->GetTaskGroup( curGroupID );
//Get the number of commands
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', '#', 'C'),
m_numCommands);
//Get the current sequence
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('S', 'Q', 'C', 'S'),
seqID);
diff --git a/codeJK2/icarus/TaskManager.cpp b/codeJK2/icarus/TaskManager.cpp
index b609738..7a247ba 100644
--- a/codeJK2/icarus/TaskManager.cpp
+++ b/codeJK2/icarus/TaskManager.cpp
@@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include <assert.h>
-#include "qcommon/ojk_saved_game_file_helper.h"
+#include "qcommon/ojk_saved_game_helper.h"
#define ICARUS_VALIDATE(a) if ( a == false ) return TASK_FAILED;
@@ -1640,27 +1640,27 @@ int CTaskManager::SaveCommand( CBlock *block )
int numMembers, bID, size;
CBlockMember *bm;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Save out the block ID
bID = block->GetBlockID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'L', 'I', 'D'),
bID);
//Save out the block's flags
flags = block->GetFlags();
- sgfh.write_chunk<uint8_t>(
+ saved_game.write_chunk<uint8_t>(
INT_ID('B', 'F', 'L', 'G'),
flags);
//Save out the number of members to read
numMembers = block->GetNumMembers();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'N', 'U', 'M'),
numMembers);
@@ -1671,21 +1671,21 @@ int CTaskManager::SaveCommand( CBlock *block )
//Save the block id
bID = bm->GetID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'M', 'I', 'D'),
bID);
//Save out the data size
size = bm->GetSize();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('B', 'S', 'I', 'Z'),
size);
//Save out the raw data
auto raw_data = static_cast<const uint8_t*>(bm->GetData());
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('B', 'M', 'E', 'M'),
raw_data,
size);
@@ -1710,18 +1710,18 @@ void CTaskManager::Save( void )
int id, numCommands;
int numWritten;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Save the taskmanager's GUID
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'M', 'I', 'D'),
m_GUID); //FIXME: This can be reconstructed
//Save out the number of tasks that will follow
int iNumTasks = m_tasks.size();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'S', 'K', '#'),
iNumTasks);
@@ -1733,14 +1733,14 @@ void CTaskManager::Save( void )
//Save the GUID
id = (*ti)->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'K', 'I', 'D'),
id);
//Save the timeStamp (FIXME: Although, this is going to be worthless if time is not consistent...)
timeStamp = (*ti)->GetTimeStamp();
- sgfh.write_chunk<uint32_t>(
+ saved_game.write_chunk<uint32_t>(
INT_ID('T', 'K', 'T', 'S'),
timeStamp);
@@ -1752,7 +1752,7 @@ void CTaskManager::Save( void )
//Save out the number of task groups
int numTaskGroups = m_taskGroups.size();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', '#', 'G'),
numTaskGroups);
@@ -1763,7 +1763,7 @@ void CTaskManager::Save( void )
{
id = (*tgi)->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'K', 'G', '#'),
id);
@@ -1778,14 +1778,14 @@ void CTaskManager::Save( void )
//Save out the parent
id = ( (*tgi)->GetParent() == NULL ) ? -1 : ((*tgi)->GetParent())->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'K', 'G', 'P'),
id);
//Save out the number of commands
numCommands = (*tgi)->m_completedTasks.size();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'C'),
numCommands);
@@ -1797,14 +1797,14 @@ void CTaskManager::Save( void )
//Write out the ID
id = (*tci).first;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('G', 'M', 'I', 'D'),
id);
//Write out the state of completion
completed = (*tci).second;
- sgfh.write_chunk<uint8_t>(
+ saved_game.write_chunk<uint8_t>(
INT_ID('G', 'M', 'D', 'N'),
completed);
}
@@ -1812,7 +1812,7 @@ void CTaskManager::Save( void )
//Save out the number of completed commands
id = (*tgi)->m_numCompleted;
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', 'D', 'N'),
id); //FIXME: This can be reconstructed
@@ -1826,7 +1826,7 @@ void CTaskManager::Save( void )
//Save out the currently active group
int curGroupID = ( m_curGroup == NULL ) ? -1 : m_curGroup->GetGUID();
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', 'C', 'G'),
curGroupID);
}
@@ -1844,12 +1844,12 @@ void CTaskManager::Save( void )
int length = strlen( name ) + 1;
//Save out the string size
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'L'),
length);
//Write out the string
- sgfh.write_chunk(
+ saved_game.write_chunk(
INT_ID('T', 'G', 'N', 'S'),
name,
length);
@@ -1859,7 +1859,7 @@ void CTaskManager::Save( void )
id = taskGroup->GetGUID();
//Write out the ID
- sgfh.write_chunk<int32_t>(
+ saved_game.write_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'I'),
id);
@@ -1887,16 +1887,16 @@ void CTaskManager::Load( void )
int bID, bSize;
int i;
- ojk::SavedGameFileHelper sgfh(
+ ojk::SavedGameHelper saved_game(
m_owner->GetInterface()->saved_game);
//Get the GUID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'M', 'I', 'D'),
m_GUID);
//Get the number of tasks to follow
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'S', 'K', '#'),
numTasks);
@@ -1908,14 +1908,14 @@ void CTaskManager::Load( void )
assert( task );
//Get the GUID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'K', 'I', 'D'),
id);
task->SetGUID( id );
//Get the time stamp
- sgfh.read_chunk<uint32_t>(
+ saved_game.read_chunk<uint32_t>(
INT_ID('T', 'K', 'T', 'S'),
timeStamp);
@@ -1926,7 +1926,7 @@ void CTaskManager::Load( void )
//
//Get the block ID and create a new container
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'L', 'I', 'D'),
id);
@@ -1935,26 +1935,26 @@ void CTaskManager::Load( void )
block->Create( id );
//Read the block's flags
- sgfh.read_chunk<uint8_t>(
+ saved_game.read_chunk<uint8_t>(
INT_ID('B', 'F', 'L', 'G'),
flags);
block->SetFlags( flags );
//Get the number of block members
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'N', 'U', 'M'),
numMembers);
for ( int j = 0; j < numMembers; j++ )
{
//Get the member ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'M', 'I', 'D'),
bID);
//Get the member size
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('B', 'S', 'I', 'Z'),
bSize);
@@ -1966,7 +1966,7 @@ void CTaskManager::Load( void )
}
//Get the actual raw data
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('B', 'M', 'E', 'M'),
static_cast<uint8_t*>(bData),
bSize);
@@ -2020,7 +2020,7 @@ void CTaskManager::Load( void )
//Load the task groups
int numTaskGroups;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', '#', 'G'),
numTaskGroups);
@@ -2037,7 +2037,7 @@ void CTaskManager::Load( void )
assert( taskGroup );
//Get this task group's ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'K', 'G', '#'),
taskIDs[i]);
@@ -2055,7 +2055,7 @@ void CTaskManager::Load( void )
assert( taskGroup );
//Load the parent ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'K', 'G', 'P'),
id);
@@ -2063,7 +2063,7 @@ void CTaskManager::Load( void )
taskGroup->m_parent = ( GetTaskGroup( id ) != NULL ) ? GetTaskGroup( id ) : NULL;
//Get the number of commands in this group
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'C'),
numMembers);
@@ -2071,12 +2071,12 @@ void CTaskManager::Load( void )
for ( int j = 0; j < numMembers; j++ )
{
//Get the ID
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('G', 'M', 'I', 'D'),
id);
//Write out the state of completion
- sgfh.read_chunk<uint8_t>(
+ saved_game.read_chunk<uint8_t>(
INT_ID('G', 'M', 'D', 'N'),
completed);
@@ -2085,7 +2085,7 @@ void CTaskManager::Load( void )
}
//Get the number of completed tasks
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', 'D', 'N'),
taskGroup->m_numCompleted);
}
@@ -2093,7 +2093,7 @@ void CTaskManager::Load( void )
//Reload the currently active group
int curGroupID;
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', 'C', 'G'),
curGroupID);
@@ -2104,18 +2104,18 @@ void CTaskManager::Load( void )
int length;
//Get the size of the string
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'L'),
length);
//Get the string
- sgfh.read_chunk(
+ saved_game.read_chunk(
INT_ID('T', 'G', 'N', 'S'),
name,
length);
//Get the id
- sgfh.read_chunk<int32_t>(
+ saved_game.read_chunk<int32_t>(
INT_ID('T', 'G', 'N', 'I'),
id);
diff --git a/codeJK2/icarus/interface.h b/codeJK2/icarus/interface.h
index b04bf26..39cc915 100644
--- a/codeJK2/icarus/interface.h
+++ b/codeJK2/icarus/interface.h
@@ -85,7 +85,7 @@ typedef struct interface_export_s
int (*I_ReadSaveData)( unsigned int chid, void *address, int length, void **addressptr/* = NULL */);
int (*I_LinkEntity)( int entID, CSequencer *sequencer, CTaskManager *taskManager );
- ojk::ISavedGameFile* saved_game;
+ ojk::ISavedGame* saved_game;
} interface_export_t;
#endif //__INTERFACE__
diff --git a/shared/qcommon/ojk_i_saved_game_file.h b/shared/qcommon/ojk_i_saved_game.h
similarity index 82%
rename from shared/qcommon/ojk_i_saved_game_file.h
rename to shared/qcommon/ojk_i_saved_game.h
index 73f5b70..f4d0140 100644
--- a/shared/qcommon/ojk_i_saved_game_file.h
+++ b/shared/qcommon/ojk_i_saved_game.h
@@ -1,10 +1,10 @@
//
-// Saved game file interface.
+// Saved game interface.
//
-#ifndef OJK_I_SAVED_GAME_FILE_INCLUDED
-#define OJK_I_SAVED_GAME_FILE_INCLUDED
+#ifndef OJK_I_SAVED_GAME_INCLUDED
+#define OJK_I_SAVED_GAME_INCLUDED
#include <cstdint>
@@ -14,20 +14,20 @@ namespace ojk
{
-class ISavedGameFile
+class ISavedGame
{
public:
- ISavedGameFile()
+ ISavedGame()
{
}
- ISavedGameFile(
- const ISavedGameFile& that) = delete;
+ ISavedGame(
+ const ISavedGame& that) = delete;
- ISavedGameFile& operator=(
- const ISavedGameFile& that) = delete;
+ ISavedGame& operator=(
+ const ISavedGame& that) = delete;
- virtual ~ISavedGameFile()
+ virtual ~ISavedGame()
{
}
@@ -92,10 +92,10 @@ public:
// Calls Com_Error with last error message or with a generic one.
virtual void throw_error() = 0;
-}; // ISavedGameFile
+}; // ISavedGame
} // ojk
-#endif // OJK_I_SAVED_GAME_FILE_INCLUDED
+#endif // OJK_I_SAVED_GAME_INCLUDED
diff --git a/shared/qcommon/ojk_saved_game_file.cpp b/shared/qcommon/ojk_saved_game.cpp
similarity index 91%
rename from shared/qcommon/ojk_saved_game_file.cpp
rename to shared/qcommon/ojk_saved_game.cpp
index aa8a9a7..708fc28 100644
--- a/shared/qcommon/ojk_saved_game_file.cpp
+++ b/shared/qcommon/ojk_saved_game.cpp
@@ -1,10 +1,10 @@
//
-// Saved game file.
+// Saved game.
//
-#include "ojk_saved_game_file.h"
-#include "ojk_saved_game_file_helper.h"
+#include "ojk_saved_game.h"
+#include "ojk_saved_game_helper.h"
#include <algorithm>
#include "qcommon/qcommon.h"
#include "server/server.h"
@@ -14,7 +14,7 @@ namespace ojk
{
-SavedGameFile::SavedGameFile() :
+SavedGame::SavedGame() :
error_message_(),
file_handle_(),
io_buffer_(),
@@ -28,12 +28,12 @@ SavedGameFile::SavedGameFile() :
{
}
-SavedGameFile::~SavedGameFile()
+SavedGame::~SavedGame()
{
close();
}
-bool SavedGameFile::open(
+bool SavedGame::open(
const std::string& base_file_name)
{
close();
@@ -70,12 +70,12 @@ bool SavedGameFile::open(
if (is_succeed)
{
- SavedGameFileHelper sgfh(
+ SavedGameHelper saved_game(
this);
int sg_version = -1;
- if (sgfh.try_read_chunk<int32_t>(
+ if (saved_game.try_read_chunk<int32_t>(
INT_ID('_', 'V', 'E', 'R'),
sg_version))
{
@@ -107,7 +107,7 @@ bool SavedGameFile::open(
return is_succeed;
}
-bool SavedGameFile::create(
+bool SavedGame::create(
const std::string& base_file_name)
{
close();
@@ -140,7 +140,7 @@ bool SavedGameFile::create(
const auto sg_version = iSAVEGAME_VERSION;
- SavedGameFileHelper sgsh(this);
+ SavedGameHelper sgsh(this);
sgsh.write_chunk<int32_t>(
INT_ID('_', 'V', 'E', 'R'),
@@ -155,7 +155,7 @@ bool SavedGameFile::create(
return true;
}
-void SavedGameFile::close()
+void SavedGame::close()
{
if (file_handle_ != 0)
{
@@ -178,7 +178,7 @@ void SavedGameFile::close()
is_failed_ = false;
}
-bool SavedGameFile::read_chunk(
+bool SavedGame::read_chunk(
const uint32_t chunk_id)
{
if (is_failed_)
@@ -350,12 +350,12 @@ bool SavedGameFile::read_chunk(
return true;
}
-bool SavedGameFile::is_all_data_read() const
+bool SavedGame::is_all_data_read() const
{
return io_buffer_.size() == io_buffer_offset_;
}
-void SavedGameFile::ensure_all_data_read()
+void SavedGame::ensure_all_data_read()
{
if (!is_all_data_read())
{
@@ -365,7 +365,7 @@ void SavedGameFile::ensure_all_data_read()
}
}
-bool SavedGameFile::write_chunk(
+bool SavedGame::write_chunk(
const uint32_t chunk_id)
{
if (is_failed_)
@@ -539,7 +539,7 @@ bool SavedGameFile::write_chunk(
return true;
}
-bool SavedGameFile::read(
+bool SavedGame::read(
void* dst_data,
int dst_size)
{
@@ -591,7 +591,7 @@ bool SavedGameFile::read(
return true;
}
-bool SavedGameFile::write(
+bool SavedGame::write(
const void* src_data,
int src_size)
{
@@ -641,12 +641,12 @@ bool SavedGameFile::write(
return true;
}
-bool SavedGameFile::is_failed() const
+bool SavedGame::is_failed() const
{
return is_failed_;
}
-bool SavedGameFile::skip(
+bool SavedGame::skip(
int count)
{
if (is_failed_)
@@ -699,29 +699,29 @@ bool SavedGameFile::skip(
return true;
}
-void SavedGameFile::save_buffer()
+void SavedGame::save_buffer()
{
saved_io_buffer_ = io_buffer_;
saved_io_buffer_offset_ = io_buffer_offset_;
}
-void SavedGameFile::load_buffer()
+void SavedGame::load_buffer()
{
io_buffer_ = saved_io_buffer_;
io_buffer_offset_ = saved_io_buffer_offset_;
}
-const void* SavedGameFile::get_buffer_data() const
+const void* SavedGame::get_buffer_data() const
{
return io_buffer_.data();
}
-int SavedGameFile::get_buffer_size() const
+int SavedGame::get_buffer_size() const
{
return static_cast<int>(io_buffer_.size());
}
-void SavedGameFile::rename(
+void SavedGame::rename(
const std::string& old_base_file_name,
const std::string& new_base_file_name)
{
@@ -744,7 +744,7 @@ void SavedGameFile::rename(
}
}
-void SavedGameFile::remove(
+void SavedGame::remove(
const std::string& base_file_name)
{
const auto&& path = generate_path(
@@ -754,19 +754,19 @@ void SavedGameFile::remove(
path.c_str());
}
-SavedGameFile& SavedGameFile::get_instance()
+SavedGame& SavedGame::get_instance()
{
- static SavedGameFile result;
+ static SavedGame result;
return result;
}
-void SavedGameFile::clear_error()
+void SavedGame::clear_error()
{
is_failed_ = false;
error_message_.clear();
}
-void SavedGameFile::throw_error()
+void SavedGame::throw_error()
{
if (error_message_.empty())
{
@@ -781,7 +781,7 @@ void SavedGameFile::throw_error()
error_message_.c_str());
}
-void SavedGameFile::compress(
+void SavedGame::compress(
const Buffer& src_buffer,
Buffer& dst_buffer)
{
@@ -844,7 +844,7 @@ void SavedGameFile::compress(
dst_index);
}
-void SavedGameFile::decompress(
+void SavedGame::decompress(
const Buffer& src_buffer,
Buffer& dst_buffer)
{
@@ -884,7 +884,7 @@ void SavedGameFile::decompress(
}
}
-std::string SavedGameFile::generate_path(
+std::string SavedGame::generate_path(
const std::string& base_file_name)
{
auto normalized_file_name = base_file_name;
@@ -900,7 +900,7 @@ std::string SavedGameFile::generate_path(
return path;
}
-std::string SavedGameFile::get_chunk_id_string(
+std::string SavedGame::get_chunk_id_string(
uint32_t chunk_id)
{
std::string result(4, '\0');
@@ -913,18 +913,18 @@ std::string SavedGameFile::get_chunk_id_string(
return result;
}
-void SavedGameFile::reset_buffer()
+void SavedGame::reset_buffer()
{
io_buffer_.clear();
reset_buffer_offset();
}
-void SavedGameFile::reset_buffer_offset()
+void SavedGame::reset_buffer_offset()
{
io_buffer_offset_ = 0;
}
-constexpr uint32_t SavedGameFile::get_jo_magic_value()
+constexpr uint32_t SavedGame::get_jo_magic_value()
{
return 0x1234ABCD;
}
diff --git a/shared/qcommon/ojk_saved_game_file.h b/shared/qcommon/ojk_saved_game.h
similarity index 88%
rename from shared/qcommon/ojk_saved_game_file.h
rename to shared/qcommon/ojk_saved_game.h
index 1de9c97..543a8a5 100644
--- a/shared/qcommon/ojk_saved_game_file.h
+++ b/shared/qcommon/ojk_saved_game.h
@@ -1,36 +1,35 @@
//
-// Saved game file.
-// (forward declaration)
+// Saved game interface implementation.
//
-#ifndef OJK_SAVED_GAME_FILE_INCLUDED
-#define OJK_SAVED_GAME_FILE_INCLUDED
+#ifndef OJK_SAVED_GAME_INCLUDED
+#define OJK_SAVED_GAME_INCLUDED
#include <cstdint>
#include <string>
#include <vector>
-#include "ojk_i_saved_game_file.h"
+#include "ojk_i_saved_game.h"
namespace ojk
{
-class SavedGameFile :
- public ISavedGameFile
+class SavedGame :
+ public ISavedGame
{
public:
- SavedGameFile();
+ SavedGame();
- SavedGameFile(
- const SavedGameFile& that) = delete;
+ SavedGame(
+ const SavedGame& that) = delete;
- SavedGameFile& operator=(
- const SavedGameFile& that) = delete;
+ SavedGame& operator=(
+ const SavedGame& that) = delete;
- virtual ~SavedGameFile();
+ virtual ~SavedGame();
// Creates a new saved game file for writing.
@@ -125,7 +124,7 @@ public:
const std::string& base_file_name);
// Returns a default instance of the class.
- static SavedGameFile& get_instance();
+ static SavedGame& get_instance();
private:
@@ -185,10 +184,10 @@ private:
uint32_t chunk_id);
static constexpr uint32_t get_jo_magic_value();
-}; // SavedGameFile
+}; // SavedGame
} // ojk
-#endif // OJK_SAVED_GAME_FILE_INCLUDED
+#endif // OJK_SAVED_GAME_INCLUDED
diff --git a/shared/qcommon/ojk_saved_game_file_helper.h b/shared/qcommon/ojk_saved_game_helper.h
similarity index 79%
rename from shared/qcommon/ojk_saved_game_file_helper.h
rename to shared/qcommon/ojk_saved_game_helper.h
index 4ee9697..1b3cc2a 100644
--- a/shared/qcommon/ojk_saved_game_file_helper.h
+++ b/shared/qcommon/ojk_saved_game_helper.h
@@ -1,15 +1,15 @@
//
-// Saved game file helper.
+// Saved game helper.
//
-#ifndef OJK_SAVED_GAME_FILE_HELPER_INCLUDED
-#define OJK_SAVED_GAME_FILE_HELPER_INCLUDED
+#ifndef OJK_SAVED_GAME_HELPER_INCLUDED
+#define OJK_SAVED_GAME_HELPER_INCLUDED
#include <cstdint>
#include <type_traits>
-#include "ojk_saved_game_file_helper_fwd.h"
+#include "ojk_saved_game_helper_fwd.h"
#include "ojk_scope_guard.h"
@@ -20,9 +20,9 @@ namespace ojk
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// Class stuff
-inline SavedGameFileHelper::SavedGameFileHelper(
- ISavedGameFile* saved_game_file) :
- saved_game_file_(saved_game_file)
+inline SavedGameHelper::SavedGameHelper(
+ ISavedGame* saved_game) :
+ saved_game_(saved_game)
{
}
@@ -33,64 +33,64 @@ inline SavedGameFileHelper::SavedGameFileHelper(
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// Public methods
-inline void SavedGameFileHelper::read_chunk(
+inline void SavedGameHelper::read_chunk(
const uint32_t chunk_id)
{
- if (!saved_game_file_->read_chunk(
+ if (!saved_game_->read_chunk(
chunk_id))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
-inline void SavedGameFileHelper::write_chunk(
+inline void SavedGameHelper::write_chunk(
const uint32_t chunk_id)
{
- if (!saved_game_file_->write_chunk(
+ if (!saved_game_->write_chunk(
chunk_id))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
-inline void SavedGameFileHelper::skip(
+inline void SavedGameHelper::skip(
int count)
{
- if (!saved_game_file_->skip(
+ if (!saved_game_->skip(
count))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
-inline const void* SavedGameFileHelper::get_buffer_data()
+inline const void* SavedGameHelper::get_buffer_data()
{
- return saved_game_file_->get_buffer_data();
+ return saved_game_->get_buffer_data();
}
-inline int SavedGameFileHelper::get_buffer_size() const
+inline int SavedGameHelper::get_buffer_size() const
{
- return saved_game_file_->get_buffer_size();
+ return saved_game_->get_buffer_size();
}
-inline void SavedGameFileHelper::reset_buffer()
+inline void SavedGameHelper::reset_buffer()
{
- saved_game_file_->reset_buffer();
+ saved_game_->reset_buffer();
}
-inline void SavedGameFileHelper::reset_buffer_offset()
+inline void SavedGameHelper::reset_buffer_offset()
{
- saved_game_file_->reset_buffer_offset();
+ saved_game_->reset_buffer_offset();
}
-inline void SavedGameFileHelper::ensure_all_data_read()
+inline void SavedGameHelper::ensure_all_data_read()
{
- saved_game_file_->ensure_all_data_read();
+ saved_game_->ensure_all_data_read();
}
-inline bool SavedGameFileHelper::is_failed() const
+inline bool SavedGameHelper::is_failed() const
{
- return saved_game_file_->is_failed();
+ return saved_game_->is_failed();
}
// Public methods
@@ -101,11 +101,11 @@ inline bool SavedGameFileHelper::is_failed() const
// try_read_chunk
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read_chunk(
+bool SavedGameHelper::try_read_chunk(
const uint32_t chunk_id,
TDst& dst_value)
{
- if (!saved_game_file_->read_chunk(
+ if (!saved_game_->read_chunk(
chunk_id))
{
return false;
@@ -117,16 +117,16 @@ bool SavedGameFileHelper::try_read_chunk(
return false;
}
- return saved_game_file_->is_all_data_read();
+ return saved_game_->is_all_data_read();
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read_chunk(
+bool SavedGameHelper::try_read_chunk(
const uint32_t chunk_id,
TDst* dst_values,
int dst_count)
{
- if (!saved_game_file_->read_chunk(
+ if (!saved_game_->read_chunk(
chunk_id))
{
return false;
@@ -139,7 +139,7 @@ bool SavedGameFileHelper::try_read_chunk(
return false;
}
- return saved_game_file_->is_all_data_read();
+ return saved_game_->is_all_data_read();
}
// try_read_chunk
@@ -150,7 +150,7 @@ bool SavedGameFileHelper::try_read_chunk(
// read_chunk
template<typename TSrc, typename TDst>
-void SavedGameFileHelper::read_chunk(
+void SavedGameHelper::read_chunk(
const uint32_t chunk_id,
TDst& dst_value)
{
@@ -158,12 +158,12 @@ void SavedGameFileHelper::read_chunk(
chunk_id,
dst_value))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
template<typename TSrc, typename TDst>
-void SavedGameFileHelper::read_chunk(
+void SavedGameHelper::read_chunk(
const uint32_t chunk_id,
TDst* dst_values,
int dst_count)
@@ -173,7 +173,7 @@ void SavedGameFileHelper::read_chunk(
dst_values,
dst_count))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
@@ -185,53 +185,53 @@ void SavedGameFileHelper::read_chunk(
// write_chunk
template<typename TSize>
-void SavedGameFileHelper::write_chunk_and_size(
+void SavedGameHelper::write_chunk_and_size(
const uint32_t size_chunk_id,
const uint32_t data_chunk_id)
{
- saved_game_file_->save_buffer();
+ saved_game_->save_buffer();
- auto data_size = saved_game_file_->get_buffer_size();
+ auto data_size = saved_game_->get_buffer_size();
- saved_game_file_->reset_buffer();
+ saved_game_->reset_buffer();
write_chunk<TSize>(
size_chunk_id,
data_size);
- saved_game_file_->load_buffer();
+ saved_game_->load_buffer();
- saved_game_file_->write_chunk(
+ saved_game_->write_chunk(
data_chunk_id);
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write_chunk(
+void SavedGameHelper::write_chunk(
const uint32_t chunk_id,
const TSrc& src_value)
{
- saved_game_file_->reset_buffer();
+ saved_game_->reset_buffer();
write<TDst>(
src_value);
- saved_game_file_->write_chunk(
+ saved_game_->write_chunk(
chunk_id);
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write_chunk(
+void SavedGameHelper::write_chunk(
const uint32_t chunk_id,
const TSrc* src_values,
int src_count)
{
- saved_game_file_->reset_buffer();
+ saved_game_->reset_buffer();
write<TDst>(
src_values,
src_count);
- saved_game_file_->write_chunk(
+ saved_game_->write_chunk(
chunk_id);
}
@@ -243,7 +243,7 @@ void SavedGameFileHelper::write_chunk(
// try_read
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst& dst_value)
{
using Tag = typename std::conditional <
@@ -289,18 +289,18 @@ bool SavedGameFileHelper::try_read(
// read
template<typename TSrc, typename TDst>
-void SavedGameFileHelper::read(
+void SavedGameHelper::read(
TDst& dst_value)
{
if (!try_read<TSrc>(
dst_value))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst& dst_value,
BooleanTag)
{
@@ -308,7 +308,7 @@ bool SavedGameFileHelper::try_read(
TSrc src_value;
- if (!saved_game_file_->read(
+ if (!saved_game_->read(
&src_value,
static_cast<int>(sizeof(TSrc))))
{
@@ -324,7 +324,7 @@ bool SavedGameFileHelper::try_read(
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst& dst_value,
NumericTag)
{
@@ -332,7 +332,7 @@ bool SavedGameFileHelper::try_read(
TSrc src_value;
- if (!saved_game_file_->read(
+ if (!saved_game_->read(
&src_value,
src_size))
{
@@ -348,7 +348,7 @@ bool SavedGameFileHelper::try_read(
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst*& dst_value,
PointerTag)
{
@@ -378,7 +378,7 @@ bool SavedGameFileHelper::try_read(
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst& dst_value,
ClassTag)
{
@@ -389,11 +389,11 @@ bool SavedGameFileHelper::try_read(
dst_value.sg_import(
*this);
- return !saved_game_file_->is_failed();
+ return !saved_game_->is_failed();
}
template<typename TSrc, typename TDst, int TCount>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst(&dst_values)[TCount],
Array1dTag)
{
@@ -403,7 +403,7 @@ bool SavedGameFileHelper::try_read(
}
template<typename TSrc, typename TDst, int TCount1, int TCount2>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst(&dst_values)[TCount1][TCount2],
Array2dTag)
{
@@ -420,7 +420,7 @@ bool SavedGameFileHelper::try_read(
// try_read (C-array)
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst* dst_values,
int dst_count)
{
@@ -484,7 +484,7 @@ bool SavedGameFileHelper::try_read(
// read (C-array)
template<typename TSrc, typename TDst>
-void SavedGameFileHelper::read(
+void SavedGameHelper::read(
TDst* dst_values,
int dst_count)
{
@@ -492,19 +492,19 @@ void SavedGameFileHelper::read(
dst_values,
dst_count))
{
- saved_game_file_->throw_error();
+ saved_game_->throw_error();
}
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst* dst_values,
int dst_count,
InplaceTag)
{
const auto dst_size = dst_count * static_cast<int>(sizeof(TDst));
- if (!saved_game_file_->read(
+ if (!saved_game_->read(
dst_values,
dst_size))
{
@@ -518,7 +518,7 @@ bool SavedGameFileHelper::try_read(
}
template<typename TSrc, typename TDst>
-bool SavedGameFileHelper::try_read(
+bool SavedGameHelper::try_read(
TDst* dst_values,
int dst_count,
CastTag)
@@ -558,7 +558,7 @@ bool SavedGameFileHelper::try_read(
// write
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc& src_value)
{
using Tag = typename std::conditional<
@@ -593,7 +593,7 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc& src_value,
NumericTag)
{
@@ -604,13 +604,13 @@ void SavedGameFileHelper::write(
// FIXME Byte order
//
- saved_game_file_->write(
+ saved_game_->write(
&dst_value,
dst_size);
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc* src_value,
PointerTag)
{
@@ -628,7 +628,7 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc& src_value,
ClassTag)
{
@@ -641,7 +641,7 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc, int TCount>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc(&src_values)[TCount],
Array1dTag)
{
@@ -651,7 +651,7 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc, int TCount1, int TCount2>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc(&src_values)[TCount1][TCount2],
Array2dTag)
{
@@ -668,7 +668,7 @@ void SavedGameFileHelper::write(
// write (C-array)
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc* src_values,
int src_count)
{
@@ -724,14 +724,14 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc* src_values,
int src_count,
InplaceTag)
{
const auto src_size = src_count * static_cast<int>(sizeof(TSrc));
- saved_game_file_->write(
+ saved_game_->write(
src_values,
src_size);
@@ -740,7 +740,7 @@ void SavedGameFileHelper::write(
}
template<typename TDst, typename TSrc>
-void SavedGameFileHelper::write(
+void SavedGameHelper::write(
const TSrc* src_values,
int src_count,
CastTag)
@@ -774,4 +774,4 @@ void SavedGameFileHelper::write(
} // ojk
-#endif // OJK_SAVED_GAME_FILE_HELPER_INCLUDED
+#endif // OJK_SAVED_GAME_HELPER_INCLUDED
diff --git a/shared/qcommon/ojk_saved_game_file_helper_fwd.h b/shared/qcommon/ojk_saved_game_helper_fwd.h
similarity index 93%
rename from shared/qcommon/ojk_saved_game_file_helper_fwd.h
rename to shared/qcommon/ojk_saved_game_helper_fwd.h
index e27daf6..7dee5b6 100644
--- a/shared/qcommon/ojk_saved_game_file_helper_fwd.h
+++ b/shared/qcommon/ojk_saved_game_helper_fwd.h
@@ -1,25 +1,25 @@
//
-// Saved game file helper.
+// Saved game helper.
// (forward declaration)
//
-#ifndef OJK_SAVED_GAME_FILE_HELPER_FWD_INCLUDED
-#define OJK_SAVED_GAME_FILE_HELPER_FWD_INCLUDED
+#ifndef OJK_SAVED_GAME_HELPER_FWD_INCLUDED
+#define OJK_SAVED_GAME_HELPER_FWD_INCLUDED
-#include "ojk_i_saved_game_file.h"
+#include "ojk_i_saved_game.h"
namespace ojk
{
-class SavedGameFileHelper
+class SavedGameHelper
{
public:
- SavedGameFileHelper(
- ISavedGameFile* saved_game_file);
+ SavedGameHelper(
+ ISavedGame* saved_game);
void read_chunk(
@@ -144,7 +144,7 @@ public:
private:
- ISavedGameFile* saved_game_file_;
+ ISavedGame* saved_game_;
// Tags for dispatching.
@@ -239,11 +239,11 @@ private:
const TSrc* src_values,
int src_count,
CastTag);
-}; // SavedGameFileHelper
+}; // SavedGameHelper
-}
+} // ojk
-#endif // OJK_SAVED_GAME_FILE_HELPER_FWD_INCLUDED
+#endif // OJK_SAVED_GAME_HELPER_FWD_INCLUDED
--
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