raze-gles/source/core/screenjob.h

63 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include <functional>
2020-06-27 09:48:55 +00:00
#include "dobject.h"
2020-06-28 08:14:42 +00:00
using CompletionFunc = std::function<void(bool)>;
2020-06-27 09:48:55 +00:00
class DScreenJob : public DObject
{
DECLARE_CLASS(DScreenJob, DObject)
public:
virtual int Frame(uint64_t clock, bool skiprequest) = 0;
2020-06-27 09:48:55 +00:00
};
2020-06-28 20:17:27 +00:00
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
class DImageScreen : public DScreenJob
{
DECLARE_CLASS(DImageScreen, DScreenJob)
int fadeoutstart = -1;
int tilenum = -1;
FGameTexture* tex = nullptr;
public:
DImageScreen(FGameTexture* tile)
{
tex = tile;
}
DImageScreen(int tile)
{
tilenum = tile;
}
int Frame(uint64_t clock, bool skiprequest) override;
};
struct JobDesc
{
DScreenJob* job;
void (*postAction)();
bool ignoreifskipped;
};
2020-06-27 09:48:55 +00:00
void RunScreenJob(JobDesc *jobs, int count, CompletionFunc completion, bool clearbefore = true);
2020-06-27 09:48:55 +00:00
struct AnimSound
{
int framenum;
int soundnum;
};
DScreenJob *PlayVideo(const char *filename, const AnimSound *ans = nullptr, const int *frameticks = nullptr);