Skip to content

Commit

Permalink
Merged pull request "Sync with Q2PRO: Game constification, formatting…
Browse files Browse the repository at this point in the history
…, code style": NVIDIA#334
  • Loading branch information
apanteleev committed Oct 7, 2023
2 parents 9108d8b + 27a47c5 commit ce0d446
Show file tree
Hide file tree
Showing 81 changed files with 3,251 additions and 4,036 deletions.
252 changes: 252 additions & 0 deletions inc/shared/m_flash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

enum {
MZ2_TANK_BLASTER_1 = 1,
MZ2_TANK_BLASTER_2,
MZ2_TANK_BLASTER_3,
MZ2_TANK_MACHINEGUN_1,
MZ2_TANK_MACHINEGUN_2,
MZ2_TANK_MACHINEGUN_3,
MZ2_TANK_MACHINEGUN_4,
MZ2_TANK_MACHINEGUN_5,
MZ2_TANK_MACHINEGUN_6,
MZ2_TANK_MACHINEGUN_7,
MZ2_TANK_MACHINEGUN_8,
MZ2_TANK_MACHINEGUN_9,
MZ2_TANK_MACHINEGUN_10,
MZ2_TANK_MACHINEGUN_11,
MZ2_TANK_MACHINEGUN_12,
MZ2_TANK_MACHINEGUN_13,
MZ2_TANK_MACHINEGUN_14,
MZ2_TANK_MACHINEGUN_15,
MZ2_TANK_MACHINEGUN_16,
MZ2_TANK_MACHINEGUN_17,
MZ2_TANK_MACHINEGUN_18,
MZ2_TANK_MACHINEGUN_19,
MZ2_TANK_ROCKET_1,
MZ2_TANK_ROCKET_2,
MZ2_TANK_ROCKET_3,

MZ2_INFANTRY_MACHINEGUN_1,
MZ2_INFANTRY_MACHINEGUN_2,
MZ2_INFANTRY_MACHINEGUN_3,
MZ2_INFANTRY_MACHINEGUN_4,
MZ2_INFANTRY_MACHINEGUN_5,
MZ2_INFANTRY_MACHINEGUN_6,
MZ2_INFANTRY_MACHINEGUN_7,
MZ2_INFANTRY_MACHINEGUN_8,
MZ2_INFANTRY_MACHINEGUN_9,
MZ2_INFANTRY_MACHINEGUN_10,
MZ2_INFANTRY_MACHINEGUN_11,
MZ2_INFANTRY_MACHINEGUN_12,
MZ2_INFANTRY_MACHINEGUN_13,

MZ2_SOLDIER_BLASTER_1,
MZ2_SOLDIER_BLASTER_2,
MZ2_SOLDIER_SHOTGUN_1,
MZ2_SOLDIER_SHOTGUN_2,
MZ2_SOLDIER_MACHINEGUN_1,
MZ2_SOLDIER_MACHINEGUN_2,

MZ2_GUNNER_MACHINEGUN_1,
MZ2_GUNNER_MACHINEGUN_2,
MZ2_GUNNER_MACHINEGUN_3,
MZ2_GUNNER_MACHINEGUN_4,
MZ2_GUNNER_MACHINEGUN_5,
MZ2_GUNNER_MACHINEGUN_6,
MZ2_GUNNER_MACHINEGUN_7,
MZ2_GUNNER_MACHINEGUN_8,
MZ2_GUNNER_GRENADE_1,
MZ2_GUNNER_GRENADE_2,
MZ2_GUNNER_GRENADE_3,
MZ2_GUNNER_GRENADE_4,

MZ2_CHICK_ROCKET_1,

MZ2_FLYER_BLASTER_1,
MZ2_FLYER_BLASTER_2,

MZ2_MEDIC_BLASTER_1,

MZ2_GLADIATOR_RAILGUN_1,

MZ2_HOVER_BLASTER_1,

MZ2_ACTOR_MACHINEGUN_1,

MZ2_SUPERTANK_MACHINEGUN_1,
MZ2_SUPERTANK_MACHINEGUN_2,
MZ2_SUPERTANK_MACHINEGUN_3,
MZ2_SUPERTANK_MACHINEGUN_4,
MZ2_SUPERTANK_MACHINEGUN_5,
MZ2_SUPERTANK_MACHINEGUN_6,
MZ2_SUPERTANK_ROCKET_1,
MZ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];
90 changes: 2 additions & 88 deletions inc/shared/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ typedef struct vrect_s {

#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))

#define BIT(n) (1U << (n))

#define SWAP(type, a, b) \
do { type SWAP_tmp = a; a = b; b = SWAP_tmp; } while (0)

Expand Down Expand Up @@ -973,94 +975,6 @@ enum {
MZ_SILENCED = 128, // bit flag ORed with one of the above numbers
};

//
// monster muzzle flashes
//
enum {
MZ2_TANK_BLASTER_1 = 1, MZ2_TANK_BLASTER_2, MZ2_TANK_BLASTER_3,
MZ2_TANK_MACHINEGUN_1, MZ2_TANK_MACHINEGUN_2, MZ2_TANK_MACHINEGUN_3,
MZ2_TANK_MACHINEGUN_4, MZ2_TANK_MACHINEGUN_5, MZ2_TANK_MACHINEGUN_6,
MZ2_TANK_MACHINEGUN_7, MZ2_TANK_MACHINEGUN_8, MZ2_TANK_MACHINEGUN_9,
MZ2_TANK_MACHINEGUN_10, MZ2_TANK_MACHINEGUN_11, MZ2_TANK_MACHINEGUN_12,
MZ2_TANK_MACHINEGUN_13, MZ2_TANK_MACHINEGUN_14, MZ2_TANK_MACHINEGUN_15,
MZ2_TANK_MACHINEGUN_16, MZ2_TANK_MACHINEGUN_17, MZ2_TANK_MACHINEGUN_18,
MZ2_TANK_MACHINEGUN_19, MZ2_TANK_ROCKET_1, MZ2_TANK_ROCKET_2,
MZ2_TANK_ROCKET_3, MZ2_INFANTRY_MACHINEGUN_1, MZ2_INFANTRY_MACHINEGUN_2,
MZ2_INFANTRY_MACHINEGUN_3, MZ2_INFANTRY_MACHINEGUN_4,
MZ2_INFANTRY_MACHINEGUN_5, MZ2_INFANTRY_MACHINEGUN_6,
MZ2_INFANTRY_MACHINEGUN_7, MZ2_INFANTRY_MACHINEGUN_8,
MZ2_INFANTRY_MACHINEGUN_9, MZ2_INFANTRY_MACHINEGUN_10,
MZ2_INFANTRY_MACHINEGUN_11, MZ2_INFANTRY_MACHINEGUN_12,
MZ2_INFANTRY_MACHINEGUN_13, MZ2_SOLDIER_BLASTER_1, MZ2_SOLDIER_BLASTER_2,
MZ2_SOLDIER_SHOTGUN_1, MZ2_SOLDIER_SHOTGUN_2, MZ2_SOLDIER_MACHINEGUN_1,
MZ2_SOLDIER_MACHINEGUN_2, MZ2_GUNNER_MACHINEGUN_1, MZ2_GUNNER_MACHINEGUN_2,
MZ2_GUNNER_MACHINEGUN_3, MZ2_GUNNER_MACHINEGUN_4, MZ2_GUNNER_MACHINEGUN_5,
MZ2_GUNNER_MACHINEGUN_6, MZ2_GUNNER_MACHINEGUN_7, MZ2_GUNNER_MACHINEGUN_8,
MZ2_GUNNER_GRENADE_1, MZ2_GUNNER_GRENADE_2, MZ2_GUNNER_GRENADE_3,
MZ2_GUNNER_GRENADE_4, MZ2_CHICK_ROCKET_1, MZ2_FLYER_BLASTER_1,
MZ2_FLYER_BLASTER_2, MZ2_MEDIC_BLASTER_1, MZ2_GLADIATOR_RAILGUN_1,
MZ2_HOVER_BLASTER_1, MZ2_ACTOR_MACHINEGUN_1, MZ2_SUPERTANK_MACHINEGUN_1,
MZ2_SUPERTANK_MACHINEGUN_2, MZ2_SUPERTANK_MACHINEGUN_3,
MZ2_SUPERTANK_MACHINEGUN_4, MZ2_SUPERTANK_MACHINEGUN_5,
MZ2_SUPERTANK_MACHINEGUN_6, MZ2_SUPERTANK_ROCKET_1, MZ2_SUPERTANK_ROCKET_2,
MZ2_SUPERTANK_ROCKET_3, MZ2_BOSS2_MACHINEGUN_L1, MZ2_BOSS2_MACHINEGUN_L2,
MZ2_BOSS2_MACHINEGUN_L3, MZ2_BOSS2_MACHINEGUN_L4, MZ2_BOSS2_MACHINEGUN_L5,
MZ2_BOSS2_ROCKET_1, MZ2_BOSS2_ROCKET_2, MZ2_BOSS2_ROCKET_3,
MZ2_BOSS2_ROCKET_4, MZ2_FLOAT_BLASTER_1, MZ2_SOLDIER_BLASTER_3,
MZ2_SOLDIER_SHOTGUN_3, MZ2_SOLDIER_MACHINEGUN_3, MZ2_SOLDIER_BLASTER_4,
MZ2_SOLDIER_SHOTGUN_4, MZ2_SOLDIER_MACHINEGUN_4, MZ2_SOLDIER_BLASTER_5,
MZ2_SOLDIER_SHOTGUN_5, MZ2_SOLDIER_MACHINEGUN_5, MZ2_SOLDIER_BLASTER_6,
MZ2_SOLDIER_SHOTGUN_6, MZ2_SOLDIER_MACHINEGUN_6, MZ2_SOLDIER_BLASTER_7,
MZ2_SOLDIER_SHOTGUN_7, MZ2_SOLDIER_MACHINEGUN_7, MZ2_SOLDIER_BLASTER_8,
MZ2_SOLDIER_SHOTGUN_8, MZ2_SOLDIER_MACHINEGUN_8,

// --- Xian shit below ---
MZ2_MAKRON_BFG, MZ2_MAKRON_BLASTER_1, MZ2_MAKRON_BLASTER_2,
MZ2_MAKRON_BLASTER_3, MZ2_MAKRON_BLASTER_4, MZ2_MAKRON_BLASTER_5,
MZ2_MAKRON_BLASTER_6, MZ2_MAKRON_BLASTER_7, MZ2_MAKRON_BLASTER_8,
MZ2_MAKRON_BLASTER_9, MZ2_MAKRON_BLASTER_10, MZ2_MAKRON_BLASTER_11,
MZ2_MAKRON_BLASTER_12, MZ2_MAKRON_BLASTER_13, MZ2_MAKRON_BLASTER_14,
MZ2_MAKRON_BLASTER_15, MZ2_MAKRON_BLASTER_16, MZ2_MAKRON_BLASTER_17,
MZ2_MAKRON_RAILGUN_1, MZ2_JORG_MACHINEGUN_L1, MZ2_JORG_MACHINEGUN_L2,
MZ2_JORG_MACHINEGUN_L3, MZ2_JORG_MACHINEGUN_L4, MZ2_JORG_MACHINEGUN_L5,
MZ2_JORG_MACHINEGUN_L6, MZ2_JORG_MACHINEGUN_R1, MZ2_JORG_MACHINEGUN_R2,
MZ2_JORG_MACHINEGUN_R3, MZ2_JORG_MACHINEGUN_R4, MZ2_JORG_MACHINEGUN_R5,
MZ2_JORG_MACHINEGUN_R6, MZ2_JORG_BFG_1, MZ2_BOSS2_MACHINEGUN_R1,
MZ2_BOSS2_MACHINEGUN_R2, MZ2_BOSS2_MACHINEGUN_R3, MZ2_BOSS2_MACHINEGUN_R4,
MZ2_BOSS2_MACHINEGUN_R5,

//ROGUE
MZ2_CARRIER_MACHINEGUN_L1, MZ2_CARRIER_MACHINEGUN_R1, MZ2_CARRIER_GRENADE,
MZ2_TURRET_MACHINEGUN, MZ2_TURRET_ROCKET, MZ2_TURRET_BLASTER,
MZ2_STALKER_BLASTER, MZ2_DAEDALUS_BLASTER, MZ2_MEDIC_BLASTER_2,
MZ2_CARRIER_RAILGUN, MZ2_WIDOW_DISRUPTOR, MZ2_WIDOW_BLASTER,
MZ2_WIDOW_RAIL, MZ2_WIDOW_PLASMABEAM, MZ2_CARRIER_MACHINEGUN_L2,
MZ2_CARRIER_MACHINEGUN_R2, MZ2_WIDOW_RAIL_LEFT, MZ2_WIDOW_RAIL_RIGHT,
MZ2_WIDOW_BLASTER_SWEEP1, MZ2_WIDOW_BLASTER_SWEEP2,
MZ2_WIDOW_BLASTER_SWEEP3, MZ2_WIDOW_BLASTER_SWEEP4,
MZ2_WIDOW_BLASTER_SWEEP5, MZ2_WIDOW_BLASTER_SWEEP6,
MZ2_WIDOW_BLASTER_SWEEP7, MZ2_WIDOW_BLASTER_SWEEP8,
MZ2_WIDOW_BLASTER_SWEEP9, MZ2_WIDOW_BLASTER_100, MZ2_WIDOW_BLASTER_90,
MZ2_WIDOW_BLASTER_80, MZ2_WIDOW_BLASTER_70, MZ2_WIDOW_BLASTER_60,
MZ2_WIDOW_BLASTER_50, MZ2_WIDOW_BLASTER_40, MZ2_WIDOW_BLASTER_30,
MZ2_WIDOW_BLASTER_20, MZ2_WIDOW_BLASTER_10, MZ2_WIDOW_BLASTER_0,
MZ2_WIDOW_BLASTER_10L, MZ2_WIDOW_BLASTER_20L, MZ2_WIDOW_BLASTER_30L,
MZ2_WIDOW_BLASTER_40L, MZ2_WIDOW_BLASTER_50L, MZ2_WIDOW_BLASTER_60L,
MZ2_WIDOW_BLASTER_70L, MZ2_WIDOW_RUN_1, MZ2_WIDOW_RUN_2, MZ2_WIDOW_RUN_3,
MZ2_WIDOW_RUN_4, MZ2_WIDOW_RUN_5, MZ2_WIDOW_RUN_6, MZ2_WIDOW_RUN_7,
MZ2_WIDOW_RUN_8, MZ2_CARRIER_ROCKET_1, MZ2_CARRIER_ROCKET_2,
MZ2_CARRIER_ROCKET_3, MZ2_CARRIER_ROCKET_4, MZ2_WIDOW2_BEAMER_1,
MZ2_WIDOW2_BEAMER_2, MZ2_WIDOW2_BEAMER_3, MZ2_WIDOW2_BEAMER_4,
MZ2_WIDOW2_BEAMER_5, MZ2_WIDOW2_BEAM_SWEEP_1, MZ2_WIDOW2_BEAM_SWEEP_2,
MZ2_WIDOW2_BEAM_SWEEP_3, MZ2_WIDOW2_BEAM_SWEEP_4, MZ2_WIDOW2_BEAM_SWEEP_5,
MZ2_WIDOW2_BEAM_SWEEP_6, MZ2_WIDOW2_BEAM_SWEEP_7, MZ2_WIDOW2_BEAM_SWEEP_8,
MZ2_WIDOW2_BEAM_SWEEP_9, MZ2_WIDOW2_BEAM_SWEEP_10,
MZ2_WIDOW2_BEAM_SWEEP_11,
//ROGUE
};

extern const vec3_t monster_flash_offset[256];


// temp entity events
//
Expand Down
Loading

0 comments on commit ce0d446

Please sign in to comment.