Skip to content

Commit

Permalink
Continued the job of sorting out the game's header files. Part 5/5
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed Mar 6, 2008
1 parent 0529861 commit d6d85d1
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 461 deletions.
147 changes: 117 additions & 30 deletions doomsday/plugins/doom64tc/include/p_mobj.h
Expand Up @@ -25,34 +25,96 @@
*/

/**
* p_mobj.h: Map Objects, MObj, definition and handling.
* p_mobj.h: Map Objects, Mobj, definition and handling Doom64TC - specific.
*/

#ifndef __P_MOBJ__
#define __P_MOBJ__

#ifndef __JDOOM__
# error "Using jDoom headers without __JDOOM__"
#ifndef __DOOM64TC__
# error "Using Doom64TC headers without __DOOM64TC__"
#endif

// Basics.
#include "tables.h"

// We need the thinker_t stuff.
#include "d_think.h"

// We need the WAD data structure for Map things,
// from the THINGS lump.
#include "doomdata.h"

// States are tied to finite states are
// tied to animation frames.
// Needs precompiled tables/data structures.
#include "info.h"

#ifdef __GNUG__
#pragma interface
#endif
#define FRICTION_NORMAL (0.90625f)
#define FRICTION_FLY (0.91796875f)
#define FRICTION_HIGH (0.5f)

#define ONFLOORZ (DDMINFLOAT)
#define ONCEILINGZ (DDMAXFLOAT)
#define FLOATRANDZ (DDMAXFLOAT - 1)

// Player radius for movement checking.
#define PLAYERRADIUS (25)

// MAXRADIUS is for precalculated sector block boxes the spider demon is
// larger, but we do not have any moving sectors nearby.
#define MAXRADIUS (32)
#define MAXMOVE (30)

#define USERANGE (64)
#define MELEERANGE (64)
#define PLRMELEERANGE (80) // d64tc wide player radius.
#define MISSILERANGE (32 * 64)
#define ACIDRANGE (296) // d64tc

#define FLOATSPEED (4)
#define MAXHEALTH (maxHealth) //100
#define VIEWHEIGHT (54)

// GMJ 02/02/02
#define sentient(mobj) ((mobj)->health > 0 && (mobj)->info->seeState)

// Any floor type >= FLOOR_LIQUID will floorclip mobjs.
enum {
FLOOR_SOLID,
FLOOR_LIQUID,
FLOOR_WATER,
FLOOR_LAVA,
FLOOR_SLUDGE,
FLOOR_BLOOD,
FLOOR_SLIME,
NUM_TERRAINTYPES
};

/**
* (Re)Spawn flags:
*/
#define MTF_EASY 1 // Appears in easy skill modes.
#define MTF_MEDIUM 2 // Appears in medium skill modes.
#define MTF_HARD 4 // Appears in hard skill modes.
#define MTF_DEAF 8 // Thing is deaf.
#define MTF_NOTSINGLE 16 // Appears in multiplayer game modes only.

// d64tc FIXME:
// DJS - Unfortunetly Doom64TC has already used the thing bits for
// other purposes so we should update the IWAD! No doubt that some
// of these can be pruned anyway...

//#define MTF_NOTDM 32 // Doesn't appear in Deathmatch
//#define MTF_NOTCOOP 64 // Doesn't appear in Coop
//#define MTF_DORMANT 512 // THING is invulnerble and inert

// Forces a MF_SPAWNCEILING enemies (d64 custom) to spawn on floor
#define MTF_FORCECEILING 32
#define MTF_WALKOFF 64
#define MTF_TRANSLUCENT 128
#define MTF_RESPAWN 256
#define MTF_SPAWNPLAYERZ 512
#define MTF_FLOAT 1024

typedef struct spawnspot_s {
float pos[3];
angle_t angle;
int type;
int flags;
} spawnspot_t;

