- cleanup

This commit is contained in:
Christoph Oelckers 2020-04-08 18:53:47 +02:00
parent db21b3ec35
commit 6276001a7c
6 changed files with 29 additions and 11 deletions

View file

@ -808,6 +808,7 @@ set (PCH_SOURCES
common/filesystem/file_whres.cpp
common/filesystem/file_directory.cpp
common/filesystem/resourcefile.cpp
common/engine/stats.cpp
common/engine/sc_man.cpp
common/engine/palettecontainer.cpp
common/engine/stringtable.cpp
@ -836,8 +837,7 @@ set (PCH_SOURCES
common/scripting/backend/vmbuilder.cpp
common/scripting/backend/codegen.cpp
core/utility/stats.cpp
core/textures/buildtiles.cpp
core/textures/texture.cpp
core/textures/imagetexture.cpp

View file

@ -33,7 +33,8 @@
*/
#include "stats.h"
#include "v_draw.h"
#include "v_2ddrawer.h"
#include "drawparms.h"
#include "v_text.h"
#include "v_font.h"
#include "c_console.h"

View file

@ -97,6 +97,7 @@ private:
#else
// Windows and macOS
#include "x86.h"
extern double PerfToSec, PerfToMillisec;
@ -184,13 +185,27 @@ private:
#endif
class glcycle_t : public cycle_t
{
public:
static bool active;
void Clock()
{
if (active) cycle_t::Clock();
}
void Unclock()
{
if (active) cycle_t::Unclock();
}
};
// Helper for code that uses a timer and has multiple exit points.
class Clocker
{
public:
Clocker(cycle_t& clck)
explicit Clocker(glcycle_t& clck)
: clock(clck)
{
clock.Clock();
@ -204,7 +219,7 @@ public:
Clocker(const Clocker&) = delete;
Clocker& operator=(const Clocker&) = delete;
private:
cycle_t & clock;
glcycle_t & clock;
};

View file

@ -109,6 +109,8 @@ enum
DTA_Burn, // activates the burn shader for this element
DTA_Spacing, // Strings only: Additional spacing between characters
DTA_Monospace, // Fonts only: Use a fixed distance between characters.
DTA_FullscreenEx,
};
enum EMonospacing : int

View file

@ -178,4 +178,10 @@ public:
}
};
void DrawTexture(F2DDrawer* drawer, FTexture* img, double x, double y, int tags_first, ...);
void DrawChar(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, int character, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, const char* string, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont* font, int normalcolor, double x, double y, const char32_t* string, int tag_first, ...);
void DrawFrame(F2DDrawer* twod, PalEntry color, int left, int top, int width, int height, int thickness);
#endif

View file

@ -39,12 +39,6 @@ bool AspectTallerThanWide(float aspect);
void ScaleWithAspect(int& w, int& h, int Width, int Height);
void V_UpdateModeSize(int width, int height);
void DrawTexture(F2DDrawer *drawer, FTexture* img, double x, double y, int tags_first, ...);
void DrawChar (F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, int character, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, const char *string, int tag_first, ...);
void DrawText(F2DDrawer* drawer, FFont *font, int normalcolor, double x, double y, const char32_t *string, int tag_first, ...);
void DrawFrame(F2DDrawer* twod, PalEntry color, int left, int top, int width, int height, int thickness);
EXTERN_CVAR(Int, con_scaletext) // Scale notify text at high resolutions?
EXTERN_CVAR(Int, con_scale)