From b38934b532f90fa193c0aedb0c3db35c11d91c9b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Mar 2017 21:54:11 +0200 Subject: [PATCH] - fixed declaration of ACS getters for status bar. - fixed some uninitialized variables in font print code. --- src/v_text.cpp | 10 +++++----- wadsrc/static/zscript/statusbar/statusbar.txt | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/v_text.cpp b/src/v_text.cpp index f068b876c..454964aa3 100644 --- a/src/v_text.cpp +++ b/src/v_text.cpp @@ -80,7 +80,7 @@ void DCanvas::DrawChar (FFont *font, int normalcolor, double x, double y, int ch { return; } - PalEntry color; + PalEntry color = 0xffffffff; parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color); parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255); DrawTextureParms(pic, parms); @@ -104,7 +104,7 @@ void DCanvas::DrawChar(FFont *font, int normalcolor, double x, double y, int cha uint32_t tag = ListGetInt(args); bool res = ParseDrawTextureTags(pic, x, y, tag, args, &parms, false); if (!res) return; - PalEntry color; + PalEntry color = 0xffffffff; parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color); parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255); DrawTextureParms(pic, parms); @@ -156,9 +156,9 @@ void DCanvas::DrawTextCommon(FFont *font, int normalcolor, double x, double y, c boldcolor = normalcolor ? normalcolor - 1 : NumTextColors - 1; PalEntry colorparm = parms.color; - PalEntry color; + PalEntry color = 0xffffffff; range = font->GetColorTranslation((EColorRange)normalcolor, &color); - parms.color = PalEntry((color.a * colorparm.a) / 255, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255); + parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255); kerning = font->GetDefaultKerning(); @@ -179,7 +179,7 @@ void DCanvas::DrawTextCommon(FFont *font, int normalcolor, double x, double y, c if (newcolor != CR_UNDEFINED) { range = font->GetColorTranslation(newcolor, &color); - parms.color = PalEntry((color.a * colorparm.a) / 255, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255); + parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255); } continue; } diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index dc916cad4..8a7476f8f 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -426,10 +426,10 @@ class BaseStatusBar native ui } // These cannot be done in ZScript. - native String GetGlobalACSString(int index); - native String GetGlobalACSArrayString(int arrayno, int index); - native int GetGlobalACSValue(int index); - native int GetGlobalACSArrayValue(int arrayno, int index); + native static String GetGlobalACSString(int index); + native static String GetGlobalACSArrayString(int arrayno, int index); + native static int GetGlobalACSValue(int index); + native static int GetGlobalACSArrayValue(int arrayno, int index); //============================================================================ //