- 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.

# Conflicts:
#	src/v_draw.cpp
This commit is contained in:
Christoph Oelckers 2018-11-18 21:18:15 +01:00 committed by drfrag
parent 5e63252fdc
commit f2fe079ddb
2 changed files with 3 additions and 3 deletions

View file

@ -208,7 +208,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;
}

View file

@ -198,7 +198,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;
}
@ -330,7 +330,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;