From a3ef711d1d684a370518d5f5f274cadab7440cee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 11:30:09 +0200 Subject: [PATCH 1/6] - added a special slider type for the scaling options that prints a descriptive text instead of the slider for the special settings. - fixed the adaptive scale calculation in GetUIScale which had the coordinates mixed up. --- src/gameconfigfile.cpp | 2 + src/v_draw.cpp | 8 +-- wadsrc/static/language.enu | 4 ++ wadsrc/static/menudef.txt | 12 ++-- .../static/zscript/menu/optionmenuitems.txt | 55 ++++++++++++++++++- 5 files changed, 70 insertions(+), 11 deletions(-) diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index ffeba90f2..b3fc0b712 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -376,6 +376,8 @@ void FGameConfigFile::DoGlobalSetup () if (var != NULL) var->ResetToDefault(); var = FindCVar("con_scaletext", NULL); if (var != NULL) var->ResetToDefault(); + var = FindCVar("uiscale", NULL); + if (var != NULL) var->ResetToDefault(); } diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 78b0dd7f3..2a1248f90 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -63,7 +63,7 @@ #include "g_levellocals.h" #include "textures.h" -CUSTOM_CVAR(Int, uiscale, 2, CVAR_ARCHIVE | CVAR_NOINITCALL) +CUSTOM_CVAR(Int, uiscale, 0, CVAR_ARCHIVE | CVAR_NOINITCALL) { if (self < 0) { @@ -82,9 +82,9 @@ int GetUIScale(int altval) if (altval > 0) scaleval = altval; else if (uiscale == 0) { - // Default should try to scale to 640x480 - int vscale = screen->GetHeight() / 640; - int hscale = screen->GetWidth() / 480; + // Default should try to scale to 640x400 + int vscale = screen->GetHeight() / 400; + int hscale = screen->GetWidth() / 640; scaleval = clamp(vscale, 1, hscale); } else scaleval = uiscale; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index de32e0253..550a94634 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1853,6 +1853,7 @@ HUDMNU_HEXENFLASHES = "Hexen weapon flashes"; HUDMNU_POISONFLASHES = "Poison damage flashes"; HUDMNU_ICEFLASHES = "Ice death flashes"; HUDMNU_HAZARDFLASHES = "Poison Buildup flashes"; +HUDMNU_SCALEOPT = "Scaling Options"; // Scaling options SCALEMNU_TITLE = "Scaling Options"; @@ -1863,6 +1864,9 @@ SCALEMNU_STATBAR = "Status bar"; SCALEMNU_HUD = "Fullscreen HUD"; SCALEMNU_ALTHUD = "Alternative HUD"; SCALEMNU_HUDASPECT = "HUD preserves aspect ratio"; +SCALEMNU_USEUI = "Use default scale"; +SCALEMNU_USEFS = "Scale to fullscreen"; +SCALEMNU_ADAPT = "Adapt to screen size"; // AltHUD Options ALTHUDMNU_TITLE = "Alternative HUD"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 37b2a0175..3c9c88759 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -852,15 +852,15 @@ OptionMenu "HUDOptions" OptionMenu "ScalingOptions" { Title "$SCALEMNU_TITLE" - Slider "$HUDMNU_UISCALE", "uiscale", 0.0, 8.0, 1.0, 0 + ScaleSlider "$HUDMNU_UISCALE", "uiscale", 0.0, 8.0, 1.0, "$SCALEMNU_ADAPT" StaticText " " // These will need a new control type. StaticText "$SCALEMNU_OVERRIDE", 1 - Option "$SCALEMNU_MESSAGES", "con_scaletext", "OnOff" - Option "$SCALEMNU_CONSOLE", "con_scale", "OnOff" - Option "$SCALEMNU_STATBAR", "st_scale", "OnOff" - Option "$SCALEMNU_HUD", "hud_scale", "OnOff" - Option "$SCALEMNU_ALTHUD", "hud_althudscale", "OnOff" + ScaleSlider "$SCALEMNU_MESSAGES", "con_scaletext", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI" + ScaleSlider "$SCALEMNU_CONSOLE", "con_scale", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI" + ScaleSlider "$SCALEMNU_STATBAR", "st_scale", -1.0, 8.0, 1.0, "$SCALEMNU_USEUI", "$SCALEMNU_USEFS" + ScaleSlider "$SCALEMNU_HUD", "hud_scale", -1.0, 8.0, 1.0, "$SCALEMNU_USEUI", "$SCALEMNU_USEFS" + ScaleSlider "$SCALEMNU_ALTHUD", "hud_althudscale", 0.0, 8.0, 1.0, "$SCALEMNU_USEUI" StaticText " " Option "$SCALEMNU_HUDASPECT", "hud_aspectscale", "OnOff" } diff --git a/wadsrc/static/zscript/menu/optionmenuitems.txt b/wadsrc/static/zscript/menu/optionmenuitems.txt index 01771a372..dd4385dbb 100644 --- a/wadsrc/static/zscript/menu/optionmenuitems.txt +++ b/wadsrc/static/zscript/menu/optionmenuitems.txt @@ -666,7 +666,7 @@ class OptionMenuSliderBase : OptionMenuItem // //============================================================================= - private void DrawSlider (int x, int y, double min, double max, double cur, int fracdigits, int indent) + protected void DrawSlider (int x, int y, double min, double max, double cur, int fracdigits, int indent) { String formater = String.format("%%.%df", fracdigits); // The format function cannot do the '%.*f' syntax. String textbuf; @@ -1211,3 +1211,56 @@ class OptionMenuItemNumberField : OptionMenuFieldBase float mStep; } +//============================================================================= +// +// A special slider that displays plain text for special settings related +// to scaling. +// +//============================================================================= + +class OptionMenuItemScaleSlider : OptionMenuItemSlider +{ + String TextZero; + String TextNegOne; + + OptionMenuItemScaleSlider Init(String label, Name command, double min, double max, double step, String zero, String negone = "") + { + Super.Init(label, command, min, max, step, 0); + mCVar =CVar.FindCVar(command); + TextZero = zero; + TextNEgOne = negone; + return self; + } + + //============================================================================= + override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected) + { + drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor); + + int Selection = GetSliderValue(); + if (Selection == 0 || Selection == -1) + { + String text = Selection == 0? TextZero : Selection == -1? TextNegOne : ""; + screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true); + } + else + { + mDrawX = indent + CursorSpace(); + DrawSlider (mDrawX, y, mMin, mMax, GetSliderValue(), mShowValue, indent); + } + return indent; + } + + override bool MouseEvent(int type, int x, int y) + { + int value = GetSliderValue(); + if (value > 0) return Super.MouseEvent(type, x, y); + if (type == Menu.MOUSE_Release) + { + return Menu.GetCurrentMenu().MenuEvent(Menu.MKEY_Enter, true); + } + return false; + } + +} + From 3a1228bf9527f11ae4ae358f5e93446aa91170fd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 12:13:28 +0200 Subject: [PATCH 2/6] - exported the clipping rectangle to scripting and added a statusbar scaling wrapper for it. - fixed: BaseStatusBar.Fill did not pass its flags parameter to the native function. --- src/g_statusbar/sbar.h | 1 + src/g_statusbar/shared_sbar.cpp | 77 ++++++++++++++++++- src/v_draw.cpp | 31 ++++++++ wadsrc/static/zscript/base.txt | 4 + wadsrc/static/zscript/statusbar/statusbar.txt | 17 +++- 5 files changed, 126 insertions(+), 4 deletions(-) diff --git a/src/g_statusbar/sbar.h b/src/g_statusbar/sbar.h index 2f3f7b202..fd200c8d8 100644 --- a/src/g_statusbar/sbar.h +++ b/src/g_statusbar/sbar.h @@ -397,6 +397,7 @@ public: void DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY); void DrawString(FFont *font, const FString &cstring, double x, double y, int flags, double Alpha, int translation, int spacing, bool monospaced, int shadowX, int shadowY); void Fill(PalEntry color, double x, double y, double w, double h, int flags = 0); + void SetClipRect(double x, double y, double w, double h, int flags = 0); void BeginStatusBar(int resW, int resH, int relTop, bool forceScaled); void BeginHUD(int resW, int resH, double Alpha, bool forceScaled = false); diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index d5330b2b5..160a0d499 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -1910,7 +1910,82 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, Fill) PARAM_FLOAT(h); PARAM_INT_DEF(flags); if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - self->Fill(color, x, y, w, h); + self->Fill(color, x, y, w, h, flags); + return 0; +} + +//============================================================================ +// +// draw stuff +// +//============================================================================ + +void DBaseStatusBar::SetClipRect(double x, double y, double w, double h, int flags) +{ + // resolve auto-alignment before making any adjustments to the position values. + if (!(flags & DI_SCREEN_MANUAL_ALIGN)) + { + if (x < 0) flags |= DI_SCREEN_RIGHT; + else flags |= DI_SCREEN_LEFT; + if (y < 0) flags |= DI_SCREEN_BOTTOM; + else flags |= DI_SCREEN_TOP; + } + + x += drawOffset.X; + y += drawOffset.Y; + + if (!fullscreenOffsets) + { + StatusbarToRealCoords(x, y, w, h); + } + else + { + double orgx, orgy; + + switch (flags & DI_SCREEN_HMASK) + { + default: orgx = 0; break; + case DI_SCREEN_HCENTER: orgx = screen->GetWidth() / 2; break; + case DI_SCREEN_RIGHT: orgx = screen->GetWidth(); break; + } + + switch (flags & DI_SCREEN_VMASK) + { + default: orgy = 0; break; + case DI_SCREEN_VCENTER: orgy = screen->GetHeight() / 2; break; + case DI_SCREEN_BOTTOM: orgy = screen->GetHeight(); break; + } + + // move stuff in the top right corner a bit down if the fps counter is on. + if ((flags & (DI_SCREEN_HMASK | DI_SCREEN_VMASK)) == DI_SCREEN_RIGHT_TOP && vid_fps) y += 10; + + DVector2 Scale = GetHUDScale(); + + x *= Scale.X; + y *= Scale.Y; + w *= Scale.X; + h *= Scale.Y; + x += orgx; + y += orgy; + } + int x1 = int(x); + int y1 = int(y); + int ww = int(x + w - x1); // account for scaling to non-integers. Truncating the values separately would fail for cases like + int hh = int(y + h - y1); // y=3.5, height = 5.5 where adding both values gives a larger integer than adding the two integers. + + screen->SetClipRect(x1, y1, ww, hh); +} + + +DEFINE_ACTION_FUNCTION(DBaseStatusBar, SetClipRect) +{ + PARAM_SELF_PROLOGUE(DBaseStatusBar); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + PARAM_FLOAT(w); + PARAM_FLOAT(h); + PARAM_INT_DEF(flags); + self->SetClipRect(x, y, w, h, flags); return 0; } diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 2a1248f90..96d5626c2 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -190,6 +190,24 @@ void DCanvas::SetClipRect(int x, int y, int w, int h) clipwidth = clamp(w, 0, GetHeight() - y); } +DEFINE_ACTION_FUNCTION(_Screen, SetClipRect) +{ + PARAM_PROLOGUE; + PARAM_INT(x); + PARAM_INT(y); + PARAM_INT(w); + PARAM_INT(h); + screen->SetClipRect(x, y, w, h); + return 0; +} + +DEFINE_ACTION_FUNCTION(_Screen, ClearClipRect) +{ + PARAM_PROLOGUE; + screen->ClearClipRect(); + return 0; +} + void DCanvas::GetClipRect(int *x, int *y, int *w, int *h) { if (x) *x = clipleft; @@ -198,6 +216,19 @@ void DCanvas::GetClipRect(int *x, int *y, int *w, int *h) if (h) *h = clipheight; } +DEFINE_ACTION_FUNCTION(_Screen, GetClipRect) +{ + PARAM_PROLOGUE; + int x, y, w, h; + screen->GetClipRect(&x, &y, &w, &h); + if (numret > 0) ret[0].SetInt(x); + if (numret > 1) ret[1].SetInt(x); + if (numret > 2) ret[2].SetInt(x); + if (numret > 3) ret[3].SetInt(x); + return MIN(numret, 4); +} + + bool DCanvas::SetTextureParms(DrawParms *parms, FTexture *img, double xx, double yy) const { if (img != NULL) diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index d92f79b6d..77d6fa26b 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -166,6 +166,10 @@ struct Screen native native static void DrawFrame(int x, int y, int w, int h); native static Vector2, Vector2 VirtualToRealCoords(Vector2 pos, Vector2 size, Vector2 vsize, bool vbottom=false, bool handleaspect=true); native static double GetAspectRatio(); + native static void SetClipRect(int x, int y, int w, int h); + native static void ClearClipRect(); + native static int, int, int, int GetClipRect(); + // This is a leftover of the abandoned Inventory.DrawPowerup method. deprecated("2.5") static ui void DrawHUDTexture(TextureID tex, double x, double y) diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index 238e177bb..0af3442d2 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -327,6 +327,12 @@ class BaseStatusBar native ui native static String FormatNumber(int number, int minsize = 0, int maxsize = 0, int format = 0, String prefix = ""); native double, double, double, double StatusbarToRealCoords(double x, double y=0, double w=0, double h=0); native int GetTopOfStatusBar(); + native void SetClipRect(double x, double y, double w, double h, int flags = 0); + + void ClearClipRect() + { + screen.ClearClipRect(); + } //============================================================================ // @@ -984,13 +990,17 @@ class BaseStatusBar native ui double sizeOfImage = (horizontal ? texsize.X - border*2 : texsize.Y - border*2); Clip[(!horizontal) | ((!reverse)<<1)] = sizeOfImage - sizeOfImage *value; + // preserve the active clipping rectangle + int cx, cy, cw, ch; + [cx, cy, cw, ch] = screen.GetClipRect(); + if(border != 0) { for(int i = 0; i < 4; i++) Clip[i] += border; //Draw the whole foreground DrawTexture(ontex, position, flags | DI_ITEM_LEFT_TOP); - // SetClip + SetClipRect(position.X + Clip[0], position.Y + Clip[1], texsize.X - Clip[0] - Clip[2], texsize.Y - Clip[1] - Clip[3], flags); } if (offtex.IsValid() && TexMan.GetScaledSize(offtex) == texsize) DrawTexture(offtex, position, flags | DI_ITEM_LEFT_TOP); @@ -998,10 +1008,11 @@ class BaseStatusBar native ui if (border == 0) { - // SetClip + SetClipRect(position.X + Clip[0], position.Y + Clip[1], texsize.X - Clip[0] - Clip[2], texsize.Y - Clip[1] - Clip[3], flags); DrawTexture(ontex, position, flags | DI_ITEM_LEFT_TOP); } - // UnsetClip + // restore the previous clipping rectangle + screen.SetClipRect(cx, cy, cw, ch); } //============================================================================ From 91ac6e30fe30b518a9d636bcd4fc5086a7df6958 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 18:51:24 +0200 Subject: [PATCH 3/6] - fixed: The automap tried to access a variable before it was initialized. The fix is not ideal but the way this code is used it cannot be done any better. --- src/am_map.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index 721bd3650..31961831e 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -790,7 +790,6 @@ static double mapystart=0; // y-value for the start of the map bitmap...used in static double mapxstart=0; //x-value for the bitmap. static bool stopped = true; -static int viewbottom; static void AM_calcMinMaxMtoF(); @@ -1063,7 +1062,7 @@ static void AM_findMinMaxBoundaries () static void AM_calcMinMaxMtoF() { double a = SCREENWIDTH / max_w; - double b = viewbottom / max_h; + double b = StatusBar->GetTopOfStatusbar() / max_h; min_scale_mtof = a < b ? a : b; max_scale_mtof = SCREENHEIGHT / (2*PLAYERRADIUS); @@ -1421,7 +1420,7 @@ void AM_NewResolution() else if (scale_mtof > max_scale_mtof) AM_maxOutWindowScale(); f_w = screen->GetWidth(); - f_h = viewbottom; + f_h = StatusBar->GetTopOfStatusbar(); AM_activateNewScale(); } @@ -3169,7 +3168,6 @@ void AM_Drawer (int bottom) bool allmap = (level.flags2 & LEVEL2_ALLMAP) != 0; bool allthings = allmap && players[consoleplayer].mo->FindInventory(NAME_PowerScanner, true) != nullptr; - viewbottom = bottom; if (am_portaloverlay) { sector_t *sec; @@ -3186,7 +3184,7 @@ void AM_Drawer (int bottom) // and view size adjustments. f_x = f_y = 0; f_w = screen->GetWidth (); - f_h = viewbottom; + f_h = bottom; f_p = screen->GetPitch (); AM_clearFB(AMColors[AMColors.Background]); From 228c57fae3de0640bd5e1363b24a20be9224ed40 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 19:00:26 +0200 Subject: [PATCH 4/6] - fixed: Even SBARINFO needs to call the scripted Init method of the status bar because it initializes some data used by the automap HUD. --- src/g_statusbar/sbarinfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/g_statusbar/sbarinfo.cpp b/src/g_statusbar/sbarinfo.cpp index 2c9d962c4..a5fd45d28 100644 --- a/src/g_statusbar/sbarinfo.cpp +++ b/src/g_statusbar/sbarinfo.cpp @@ -57,6 +57,7 @@ #include "gstrings.h" #include "cmdlib.h" #include "g_levellocals.h" +#include "virtual.h" #define ARTIFLASH_OFFSET (statusBar->invBarOffset+6) enum @@ -1545,10 +1546,16 @@ DBaseStatusBar *CreateCustomStatusBar(int scriptno) I_FatalError("Tried to create a status bar with no script!"); auto sbar = (DBaseStatusBar*)PClass::FindClass("SBarInfoWrapper")->CreateNew(); + IFVIRTUALPTR(sbar, DBaseStatusBar, Init) + { + VMValue params[] = { sbar }; + GlobalVMStack.Call(func, params, 1, nullptr, 0); + } auto core = new DSBarInfo(sbar, script); sbar->PointerVar("core") = core; sbar->SetSize(script->height, script->_resW, script->_resH); sbar->CompleteBorder = script->completeBorder; + return sbar; } From 51d89740e3dea0a68fd4e365d6f429a51cc6020c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 20:12:39 +0200 Subject: [PATCH 5/6] - fixed mouse input for scale slider. --- .../static/zscript/menu/optionmenuitems.txt | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/wadsrc/static/zscript/menu/optionmenuitems.txt b/wadsrc/static/zscript/menu/optionmenuitems.txt index dd4385dbb..04d2023a2 100644 --- a/wadsrc/static/zscript/menu/optionmenuitems.txt +++ b/wadsrc/static/zscript/menu/optionmenuitems.txt @@ -1222,6 +1222,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider { String TextZero; String TextNegOne; + int mClickVal; OptionMenuItemScaleSlider Init(String label, Name command, double min, double max, double step, String zero, String negone = "") { @@ -1229,6 +1230,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider mCVar =CVar.FindCVar(command); TextZero = zero; TextNEgOne = negone; + mClickVal = -10; return self; } @@ -1238,7 +1240,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor); int Selection = GetSliderValue(); - if (Selection == 0 || Selection == -1) + if ((Selection == 0 || Selection == -1) && mClickVal <= 0) { String text = Selection == 0? TextZero : Selection == -1? TextNegOne : ""; screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true); @@ -1254,10 +1256,26 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider override bool MouseEvent(int type, int x, int y) { int value = GetSliderValue(); - if (value > 0) return Super.MouseEvent(type, x, y); - if (type == Menu.MOUSE_Release) + switch (type) { - return Menu.GetCurrentMenu().MenuEvent(Menu.MKEY_Enter, true); + case Menu.MOUSE_Click: + mClickVal = value; + if (value <= 0) return false; + return Super.MouseEvent(type, x, y); + + case Menu.MOUSE_Move: + if (mClickVal <= 0) return false; + return Super.MouseEvent(type, x, y); + + case Menu.MOUSE_Release: + if (mClickVal <= 0) + { + mClickVal = -10; + SetSliderValue(value + 1); + return true; + } + mClickVal = -10; + return Super.MouseEvent(type, x, y); } return false; } From 5601364aafec507687bb652eba8dbfcd4ccb7e6b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Mar 2017 21:12:39 +0200 Subject: [PATCH 6/6] - fixed some issues with Set/GetClipRect. --- src/v_draw.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 96d5626c2..5def06068 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -187,7 +187,7 @@ void DCanvas::SetClipRect(int x, int y, int w, int h) clipleft = clamp(x, 0, GetWidth()); clipwidth = clamp(w, 0, GetWidth() - x); cliptop = clamp(y, 0, GetHeight()); - clipwidth = clamp(w, 0, GetHeight() - y); + clipheight = clamp(h, 0, GetHeight() - y); } DEFINE_ACTION_FUNCTION(_Screen, SetClipRect) @@ -222,9 +222,9 @@ DEFINE_ACTION_FUNCTION(_Screen, GetClipRect) int x, y, w, h; screen->GetClipRect(&x, &y, &w, &h); if (numret > 0) ret[0].SetInt(x); - if (numret > 1) ret[1].SetInt(x); - if (numret > 2) ret[2].SetInt(x); - if (numret > 3) ret[3].SetInt(x); + if (numret > 1) ret[1].SetInt(y); + if (numret > 2) ret[2].SetInt(w); + if (numret > 3) ret[3].SetInt(h); return MIN(numret, 4); }