From 5df0dde756e7caada50933309e2d47474f8c0a4f Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 11 Apr 2022 17:49:49 -0600 Subject: [PATCH] map.cc: move rgfStartSpots to map struct --- include/qbsp/map.hh | 3 +++ qbsp/map.cc | 16 +++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/qbsp/map.hh b/include/qbsp/map.hh index 4d8bfdc4..23e58885 100644 --- a/include/qbsp/map.hh +++ b/include/qbsp/map.hh @@ -154,6 +154,9 @@ struct mapdata_t // Q2 stuff int32_t numareaportals; + // misc + int start_spots = 0; + // helpers const std::string &miptexTextureName(int mt) const { return miptex.at(mt).name; } diff --git a/qbsp/map.cc b/qbsp/map.cc index f8dd5e81..63bb8ab3 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -46,8 +46,6 @@ #define info_player_deathmatch 2 #define info_player_coop 4 -static int rgfStartSpots; - struct texdef_valve_t { qmat axis{}; @@ -441,14 +439,14 @@ static void ParseEpair(parser_t &parser, mapentity_t *entity) // Quake II uses multiple starts for level transitions/backtracking. // TODO: instead, this should check targetnames. There should only be // one info_player_start per targetname in Q2. - if (options.target_game->id != GAME_QUAKE_II && (rgfStartSpots & info_player_start)) { + if (options.target_game->id != GAME_QUAKE_II && (map.start_spots & info_player_start)) { logging::print("WARNING: Multiple info_player_start entities\n"); } - rgfStartSpots |= info_player_start; + map.start_spots |= info_player_start; } else if (string_iequals(parser.token, "info_player_deathmatch")) { - rgfStartSpots |= info_player_deathmatch; + map.start_spots |= info_player_deathmatch; } else if (string_iequals(parser.token, "info_player_coop")) { - rgfStartSpots |= info_player_coop; + map.start_spots |= info_player_coop; } } } @@ -1894,11 +1892,11 @@ void LoadMapFile(void) } // Print out warnings for entities - if (!(rgfStartSpots & info_player_start)) + if (!(map.start_spots & info_player_start)) logging::print("WARNING: No info_player_start entity in level\n"); - if (!(rgfStartSpots & info_player_deathmatch)) + if (!(map.start_spots & info_player_deathmatch)) logging::print("WARNING: No info_player_deathmatch entities in level\n"); - // if (!(rgfStartSpots & info_player_coop)) + // if (!(map.start_spots & info_player_coop)) // logging::print("WARNING: No info_player_coop entities in level\n"); logging::print(logging::flag::STAT, " {:8} faces\n", map.numfaces());