/**
* NOTES: mobj_t
Expand Down Expand Up @@ -248,8 +310,8 @@ typedef struct mobj_s {
int health;

// Movement direction, movement generation (zig-zagging).
int movedir; // 0-7
int movecount; // when 0, select a new dir
int moveDir; // 0-7
int moveCount; // when 0, select a new dir

// Thing being chased/attacked (or NULL),
// also the originator for missiles.
Expand All @@ -259,37 +321,62 @@ typedef struct mobj_s {
// no matter what (even if shot)
int threshold;

int intflags; // internal flags
float dropoffz; // killough $dropoff_fix
int intFlags; // internal flags
float dropOffZ; // killough $dropoff_fix
short gear; // killough 11/98: used in torque simulation
boolean wallrun; // true = last move was the result of a wallrun
boolean wallRun; // true = last move was the result of a wallrun

// Additional info record for player avatars only.
// Only valid if type == MT_PLAYER
struct player_s *player;

// Player number last looked for.
int lastlook;
int lastLook;

// For nightmare/multiplayer respawn.
struct {
float fpos[3]; // Note DOOM didn't include VZ
angle_t angle;
int type;
int options;
} spawninfo;
spawnspot_t spawnSpot;

// Thing being chased/attacked for tracers.
struct mobj_s *tracer;

int turntime; // $visangle-facetarget
int corpsetics; // $vanish: how long has this been dead?
int turnTime; // $visangle-facetarget
int corpseTics; // $vanish: how long has this been dead?

int floattics; // d64tc
int floatswitch; // d64tc
int floatTics; // d64tc
int floatSwitch; // d64tc
} mobj_t;

extern spawnspot_t* things;

void P_EmptyRespawnQueue(void);
void P_RespawnEnqueue(spawnspot_t *spot);
void P_CheckRespawnQueue(void);

void P_ExplodeMissile(mobj_t *mo);
float P_MobjGetFriction(mobj_t *mo);
mobj_t *P_SPMAngle(mobjtype_t type, mobj_t *source, angle_t angle);

mobj_t *P_SpawnMobj3f(mobjtype_t type, float x, float y, float z);
mobj_t *P_SpawnMobj3fv(mobjtype_t type, float pos[3]);

void P_SpawnPuff(float x, float y, float z);
mobj_t *P_SpawnCustomPuff(mobjtype_t type, float x, float y, float z);
void P_SpawnBlood(float x, float y, float z, int damage);
mobj_t *P_SpawnMissile(mobjtype_t type, mobj_t *source, mobj_t *dest);
void P_SpawnPlayerMissile(mobjtype_t type, mobj_t *source);
mobj_t *P_SpawnTeleFog(float x, float y);
mobj_t *P_SpawnMotherMissile(mobjtype_t type, float x, float y, float z,
mobj_t *source, mobj_t *dest); // d64tc

void P_MobjRemove(mobj_t *th);
boolean P_MobjChangeState(mobj_t *mobj, statenum_t state);
void P_MobjThinker(mobj_t *mobj);
int P_MobjGetFloorType(mobj_t *thing);
void P_RipperBlood(mobj_t *mo);
void P_SetDoomsdayFlags(mobj_t *mo);
void P_HitFloor(mobj_t *mo);

void P_SpawnMapThing(spawnspot_t *th);
void P_SpawnPlayer(spawnspot_t *mthing, int pnum);

#endif
54 changes: 21 additions & 33 deletions doomsday/plugins/doom64tc/include/p_pspr.h
Expand Up @@ -4,7 +4,7 @@
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006-2008 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1993-1996 by id Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -19,55 +19,43 @@
*
* 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 St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

/*
* Sprite animation.
/**
* p_pspr.h: Sprite animation.
*/

#ifndef __P_PSPR__
#define __P_PSPR__
#ifndef __P_PSPR_H__
#define __P_PSPR_H__

#ifndef __JDOOM__
# error "Using jDoom headers without __JDOOM__"
#ifndef __DOOM64TC__
# error "Using Doom64TC headers without __DOOM64TC__"
#endif

// Basic data types.
// Needs fixed point, and BAM angles.
#include "tables.h"
//#include "d_player.h"
//#include "info.h"

//
// Needs to include the precompiled
// sprite animation tables.
// Header generated by multigen utility.
// This includes all the data for thing animation,
// i.e. the Thing Atrributes table
// and the Frame Sequence table.
#include "info.h"

#ifdef __GNUG__
#pragma interface
#endif

//
// Overlay psprites are scaled shapes
// drawn directly on the view screen,
// coordinates are given for a 320*200 view screen.
//
/**
* 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,
NUMPSPRITES
} psprnum_t;

typedef struct {
state_t *state; // a NULL state means not active
state_t *state; // A NULL state means not active.
int tics;
fixed_t sx;
fixed_t sy;

float pos[2]; // [x, y]
} pspdef_t;

void P_SetupPsprites(struct player_s *curplayer);
void P_MovePsprites(struct player_s *curplayer);
void P_DropWeapon(struct player_s *player);
void P_SetPsprite(struct player_s *player, int position, statenum_t stnum);

#endif
12 changes: 7 additions & 5 deletions doomsday/plugins/doom64tc/include/p_setup.h
Expand Up @@ -4,7 +4,7 @@
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2006-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006-2007 Daniel Swanson <danij@dengine.net>
*\author Copyright © 2006-2009 Daniel Swanson <danij@dengine.net>
*
* 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
Expand All @@ -26,11 +26,11 @@
* p_setup.h: Map setup routines
*/

#ifndef __D_SETUP_H__
#define __D_SETUP_H__
#ifndef __P_SETUP_H__
#define __P_SETUP_H__

#ifndef __JDOOM__
# error "Using jDoom headers without __JDOOM__"
#ifndef __DOOM64TC__
# error "Using Doom64TC headers without __DOOM64TC__"
#endif

/** Game specific map format properties for ALL games.
Expand Down Expand Up @@ -89,6 +89,8 @@ int P_HandleMapDataProperty(uint id, int dtype, int prop,
int type, void *data);
int P_HandleMapDataPropertyValue(uint id, int dtype, int prop,
int type, void *data);
int P_HandleMapObjectStatusReport(int code, uint id, int dtype,
void *data);
void P_Init(void);
boolean P_MapExists(int episode, int map);

Expand Down
Expand Up @@ -3,7 +3,7 @@
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2007 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2008 Daniel Swanson <danij@dengine.net>
*
* 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
Expand All @@ -17,28 +17,33 @@
*
* 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 St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#ifndef __S_SOUND__
#define __S_SOUND__
/**
* p_sound.h:
*/

#ifndef __P_SOUND_H__
#define __P_SOUND_H__

#ifndef __JDOOM__
# error "Using jDoom headers without __JDOOM__"
#ifndef __DOOM64TC__
# error "Using Doom64TC headers without __DOOM64TC__"
#endif

#include "r_defs.h"
#include "doomsday.h"

#include "sndidx.h" // Sfx and music indices.
#include "sndidx.h"

enum {
SORG_CENTER,
SORG_FLOOR,
SORG_CEILING
};

int S_GetMusicNum(int episode, int map);
void S_LevelMusic(void);
void S_SectorSound(sector_t *sector, int origin, int sound_id);
void S_SectorSound(sector_t *sec, int origin, int id);

#endif

0 comments on commit d6d85d1

Please sign in to comment.