| 1 |
/* Emacs style mode select -*- C -*- |
| 2 |
*----------------------------------------------------------------------------- |
| 3 |
* |
| 4 |
* |
| 5 |
* PrBoom: a Doom port merged with LxDoom and LSDLDoom |
| 6 |
* based on BOOM, a modified and improved DOOM engine |
| 7 |
* Copyright (C) 1999 by |
| 8 |
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
| 9 |
* Copyright (C) 1999-2000 by |
| 10 |
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
| 11 |
* Copyright 2005, 2006 by |
| 12 |
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko |
| 13 |
* |
| 14 |
* This program is free software; you can redistribute it and/or |
| 15 |
* modify it under the terms of the GNU General Public License |
| 16 |
* as published by the Free Software Foundation; either version 2 |
| 17 |
* of the License, or (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 27 |
* 02111-1307, USA. |
| 28 |
* |
| 29 |
* DESCRIPTION: |
| 30 |
* Sprite animation. |
| 31 |
* |
| 32 |
*-----------------------------------------------------------------------------*/ |
| 33 |
|
| 34 |
#ifndef __P_PSPR__ |
| 35 |
#define __P_PSPR__ |
| 36 |
|
| 37 |
#include "p_mobj.h" |
| 38 |
|
| 39 |
/* Basic data types. |
| 40 |
* Needs fixed point, and BAM angles. */ |
| 41 |
|
| 42 |
#include "m_fixed.h" |
| 43 |
#include "tables.h" |
| 44 |
|
| 45 |
/* Needs to include the precompiled sprite animation tables. |
| 46 |
* |
| 47 |
* Header generated by multigen utility. |
| 48 |
* This includes all the data for thing animation, |
| 49 |
* i.e. the Thing Atrributes table and the Frame Sequence table. |
| 50 |
*/ |
| 51 |
|
| 52 |
#include "info.h" |
| 53 |
|
| 54 |
/* |
| 55 |
* Frame flags: |
| 56 |
* handles maximum brightness (torches, muzzle flare, light sources) |
| 57 |
*/ |
| 58 |
|
| 59 |
#define FF_FULLBRIGHT 0x8000 /* flag in thing->frame */ |
| 60 |
#define FF_FRAMEMASK 0x7fff |
| 61 |
|
| 62 |
/* |
| 63 |
* Overlay psprites are scaled shapes |
| 64 |
* drawn directly on the view screen, |
| 65 |
* coordinates are given for a 320*200 view screen. |
| 66 |
*/ |
| 67 |
|
| 68 |
typedef enum |
| 69 |
{ |
| 70 |
ps_weapon, |
| 71 |
ps_flash, |
| 72 |
NUMPSPRITES |
| 73 |
} psprnum_t; |
| 74 |
|
| 75 |
typedef struct |
| 76 |
{ |
| 77 |
state_t *state; /* a NULL state means not active */ |
| 78 |
int tics; |
| 79 |
fixed_t sx; |
| 80 |
fixed_t sy; |
| 81 |
} pspdef_t; |
| 82 |
|
| 83 |
enum |
| 84 |
{ |
| 85 |
CENTERWEAPON_OFF, |
| 86 |
CENTERWEAPON_HOR, |
| 87 |
CENTERWEAPON_HORVER, |
| 88 |
CENTERWEAPON_BOB, |
| 89 |
NUM_CENTERWEAPON, |
| 90 |
}; |
| 91 |
|
| 92 |
int P_WeaponPreferred(int w1, int w2); |
| 93 |
|
| 94 |
struct player_s; |
| 95 |
int P_SwitchWeapon(struct player_s *player); |
| 96 |
dboolean P_CheckAmmo(struct player_s *player); |
| 97 |
void P_SubtractAmmo(struct player_s *player, int compat_amt); |
| 98 |
void P_SetupPsprites(struct player_s *curplayer); |
| 99 |
void P_MovePsprites(struct player_s *curplayer); |
| 100 |
void P_DropWeapon(struct player_s *player); |
| 101 |
int P_AmmoPercent(struct player_s *player, int weapon); |
| 102 |
|
| 103 |
void A_Light0(struct player_s *player, pspdef_t *psp); |
| 104 |
void A_WeaponReady(struct player_s *player, pspdef_t *psp); |
| 105 |
void A_Lower(struct player_s *player, pspdef_t *psp); |
| 106 |
void A_Raise(struct player_s *player, pspdef_t *psp); |
| 107 |
void A_Punch(struct player_s *player, pspdef_t *psp); |
| 108 |
void A_ReFire(struct player_s *player, pspdef_t *psp); |
| 109 |
void A_FirePistol(struct player_s *player, pspdef_t *psp); |
| 110 |
void A_Light1(struct player_s *player, pspdef_t *psp); |
| 111 |
void A_FireShotgun(struct player_s *player, pspdef_t *psp); |
| 112 |
void A_Light2(struct player_s *player, pspdef_t *psp); |
| 113 |
void A_FireShotgun2(struct player_s *player, pspdef_t *psp); |
| 114 |
void A_CheckReload(struct player_s *player, pspdef_t *psp); |
| 115 |
void A_OpenShotgun2(struct player_s *player, pspdef_t *psp); |
| 116 |
void A_LoadShotgun2(struct player_s *player, pspdef_t *psp); |
| 117 |
void A_CloseShotgun2(struct player_s *player, pspdef_t *psp); |
| 118 |
void A_FireCGun(struct player_s *player, pspdef_t *psp); |
| 119 |
void A_GunFlash(struct player_s *player, pspdef_t *psp); |
| 120 |
void A_FireMissile(struct player_s *player, pspdef_t *psp); |
| 121 |
void A_Saw(struct player_s *player, pspdef_t *psp); |
| 122 |
void A_FirePlasma(struct player_s *player, pspdef_t *psp); |
| 123 |
void A_BFGsound(struct player_s *player, pspdef_t *psp); |
| 124 |
void A_FireBFG(struct player_s *player, pspdef_t *psp); |
| 125 |
void A_BFGSpray(mobj_t *mo); |
| 126 |
void A_FireOldBFG(struct player_s *player, pspdef_t *psp); |
| 127 |
|
| 128 |
// [XA] New mbf21 codepointers |
| 129 |
|
| 130 |
void A_WeaponProjectile(struct player_s *player, pspdef_t *psp); |
| 131 |
void A_WeaponBulletAttack(struct player_s *player, pspdef_t *psp); |
| 132 |
void A_WeaponMeleeAttack(struct player_s *player, pspdef_t *psp); |
| 133 |
void A_WeaponSound(struct player_s *player, pspdef_t *psp); |
| 134 |
void A_WeaponAlert(struct player_s *player, pspdef_t *psp); |
| 135 |
void A_WeaponJump(struct player_s *player, pspdef_t *psp); |
| 136 |
void A_ConsumeAmmo(struct player_s *player, pspdef_t *psp); |
| 137 |
void A_CheckAmmo(struct player_s *player, pspdef_t *psp); |
| 138 |
void A_RefireTo(struct player_s *player, pspdef_t *psp); |
| 139 |
void A_GunFlashTo(struct player_s *player, pspdef_t *psp); |
| 140 |
|
| 141 |
// heretic |
| 142 |
|
| 143 |
void P_RepositionMace(mobj_t * mo); |
| 144 |
void P_ActivateBeak(struct player_s * player); |
| 145 |
void P_PostChickenWeapon(struct player_s * player, weapontype_t weapon); |
| 146 |
void P_SetPsprite(struct player_s * player, int position, statenum_t stnum); |
| 147 |
void P_SetPspritePtr(struct player_s * player, pspdef_t *psp, statenum_t stnum); |
| 148 |
void P_OpenWeapons(void); |
| 149 |
void P_CloseWeapons(void); |
| 150 |
void P_AddMaceSpot(const mapthing_t * mthing); |
| 151 |
void P_DropWeapon(struct player_s * player); |
| 152 |
void P_UpdateBeak(struct player_s * player, pspdef_t * psp); |
| 153 |
|
| 154 |
// hexen |
| 155 |
|
| 156 |
void P_SetPspriteNF(struct player_s * player, int position, statenum_t stnum); |
| 157 |
void P_PostMorphWeapon(struct player_s * player, weapontype_t weapon); |
| 158 |
void P_ActivateMorphWeapon(struct player_s * player); |
| 159 |
|
| 160 |
#endif |