From 108874f3791bc00b92a309c501b2532da1953830 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Nov 2018 21:18:15 +0100 Subject: [PATCH] - fixed the reginfo checks for the Draw... functions. They need to be offset by the same amount as the arguments so that the values are properly matched. --- src/v_draw.cpp | 4 ++-- src/v_text.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index c64fcedfd..502e14a29 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -176,7 +176,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawTexture) if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); FTexture *tex = animate ? TexMan(FSetTextureID(texid)) : TexMan[FSetTextureID(texid)]; - VMVa_List args = { param + 4, 0, numparam - 5, va_reginfo }; + VMVa_List args = { param + 4, 0, numparam - 5, va_reginfo + 4 }; screen->DrawTexture(tex, x, y, args); return 0; } @@ -232,7 +232,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawShape) if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); FTexture *tex = animate ? TexMan(FSetTextureID(texid)) : TexMan[FSetTextureID(texid)]; - VMVa_List args = { param + 3, 0, numparam - 4, va_reginfo }; + VMVa_List args = { param + 3, 0, numparam - 4, va_reginfo + 3 }; screen->DrawShape(tex, shape, args); return 0; diff --git a/src/v_text.cpp b/src/v_text.cpp index fe535b598..2eae3e9f3 100644 --- a/src/v_text.cpp +++ b/src/v_text.cpp @@ -194,7 +194,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawChar) PARAM_VA_POINTER(va_reginfo) // Get the hidden type information array if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo }; + VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo + 5 }; screen->DrawChar(font, cr, x, y, chr, args); return 0; } @@ -326,7 +326,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawText) PARAM_VA_POINTER(va_reginfo) // Get the hidden type information array if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo }; + VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo + 5 }; const char *txt = chr[0] == '$' ? GStrings(&chr[1]) : chr.GetChars(); screen->DrawText(font, cr, x, y, txt, args); return 0;