summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Greffrath2015-04-13 08:33:57 +0200
committerFabian Greffrath2015-04-13 08:57:16 +0200
commite1426b004c0446dff935da2d62d13c696ca24dad (patch)
tree7136434df4c8677489f7771ee2b68c4169ef20a3
parent7504716edfe360c6a72d4d10eb4213d9cfe1f551 (diff)
downloadchocolate-doom-e1426b004c0446dff935da2d62d13c696ca24dad.tar.gz
chocolate-doom-e1426b004c0446dff935da2d62d13c696ca24dad.tar.bz2
chocolate-doom-e1426b004c0446dff935da2d62d13c696ca24dad.zip
Fix assigning structs not compiling on Visual Studio
-rw-r--r--src/hexen/sb_bar.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c
index 3846f4c6..52a65824 100644
--- a/src/hexen/sb_bar.c
+++ b/src/hexen/sb_bar.c
@@ -242,6 +242,10 @@ static Cheat_t Cheats[] = {
{CheatRevealFunc, &CheatRevealSeq},
};
+#define SET_CHEAT(cheat, seq) \
+ { memcpy(cheat.sequence, seq, sizeof(seq)); \
+ cheat.sequence_len = sizeof(seq) - 1; }
+
// CODE --------------------------------------------------------------------
//==========================================================================
@@ -306,30 +310,30 @@ void SB_Init(void)
if (gamemode == shareware)
{
- CheatGodSeq = (cheatseq_t) CHEAT("bgokey", 0);
- CheatNoClipSeq = (cheatseq_t) CHEAT("rjohnson", 0);
- CheatWeaponsSeq = (cheatseq_t) CHEAT("crhinehart", 0);
- CheatHealthSeq = (cheatseq_t) CHEAT("sgurno", 0);
- CheatKeysSeq = (cheatseq_t) CHEAT("mraymondjudy", 0);
- CheatSoundSeq = (cheatseq_t) CHEAT("kschilder", 0);
- CheatTickerSeq = (cheatseq_t) CHEAT("rrettenmund", 0);
- CheatArtifactAllSeq = (cheatseq_t) CHEAT("braffel", 0);
- CheatPuzzleSeq = (cheatseq_t) CHEAT("tmoore", 0);
- CheatWarpSeq = (cheatseq_t) CHEAT("bpelletier", 2);
- CheatPigSeq = (cheatseq_t) CHEAT("ebiessman", 0);
- CheatMassacreSeq = (cheatseq_t) CHEAT("cstika", 0);
- CheatIDKFASeq = (cheatseq_t) CHEAT("rambo", 0);
- CheatQuickenSeq1 = (cheatseq_t) CHEAT("quicken", 0);
- CheatQuickenSeq2 = (cheatseq_t) CHEAT("quickenquicken", 0);
- CheatQuickenSeq3 = (cheatseq_t) CHEAT("quickenquickenquicken", 0);
- CheatClass1Seq = (cheatseq_t) CHEAT("plipo", 0);
- CheatClass2Seq = (cheatseq_t) CHEAT("plipo", 1);
- CheatVersionSeq = (cheatseq_t) CHEAT("pmacarther", 0);
- CheatDebugSeq = (cheatseq_t) CHEAT("jsumwalt", 0);
- CheatScriptSeq1 = (cheatseq_t) CHEAT("mwagabaza", 0);
- CheatScriptSeq2 = (cheatseq_t) CHEAT("mwagabaza", 1);
- CheatScriptSeq3 = (cheatseq_t) CHEAT("mwagabaza", 2);
- CheatRevealSeq = (cheatseq_t) CHEAT("reveal", 0);
+ SET_CHEAT(CheatGodSeq, "bgokey");
+ SET_CHEAT(CheatNoClipSeq, "rjohnson");
+ SET_CHEAT(CheatWeaponsSeq, "crhinehart");
+ SET_CHEAT(CheatHealthSeq,"sgurno");
+ SET_CHEAT(CheatKeysSeq, "mraymondjudy");
+ SET_CHEAT(CheatSoundSeq, "kschilder");
+ SET_CHEAT(CheatTickerSeq, "rrettenmund");
+ SET_CHEAT(CheatArtifactAllSeq, "braffel");
+ SET_CHEAT(CheatPuzzleSeq, "tmoore");
+ SET_CHEAT(CheatWarpSeq, "bpelletier");
+ SET_CHEAT(CheatPigSeq, "ebiessman");
+ SET_CHEAT(CheatMassacreSeq, "cstika");
+ SET_CHEAT(CheatIDKFASeq, "rambo");
+ SET_CHEAT(CheatQuickenSeq1, "quicken");
+ SET_CHEAT(CheatQuickenSeq2, "quickenquicken");
+ SET_CHEAT(CheatQuickenSeq3, "quickenquickenquicken");
+ SET_CHEAT(CheatClass1Seq, "plipo");
+ SET_CHEAT(CheatClass2Seq, "plipo");
+ SET_CHEAT(CheatVersionSeq, "pmacarther");
+ SET_CHEAT(CheatDebugSeq, "jsumwalt");
+ SET_CHEAT(CheatScriptSeq1, "mwagabaza");
+ SET_CHEAT(CheatScriptSeq2, "mwagabaza");
+ SET_CHEAT(CheatScriptSeq3, "mwagabaza");
+ SET_CHEAT(CheatRevealSeq, "reveal");
}
}