From 0049fea8d627f88b76a3a1d38f67d03e55dfddf7 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 23 Jul 2022 18:21:04 +0200 Subject: [PATCH] Add missing DrawText binding --- src/common/2d/v_drawtext.cpp | 18 ++++++++++++++++++ wadsrc/static/zscript/engine/base.zs | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/common/2d/v_drawtext.cpp b/src/common/2d/v_drawtext.cpp index f9ca1bdce..d5ed9af98 100644 --- a/src/common/2d/v_drawtext.cpp +++ b/src/common/2d/v_drawtext.cpp @@ -436,3 +436,21 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawText) return 0; } + +DEFINE_ACTION_FUNCTION(FCanvas, DrawText) +{ + PARAM_SELF_PROLOGUE(FCanvas); + PARAM_POINTER_NOT_NULL(font, FFont); + PARAM_INT(cr); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + PARAM_STRING(chr); + + PARAM_VA_POINTER(va_reginfo) // Get the hidden type information array + + VMVa_List args = { param + 5, 0, numparam - 6, va_reginfo + 5 }; + const char *txt = chr[0] == '$' ? GStrings(&chr[1]) : chr.GetChars(); + DrawText(self->Drawer.get(), font, cr, x, y, txt, args); + return 0; +} + diff --git a/wadsrc/static/zscript/engine/base.zs b/wadsrc/static/zscript/engine/base.zs index 4bff10736..7bc46a7a2 100644 --- a/wadsrc/static/zscript/engine/base.zs +++ b/wadsrc/static/zscript/engine/base.zs @@ -519,7 +519,6 @@ class Canvas : Object native native void SetClipRect(int x, int y, int w, int h); native void ClearClipRect(); native int, int, int, int GetClipRect(); - native int, int, int, int GetViewWindow(); native double, double, double, double GetFullscreenRect(double vwidth, double vheight, int fsmode); native Vector2 SetOffset(double x, double y); native void ClearScreen(color col = 0);