From 708d24aba748f5e1e138b739c631161982c09a4d Mon Sep 17 00:00:00 2001 From: Jonathan Russell Date: Sat, 20 Jan 2018 20:02:36 +0000 Subject: [PATCH] - added Screen.getViewWindow function --- src/v_draw.cpp | 9 +++++++++ wadsrc/static/zscript/base.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index fc592949c..32f908d03 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -230,6 +230,15 @@ DEFINE_ACTION_FUNCTION(_Screen, GetClipRect) return MIN(numret, 4); } +DEFINE_ACTION_FUNCTION(_Screen, GetViewWindow) +{ + PARAM_PROLOGUE; + if (numret > 0) ret[0].SetInt(viewwindowx); + if (numret > 1) ret[1].SetInt(viewwindowy); + if (numret > 2) ret[2].SetInt(viewwidth); + if (numret > 3) ret[3].SetInt(viewheight); + return MIN(numret, 4); +} bool DCanvas::SetTextureParms(DrawParms *parms, FTexture *img, double xx, double yy) const { diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 804bc7c49..bf5edf6ca 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -175,6 +175,7 @@ struct Screen native native static void SetClipRect(int x, int y, int w, int h); native static void ClearClipRect(); native static int, int, int, int GetClipRect(); + native static int, int, int, int GetViewWindow(); // This is a leftover of the abandoned Inventory.DrawPowerup method.