[openjk] 87/130: Fix merge
Simon McVittie
smcv at debian.org
Fri Oct 28 11:09:23 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 66683dd7d2fb3846015086441e2a4153d60d6c39
Author: bibendovsky <bibendovsky at hotmail.com>
Date: Tue Aug 30 20:56:08 2016 +0300
Fix merge
---
code/game/g_savegame.cpp | 2 +-
code/server/sv_savegame.cpp | 14 +++++++-------
shared/qcommon/ojk_saved_game.cpp | 2 +-
shared/qcommon/ojk_saved_game_helper.h | 16 ++++++++--------
shared/qcommon/q_math.h | 27 +++++++++++++++++++++++++++
5 files changed, 44 insertions(+), 17 deletions(-)
diff --git a/code/game/g_savegame.cpp b/code/game/g_savegame.cpp
index c1e0224..24b5d78 100644
--- a/code/game/g_savegame.cpp
+++ b/code/game/g_savegame.cpp
@@ -680,7 +680,7 @@ void saberInfoRetail_t::sg_export(
{
::WP_SaberSetDefaults(
&dst,
- false);
+ qfalse);
if (!activeBlocking)
{
diff --git a/code/server/sv_savegame.cpp b/code/server/sv_savegame.cpp
index 2fe4cd1..053196d 100644
--- a/code/server/sv_savegame.cpp
+++ b/code/server/sv_savegame.cpp
@@ -907,7 +907,7 @@ static bool SG_ReadScreenshot(
jpeg_data = static_cast<byte*>(::Z_Malloc(
static_cast<int>(screenshot_length + 4096),
TAG_TEMP_WORKSPACE,
- false));
+ qfalse));
}
//
@@ -984,14 +984,14 @@ qboolean SG_GetSaveImage(
{
if (!base_name)
{
- return false;
+ return qfalse;
}
ojk::SavedGame& saved_game = ojk::SavedGame::get_instance();
if (!saved_game.open(base_name))
{
- return false;
+ return qfalse;
}
bool is_succeed = true;
@@ -1017,7 +1017,7 @@ qboolean SG_GetSaveImage(
saved_game.close();
- return is_succeed;
+ return is_succeed ? qtrue : qfalse;
}
@@ -1297,7 +1297,7 @@ qboolean SG_ReadSavegame(
::SG_ReadCvars();
// read game state
- const int qbAutosave = ::ReadGame();
+ const qboolean qbAutosave = ::ReadGame();
::eSavedGameJustLoaded = (qbAutosave ? eAUTO : eFULL);
@@ -1305,7 +1305,7 @@ qboolean SG_ReadSavegame(
::SV_SpawnServer(
sMapCmd,
eForceReload_NOTHING,
- (::eSavedGameJustLoaded != eFULL));
+ (::eSavedGameJustLoaded != eFULL ? qtrue : qfalse));
// read in all the level data...
//
@@ -1328,7 +1328,7 @@ qboolean SG_ReadSavegame(
qbAutosave,
qbLoadTransition);
- return true;
+ return qtrue;
}
void SG_TestSave(void)
diff --git a/shared/qcommon/ojk_saved_game.cpp b/shared/qcommon/ojk_saved_game.cpp
index ae62998..79704a0 100644
--- a/shared/qcommon/ojk_saved_game.cpp
+++ b/shared/qcommon/ojk_saved_game.cpp
@@ -47,7 +47,7 @@ bool SavedGame::open(
static_cast<void>(::FS_FOpenFileRead(
file_path.c_str(),
&file_handle_,
- true));
+ qtrue));
if (file_handle_ == 0)
{
diff --git a/shared/qcommon/ojk_saved_game_helper.h b/shared/qcommon/ojk_saved_game_helper.h
index 00a7997..0cf8426 100644
--- a/shared/qcommon/ojk_saved_game_helper.h
+++ b/shared/qcommon/ojk_saved_game_helper.h
@@ -432,9 +432,8 @@ bool SavedGameHelper::try_read(
int dst_count)
{
static_assert(
- (std::is_arithmetic<TDst>::value &&
- !std::is_same<TDst, bool>::value &&
- !std::is_enum<TDst>::value) ||
+ std::is_arithmetic<TDst>::value ||
+ std::is_enum<TDst>::value ||
std::is_pointer<TDst>::value ||
std::is_class<TDst>::value,
"Unsupported types.");
@@ -531,7 +530,8 @@ bool SavedGameHelper::try_read(
CastTag)
{
using Tag = typename std::conditional<
- std::is_arithmetic<TDst>::value,
+ std::is_arithmetic<TDst>::value ||
+ std::is_enum<TDst>::value,
NumericTag,
typename std::conditional<
std::is_pointer<TDst>::value,
@@ -680,9 +680,8 @@ void SavedGameHelper::write(
int src_count)
{
static_assert(
- (std::is_arithmetic<TSrc>::value &&
- !std::is_same<TSrc, bool>::value &&
- !std::is_enum<TSrc>::value) ||
+ std::is_arithmetic<TSrc>::value ||
+ std::is_enum<TSrc>::value ||
std::is_pointer<TSrc>::value ||
std::is_class<TSrc>::value,
"Unsupported types.");
@@ -753,7 +752,8 @@ void SavedGameHelper::write(
CastTag)
{
using Tag = typename std::conditional<
- std::is_arithmetic<TSrc>::value,
+ std::is_arithmetic<TSrc>::value ||
+ std::is_enum<TSrc>::value,
NumericTag,
typename std::conditional<
std::is_pointer<TSrc>::value,
diff --git a/shared/qcommon/q_math.h b/shared/qcommon/q_math.h
index e4399d6..4005e58 100644
--- a/shared/qcommon/q_math.h
+++ b/shared/qcommon/q_math.h
@@ -24,6 +24,10 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "q_platform.h"
+#ifdef __cplusplus
+#include "ojk_saved_game_helper_fwd.h"
+#endif // __cplusplus
+
#if defined(__cplusplus)
extern "C" {
#endif
@@ -180,6 +184,29 @@ typedef struct cplane_s {
byte type; // for fast side tests: 0,1,2 = axial, 3 = nonaxial
byte signbits; // signx + (signy<<1) + (signz<<2), used as lookup during collision
byte pad[2];
+
+
+#ifdef __cplusplus
+ void sg_export(
+ ojk::SavedGameHelper& saved_game) const
+ {
+ saved_game.write<float>(normal);
+ saved_game.write<float>(dist);
+ saved_game.write<uint8_t>(type);
+ saved_game.write<uint8_t>(signbits);
+ saved_game.write<uint8_t>(pad);
+ }
+
+ void sg_import(
+ ojk::SavedGameHelper& saved_game)
+ {
+ saved_game.read<float>(normal);
+ saved_game.read<float>(dist);
+ saved_game.read<uint8_t>(type);
+ saved_game.read<uint8_t>(signbits);
+ saved_game.read<uint8_t>(pad);
+ }
+#endif // __cplusplus
} cplane_t;
void SetPlaneSignbits( cplane_t *out );
--
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