2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior 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.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef PANEL_H
|
|
|
|
|
|
|
|
#define PANEL_H
|
|
|
|
|
|
|
|
#include "game.h"
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PRI_FRONT_MAX = 250,
|
|
|
|
PRI_FRONT = 192,
|
|
|
|
PRI_MID = 128,
|
|
|
|
PRI_BACK = 64,
|
|
|
|
PRI_BACK_MAX = 0
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
#define MAKE_CONPIC_ENUM
|
|
|
|
enum conpic_id
|
|
|
|
{
|
|
|
|
#include "conpic.h"
|
|
|
|
};
|
|
|
|
typedef enum conpic_id CONPIC_ID;
|
|
|
|
#undef MAKE_CONPIC_ENUM
|
|
|
|
|
|
|
|
enum PanelSpriteIDs
|
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
ID_BORDER_TOP = 1, ID_BORDER_BOTTOM, ID_BORDER_LEFT, ID_BORDER_RIGHT, ID_BORDER_SHADE,
|
|
|
|
ID_PANEL_BORDER_LEFT, ID_PANEL_BORDER_RIGHT,
|
|
|
|
ID_TEXT, ID_TEXT2, ID_TEXT3, ID_TEXT4
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
struct PANEL_STATE
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
short picndx; // for pip stuff in conpic.h
|
|
|
|
int tics;
|
|
|
|
void (*Animator)(PANEL_SPRITEp); // JBF: return type was long
|
|
|
|
PANEL_STATEp NextState;
|
|
|
|
uint32_t flags;
|
|
|
|
uint8_t xvel;
|
|
|
|
uint8_t yvel;
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PANF_PRIMARY = (BIT(0)), // denotes primary weapon
|
|
|
|
PANF_SECONDARY = (BIT(1)), // denotes secondary weapon
|
|
|
|
PANF_BOB = (BIT(2)),
|
|
|
|
PANF_REST_POS = (BIT(3)), // used for certain weapons - fireball
|
|
|
|
PANF_RELOAD = (BIT(4)), // reload flag used for uzi
|
|
|
|
PANF_TRANS_FLIP = (BIT(5)), // translucent flip - matches rotate sprite
|
|
|
|
PANF_ACTION_POS = (BIT(6)), // used for certain weapons - fireball
|
|
|
|
PANF_WEAPON_HIDE = (BIT(7)), // hide when climbing/driving
|
|
|
|
PANF_TRANSLUCENT = (BIT(8)), // turn invisible
|
|
|
|
PANF_INVISIBLE = (BIT(9)), // turn invisible
|
|
|
|
PANF_DEATH_HIDE = (BIT(10)), // hide done when dead
|
|
|
|
PANF_SCREEN_CLIP = (BIT(12)), // maintain aspect to the screen
|
|
|
|
PANF_IGNORE_START_MOST = (BIT(14)), // maintain aspect to the screen
|
|
|
|
PANF_XFLIP = (BIT(15)), // xflip
|
|
|
|
PANF_SUICIDE = (BIT(16)), // kill myself
|
|
|
|
PANF_WEAPON_SPRITE = (BIT(17)), // its a weapon sprite - for V mode
|
|
|
|
PANF_CORNER = (BIT(18)), // draw from the corner
|
|
|
|
PANF_NOT_IN_VIEW = (BIT(19)), // not in view
|
|
|
|
PANF_UNHIDE_SHOOT = (BIT(20)), // shoot after un-hiding a weapon
|
|
|
|
PANF_JUMPING = (BIT(21)),
|
|
|
|
PANF_FALLING = (BIT(22)),
|
|
|
|
PANF_DRAW_BEFORE_VIEW = (BIT(30)), // draw before drawrooms
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2015-05-19 21:58:29 +00:00
|
|
|
typedef void (*PANEL_SPRITE_FUNCp)(PANEL_SPRITEp);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
struct PANEL_SPRITE_OVERLAY
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
PANEL_STATEp State;
|
|
|
|
int flags;
|
|
|
|
short tics;
|
|
|
|
short pic;
|
|
|
|
short xoff; // from panel sprite center x
|
|
|
|
short yoff; // from panel sprite center y
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PANEL_SPRITE
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
PANEL_SPRITE* Next, * Prev;
|
|
|
|
PANEL_SPRITE* sibling;
|
|
|
|
PANEL_STATEp State, RetractState, PresentState, ActionState, RestState;
|
|
|
|
PLAYERp PlayerP;
|
|
|
|
DVector2 pos, opos, bobpos;
|
|
|
|
|
|
|
|
PANEL_SPRITE_OVERLAY over[8];
|
|
|
|
PANEL_SPRITE_FUNCp PanelSpriteFunc;
|
|
|
|
short ID; // id for finding sprite types on the list
|
|
|
|
short picndx; // for pip stuff in conpic.h
|
|
|
|
short picnum; // bypass pip stuff in conpic.h
|
|
|
|
short vel, vel_adj;
|
|
|
|
int flags, priority;
|
|
|
|
int scale;
|
|
|
|
int jump_speed, jump_grav; // jumping vars
|
|
|
|
int xspeed;
|
|
|
|
short tics, delay; // time vars
|
|
|
|
short ang, rotate_ang;
|
|
|
|
short sin_ndx, sin_amt, sin_arc_speed;
|
|
|
|
double bob_height_divider;
|
|
|
|
short shade, pal;
|
|
|
|
short kill_tics;
|
|
|
|
short WeaponType; // remember my own weapon type for weapons with secondary function
|
|
|
|
|
|
|
|
// Inline helpers.
|
|
|
|
void backupx() { opos.X = pos.X; };
|
|
|
|
void backupy() { opos.Y = pos.Y; };
|
|
|
|
void backupcoords() { opos = pos; };
|
|
|
|
void backupbobx() { bobpos.X = pos.X; };
|
|
|
|
void backupboby() { bobpos.Y = pos.Y; };
|
|
|
|
void backupbobcoords() { bobpos = pos; };
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
struct PANEL_STATE_TABLE
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
PANEL_STATEp pstate;
|
|
|
|
short state_size;
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
extern PANEL_STATE_TABLE PanelStateTable[];
|
|
|
|
|
|
|
|
// Panel State flags - also used for
|
2021-12-31 12:49:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
psf_Invisible = BIT(16),
|
|
|
|
psf_QuickCall = BIT(23),
|
|
|
|
psf_Xflip = BIT(24),
|
|
|
|
psf_ShadeHalf = BIT(25),
|
|
|
|
psf_ShadeNone = BIT(26),
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
enum BorderTypes
|
|
|
|
{
|
2021-12-31 12:49:34 +00:00
|
|
|
BORDER_NONE = 0,
|
|
|
|
BORDER_MINI_BAR = 1,
|
|
|
|
BORDER_BAR = 2
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
2021-12-31 12:49:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MICRO_SIGHT_NUM = 0,
|
|
|
|
MICRO_SIGHT = 2075,
|
|
|
|
|
|
|
|
MICRO_SHOT_NUM = 2,
|
|
|
|
MICRO_SHOT_20 = 2076,
|
|
|
|
MICRO_SHOT_1 = 2077,
|
|
|
|
|
|
|
|
MICRO_HEAT_NUM = 1,
|
|
|
|
MICRO_HEAT = 2084,
|
|
|
|
|
|
|
|
UZI_COPEN = 2040,
|
|
|
|
UZI_CCLOSED = 2041,
|
|
|
|
UZI_CLIT = 2042,
|
|
|
|
UZI_CRELOAD = 2043,
|
|
|
|
|
|
|
|
HEAD_MODE1 = 2055,
|
|
|
|
HEAD_MODE2 = 2056,
|
|
|
|
HEAD_MODE3 = 2057,
|
|
|
|
|
|
|
|
SHOTGUN_AUTO_NUM = 0,
|
|
|
|
SHOTGUN_AUTO = 2078,
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
|
2020-08-18 11:39:20 +00:00
|
|
|
PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATEp state, uint8_t priority, double x, double y);
|
2015-05-19 21:54:34 +00:00
|
|
|
void pSetSuicide(PANEL_SPRITEp psp);
|
2020-09-09 18:32:24 +00:00
|
|
|
bool pKillScreenSpiteIDs(PLAYERp pp, short id);
|
2020-08-18 06:25:12 +00:00
|
|
|
void PreUpdatePanel(double smoothratio);
|
|
|
|
void UpdatePanel(double smoothratio);
|
2015-05-19 21:54:34 +00:00
|
|
|
void PlayerUpdateArmor(PLAYERp pp,short value);
|
2020-03-07 13:51:49 +00:00
|
|
|
void pToggleCrosshair(void);
|
2015-05-19 21:54:34 +00:00
|
|
|
void pKillSprite(PANEL_SPRITEp psp);
|
|
|
|
void InitChops(PLAYERp pp);
|
|
|
|
void ChopsSetRetract(PLAYERp pp);
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#endif
|