From c3f9b4a5eeb7b04b10a204735f9d08da5c138181 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 27 Apr 2017 10:23:31 +0200 Subject: [PATCH] - silenced a few float truncation warnings that get printed in developer mode. --- wadsrc/static/zscript/menu/optionmenuitems.txt | 4 ++-- wadsrc/static/zscript/statscreen/statscreen.txt | 2 +- wadsrc/static/zscript/statscreen/statscreen_coop.txt | 2 +- wadsrc/static/zscript/statscreen/statscreen_dm.txt | 2 +- wadsrc/static/zscript/statusbar/statusbar.txt | 4 ++-- wadsrc/static/zscript/statusbar/strife_sbar.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wadsrc/static/zscript/menu/optionmenuitems.txt b/wadsrc/static/zscript/menu/optionmenuitems.txt index 4ec0fcc6a..a778dc682 100644 --- a/wadsrc/static/zscript/menu/optionmenuitems.txt +++ b/wadsrc/static/zscript/menu/optionmenuitems.txt @@ -1244,7 +1244,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider { drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor); - int Selection = GetSliderValue(); + int Selection = int(GetSliderValue()); if ((Selection == 0 || Selection == -1) && mClickVal <= 0) { String text = Selection == 0? TextZero : Selection == -1? TextNegOne : ""; @@ -1260,7 +1260,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider override bool MouseEvent(int type, int x, int y) { - int value = GetSliderValue(); + int value = int(GetSliderValue()); switch (type) { case Menu.MOUSE_Click: diff --git a/wadsrc/static/zscript/statscreen/statscreen.txt b/wadsrc/static/zscript/statscreen/statscreen.txt index 92d6abb7d..de6e3d28c 100644 --- a/wadsrc/static/zscript/statscreen/statscreen.txt +++ b/wadsrc/static/zscript/statscreen/statscreen.txt @@ -192,7 +192,7 @@ class StatusScreen abstract play version("2.5") { let size = TexMan.GetScaledSize(pinfo.mPatch); screen.DrawTexture(pinfo.mPatch, true, midx - size.X * CleanXfac/2, y, DTA_CleanNoMove, true); - return y + (size.Y * CleanYfac); + return y + int(size.Y * CleanYfac); } else { diff --git a/wadsrc/static/zscript/statscreen/statscreen_coop.txt b/wadsrc/static/zscript/statscreen/statscreen_coop.txt index a38d924a2..7393877b6 100644 --- a/wadsrc/static/zscript/statscreen/statscreen_coop.txt +++ b/wadsrc/static/zscript/statscreen/statscreen_coop.txt @@ -221,7 +221,7 @@ class CoopStatusScreen : StatusScreen // Use the readyico height if it's bigger. Vector2 readysize = TexMan.GetScaledSize(readyico); Vector2 readyoffset = TexMan.GetScaledOffset(readyico); - height = readysize.Y - readyoffset.Y; + height = int(readysize.Y - readyoffset.Y); maxiconheight = MAX(height, maxiconheight); height = SmallFont.GetHeight() * CleanYfac; lineheight = MAX(height, maxiconheight * CleanYfac); diff --git a/wadsrc/static/zscript/statscreen/statscreen_dm.txt b/wadsrc/static/zscript/statscreen/statscreen_dm.txt index a8c7119ee..8807fb19c 100644 --- a/wadsrc/static/zscript/statscreen/statscreen_dm.txt +++ b/wadsrc/static/zscript/statscreen/statscreen_dm.txt @@ -158,7 +158,7 @@ class DeathmatchStatusScreen : StatusScreen // Use the readyico height if it's bigger. Vector2 readysize = TexMan.GetScaledSize(readyico); Vector2 readyoffset = TexMan.GetScaledOffset(readyico); - height = readysize.Y - readyoffset.Y; + height = int(readysize.Y - readyoffset.Y); maxiconheight = MAX(height, maxiconheight); height = SmallFont.GetHeight() * CleanYfac; lineheight = MAX(height, maxiconheight * CleanYfac); diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index c5fd4a9ca..b1aa96f31 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -774,9 +774,9 @@ class BaseStatusBar native ui } String mapname = level.FormatMapName(crdefault); - BrokenLines lines = SmallFont.BreakLines(mapname, SCREENWIDTH / scale.X); + BrokenLines lines = SmallFont.BreakLines(mapname, int(SCREENWIDTH / scale.X)); int numlines = lines.Count(); - int finalwidth = SmallFont.StringWidth(lines.StringAt(numlines-1)) * scale.X; + int finalwidth = int(SmallFont.StringWidth(lines.StringAt(numlines-1)) * scale.X); // calculate the top of the statusbar including any protrusion and transform it from status bar to screen space. double tmp, hres; diff --git a/wadsrc/static/zscript/statusbar/strife_sbar.txt b/wadsrc/static/zscript/statusbar/strife_sbar.txt index 8a7717e99..866c4a32a 100644 --- a/wadsrc/static/zscript/statusbar/strife_sbar.txt +++ b/wadsrc/static/zscript/statusbar/strife_sbar.txt @@ -266,7 +266,7 @@ class StrifeStatusBar : BaseStatusBar { double tmp, h; [tmp, tmp, h] = StatusbarToRealCoords(0, 0, 8); - DrawPopScreen (GetTopOfStatusBar() - h, TicFrac); + DrawPopScreen (int(GetTopOfStatusBar() - h), TicFrac); } DrawImage("INVBACK", (0, 168), DI_ITEM_OFFSETS);