Skip to content

Commit

Permalink
xrGame: Explicit narrowing u32-int cast (ugly)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri committed Sep 16, 2018
1 parent 7119e15 commit 2cbf6c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
23 changes: 12 additions & 11 deletions src/xrGame/ai_sounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#include "ai_sounds.h"
#include "xrCore/xr_token.h"

const xr_token anomaly_type_token[] = {{"undefined", sg_Undefined}, {"Item picking up", SOUND_TYPE_ITEM_PICKING_UP},
{"Item dropping", SOUND_TYPE_ITEM_DROPPING}, {"Item taking", SOUND_TYPE_ITEM_TAKING},
{"Item hiding", SOUND_TYPE_ITEM_HIDING}, {"Item using", SOUND_TYPE_ITEM_USING},
{"Weapon shooting", SOUND_TYPE_WEAPON_SHOOTING}, {"Weapon empty clicking", SOUND_TYPE_WEAPON_EMPTY_CLICKING},
{"Weapon bullet hit", SOUND_TYPE_WEAPON_BULLET_HIT}, {"Weapon recharging", SOUND_TYPE_WEAPON_RECHARGING},
{"NPC dying", SOUND_TYPE_MONSTER_DYING}, {"NPC injuring", SOUND_TYPE_MONSTER_INJURING},
{"NPC step", SOUND_TYPE_MONSTER_STEP}, {"NPC talking", SOUND_TYPE_MONSTER_TALKING},
{"NPC attacking", SOUND_TYPE_MONSTER_ATTACKING}, {"NPC eating", SOUND_TYPE_MONSTER_EATING},
{"Anomaly idle", SOUND_TYPE_ANOMALY_IDLE}, {"Object breaking", SOUND_TYPE_WORLD_OBJECT_BREAKING},
{"Object colliding", SOUND_TYPE_WORLD_OBJECT_COLLIDING}, {"Object exploding", SOUND_TYPE_WORLD_OBJECT_EXPLODING},
{"World ambient", SOUND_TYPE_WORLD_AMBIENT}, {0, 0}};
const xr_token anomaly_type_token[] = {
{"undefined", int(sg_Undefined)}, {"Item picking up", int(SOUND_TYPE_ITEM_PICKING_UP)},
{"Item dropping", int(SOUND_TYPE_ITEM_DROPPING)}, {"Item taking", int(SOUND_TYPE_ITEM_TAKING)},
{"Item hiding", int(SOUND_TYPE_ITEM_HIDING)}, {"Item using", int(SOUND_TYPE_ITEM_USING)},
{"Weapon shooting", int(SOUND_TYPE_WEAPON_SHOOTING)}, {"Weapon empty clicking", int(SOUND_TYPE_WEAPON_EMPTY_CLICKING)},
{"Weapon bullet hit", int(SOUND_TYPE_WEAPON_BULLET_HIT)}, {"Weapon recharging", int(SOUND_TYPE_WEAPON_RECHARGING)},
{"NPC dying", int(SOUND_TYPE_MONSTER_DYING)}, {"NPC injuring", int(SOUND_TYPE_MONSTER_INJURING)},
{"NPC step", int(SOUND_TYPE_MONSTER_STEP)}, {"NPC talking", int(SOUND_TYPE_MONSTER_TALKING)},
{"NPC attacking", int(SOUND_TYPE_MONSTER_ATTACKING)}, {"NPC eating", int(SOUND_TYPE_MONSTER_EATING)},
{"Anomaly idle", int(SOUND_TYPE_ANOMALY_IDLE)}, {"Object breaking", int(SOUND_TYPE_WORLD_OBJECT_BREAKING)},
{"Object colliding", int(SOUND_TYPE_WORLD_OBJECT_COLLIDING)}, {"Object exploding", int(SOUND_TYPE_WORLD_OBJECT_EXPLODING)},
{"World ambient", int(SOUND_TYPE_WORLD_AMBIENT)}, {0, 0}};
6 changes: 3 additions & 3 deletions src/xrGame/game_sv_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ u32 g_sv_base_dwRPointFreezeTime = 0;
int g_sv_base_iVotingEnabled = 0x00ff;
//-----------------------------------------------------------------

extern const xr_token round_end_result_str[] = {{"Finish", eRoundEnd_Finish}, {"Game restarted", eRoundEnd_GameRestarted},
{"Game restarted fast", eRoundEnd_GameRestartedFast}, {"Time limit", eRoundEnd_TimeLimit},
{"Frag limit", eRoundEnd_FragLimit}, {"Artefact limit", eRoundEnd_ArtrefactLimit}, {"Unknown", eRoundEnd_Force},
extern const xr_token round_end_result_str[] = {{"Finish", int(eRoundEnd_Finish)}, {"Game restarted", int(eRoundEnd_GameRestarted)},
{"Game restarted fast", int(eRoundEnd_GameRestartedFast)}, {"Time limit", int(eRoundEnd_TimeLimit)},
{"Frag limit", int(eRoundEnd_FragLimit)}, {"Artefact limit", int(eRoundEnd_ArtrefactLimit)}, {"Unknown", int(eRoundEnd_Force)},
{0, 0}};

// Main
Expand Down

0 comments on commit 2cbf6c0

Please sign in to comment.