- text screen helper stuff for cutscene system.

This commit is contained in:
Christoph Oelckers 2021-05-22 12:21:25 +02:00
parent 933fa62782
commit e5baef837a
4 changed files with 17 additions and 3 deletions

View file

@ -51,6 +51,8 @@
#include "s_music.h"
#include "m_argv.h"
CVAR(Bool, inter_subtitles, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
DObject* runner;
PClass* runnerclass;
PType* runnerclasstype;

View file

@ -6,6 +6,9 @@
#include "s_soundinternal.h"
#include "gamestate.h"
#include "zstring.h"
#include "c_cvars.h"
EXTERN_CVAR(Bool, inter_subtitles)
using CompletionFunc = std::function<void(bool)>;

View file

@ -56,6 +56,8 @@
#include "v_draw.h"
#include "doommenu.h"
#include "sbar.h"
#include "screenjob.h"
#include "vm.h"
FIntermissionDescriptorList IntermissionDescriptors;
@ -73,10 +75,17 @@ IMPLEMENT_POINTERS_END
extern int NoWipe;
CVAR(Bool, nointerscrollabort, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR(Bool, inter_subtitles, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
CVAR(Bool, inter_classic_scaling, true, CVAR_ARCHIVE);
DEFINE_ACTION_FUNCTION(_Screen, GetTextScreenSize)
{
auto scale = active_con_scaletext(twod, generic_ui);
int hudwidth = twod->GetWidth() / scale;
int hudheight = twod->GetHeight() / scale;
ACTION_RETURN_VEC2(DVector2(hudwidth, hudheight));
}
//==========================================================================
//
// This also gets used by the title loop.
@ -376,7 +385,6 @@ void DIntermissionScreenText::Drawer ()
Super::Drawer();
if (mTicker >= mTextDelay)
{
FGameTexture *pic;
int w;
size_t count;
int c;
@ -446,7 +454,7 @@ void DIntermissionScreenText::Drawer ()
continue;
}
pic = font->GetChar (c, mTextColor, &w);
w = font->GetCharWidth(c);
w += kerning;
w *= fontscale;
if (cx + w > twod->GetWidth())

View file

@ -412,6 +412,7 @@ struct Screen native
native static Color PaletteColor(int index);
native static int GetWidth();
native static int GetHeight();
native static Vector2 GetTextScreenSize();
native static void Clear(int left, int top, int right, int bottom, Color color, int palcolor = -1);
native static void Dim(Color col, double amount, int x, int y, int w, int h, ERenderStyle style = STYLE_Translucent);