2012-11-05 02:49:08 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
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
|
2014-07-20 08:55:56 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2012-11-05 02:49:08 +00:00
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef actors_inline_c_
|
|
|
|
#define actors_inline_c_
|
2012-11-05 02:49:08 +00:00
|
|
|
|
|
|
|
#include "compat.h"
|
|
|
|
#include "build.h"
|
|
|
|
#include "global.h"
|
|
|
|
#include "duke3d.h"
|
|
|
|
#include "actors_inline.h"
|
|
|
|
|
2015-01-11 04:55:07 +00:00
|
|
|
ACTOR_INLINE int A_CheckEnemyTile(int32_t pn)
|
|
|
|
{
|
|
|
|
return ((g_tile[pn].flags & (SFLAG_HARDCODED_BADGUY | SFLAG_BADGUY)) != 0);
|
|
|
|
}
|
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
ACTOR_INLINE int32_t A_SetSprite(int32_t i,uint32_t cliptype)
|
|
|
|
{
|
|
|
|
vec3_t davect = {(sprite[i].xvel*(sintable[(sprite[i].ang+512)&2047]))>>14,
|
|
|
|
(sprite[i].xvel*(sintable[sprite[i].ang&2047]))>>14,
|
|
|
|
sprite[i].zvel
|
|
|
|
};
|
|
|
|
return (A_MoveSprite(i,&davect,cliptype)==0);
|
|
|
|
}
|
|
|
|
|
2014-09-07 18:10:16 +00:00
|
|
|
ACTOR_INLINE int32_t A_MoveSprite(int32_t spritenum, const vec3_t *change, uint32_t cliptype)
|
|
|
|
{
|
|
|
|
return A_MoveSpriteClipdist(spritenum, change, cliptype, -1);
|
|
|
|
}
|
2012-11-05 02:49:08 +00:00
|
|
|
|
|
|
|
EXTERN_INLINE void G_UpdateInterpolations(void) //Stick at beginning of G_DoMoveThings
|
|
|
|
{
|
2015-01-11 04:55:07 +00:00
|
|
|
for (int i=g_numInterpolations-1; i>=0; i--) oldipos[i] = *curipos[i];
|
2012-11-05 02:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_INLINE void G_RestoreInterpolations(void) //Stick at end of drawscreen
|
|
|
|
{
|
|
|
|
int32_t i=g_numInterpolations-1;
|
|
|
|
|
|
|
|
if (--g_interpolationLock)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (; i>=0; i--) *curipos[i] = bakipos[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_INLINE int32_t G_CheckForSpaceCeiling(int32_t sectnum)
|
|
|
|
{
|
2013-04-15 10:48:09 +00:00
|
|
|
return ((sector[sectnum].ceilingstat&1) && sector[sectnum].ceilingpal == 0 &&
|
|
|
|
(sector[sectnum].ceilingpicnum==MOONSKY1 || sector[sectnum].ceilingpicnum==BIGORBIT1));
|
2012-11-05 02:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_INLINE int32_t G_CheckForSpaceFloor(int32_t sectnum)
|
|
|
|
{
|
2013-04-15 10:48:09 +00:00
|
|
|
return ((sector[sectnum].floorstat&1) && sector[sectnum].ceilingpal == 0 &&
|
|
|
|
(sector[sectnum].floorpicnum==MOONSKY1 || sector[sectnum].floorpicnum==BIGORBIT1));
|
2012-11-05 02:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_INLINE int32_t A_CheckEnemySprite(const spritetype *s)
|
|
|
|
{
|
2013-04-15 10:48:09 +00:00
|
|
|
return A_CheckEnemyTile(s->picnum);
|
2012-11-05 02:49:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|