Skip to content

Commit

Permalink
- use the border flat as console fallback instead of the title pic.
Browse files Browse the repository at this point in the history
This tends to work a lot better because it has far lower contrast.
  • Loading branch information
coelckers committed Oct 25, 2020
1 parent 0e46258 commit 9644179
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/common/2d/v_2ddrawer.cpp
Expand Up @@ -753,14 +753,14 @@ float F2DDrawer::GetClassicFlatScalarHeight()
return sh;
}

void F2DDrawer::AddFlatFill(int left, int top, int right, int bottom, FGameTexture *src, int local_origin, double flatscale, PalEntry color)
void F2DDrawer::AddFlatFill(int left, int top, int right, int bottom, FGameTexture *src, int local_origin, double flatscale, PalEntry color, ERenderStyle style)
{
float fU1, fU2, fV1, fV2;

RenderCommand dg;

dg.mType = DrawTypeTriangles;
dg.mRenderStyle = DefaultRenderStyle();
dg.mRenderStyle = LegacyRenderStyles[style];
dg.mTexture = src;
dg.mVertCount = 4;
dg.mTexture = src;
Expand Down
2 changes: 1 addition & 1 deletion src/common/2d/v_2ddrawer.h
Expand Up @@ -190,7 +190,7 @@ class F2DDrawer
void AddPoly(FGameTexture* img, FVector4 *vt, size_t vtcount, unsigned int *ind, size_t idxcount, int translation, PalEntry color, FRenderStyle style, int clipx1, int clipy1, int clipx2, int clipy2);
void FillPolygon(int* rx1, int* ry1, int* xb1, int32_t npoints, int picnum, int palette, int shade, int props, const FVector2& xtex, const FVector2& ytex, const FVector2& otex,
int clipx1, int clipy1, int clipx2, int clipy2);
void AddFlatFill(int left, int top, int right, int bottom, FGameTexture *src, int local_origin = false, double flatscale = 1.0, PalEntry color = 0xffffffff);
void AddFlatFill(int left, int top, int right, int bottom, FGameTexture *src, int local_origin = false, double flatscale = 1.0, PalEntry color = 0xffffffff, ERenderStyle rs = STYLE_Normal);

void AddColorOnlyQuad(int left, int top, int width, int height, PalEntry color, FRenderStyle *style = nullptr, bool prepend = false);
void ClearScreen(PalEntry color = 0xff000000);
Expand Down
18 changes: 14 additions & 4 deletions src/common/console/c_console.cpp
Expand Up @@ -89,6 +89,7 @@ void C_SetNotifyFontScale(double scale)
FConsoleBuffer *conbuffer;

static FTextureID conback;
static FTextureID conflat;
static uint32_t conshade;
static bool conline;

Expand Down Expand Up @@ -211,10 +212,10 @@ CUSTOM_CVAR (Int, msgmidcolor2, CR_BROWN, CVAR_ARCHIVE)
setmsgcolor (PRINTLEVELS+1, self);
}

void C_InitConback()
void C_InitConback(FTextureID fallback, bool tile)
{
conback = TexMan.CheckForTexture ("CONBACK", ETextureType::MiscPatch);

conflat = fallback;
if (!conback.isValid())
{
conback.SetInvalid();
Expand All @@ -225,6 +226,7 @@ void C_InitConback()
{
conshade = 0;
conline = false;
if (!tile) conback = fallback;
}
}

Expand Down Expand Up @@ -612,8 +614,16 @@ void C_DrawConsole ()
}
else
{
PalEntry pe((uint8_t)(con_alpha * 255), 0, 0, 0);
twod->AddColorOnlyQuad(0, 0, screen->GetWidth(), visheight, pe);
if (conflat.isValid())
{
PalEntry pe((uint8_t(255 * con_alpha)), 64, 64, 64);
twod->AddFlatFill(0, visheight - screen->GetHeight(), screen->GetWidth(), visheight, TexMan.GetGameTexture(conflat), 1, CleanXfac, pe, STYLE_Shaded);
}
else
{
PalEntry pe((uint8_t)(con_alpha * 255), 0, 0, 0);
twod->AddColorOnlyQuad(0, 0, screen->GetWidth(), visheight, pe);
}
}

if (conline && visheight < screen->GetHeight())
Expand Down
3 changes: 2 additions & 1 deletion src/common/console/c_console.h
Expand Up @@ -37,6 +37,7 @@
#include <stdarg.h>
#include "basics.h"
#include "c_tabcomplete.h"
#include "textureid.h"

struct event_t;

Expand All @@ -57,7 +58,7 @@ extern constate_e ConsoleState;
// Initialize the console
void C_InitConsole (int width, int height, bool ingame);
void C_DeinitConsole ();
void C_InitConback();
void C_InitConback(FTextureID fallback, bool tile);

// Adjust the console for a new screen mode
void C_NewModeAdjust (void);
Expand Down
2 changes: 1 addition & 1 deletion src/d_main.cpp
Expand Up @@ -3366,7 +3366,7 @@ static int D_DoomMain_Internal (void)
TexMan.Init([]() { StartScreen->Progress(); }, CheckForHacks);
PatchTextures();
TexAnim.Init();
C_InitConback();
C_InitConback(TexMan.CheckForTexture(gameinfo.BorderFlat, ETextureType::Flat), true);

FixWideStatusBar();

Expand Down

0 comments on commit 9644179

Please sign in to comment.