2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood 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.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
|
2021-11-20 16:01:59 +00:00
|
|
|
#include "mapstructs.h"
|
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-11-21 14:09:38 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
kAttrMove = 0x0001, // is affected by movement physics
|
|
|
|
kAttrGravity = 0x0002, // is affected by gravity
|
|
|
|
kAttrFalling = 0x0004, // in z motion
|
|
|
|
kAttrAiming = 0x0008,
|
|
|
|
kAttrRespawn = 0x0010,
|
|
|
|
kAttrFree = 0x0020,
|
|
|
|
kAttrSmoke = 0x0100, // receives tsprite smoke/steam
|
2021-12-29 19:45:55 +00:00
|
|
|
};
|
2020-11-21 14:09:38 +00:00
|
|
|
|
2019-09-21 11:02:17 +00:00
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
|
|
|
struct AISTATE;
|
|
|
|
|
|
|
|
|
|
|
|
struct MAPSIGNATURE {
|
2021-12-29 19:45:55 +00:00
|
|
|
char signature[4];
|
|
|
|
int16_t version;
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2021-12-29 19:45:55 +00:00
|
|
|
struct MAPHEADER {
|
|
|
|
int32_t x; // x
|
|
|
|
int32_t y; // y
|
|
|
|
int32_t z; // z
|
|
|
|
int16_t ang; // ang
|
|
|
|
int16_t sect; // sect
|
|
|
|
int16_t pskybits; // pskybits
|
|
|
|
int32_t visibility; // visibility
|
|
|
|
int32_t mattid; // song id, Matt
|
|
|
|
uint8_t parallax; // parallaxtype
|
|
|
|
int32_t revision; // map revision
|
|
|
|
int16_t numsectors; // numsectors
|
|
|
|
int16_t numwalls; // numwalls
|
|
|
|
int16_t numsprites; // numsprites
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MAPHEADER2 {
|
2021-12-29 19:45:55 +00:00
|
|
|
char name[64];
|
|
|
|
int numxsprites; // xsprite size
|
|
|
|
int numxwalls; // xwall size
|
|
|
|
int numxsectors; // xsector size
|
|
|
|
uint8_t pad[52];
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
extern int gVisibility;
|
2021-12-29 19:45:55 +00:00
|
|
|
extern const char* gItemText[];
|
|
|
|
extern const char* gAmmoText[];
|
|
|
|
extern const char* gWeaponText[];
|
2021-12-29 19:33:09 +00:00
|
|
|
extern int gSkyCount;
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2021-12-29 19:45:55 +00:00
|
|
|
void GetSpriteExtents(spritetypebase const* const pSprite, int* top, int* bottom)
|
2019-07-01 08:29:55 +00:00
|
|
|
{
|
2022-02-02 19:03:02 +00:00
|
|
|
*top = *bottom = pSprite->int_pos().Z;
|
2021-12-29 19:45:55 +00:00
|
|
|
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
|
|
|
{
|
|
|
|
int height = tileHeight(pSprite->picnum);
|
|
|
|
int center = height / 2 + tileTopOffset(pSprite->picnum);
|
|
|
|
*top -= (pSprite->yrepeat << 2) * center;
|
|
|
|
*bottom += (pSprite->yrepeat << 2) * (height - center);
|
|
|
|
}
|
2019-07-01 08:29:55 +00:00
|
|
|
}
|
|
|
|
|
2021-12-03 21:45:54 +00:00
|
|
|
struct BloodSpawnSpriteDef : public SpawnSpriteDef
|
|
|
|
{
|
2021-12-29 19:45:55 +00:00
|
|
|
TArray<XSPRITE> xspr;
|
2021-12-03 21:45:54 +00:00
|
|
|
};
|
|
|
|
|
2021-11-23 23:55:57 +00:00
|
|
|
DBloodActor* InsertSprite(sectortype* pSector, int nStat);
|
2021-11-28 12:29:59 +00:00
|
|
|
int DeleteSprite(DBloodActor* actor);
|
2021-12-04 21:04:16 +00:00
|
|
|
|
2021-12-29 19:45:55 +00:00
|
|
|
unsigned int dbReadMapCRC(const char* pPath);
|
2022-08-23 21:36:23 +00:00
|
|
|
void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, int* pSector, unsigned int* pCRC, BloodSpawnSpriteDef& sprites);
|
2019-09-22 06:39:22 +00:00
|
|
|
|
2021-11-20 08:16:23 +00:00
|
|
|
|
2021-11-18 23:55:30 +00:00
|
|
|
END_BLD_NS
|