2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Sprite animation.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __P_PSPR_H__
|
|
|
|
#define __P_PSPR_H__
|
|
|
|
|
|
|
|
// Basic data types.
|
|
|
|
// Needs fixed point, and BAM angles.
|
|
|
|
#include "tables.h"
|
2008-08-10 22:48:37 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#define WEAPONBOTTOM 128*FRACUNIT
|
|
|
|
|
|
|
|
// [RH] +0x6000 helps it meet the screen bottom
|
|
|
|
// at higher resolutions while still being in
|
|
|
|
// the right spot at 320x200.
|
|
|
|
#define WEAPONTOP (32*FRACUNIT+0x6000)
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Overlay psprites are scaled shapes
|
|
|
|
// drawn directly on the view screen,
|
|
|
|
// coordinates are given for a 320*200 view screen.
|
|
|
|
//
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ps_weapon,
|
|
|
|
ps_flash,
|
|
|
|
ps_targetcenter,
|
|
|
|
ps_targetleft,
|
|
|
|
ps_targetright,
|
|
|
|
NUMPSPRITES
|
|
|
|
|
|
|
|
} psprnum_t;
|
|
|
|
|
2008-09-15 00:47:31 +00:00
|
|
|
/*
|
2006-02-24 04:48:15 +00:00
|
|
|
inline FArchive &operator<< (FArchive &arc, psprnum_t &i)
|
|
|
|
{
|
|
|
|
BYTE val = (BYTE)i;
|
|
|
|
arc << val;
|
|
|
|
i = (psprnum_t)val;
|
|
|
|
return arc;
|
|
|
|
}
|
2008-09-15 00:47:31 +00:00
|
|
|
*/
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-03-28 11:49:44 +00:00
|
|
|
struct pspdef_t
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
FState* state; // a NULL state means not active
|
|
|
|
int tics;
|
|
|
|
fixed_t sx;
|
|
|
|
fixed_t sy;
|
2010-04-21 01:40:03 +00:00
|
|
|
int sprite;
|
|
|
|
int frame;
|
2012-04-01 02:49:04 +00:00
|
|
|
bool processPending; // true: waiting for periodic processing on this tick
|
2009-03-28 11:49:44 +00:00
|
|
|
};
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-09-15 14:11:05 +00:00
|
|
|
class FArchive;
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
FArchive &operator<< (FArchive &, pspdef_t &);
|
|
|
|
|
2008-06-01 07:52:33 +00:00
|
|
|
class player_t;
|
2008-09-15 14:11:05 +00:00
|
|
|
class AActor;
|
|
|
|
struct FState;
|
2008-06-01 07:52:33 +00:00
|
|
|
|
2012-04-01 02:49:04 +00:00
|
|
|
void P_NewPspriteTick();
|
2010-04-19 02:46:50 +00:00
|
|
|
void P_SetPsprite (player_t *player, int position, FState *state, bool nofunction=false);
|
2008-06-01 07:52:33 +00:00
|
|
|
void P_CalcSwing (player_t *player);
|
|
|
|
void P_BringUpWeapon (player_t *player);
|
|
|
|
void P_FireWeapon (player_t *player);
|
|
|
|
void P_DropWeapon (player_t *player);
|
|
|
|
void P_BobWeapon (player_t *player, pspdef_t *psp, fixed_t *x, fixed_t *y);
|
2016-03-01 15:38:45 +00:00
|
|
|
angle_t P_BulletSlope (AActor *mo, FTranslatedLineTarget *pLineTarget = NULL, int aimflags = 0);
|
2010-03-24 02:49:37 +00:00
|
|
|
void P_GunShot (AActor *mo, bool accurate, PClassActor *pufftype, angle_t pitch);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2010-03-24 02:49:37 +00:00
|
|
|
void DoReadyWeapon(AActor *self);
|
|
|
|
void DoReadyWeaponToBob(AActor *self);
|
|
|
|
void DoReadyWeaponToFire(AActor *self, bool primary = true, bool secondary = true);
|
2013-06-07 03:31:30 +00:00
|
|
|
void DoReadyWeaponToSwitch(AActor *self, bool switchable = true);
|
2009-07-06 15:48:31 +00:00
|
|
|
|
2008-08-10 22:48:37 +00:00
|
|
|
DECLARE_ACTION(A_Raise)
|
2009-10-16 16:04:19 +00:00
|
|
|
void A_ReFire(AActor *self, FState *state = NULL);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#endif // __P_PSPR_H__
|