From a66567ea0f16544cf6d62f84d69d4878f09deddb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 10 Feb 2017 23:24:06 +0000 Subject: [PATCH] borp https://gfycat.com/AcceptableWhiteJabiru doesn't do anything in ogl sorry, inu might change that later but --- src/dehacked.c | 1 + src/hardware/hw_draw.c | 8 ++++++-- src/m_menu.c | 17 +++++++++-------- src/v_video.c | 41 ++++++++++++++++++++++++++++------------- src/v_video.h | 1 + 5 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index e5d08fdb0..53687b705 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7672,6 +7672,7 @@ struct { {"V_70TRANS",V_70TRANS}, {"V_80TRANS",V_80TRANS}, {"V_90TRANS",V_90TRANS}, + {"V_STATIC",V_STATIC}, {"V_HUDTRANSHALF",V_HUDTRANSHALF}, {"V_HUDTRANS",V_HUDTRANS}, {"V_HUDTRANSDOUBLE",V_HUDTRANSDOUBLE}, diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index f23753ee5..a00bf3aeb 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -152,7 +152,9 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f*FIXED_TO_FLOAT(pscale); float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f*FIXED_TO_FLOAT(pscale); - if (alphalevel >= 10 && alphalevel < 13) + if (alphalevel == 12) + alphalevel = 0; + else if (alphalevel >= 10 && alphalevel < 13) return; // make patch ready in hardware cache @@ -252,7 +254,9 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal float pdupx = FIXED_TO_FLOAT(vid.fdupx)*2.0f*FIXED_TO_FLOAT(pscale); float pdupy = FIXED_TO_FLOAT(vid.fdupy)*2.0f*FIXED_TO_FLOAT(pscale); - if (alphalevel >= 10 && alphalevel < 13) + if (alphalevel == 12) + alphalevel = 0; + else if (alphalevel >= 10 && alphalevel < 13) return; // make patch ready in hardware cache diff --git a/src/m_menu.c b/src/m_menu.c index 20667eea5..fc8d09437 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -209,7 +209,7 @@ menu_t SPauseDef; // Level Select static levelselect_t levelselect = {0, NULL}; static UINT8 levelselectselect[4]; -static patch_t *levselp[4]; +static patch_t *levselp[3]; static INT32 lsoffs[2]; #define lsrow levelselectselect[0] @@ -3803,13 +3803,11 @@ static boolean M_PrepareLevelPlatter(INT32 gt) W_UnlockCachedPatch(levselp[0]); W_UnlockCachedPatch(levselp[1]); W_UnlockCachedPatch(levselp[2]); - W_UnlockCachedPatch(levselp[3]); } levselp[0] = W_CachePatchName("SLCT1LVL", PU_STATIC); levselp[1] = W_CachePatchName("SLCT2LVL", PU_STATIC); levselp[2] = W_CachePatchName("BLANKLVL", PU_STATIC); - levselp[3] = W_CachePatchName("STATCLVL", PU_STATIC); return true; } @@ -3979,13 +3977,16 @@ static void M_DrawLevelPlatterMap(UINT8 row, UINT8 col, INT32 x, INT32 y, boolea // A 160x100 image of the level as entry MAPxxP if (!(levelselect.rows[row].mapavailable[col])) - patch = ((lstic & 1) ? levselp[2] : levselp[3]); // static - make secret maps look ENTICING - else if (W_CheckNumForName(va("%sP", G_BuildMapName(map))) != LUMPERROR) - patch = W_CachePatchName(va("%sP", G_BuildMapName(map)), PU_CACHE); + V_DrawSmallScaledPatch(x, y, V_STATIC, levselp[2]); // static - make secret maps look ENTICING else - patch = levselp[2]; // don't flash to indicate that it's just a normal level + { + if (W_CheckNumForName(va("%sP", G_BuildMapName(map))) != LUMPERROR) + patch = W_CachePatchName(va("%sP", G_BuildMapName(map)), PU_CACHE); + else + patch = levselp[2]; // don't flash to indicate that it's just a normal level - V_DrawSmallScaledPatch(x, y, 0, patch); + V_DrawSmallScaledPatch(x, y, 0, patch); + } if ((y+50) < 200) { diff --git a/src/v_video.c b/src/v_video.c index 9109ce5cc..fb02dfc96 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -325,6 +325,13 @@ static inline UINT8 transmappedpdraw(const UINT8 *dest, const UINT8 *source, fix { return *(v_translevel + (((*(v_colormap + source[ofs>>FRACBITS]))<<8)&0xff00) + (*dest&0xff)); } +static inline UINT8 staticpdraw(const UINT8 *dest, const UINT8 *source, fixed_t ofs) +{ + UINT8 val = source[ofs>>FRACBITS]; + (void)dest; + if (val < 7) return val; + return M_RandomKey(7+1)+(val-7);//M_RandomByte(); +} // Draws a patch scaled to arbitrary size. void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t *patch, const UINT8 *colormap) @@ -356,22 +363,30 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t patchdrawfunc = standardpdraw; v_translevel = NULL; - if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT))) + if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT)) == 12) // static { - if (alphalevel == 13) - alphalevel = hudminusalpha[cv_translucenthud.value]; - else if (alphalevel == 14) - alphalevel = 10 - cv_translucenthud.value; - else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value]; - - if (alphalevel >= 10) - return; // invis + alphalevel = 0; + patchdrawfunc = staticpdraw; } - if (alphalevel) + else { - v_translevel = transtables + ((alphalevel-1)<= 10) + return; // invis + } + if (alphalevel) + { + v_translevel = transtables + ((alphalevel-1)<