mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
- Big cleanup.
This commit is contained in:
parent
f1babcee95
commit
83bcfcfd0c
26 changed files with 282 additions and 490 deletions
|
@ -4850,7 +4850,7 @@ int furthestangle(int i, int angs)
|
|||
angincs = 2048 / angs;
|
||||
|
||||
if (s->picnum != TILE_APLAYER)
|
||||
if ((hittype[i].t_data[0] & 63) > 2) return(s->ang + 1024);
|
||||
if ((hittype[i].temp_data[0] & 63) > 2) return(s->ang + 1024);
|
||||
|
||||
for (j = s->ang; j < (2048 + s->ang); j += angincs)
|
||||
{
|
||||
|
@ -4882,7 +4882,7 @@ int furthestcanseepoint(int i, spritetype* ts, int* dax, int* day)
|
|||
int hx, hy, hz, d, da;//, d, cd, ca,tempx,tempy,cx,cy;
|
||||
spritetype* s = &sprite[i];
|
||||
|
||||
if ((hittype[i].t_data[0] & 63)) return -1;
|
||||
if ((hittype[i].temp_data[0] & 63)) return -1;
|
||||
|
||||
if (ud.multimode < 2 && ud.player_skill < 3)
|
||||
angincs = 2048 / 2;
|
||||
|
@ -4919,7 +4919,7 @@ void alterang(int a, int g_i, int g_p)
|
|||
{
|
||||
short aang, angdif, goalang, j;
|
||||
int ticselapsed;
|
||||
int* g_t = hittype[g_i].t_data;
|
||||
int* g_t = hittype[g_i].temp_data;
|
||||
auto* g_sp = &sprite[g_i];
|
||||
|
||||
auto moveptr = &ScriptCode[g_t[1]];
|
||||
|
|
|
@ -4083,7 +4083,7 @@ void moveeffectors_d(void) //STATNUM 3
|
|||
void move_d(int g_i, int g_p, int g_x)
|
||||
{
|
||||
auto g_sp = &sprite[g_i];
|
||||
auto g_t = hittype[g_i].t_data;
|
||||
auto g_t = hittype[g_i].temp_data;
|
||||
int l;
|
||||
short a, goalang, angdif;
|
||||
int daxvel;
|
||||
|
|
|
@ -4069,7 +4069,7 @@ int adjustfall(spritetype *s, int c)
|
|||
void move_r(int g_i, int g_p, int g_x)
|
||||
{
|
||||
auto g_sp = &sprite[g_i];
|
||||
auto g_t = hittype[g_i].t_data;
|
||||
auto g_t = hittype[g_i].temp_data;
|
||||
int l;
|
||||
short a, goalang, angdif;
|
||||
int daxvel;
|
||||
|
|
|
@ -393,3 +393,58 @@ enum
|
|||
STAT_NETALLOC = MAXSTATUS-1
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MAXCYCLERS = 1024,
|
||||
MAXANIMATES = 1024,
|
||||
MAXANIMWALLS = 512,
|
||||
MAXANIMPOINTS = 2048,
|
||||
};
|
||||
|
||||
enum amoveflags_t
|
||||
{
|
||||
face_player = 1,
|
||||
geth = 2,
|
||||
getv = 4,
|
||||
random_angle = 8,
|
||||
face_player_slow = 16,
|
||||
spin = 32,
|
||||
face_player_smart = 64,
|
||||
fleeenemy = 128,
|
||||
jumptoplayer_only = 256,
|
||||
justjump1 = 256,
|
||||
jumptoplayer = 257,
|
||||
seekplayer = 512,
|
||||
furthestdir = 1024,
|
||||
dodgebullet = 4096,
|
||||
justjump2 = 8192,
|
||||
windang = 16384,
|
||||
antifaceplayerslow = 32768
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SWITCH_WALL,
|
||||
SWITCH_SPRITE
|
||||
};
|
||||
|
||||
enum sflags_t
|
||||
{
|
||||
SFLAG_SHADOW = 0x00000001,
|
||||
SFLAG_NVG = 0x00000002,
|
||||
SFLAG_INVENTORY = 0x00000004,
|
||||
SFLAG_ADULT = 0x00000008,
|
||||
SFLAG_SHRINKAUTOAIM = 0x00000010,
|
||||
SFLAG_BADGUY = 0x00000020,
|
||||
SFLAG_NOPAL = 0x00000040,
|
||||
SFLAG_FORCEAUTOAIM = 0x00000080,
|
||||
SFLAG_USEACTIVATOR = 0x00000200,
|
||||
SFLAG_NOFLOORSHADOW = 0x00001000, // for temp. internal use, per-tile flag not checked
|
||||
SFLAG_BADGUYSTAYPUT = 0x00008000,
|
||||
SFLAG_GREENSLIMEFOOD = 0x00800000,
|
||||
SFLAG_NODAMAGEPUSH = 0x00100000,
|
||||
SFLAG_NOWATERDIP = 0x00200000,
|
||||
SFLAG_INTERNAL_BADGUY = 0x08000000, // a separate flag is needed for the internal ones because SFLAG_BADGUY has additional semantics.
|
||||
SFLAG_KILLCOUNT = 0x10000000,
|
||||
SFLAG_NOCANSEECHECK = 0x20000000,
|
||||
};
|
||||
|
|
|
@ -1,25 +1,3 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 2016 EDuke32 developers and contributors
|
||||
|
||||
This file is part of EDuke32.
|
||||
|
||||
EDuke32 is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
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.
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef duke3d_h_
|
||||
#define duke3d_h_
|
||||
|
||||
|
@ -47,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "player.h"
|
||||
#include "quotemgr.h"
|
||||
#include "rts.h"
|
||||
#include "sector.h"
|
||||
#include "sounds.h"
|
||||
#include "soundefs.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
// shared functions
|
||||
#include "screenjob.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
// dumping ground for all external function prototypes to keep them out of the important headers.
|
||||
|
||||
void movecyclers(void);
|
||||
void movedummyplayers(void);
|
||||
void resetlanepics(void);
|
||||
|
@ -8,6 +13,7 @@ void moveplayers();
|
|||
void doanimations();
|
||||
void movefx();
|
||||
|
||||
void RANDOMSCRAP(spritetype* s, int i);
|
||||
void ms(short i);
|
||||
void movecrane(int i, int crane);
|
||||
void movefountain(int i, int fountain);
|
||||
|
@ -80,3 +86,64 @@ void addammo(int weapon, struct player_struct* p, int amount);
|
|||
|
||||
int ssp(int i, unsigned int cliptype); //The set sprite function
|
||||
void insertspriteq(int i);
|
||||
int wakeup(int sn, int pn);
|
||||
|
||||
|
||||
int timedexit(int snum);
|
||||
void dokneeattack(int snum, int pi, const std::initializer_list<int>& respawnlist);
|
||||
int endoflevel(int snum);
|
||||
void playerisdead(int snum, int psectlotag, int fz, int cz);
|
||||
void footprints(int snum);
|
||||
int makepainsounds(int snum, int type);
|
||||
void playerCrouch(int snum);
|
||||
void playerJump(int snum, int fz, int cz);
|
||||
void playerLookLeft(int snum);
|
||||
void playerLookRight(int snum);
|
||||
void playerCenterView(int snum);
|
||||
void playerLookUp(int snum, ESyncBits sb_snum);
|
||||
void playerLookDown(int snum, ESyncBits sb_snum);
|
||||
void playerAimUp(int snum, ESyncBits sb_snum);
|
||||
void playerAimDown(int snum, ESyncBits sb_snum);
|
||||
bool view(struct player_struct* pp, int* vx, int* vy, int* vz, short* vsectnum, int ang, int horiz);
|
||||
void tracers(int x1, int y1, int z1, int x2, int y2, int z2, int n);
|
||||
int hits(int i);
|
||||
int hitasprite(int i, short* hitsp);
|
||||
int aim(spritetype* s, int aang);
|
||||
void checkweapons(struct player_struct* const p);
|
||||
int findotherplayer(int p, int* d);
|
||||
void quickkill(struct player_struct* p);
|
||||
void setpal(struct player_struct* p);
|
||||
int madenoise(int playerNum);
|
||||
int haskey(int sect, int snum);
|
||||
|
||||
void breakwall(short newpn, short spr, short dawallnum);
|
||||
void callsound2(int soundNum, int playerNum);
|
||||
int callsound(int sectNum,int spriteNum);
|
||||
int hitasprite(int spriteNum,short *hitSprite);
|
||||
int findplayer(const spritetype* s, int* dist);
|
||||
void operatejaildoors(int hitag);
|
||||
void allignwarpelevators(void);
|
||||
bool isablockdoor(int tileNum);
|
||||
bool activatewarpelevators(int s, int w);
|
||||
int check_activator_motion(int lotag);
|
||||
void operateactivators(int l, int w);
|
||||
void operateforcefields_common(int s, int low, const std::initializer_list<int>& tiles);
|
||||
void operatemasterswitches(int lotag);
|
||||
void operatesectors(int s, int i);
|
||||
void hud_input(int playerNum);
|
||||
int getanimationgoal(const int* animPtr);
|
||||
bool isanearoperator(int lotag);
|
||||
bool isanunderoperator(int lotag);
|
||||
int setanimation(short animsect, int* animptr, int thegoal, int thevel);
|
||||
void dofurniture(int wallNum, int sectNum, int playerNum);
|
||||
void dotorch();
|
||||
|
||||
void clearsectinterpolate(int sprnum);
|
||||
void setsectinterpolate(int sprnum);
|
||||
int LocateTheLocator(int const tag, int const sectNum);
|
||||
void clearcamera(player_struct* ps);
|
||||
|
||||
void showtwoscreens(CompletionFunc func);
|
||||
void doorders(CompletionFunc func);
|
||||
|
||||
END_DUKE_NS
|
|
@ -32,7 +32,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
|
|||
#include "ns.h" // Must come before everything else!
|
||||
|
||||
#include "duke3d.h"
|
||||
#include "screens.h"
|
||||
#include "baselayer.h"
|
||||
#include "m_argv.h"
|
||||
#include "mapinfo.h"
|
||||
|
|
|
@ -1600,7 +1600,7 @@ int parse(void)
|
|||
|
||||
void execute(int i,int p,int x)
|
||||
{
|
||||
if (!G_HaveActor(sprite[i].picnum)) return;
|
||||
if (actorinfo[sprite[i].picnum].scriptaddress == 0) return;
|
||||
|
||||
int done;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#define gameexec_h_
|
||||
|
||||
#include "build.h"
|
||||
#include "sector.h" // mapstate_t
|
||||
#include "global.h"
|
||||
#include "gamedef.h" // vmstate_t
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
|
|
@ -30,7 +30,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
|
|||
|
||||
#include "duke3d.h"
|
||||
#include "sbar.h"
|
||||
#include "screens.h"
|
||||
#include "baselayer.h"
|
||||
#include "m_argv.h"
|
||||
#include "mapinfo.h"
|
||||
|
|
|
@ -28,9 +28,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "duke3d.h"
|
||||
#include "mmulti.h"
|
||||
#include "quotemgr.h"
|
||||
#include "sector.h"
|
||||
#include "sounds.h"
|
||||
#include "constants.h"
|
||||
#include "gameexec.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
@ -80,6 +80,13 @@ enum DUKE3D_GLOBALFLAGS {
|
|||
G_EXTERN actor_t actor[MAXSPRITES];
|
||||
// actorinfo: tile-specific data THAT DOES NOT CHANGE during the course of a game
|
||||
G_EXTERN ActorInfo actorinfo[MAXTILES];
|
||||
|
||||
struct animwalltype
|
||||
{
|
||||
int16_t wallnum, tag;
|
||||
};
|
||||
|
||||
|
||||
G_EXTERN animwalltype animwall[MAXANIMWALLS];
|
||||
enum
|
||||
{
|
||||
|
@ -200,18 +207,6 @@ G_EXTERN int16_t ambientlotag[64];
|
|||
G_EXTERN int16_t ambienthitag[64];
|
||||
G_EXTERN uint32_t ambientfx;
|
||||
|
||||
inline int32_t G_HaveActor(int spriteNum)
|
||||
{
|
||||
return actorinfo[spriteNum].scriptaddress != NULL;
|
||||
}
|
||||
|
||||
inline int32_t G_DefaultActorHealth(int spriteNum) // rename!
|
||||
{
|
||||
return G_HaveActor(spriteNum) ? ScriptCode[actorinfo[spriteNum].scriptaddress] : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
G_EXTERN vec2_t g_origins[MAXANIMPOINTS];
|
||||
struct msx_
|
||||
|
@ -338,76 +333,6 @@ extern int spriteqamount;
|
|||
#define spriteq SpriteDeletionQueue
|
||||
#define spriteqloc g_spriteDeleteQueuePos
|
||||
|
||||
inline bool isIn(int value, int first)
|
||||
{
|
||||
return value == first;
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
bool isIn(int value, int first, Args... args)
|
||||
{
|
||||
return value == first || isIn(value, args...);
|
||||
}
|
||||
|
||||
inline bool isIn(int value, const std::initializer_list<int> &list)
|
||||
{
|
||||
for (auto v : list) if (v == value) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// these are mainly here to avoid directly accessing the input data so that it can be more easily refactored later.
|
||||
inline bool PlayerInput(int pl, ESyncBits bit)
|
||||
{
|
||||
return (!!((g_player[pl].input->bits) &bit));
|
||||
}
|
||||
|
||||
inline void PlayerSetInput(int pl, ESyncBits bit)
|
||||
{
|
||||
g_player[pl].input->bits |= bit;
|
||||
}
|
||||
|
||||
inline void PlayerClearInput(int pl, ESyncBits bit)
|
||||
{
|
||||
g_player[pl].input->bits &= ~bit;
|
||||
}
|
||||
|
||||
inline ESyncBits PlayerInputBits(int pl, ESyncBits bits)
|
||||
{
|
||||
return (g_player[pl].input->bits & bits);
|
||||
}
|
||||
|
||||
inline int PlayerInputSideVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->svel;
|
||||
}
|
||||
|
||||
inline int PlayerInputForwardVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->fvel;
|
||||
}
|
||||
|
||||
inline fixed_t PlayerInputAngVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->q16avel;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
inline void hud_drawsprite(int sx, int sy, int z, int16_t a, int16_t picnum, int8_t dashade, uint8_t dapalnum, int dastat)
|
||||
{
|
||||
twod_rotatesprite(&twodpsp, sx, sy, z, a, picnum, dashade, dapalnum, dastat, 0, 0, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
|
||||
}
|
||||
|
||||
inline void hud_draw(int x, int y, int tilenum, int shade, int orientation)
|
||||
{
|
||||
int p = sector[ps[screenpeek].cursectnum].floorpal;
|
||||
hud_drawsprite(x << 16, y << 16, 65536L, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation);
|
||||
}
|
||||
|
||||
|
||||
enum
|
||||
|
@ -419,6 +344,13 @@ enum
|
|||
kHitSprite = 0xC000,
|
||||
};
|
||||
|
||||
extern uint8_t shadedsector[MAXSECTORS];
|
||||
|
||||
|
||||
|
||||
|
||||
END_DUKE_NS
|
||||
|
||||
#include "inlines.h"
|
||||
|
||||
#endif
|
||||
|
|
124
source/games/duke/src/inlines.h
Normal file
124
source/games/duke/src/inlines.h
Normal file
|
@ -0,0 +1,124 @@
|
|||
#pragma once
|
||||
|
||||
#include "mathutil.h"
|
||||
|
||||
// all inline functions.
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
||||
inline int badguypic(int const tileNum)
|
||||
{
|
||||
return ((actorinfo[tileNum].flags & (SFLAG_INTERNAL_BADGUY | SFLAG_BADGUY)) != 0);
|
||||
}
|
||||
|
||||
inline int badguy(void const * const pSprite)
|
||||
{
|
||||
return badguypic(((uspritetype const *) pSprite)->picnum);
|
||||
}
|
||||
|
||||
inline int checkcursectnums(int se)
|
||||
{
|
||||
int i;
|
||||
for(i=connecthead;i>=0;i=connectpoint2[i])
|
||||
if((unsigned)ps[i].i < MAXSPRITES && sprite[ps[i].i].sectnum == se ) return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// These are from duke's sector.c
|
||||
inline int ldist(const spritetype* s1, const spritetype* s2)
|
||||
{
|
||||
int vx, vy;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
return(FindDistance2D(vx, vy) + 1);
|
||||
}
|
||||
|
||||
inline int ldist(const spritetype* s1, const tspritetype* s2)
|
||||
{
|
||||
int vx, vy;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
return(FindDistance2D(vx, vy) + 1);
|
||||
}
|
||||
|
||||
inline int dist(const spritetype* s1, const spritetype* s2)
|
||||
{
|
||||
int vx, vy, vz;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
vz = s1->z - s2->z;
|
||||
return(FindDistance3D(vx, vy, vz >> 4));
|
||||
}
|
||||
|
||||
inline bool isIn(int value, int first)
|
||||
{
|
||||
return value == first;
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
bool isIn(int value, int first, Args... args)
|
||||
{
|
||||
return value == first || isIn(value, args...);
|
||||
}
|
||||
|
||||
inline bool isIn(int value, const std::initializer_list<int>& list)
|
||||
{
|
||||
for (auto v : list) if (v == value) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// these are mainly here to avoid directly accessing the input data so that it can be more easily refactored later.
|
||||
inline bool PlayerInput(int pl, ESyncBits bit)
|
||||
{
|
||||
return (!!((g_player[pl].input->bits) & bit));
|
||||
}
|
||||
|
||||
inline void PlayerSetInput(int pl, ESyncBits bit)
|
||||
{
|
||||
g_player[pl].input->bits |= bit;
|
||||
}
|
||||
|
||||
inline void PlayerClearInput(int pl, ESyncBits bit)
|
||||
{
|
||||
g_player[pl].input->bits &= ~bit;
|
||||
}
|
||||
|
||||
inline ESyncBits PlayerInputBits(int pl, ESyncBits bits)
|
||||
{
|
||||
return (g_player[pl].input->bits & bits);
|
||||
}
|
||||
|
||||
inline int PlayerInputSideVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->svel;
|
||||
}
|
||||
|
||||
inline int PlayerInputForwardVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->fvel;
|
||||
}
|
||||
|
||||
inline fixed_t PlayerInputAngVel(int pl)
|
||||
{
|
||||
return g_player[pl].input->q16avel;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
inline void hud_drawsprite(int sx, int sy, int z, int16_t a, int16_t picnum, int8_t dashade, uint8_t dapalnum, int dastat)
|
||||
{
|
||||
twod_rotatesprite(&twodpsp, sx, sy, z, a, picnum, dashade, dapalnum, dastat, 0, 0, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y);
|
||||
}
|
||||
|
||||
inline void hud_draw(int x, int y, int tilenum, int shade, int orientation)
|
||||
{
|
||||
int p = sector[ps[screenpeek].cursectnum].floorpal;
|
||||
hud_drawsprite(x << 16, y << 16, 65536L, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation);
|
||||
}
|
||||
|
||||
END_DUKE_NS
|
|
@ -37,8 +37,6 @@ static FORCE_INLINE int32_t krand2(void)
|
|||
|
||||
#define BGSTRETCH (hud_bgstretch ? 1024 : 0)
|
||||
|
||||
void RANDOMSCRAP(spritetype* s, int i);
|
||||
|
||||
#define TRAVERSE_SPRITE_SECT(l, o, n) (o) = (l); ((o) != -1) && ((n) = nextspritesect[o]); (o) = (n)
|
||||
#define TRAVERSE_SPRITE_STAT(l, o, n) (o) = (l); ((o) != -1) && ((n) = nextspritestat[o]); (o) = (n)
|
||||
#define TRAVERSE_CONNECT(i) i = 0; i != -1; i = connectpoint2[i]
|
||||
|
|
|
@ -338,36 +338,9 @@ int hits(int spriteNum);
|
|||
void P_GetInput(int playerNum);
|
||||
void P_GetInputMotorcycle(int playerNum);
|
||||
void P_GetInputBoat(int playerNum);
|
||||
void checkweapons(DukePlayer_t* const pPlayer);
|
||||
int findotherplayer(int p, int* d);
|
||||
void quickkill(DukePlayer_t* pPlayer);
|
||||
void setpal(DukePlayer_t* pPlayer);
|
||||
int madenoise(int playerNum);
|
||||
int haskey(int sect, int snum);
|
||||
|
||||
extern int16_t max_ammo_amount[MAX_WEAPONS];
|
||||
|
||||
void tracers(int x1, int y1, int z1, int x2, int y2, int z2, int n);
|
||||
int hits(int i);
|
||||
int hitasprite(int i, short* hitsp);
|
||||
int aim(spritetype* s, int aang);
|
||||
|
||||
int timedexit(int snum);
|
||||
void dokneeattack(int snum, int pi, const std::initializer_list<int>& respawnlist);
|
||||
int endoflevel(int snum);
|
||||
void playerisdead(int snum, int psectlotag, int fz, int cz);
|
||||
void footprints(int snum);
|
||||
int makepainsounds(int snum, int type);
|
||||
void playerCrouch(int snum);
|
||||
void playerJump(int snum, int fz, int cz);
|
||||
void playerLookLeft(int snum);
|
||||
void playerLookRight(int snum);
|
||||
void playerCenterView(int snum);
|
||||
void playerLookUp(int snum, ESyncBits sb_snum);
|
||||
void playerLookDown(int snum, ESyncBits sb_snum);
|
||||
void playerAimUp(int snum, ESyncBits sb_snum);
|
||||
void playerAimDown(int snum, ESyncBits sb_snum);
|
||||
bool view(struct player_struct* pp, int* vx, int* vy, int* vz, short* vsectnum, int ang, int horiz);
|
||||
|
||||
extern int lastvisinc;
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
|
|||
|
||||
#include "duke3d.h"
|
||||
#include "sbar.h"
|
||||
#include "screens.h"
|
||||
#include "baselayer.h"
|
||||
#include "m_argv.h"
|
||||
#include "mapinfo.h"
|
||||
|
|
|
@ -32,11 +32,11 @@ int G_FindLevelByFile(const char *fileName);
|
|||
void G_CacheMapData(void);
|
||||
void G_NewGame(int volumeNum, int levelNum, int skillNum);
|
||||
void G_ResetTimers(uint8_t keepgtics);
|
||||
void pickrandomspot(int playerNum);
|
||||
void resetinventory(int playerNum);
|
||||
void P_ResetPlayer(int playerNum);
|
||||
void resetplayerstats(int playerNum);
|
||||
void resetweapons(int playerNum);
|
||||
void pickrandomspot(int pn);
|
||||
void resetinventory(int pn);
|
||||
void P_ResetPlayer(int pn);
|
||||
void resetplayerstats(int pn);
|
||||
void resetweapons(int pn);
|
||||
void resetprestat(int snum, int g);
|
||||
void clearfifo(void);
|
||||
void G_ResetInterpolations(void);
|
||||
|
|
|
@ -250,6 +250,8 @@ void renderMirror(int cposx, int cposy, int cposz, int cang, int choriz, int smo
|
|||
|
||||
void animatecamsprite(int smoothRatio)
|
||||
{
|
||||
const int VIEWSCREEN_ACTIVE_DISTANCE = 8192;
|
||||
|
||||
if (camsprite < 0)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 2016 EDuke32 developers and contributors
|
||||
|
||||
This file is part of EDuke32.
|
||||
|
||||
EDuke32 is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
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.
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#include "screenjob.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
extern void showtwoscreens(CompletionFunc func);
|
||||
extern void doorders(CompletionFunc func);
|
||||
|
||||
extern int32_t dr_yxaspect, dr_viewingrange;
|
||||
extern int32_t g_noLogoAnim, g_noLogo;
|
||||
|
||||
|
||||
END_DUKE_NS
|
|
@ -1,135 +0,0 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 2010 EDuke32 developers and contributors
|
||||
|
||||
This file is part of EDuke32.
|
||||
|
||||
EDuke32 is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
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.
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef sector_h_
|
||||
#define sector_h_
|
||||
|
||||
#include "zz_actors.h" // actor_t
|
||||
#include "gamedef.h"
|
||||
#include "gamevar.h"
|
||||
#include "macros.h"
|
||||
#include "names.h"
|
||||
#include "player.h" // playerspawn_t
|
||||
#include "mathutil.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
#define MAXCYCLERS 1024
|
||||
#define MAXANIMATES 1024
|
||||
#define MAXANIMWALLS 512
|
||||
#define MAXANIMPOINTS 2048
|
||||
|
||||
#define VIEWSCREEN_ACTIVE_DISTANCE 8192
|
||||
|
||||
extern uint8_t shadedsector[MAXSECTORS];
|
||||
|
||||
typedef struct {
|
||||
int16_t wallnum, tag;
|
||||
} animwalltype;
|
||||
|
||||
|
||||
void breakwall(short newpn, short spr, short dawallnum);
|
||||
void callsound2(int soundNum, int playerNum);
|
||||
int callsound(int sectNum,int spriteNum);
|
||||
int hitasprite(int spriteNum,int16_t *hitSprite);
|
||||
|
||||
int findplayer(const spritetype* pSprite, int32_t* dist);
|
||||
void operatejaildoors(int hitag);
|
||||
void allignwarpelevators(void);
|
||||
bool isablockdoor(int tileNum);
|
||||
void G_AnimateCamSprite(int smoothRatio);
|
||||
bool activatewarpelevators(int s, int w);
|
||||
int check_activator_motion(int lotag);
|
||||
void operateactivators(int l, int w);
|
||||
void operateforcefields_common(int s, int low, const std::initializer_list<int>& tiles);
|
||||
void operatemasterswitches(int lotag);
|
||||
void operatesectors(int s, int i);
|
||||
void hud_input(int playerNum);
|
||||
int getanimationgoal(const int32_t* animPtr);
|
||||
bool isanearoperator(int lotag);
|
||||
bool isanunderoperator(int lotag);
|
||||
int setanimation(short animsect, int* animptr, int thegoal, int thevel);
|
||||
void dofurniture(int wallNum, int sectNum, int playerNum);
|
||||
void dotorch();
|
||||
|
||||
#define FORCEFIELD_CSTAT (64+16+4+1)
|
||||
|
||||
// Returns TILE_W_FORCEFIELD if wall has a forcefield overpicnum, its overpicnum else.
|
||||
static inline int G_GetForcefieldPicnum(int wallNum)
|
||||
{
|
||||
int tileNum = wall[wallNum].overpicnum;
|
||||
if (tileNum == TILE_W_FORCEFIELD + 1 || tileNum == TILE_W_FORCEFIELD + 2)
|
||||
tileNum = TILE_W_FORCEFIELD;
|
||||
return tileNum;
|
||||
}
|
||||
|
||||
EXTERN_INLINE_HEADER int32_t G_CheckPlayerInSector(int32_t sect);
|
||||
|
||||
#if defined sector_c_ || !defined DISABLE_INLINING
|
||||
|
||||
EXTERN_INLINE int32_t G_CheckPlayerInSector(int32_t sect)
|
||||
{
|
||||
int32_t i;
|
||||
for (TRAVERSE_CONNECT(i))
|
||||
if ((unsigned)g_player[i].ps->i < MAXSPRITES && sprite[g_player[i].ps->i].sectnum == sect)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
inline int checkcursectnums(int se)
|
||||
{
|
||||
return G_CheckPlayerInSector(se);
|
||||
}
|
||||
|
||||
// These are from duke's sector.c
|
||||
inline int ldist(const spritetype* s1, const spritetype* s2)
|
||||
{
|
||||
int vx, vy;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
return(FindDistance2D(vx, vy) + 1);
|
||||
}
|
||||
|
||||
inline int ldist(const spritetype* s1, const tspritetype* s2)
|
||||
{
|
||||
int vx, vy;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
return(FindDistance2D(vx, vy) + 1);
|
||||
}
|
||||
|
||||
inline int dist(const spritetype* s1, const spritetype* s2)
|
||||
{
|
||||
int vx, vy, vz;
|
||||
vx = s1->x - s2->x;
|
||||
vy = s1->y - s2->y;
|
||||
vz = s1->z - s2->z;
|
||||
return(FindDistance3D(vx, vy, vz >> 4));
|
||||
}
|
||||
|
||||
enum { SWITCH_WALL, SWITCH_SPRITE };
|
||||
|
||||
#endif
|
||||
|
||||
END_DUKE_NS
|
||||
|
||||
#endif
|
|
@ -1164,7 +1164,7 @@ void checkhitsprite_d(int i, int sn)
|
|||
case FUELPOD:
|
||||
case SOLARPANNEL:
|
||||
case ANTENNA:
|
||||
if (sprite[sn].extra != G_DefaultActorHealth(SHOTSPARK1)) // TRANSITIONAL - fix after getting rid of EDUKE cruft
|
||||
if (actorinfo[SHOTSPARK1].scriptaddress && sprite[sn].extra != ScriptCode[actorinfo[SHOTSPARK1].scriptaddress])
|
||||
{
|
||||
for (j = 0; j < 15; j++)
|
||||
EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
|
||||
|
|
|
@ -2205,7 +2205,7 @@ void checkhitsprite_r(int i, int sn)
|
|||
case FUELPOD:
|
||||
case SOLARPANNEL:
|
||||
case ANTENNA:
|
||||
if (sprite[sn].extra != G_DefaultActorHealth(SHOTSPARK1)) // TRANSITIONAL - fix after getting rid of EDUKE cruft
|
||||
if (actorinfo[SHOTSPARK1].scriptaddress && sprite[sn].extra != ScriptCode[actorinfo[SHOTSPARK1].scriptaddress])
|
||||
{
|
||||
for (j = 0; j < 15; j++)
|
||||
EGS(sprite[i].sectnum, sprite[i].x, sprite[i].y, sector[sprite[i].sectnum].floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
|
||||
|
|
|
@ -509,7 +509,7 @@ void S_StopEnvSound(int sndNum, int sprNum, int channel)
|
|||
|
||||
// StopSound kills the actor reference so this cannot be delayed until ChannelEnded gets called. At that point the actor may also not be valid anymore.
|
||||
if (S_IsAmbientSFX(sprNum) && sector[sprite[sprNum].sectnum].lotag < 3) // ST_2_UNDERWATER
|
||||
actor[sprNum].t_data[0] = 0;
|
||||
actor[sprNum].temp_data[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,28 +45,6 @@ BEGIN_DUKE_NS
|
|||
#define ACTOR_ONWATER_ADDZ (24<<8)
|
||||
|
||||
|
||||
// Defines the motion characteristics of an actor
|
||||
enum amoveflags_t
|
||||
{
|
||||
face_player = 1,
|
||||
geth = 2,
|
||||
getv = 4,
|
||||
random_angle = 8,
|
||||
face_player_slow = 16,
|
||||
spin = 32,
|
||||
face_player_smart = 64,
|
||||
fleeenemy = 128,
|
||||
jumptoplayer_only = 256,
|
||||
justjump1 = 256,
|
||||
jumptoplayer_bits = 257, // NOTE: two bits set!
|
||||
jumptoplayer = 257, // NOTE: two bits set!
|
||||
seekplayer = 512,
|
||||
furthestdir = 1024,
|
||||
dodgebullet = 4096,
|
||||
justjump2 = 8192,
|
||||
windang = 16384,
|
||||
antifaceplayerslow = 32768
|
||||
};
|
||||
|
||||
// Defines for 'useractor' keyword
|
||||
enum uactortypes_t
|
||||
|
@ -76,19 +54,6 @@ enum uactortypes_t
|
|||
enemystayput
|
||||
};
|
||||
|
||||
// These macros are there to give names to the t_data[]/T*/vm.g_t[] indices
|
||||
// when used with actors. Greppability of source code is certainly a virtue.
|
||||
#define AC_COUNT(t) ((t)[0]) /* the actor's count */
|
||||
/* The ID of the actor's current move. In C-CON, the bytecode offset to the
|
||||
* move composite: */
|
||||
#define AC_MOVE_ID(t) ((t)[1])
|
||||
#define AC_ACTION_COUNT(t) ((t)[2]) /* the actor's action count */
|
||||
#define AC_CURFRAME(t) ((t)[3]) /* the actor's current frame offset */
|
||||
/* The ID of the actor's current action. In C-CON, the bytecode offset to the
|
||||
* action composite: */
|
||||
#define AC_ACTION_ID(t) ((t)[4])
|
||||
#define AC_AI_ID(t) ((t)[5]) /* the ID of the actor's current ai */
|
||||
|
||||
enum actionparams
|
||||
{
|
||||
ACTION_STARTFRAME = 0,
|
||||
|
@ -100,23 +65,10 @@ enum actionparams
|
|||
ACTION_PARAM_COUNT,
|
||||
};
|
||||
|
||||
enum actionflags
|
||||
{
|
||||
AF_VIEWPOINT = 1u<<0u,
|
||||
};
|
||||
|
||||
// Select an actor's actiontics and movflags locations depending on
|
||||
// whether we compile the Lunatic build.
|
||||
// <spr>: sprite pointer
|
||||
// <a>: actor_t pointer
|
||||
# define AC_ACTIONTICS(spr, a) ((spr)->lotag)
|
||||
# define AC_MOVFLAGS(spr, a) ((spr)->hitag)
|
||||
|
||||
// (+ 40 16 16 4 8 6 8 6 4 20)
|
||||
#pragma pack(push, 1)
|
||||
typedef struct
|
||||
{
|
||||
int32_t t_data[10]; // 40b sometimes used to hold offsets to con code
|
||||
int32_t temp_data[10]; // 40b sometimes used to hold offsets to con code
|
||||
|
||||
int32_t aflags; // 4b
|
||||
union
|
||||
|
@ -138,33 +90,8 @@ typedef struct
|
|||
// NOTE: 'dispicnum' is updated every frame, not in sync with game tics!
|
||||
int16_t dispicnum; // 2b
|
||||
|
||||
#ifdef POLYMER
|
||||
int16_t lightId, lightmaxrange; // 4b
|
||||
_prlight *lightptr; // 4b/8b aligned on 96 bytes
|
||||
uint8_t lightcount, filler[3];
|
||||
#endif
|
||||
} actor_t;
|
||||
#define temp_data t_data
|
||||
|
||||
// this struct needs to match the beginning of actor_t above
|
||||
typedef struct
|
||||
{
|
||||
int32_t t_data[10]; // 40b sometimes used to hold offsets to con code
|
||||
|
||||
int32_t flags; // 4b
|
||||
vec3_t bpos; // 12b
|
||||
int32_t floorz, ceilingz; // 8b
|
||||
vec2_t lastv; // 8b
|
||||
int16_t picnum, ang, extra, owner; // 8b
|
||||
int16_t movflag, tempang, timetosleep; // 6b
|
||||
int16_t actorstayput;
|
||||
|
||||
uint8_t cgg, lasttransport;
|
||||
|
||||
spritetype sprite;
|
||||
int16_t netIndex;
|
||||
} netactor_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
// Todo - put more state in here
|
||||
struct ActorInfo
|
||||
|
@ -176,39 +103,6 @@ struct ActorInfo
|
|||
|
||||
|
||||
// KEEPINSYNC lunatic/con_lang.lua
|
||||
enum sflags_t
|
||||
{
|
||||
SFLAG_SHADOW = 0x00000001,
|
||||
SFLAG_NVG = 0x00000002,
|
||||
SFLAG_INVENTORY = 0x00000004,
|
||||
SFLAG_ADULT = 0x00000008,
|
||||
SFLAG_SHRINKAUTOAIM = 0x00000010,
|
||||
SFLAG_BADGUY = 0x00000020,
|
||||
SFLAG_NOPAL = 0x00000040,
|
||||
SFLAG_FORCEAUTOAIM = 0x00000080,
|
||||
SFLAG_USEACTIVATOR = 0x00000200,
|
||||
SFLAG_NOFLOORSHADOW = 0x00001000, // for temp. internal use, per-tile flag not checked
|
||||
SFLAG_BADGUYSTAYPUT = 0x00008000,
|
||||
SFLAG_GREENSLIMEFOOD = 0x00800000,
|
||||
SFLAG_NODAMAGEPUSH = 0x00100000,
|
||||
SFLAG_NOWATERDIP = 0x00200000,
|
||||
SFLAG_INTERNAL_BADGUY = 0x08000000, // a separate flag is needed for the internal ones because SFLAG_BADGUY has additional semantics.
|
||||
SFLAG_KILLCOUNT = 0x10000000,
|
||||
SFLAG_NOCANSEECHECK = 0x20000000,
|
||||
|
||||
//SFLAG_NOSHADE = 0x00000004,
|
||||
//SFLAG_PROJECTILE = 0x00000008,
|
||||
//SFLAG_DECAL = 0x00000010,
|
||||
//SFLAG_NOEVENTCODE = 0x00000080,
|
||||
//SFLAG_NOLIGHT = 0x00000100,
|
||||
//SFLAG_NULL = 0x00000400, // null sprite in multiplayer
|
||||
//SFLAG_NOCLIP = 0x00000800, // clipmove it with cliptype 0
|
||||
//SFLAG_SMOOTHMOVE = 0x00002000,
|
||||
//SFLAG_NOTELEPORT = 0x00004000,
|
||||
//SFLAG_HURTSPAWNBLOOD = 0x00400000,
|
||||
//SFLAG_REALCLIPDIST = 0x01000000,
|
||||
//SFLAG_WAKEUPBADGUYS = 0x02000000,
|
||||
};
|
||||
|
||||
|
||||
extern ActorInfo actorinfo[MAXTILES];
|
||||
|
@ -219,61 +113,9 @@ extern int32_t g_noEnemies;
|
|||
extern int32_t otherp;
|
||||
extern int g_canSeePlayer;
|
||||
|
||||
int LocateTheLocator(int const tag, int const sectNum);
|
||||
|
||||
int A_IncurDamage(int spriteNum);
|
||||
|
||||
void clearcamera(player_struct* ps);
|
||||
void G_RefreshLights(void);
|
||||
|
||||
void clearsectinterpolate(int sprnum);
|
||||
void setsectinterpolate(int sprnum);
|
||||
|
||||
#if KRANDDEBUG
|
||||
# define ACTOR_INLINE __fastcall
|
||||
# define ACTOR_INLINE_HEADER extern __fastcall
|
||||
#else
|
||||
# define ACTOR_INLINE EXTERN_INLINE
|
||||
# define ACTOR_INLINE_HEADER EXTERN_INLINE_HEADER
|
||||
#endif
|
||||
|
||||
ACTOR_INLINE_HEADER int A_CheckEnemyTile(int tileNum);
|
||||
|
||||
EXTERN_INLINE_HEADER int A_CheckEnemySprite(void const * s);
|
||||
|
||||
#if defined actors_c_ || !defined DISABLE_INLINING
|
||||
|
||||
# if !KRANDDEBUG || (KRANDDEBUG && defined actors_c_)
|
||||
|
||||
ACTOR_INLINE int A_CheckEnemyTile(int const tileNum)
|
||||
{
|
||||
return ((actorinfo[tileNum].flags & (SFLAG_INTERNAL_BADGUY | SFLAG_BADGUY)) != 0);
|
||||
}
|
||||
|
||||
|
||||
# endif
|
||||
|
||||
|
||||
EXTERN_INLINE int A_CheckEnemySprite(void const * const pSprite)
|
||||
{
|
||||
return A_CheckEnemyTile(((uspritetype const *) pSprite)->picnum);
|
||||
}
|
||||
|
||||
inline int badguy(void const* const pSprite)
|
||||
{
|
||||
return A_CheckEnemySprite(pSprite);
|
||||
}
|
||||
|
||||
inline int badguypic(int tile)
|
||||
{
|
||||
return A_CheckEnemyTile(tile);
|
||||
}
|
||||
int wakeup(int sn, int pn);
|
||||
|
||||
#include "actor.h"
|
||||
|
||||
#endif
|
||||
|
||||
END_DUKE_NS
|
||||
#include "funct.h"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "savegame.h"
|
||||
|
||||
#include "sbar.h"
|
||||
#include "screens.h"
|
||||
#include "palette.h"
|
||||
#include "gamecvars.h"
|
||||
#include "gameconfigfile.h"
|
||||
|
@ -785,7 +784,6 @@ MAIN_LOOP_RESTART:
|
|||
if (menuloop())
|
||||
{
|
||||
FX_StopAllSounds();
|
||||
g_noLogoAnim = 1;
|
||||
goto MAIN_LOOP_RESTART;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ void G_ResetTimers(uint8_t keepgtics)
|
|||
g_moveThingsCount = 0;
|
||||
|
||||
if (camsprite >= 0)
|
||||
actor[camsprite].t_data[0] = 0;
|
||||
actor[camsprite].temp_data[0] = 0;
|
||||
}
|
||||
|
||||
int G_FindLevelByFile(const char *fileName)
|
||||
|
|
|
@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
#include "duke3d.h"
|
||||
#include "compat.h"
|
||||
#include "screens.h"
|
||||
|
||||
#include "sbar.h"
|
||||
#include "mdsprite.h"
|
||||
|
@ -45,10 +44,7 @@ void cameratext(int i);
|
|||
|
||||
int32_t g_crosshairSum = -1;
|
||||
// yxaspect and viewingrange just before the 'main' drawrooms call
|
||||
int32_t dr_yxaspect, dr_viewingrange;
|
||||
double g_moveActorsTime, g_moveWorldTime; // in ms, smoothed
|
||||
int32_t g_noLogoAnim = 0;
|
||||
int32_t g_noLogo = 0;
|
||||
|
||||
|
||||
void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, ESetPalFlags set)
|
||||
|
|
Loading…
Reference in a new issue