diff --git a/src/common/cutscenes/screenjob.cpp b/src/common/cutscenes/screenjob.cpp index 305710eb5..b983c3e81 100644 --- a/src/common/cutscenes/screenjob.cpp +++ b/src/common/cutscenes/screenjob.cpp @@ -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; diff --git a/src/common/cutscenes/screenjob.h b/src/common/cutscenes/screenjob.h index be39bd25f..eaf6a10a9 100644 --- a/src/common/cutscenes/screenjob.h +++ b/src/common/cutscenes/screenjob.h @@ -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; diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 64a538878..28bbdcf31 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -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()) diff --git a/wadsrc/static/zscript/engine/base.zs b/wadsrc/static/zscript/engine/base.zs index 41bdb07f9..8c7e54368 100644 --- a/wadsrc/static/zscript/engine/base.zs +++ b/wadsrc/static/zscript/engine/base.zs @@ -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);