2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 sirlemonhead, Nuke.YKT
|
|
|
|
This file is part of PCExhumed.
|
|
|
|
PCExhumed 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.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-10-11 10:41:38 +00:00
|
|
|
#pragma once
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
struct actionSeq
|
|
|
|
{
|
2023-04-06 13:45:07 +00:00
|
|
|
int16_t nSeqId;
|
|
|
|
int16_t nFlags;
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
2023-04-15 10:49:52 +00:00
|
|
|
struct SeqFrameChunk
|
|
|
|
{
|
|
|
|
int16_t xpos;
|
|
|
|
int16_t ypos;
|
2023-04-17 00:38:34 +00:00
|
|
|
FTextureID tex;
|
2023-04-15 10:49:52 +00:00
|
|
|
int16_t flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SeqFrame
|
|
|
|
{
|
|
|
|
int16_t sound;
|
|
|
|
int16_t flags;
|
|
|
|
TArray<SeqFrameChunk> chunks;
|
2023-04-15 10:25:40 +00:00
|
|
|
|
2023-04-16 23:05:21 +00:00
|
|
|
const FTextureID getFirstChunkTexture() const
|
2023-04-15 10:25:40 +00:00
|
|
|
{
|
2023-04-16 08:44:17 +00:00
|
|
|
return chunks.Size() ? chunks[0].tex : FNullTextureID();
|
2023-04-15 10:25:40 +00:00
|
|
|
}
|
2023-04-15 11:48:48 +00:00
|
|
|
|
|
|
|
const void playSound(DExhumedActor* const pActor) const
|
|
|
|
{
|
|
|
|
if (sound == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (pActor)
|
|
|
|
{
|
|
|
|
D3PlayFX(sound, pActor);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PlayLocalSound(sound, 0);
|
|
|
|
}
|
|
|
|
}
|
2023-04-15 10:49:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-15 22:03:23 +00:00
|
|
|
struct Seq
|
|
|
|
{
|
|
|
|
int16_t flags;
|
|
|
|
TArray<SeqFrame> frames;
|
|
|
|
|
2023-04-16 23:05:21 +00:00
|
|
|
const FTextureID getFirstFrameTexture() const
|
2023-04-15 22:03:23 +00:00
|
|
|
{
|
2023-04-16 23:05:21 +00:00
|
|
|
return frames[0].getFirstChunkTexture();
|
2023-04-15 22:03:23 +00:00
|
|
|
}
|
|
|
|
};
|
2023-04-21 11:11:52 +00:00
|
|
|
|
2021-11-21 19:48:11 +00:00
|
|
|
extern int16_t nFlameHeight;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-21 19:48:11 +00:00
|
|
|
extern int16_t nPilotLightFrame;
|
|
|
|
extern int16_t nPilotLightCount;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
void seq_LoadSequences();
|
2023-04-18 05:04:58 +00:00
|
|
|
void seq_DrawGunSequence(const SeqFrame& seqFrame, double xPos, double yPos, int nShade, int nPal, DAngle nAngle, double nAlpha, int nStat = 0);
|
2023-04-21 11:11:52 +00:00
|
|
|
void seq_PlotSequence(const int nSprite, const FName seqFile, const int16_t seqIndex, const int16_t frameIndex, const int16_t nFlags);
|
2023-04-15 22:20:04 +00:00
|
|
|
void seq_PlotArrowSequence(const int nSprite, const FName seqFile, const int16_t seqIndex, const int frameIndex);
|
2023-04-18 05:04:58 +00:00
|
|
|
void seq_DrawPilotLightSeq(double xPos, double yPos, double nAngle);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2023-04-26 10:13:26 +00:00
|
|
|
const TArray<Seq>* const getFileSeqs(const FName nSeqFile);
|
2023-04-21 11:11:52 +00:00
|
|
|
|
2023-04-27 10:12:39 +00:00
|
|
|
inline const Seq* const getSequence(const FName nSeqFile, const unsigned nSeqIndex = 0)
|
2023-04-16 06:49:51 +00:00
|
|
|
{
|
2023-04-27 10:12:39 +00:00
|
|
|
return getFileSeqs(nSeqFile)->Data(nSeqIndex);
|
2023-04-16 06:49:51 +00:00
|
|
|
}
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|
|
|
|
|