From cedcccb18e4a5981bd58e189d58501d93895586f Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Mar 2025 18:39:49 +0100 Subject: [PATCH] move patch null checks into the patch drawers instead --- src/lua_hudlib_drawlist.c | 6 ------ src/v_video.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lua_hudlib_drawlist.c b/src/lua_hudlib_drawlist.c index e06244411..d64722f0c 100644 --- a/src/lua_hudlib_drawlist.c +++ b/src/lua_hudlib_drawlist.c @@ -651,18 +651,12 @@ void LUA_HUD_DrawList(huddrawlist_h list) switch (item->type) { case DI_Draw: - if (!item->patch || item->patch == NULL) - return; V_DrawBlendingFixedPatch(LERPS(x), LERPS(y), FRACUNIT, item->flags, item->patch, item->colormap, item->blend); break; case DI_DrawScaled: - if (!item->patch || item->patch == NULL) - return; V_DrawBlendingFixedPatch(LERPS(x), LERPS(y), LERP(scale), item->flags, item->patch, item->colormap, item->blend); break; case DI_DrawStretched: - if (!item->patch || item->patch == NULL) - return; V_DrawStretchyFixedPatch(LERPS(x), LERPS(y), LERP(hscale), LERP(vscale), item->flags, item->patch, item->colormap, item->blend); break; case DI_DrawNum: diff --git a/src/v_video.c b/src/v_video.c index 5e11c5758..3c3248ad8 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -627,6 +627,9 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca if (rendermode == render_none) return; + if (!patch) + return; + #ifdef HWRENDER //if (rendermode != render_soft && !con_startup) // Why? if (rendermode == render_opengl) @@ -857,6 +860,9 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ if (rendermode == render_none) return; + if (!patch) + return; + #ifdef HWRENDER if (rendermode == render_opengl) {