diff --git a/source/common/2d/v_2ddrawer.cpp b/source/common/2d/v_2ddrawer.cpp index 46d02a2af..2d1387f02 100644 --- a/source/common/2d/v_2ddrawer.cpp +++ b/source/common/2d/v_2ddrawer.cpp @@ -787,7 +787,7 @@ void F2DDrawer::AddPoly(FGameTexture* img, FVector4* vt, size_t vtcount, const u mIndices.Reserve(vtcount); for (size_t i = 0; i < vtcount; i++) { - mIndices[dg.mIndexIndex + i] = i + dg.mVertIndex; + mIndices[dg.mIndexIndex + i] = int(i + dg.mVertIndex); } dg.mIndexCount = (int)vtcount; diff --git a/source/common/2d/v_draw.cpp b/source/common/2d/v_draw.cpp index e662baed4..9c53e754b 100644 --- a/source/common/2d/v_draw.cpp +++ b/source/common/2d/v_draw.cpp @@ -50,7 +50,7 @@ CVAR(Bool, ui_screenborder_classic_scaling, true, CVAR_ARCHIVE) // nonsense that graphics should not be able to actually use that extra screen space. extern bool setsizeneeded; -CUSTOM_CVAR(Bool, vid_allowtrueultrawide, true, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_NOINITCALL) +CUSTOM_CVAR(Int, vid_allowtrueultrawide, 1, CVAR_ARCHIVE|CVAR_NOINITCALL) { setsizeneeded = true; } @@ -335,7 +335,7 @@ DEFINE_ACTION_FUNCTION(_Screen, SetScreenFade) { PARAM_PROLOGUE; PARAM_FLOAT(x); - twod->SetScreenFade(x); + twod->SetScreenFade(float(x)); return 0; } @@ -1279,11 +1279,20 @@ static void VirtualToRealCoords(F2DDrawer *drawer, double Width, double Height, { float myratio = float(handleaspect ? ActiveRatio (Width, Height) : (4.0 / 3.0)); - // if 21:9 AR, map to 16:9 for all callers. - // this allows for black bars and stops the stretching of fullscreen images - if ((myratio > 1.7f) && !vid_allowtrueultrawide) { - myratio = 16.0f / 9.0f; - } + // if 21:9 AR, map to 16:9 for all callers. + // this allows for black bars and stops the stretching of fullscreen images + + switch (vid_allowtrueultrawide) + { + case 1: + default: + myratio = MIN(64.0f / 27.0f, myratio); + break; + case 0: + myratio = MIN(16.0f / 9.0f, myratio); + case -1: + break; + } double right = x + w; double bottom = y + h; diff --git a/source/common/platform/posix/sdl/sdlglvideo.cpp b/source/common/platform/posix/sdl/sdlglvideo.cpp index 4a419b10d..9487854f9 100644 --- a/source/common/platform/posix/sdl/sdlglvideo.cpp +++ b/source/common/platform/posix/sdl/sdlglvideo.cpp @@ -61,12 +61,9 @@ // MACROS ------------------------------------------------------------------ -// Requires SDL 2.0.6 or newer -//#define SDL2_STATIC_LIBRARY - -#if defined SDL2_STATIC_LIBRARY && defined HAVE_VULKAN +#if defined HAVE_VULKAN #include -#endif // SDL2_STATIC_LIBRARY && HAVE_VULKAN +#endif // HAVE_VULKAN // TYPES ------------------------------------------------------------------- @@ -118,30 +115,7 @@ CCMD(vid_list_sdl_render_drivers) namespace Priv { -#ifdef SDL2_STATIC_LIBRARY - -#define SDL2_OPTIONAL_FUNCTION(RESULT, NAME, ...) \ - RESULT(*NAME)(__VA_ARGS__) = SDL_ ## NAME - -#else // !SDL2_STATIC_LIBRARY - - FModule library("SDL2"); - -#define SDL2_OPTIONAL_FUNCTION(RESULT, NAME, ...) \ - static TOptProc NAME("SDL_" #NAME) - -#endif // SDL2_STATIC_LIBRARY - - SDL2_OPTIONAL_FUNCTION(int, GetWindowBordersSize, SDL_Window *window, int *top, int *left, int *bottom, int *right); -#ifdef HAVE_VULKAN - SDL2_OPTIONAL_FUNCTION(void, Vulkan_GetDrawableSize, SDL_Window *window, int *width, int *height); - SDL2_OPTIONAL_FUNCTION(SDL_bool, Vulkan_GetInstanceExtensions, SDL_Window *window, unsigned int *count, const char **names); - SDL2_OPTIONAL_FUNCTION(SDL_bool, Vulkan_CreateSurface, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); -#endif - -#undef SDL2_OPTIONAL_FUNCTION - - static const uint32_t VulkanWindowFlag = 0x1000'0000; + static const uint32_t VulkanWindowFlag = SDL_WINDOW_VULKAN; SDL_Window *window; bool vulkanEnabled; @@ -240,22 +214,21 @@ void I_GetVulkanDrawableSize(int *width, int *height) { assert(Priv::vulkanEnabled); assert(Priv::window != nullptr); - assert(Priv::Vulkan_GetDrawableSize); - Priv::Vulkan_GetDrawableSize(Priv::window, width, height); + SDL_Vulkan_GetDrawableSize(Priv::window, width, height); } bool I_GetVulkanPlatformExtensions(unsigned int *count, const char **names) { assert(Priv::vulkanEnabled); assert(Priv::window != nullptr); - return Priv::Vulkan_GetInstanceExtensions(Priv::window, count, names) == SDL_TRUE; + return SDL_Vulkan_GetInstanceExtensions(Priv::window, count, names) == SDL_TRUE; } bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface) { assert(Priv::vulkanEnabled); assert(Priv::window != nullptr); - return Priv::Vulkan_CreateSurface(Priv::window, instance, surface) == SDL_TRUE; + return SDL_Vulkan_CreateSurface(Priv::window, instance, surface) == SDL_TRUE; } #endif @@ -419,20 +392,19 @@ SDLVideo::SDLVideo () return; } -#ifndef SDL2_STATIC_LIBRARY - // Load optional SDL functions - if (!Priv::library.IsLoaded()) + // Fail gracefully if we somehow reach here after linking against a SDL2 library older than 2.0.6. + SDL_version sdlver; + SDL_GetVersion(&sdlver); + if (!(sdlver.patch >= 6)) { - Priv::library.Load({ "libSDL2-2.0.so.0", "libSDL2-2.0.so", "libSDL2.so" }); + I_FatalError("Only SDL 2.0.6 or later is supported."); } -#endif // !SDL2_STATIC_LIBRARY #ifdef HAVE_SOFTPOLY Priv::softpolyEnabled = vid_preferbackend == 2; #endif #ifdef HAVE_VULKAN - Priv::vulkanEnabled = vid_preferbackend == 1 - && Priv::Vulkan_GetDrawableSize && Priv::Vulkan_GetInstanceExtensions && Priv::Vulkan_CreateSurface; + Priv::vulkanEnabled = vid_preferbackend == 1; if (Priv::vulkanEnabled) { @@ -539,7 +511,7 @@ int SystemBaseFrameBuffer::GetClientWidth() #ifdef HAVE_VULKAN assert(Priv::vulkanEnabled); - Priv::Vulkan_GetDrawableSize(Priv::window, &width, nullptr); + SDL_Vulkan_GetDrawableSize(Priv::window, &width, nullptr); #endif return width; @@ -562,7 +534,7 @@ int SystemBaseFrameBuffer::GetClientHeight() #ifdef HAVE_VULKAN assert(Priv::vulkanEnabled); - Priv::Vulkan_GetDrawableSize(Priv::window, nullptr, &height); + SDL_Vulkan_GetDrawableSize(Priv::window, nullptr, &height); #endif return height; @@ -745,10 +717,10 @@ void ProcessSDLWindowEvent(const SDL_WindowEvent &event) break; case SDL_WINDOWEVENT_MOVED: - if (!vid_fullscreen && Priv::GetWindowBordersSize) + if (!vid_fullscreen) { int top = 0, left = 0; - Priv::GetWindowBordersSize(Priv::window, &top, &left, nullptr, nullptr); + SDL_GetWindowBordersSize(Priv::window, &top, &left, nullptr, nullptr); win_x = event.data1-left; win_y = event.data2-top; } diff --git a/source/common/scripting/interface/vmnatives.cpp b/source/common/scripting/interface/vmnatives.cpp index 5eebabbab..23705b93a 100644 --- a/source/common/scripting/interface/vmnatives.cpp +++ b/source/common/scripting/interface/vmnatives.cpp @@ -81,10 +81,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, StatusbarToRealCoords, StatusbarTo return MIN(4, numret); } -void SBar_DrawTexture(DStatusBarCore* self, int texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY) +void SBar_DrawTexture(DStatusBarCore* self, int texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY, int style) { if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - self->DrawGraphic(FSetTextureID(texid), x, y, flags, alpha, w, h, scaleX, scaleY); + self->DrawGraphic(FSetTextureID(texid), x, y, flags, alpha, w, h, scaleX, scaleY, ERenderStyle(style)); } DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawTexture, SBar_DrawTexture) @@ -99,14 +99,15 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawTexture, SBar_DrawTexture) PARAM_FLOAT(h); PARAM_FLOAT(scaleX); PARAM_FLOAT(scaleY); - SBar_DrawTexture(self, texid, x, y, flags, alpha, w, h, scaleX, scaleY); + PARAM_INT(style); + SBar_DrawTexture(self, texid, x, y, flags, alpha, w, h, scaleX, scaleY, style); return 0; } -void SBar_DrawImage(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY) +void SBar_DrawImage(DStatusBarCore* self, const FString& texid, double x, double y, int flags, double alpha, double w, double h, double scaleX, double scaleY, int style) { if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); - self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY); + self->DrawGraphic(TexMan.CheckForTexture(texid, ETextureType::Any), x, y, flags, alpha, w, h, scaleX, scaleY, ERenderStyle(style)); } DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImage, SBar_DrawImage) @@ -121,11 +122,12 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawImage, SBar_DrawImage) PARAM_FLOAT(h); PARAM_FLOAT(scaleX); PARAM_FLOAT(scaleY); - SBar_DrawImage(self, texid, x, y, flags, alpha, w, h, scaleX, scaleY); + PARAM_INT(style); + SBar_DrawImage(self, texid, x, y, flags, alpha, w, h, scaleX, scaleY, style); return 0; } -void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int translation); +void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int translation, int style); DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawString, SBar_DrawString) { @@ -142,7 +144,8 @@ DEFINE_ACTION_FUNCTION_NATIVE(DStatusBarCore, DrawString, SBar_DrawString) PARAM_FLOAT(scaleX); PARAM_FLOAT(scaleY); PARAM_INT(pt); - SBar_DrawString(self, font, string, x, y, flags, trans, alpha, wrapwidth, linespacing, scaleX, scaleY, pt); + PARAM_INT(style); + SBar_DrawString(self, font, string, x, y, flags, trans, alpha, wrapwidth, linespacing, scaleX, scaleY, pt, style); return 0; } diff --git a/source/common/statusbar/base_sbar.cpp b/source/common/statusbar/base_sbar.cpp index ae1a375c3..948b2504b 100644 --- a/source/common/statusbar/base_sbar.cpp +++ b/source/common/statusbar/base_sbar.cpp @@ -452,16 +452,16 @@ void DStatusBarCore::StatusbarToRealCoords(double& x, double& y, double& w, doub // //============================================================================ -void DStatusBarCore::DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, PalEntry color, int translation, ERenderStyle style, double clipwidth) +void DStatusBarCore::DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, ERenderStyle style, PalEntry color, int translation, double clipwidth) { if (!texture.isValid()) return; FGameTexture* tex = TexMan.GetGameTexture(texture, !(flags & DI_DONTANIMATE)); - DrawGraphic(tex, x, y, flags, Alpha, boxwidth, boxheight, scaleX, scaleY, color, translation, style); + DrawGraphic(tex, x, y, flags, Alpha, boxwidth, boxheight, scaleX, scaleY, style, color, translation); } -void DStatusBarCore::DrawGraphic(FGameTexture* tex, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, PalEntry color, int translation, ERenderStyle style, double clipwidth) +void DStatusBarCore::DrawGraphic(FGameTexture* tex, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, ERenderStyle style, PalEntry color, int translation, double clipwidth) { double texwidth = tex->GetDisplayWidth() * scaleX; double texheight = tex->GetDisplayHeight() * scaleY; @@ -695,7 +695,7 @@ void DStatusBarCore::DrawRotated(FGameTexture* tex, double x, double y, int flag // //============================================================================ -void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, double y, int flags, double Alpha, int translation, int spacing, EMonospacing monospacing, int shadowX, int shadowY, double scaleX, double scaleY, int pt) +void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, double y, int flags, double Alpha, int translation, int spacing, EMonospacing monospacing, int shadowX, int shadowY, double scaleX, double scaleY, int pt, int style) { bool monospaced = monospacing != EMonospacing::Off; double dx = 0; @@ -822,6 +822,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d DTA_DestHeightF, rh, DTA_Alpha, Alpha, DTA_TranslationIndex, pt, + DTA_LegacyRenderStyle, ERenderStyle(style), TAG_DONE); dx = monospaced @@ -833,7 +834,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d } } -void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int pt) +void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int pt, int style) { if (font == nullptr) ThrowAbortException(X_READ_NIL, nullptr); if (!twod->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); @@ -852,13 +853,13 @@ void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string auto brk = V_BreakLines(font->mFont, int(wrapwidth * scaleX), string, true); for (auto& line : brk) { - self->DrawString(font->mFont, line.Text, x, y, flags, alpha, trans, font->mSpacing, font->mMonospacing, font->mShadowX, font->mShadowY, scaleX, scaleY, pt); + self->DrawString(font->mFont, line.Text, x, y, flags, alpha, trans, font->mSpacing, font->mMonospacing, font->mShadowX, font->mShadowY, scaleX, scaleY, pt, style); y += (font->mFont->GetHeight() + linespacing) * scaleY; } } else { - self->DrawString(font->mFont, string, x, y, flags, alpha, trans, font->mSpacing, font->mMonospacing, font->mShadowX, font->mShadowY, scaleX, scaleY, pt); + self->DrawString(font->mFont, string, x, y, flags, alpha, trans, font->mSpacing, font->mMonospacing, font->mShadowX, font->mShadowY, scaleX, scaleY, pt, style); } } diff --git a/source/common/statusbar/base_sbar.h b/source/common/statusbar/base_sbar.h index 7f892b4e4..9b1204412 100644 --- a/source/common/statusbar/base_sbar.h +++ b/source/common/statusbar/base_sbar.h @@ -184,11 +184,11 @@ public: virtual void SetScale(); void ValidateResolution(int& hres, int& vres) const; void StatusbarToRealCoords(double& x, double& y, double& w, double& h) const; - void DrawGraphic(FGameTexture* texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, PalEntry color = 0xffffffff, int translation = 0, ERenderStyle style = STYLE_Translucent, double clipwidth = -1.0); - void DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, PalEntry color = 0xffffffff, int translation = 0, ERenderStyle style = STYLE_Translucent, double clipwidth = -1.0); + void DrawGraphic(FGameTexture* texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, ERenderStyle style = STYLE_Translucent, PalEntry color = 0xffffffff, int translation = 0, double clipwidth = -1.0); + void DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY, ERenderStyle style = STYLE_Translucent, PalEntry color = 0xffffffff, int translation = 0, double clipwidth = -1.0); void DrawRotated(FTextureID texture, double x, double y, int flags, double angle, double Alpha, double scaleX, double scaleY, PalEntry color = 0xffffffff, int translation = 0, ERenderStyle style = STYLE_Translucent); void DrawRotated(FGameTexture* tex, double x, double y, int flags, double angle, double Alpha, double scaleX, double scaleY, PalEntry color = 0xffffffff, int translation = 0, ERenderStyle style = STYLE_Translucent); - void DrawString(FFont* font, const FString& cstring, double x, double y, int flags, double Alpha, int translation, int spacing, EMonospacing monospacing, int shadowX, int shadowY, double scaleX, double scaleY, int pt); + void DrawString(FFont* font, const FString& cstring, double x, double y, int flags, double Alpha, int translation, int spacing, EMonospacing monospacing, int shadowX, int shadowY, double scaleX, double scaleY, int pt, int style); void TransformRect(double& x, double& y, double& w, double& h, int flags = 0); 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); diff --git a/source/core/statusbar.h b/source/core/statusbar.h index 3edeb862e..086b4c383 100644 --- a/source/core/statusbar.h +++ b/source/core/statusbar.h @@ -136,7 +136,7 @@ void ST_Clear(); extern FGameTexture *CrosshairImage; -void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int pt = 0); +void SBar_DrawString(DStatusBarCore* self, DHUDFont* font, const FString& string, double x, double y, int flags, int trans, double alpha, int wrapwidth, int linespacing, double scaleX, double scaleY, int pt = 0, int style = STYLE_Translucent); void setViewport(int viewSize); struct MapRecord; void setLevelStarted(MapRecord *); diff --git a/source/games/blood/src/sbar.cpp b/source/games/blood/src/sbar.cpp index 8ec54765b..e7967861c 100644 --- a/source/games/blood/src/sbar.cpp +++ b/source/games/blood/src/sbar.cpp @@ -130,7 +130,7 @@ private: int flags = align | ((nStat & RS_CENTERBOTTOM)? DI_ITEM_CENTER_BOTTOM : (nStat & RS_TOPLEFT)? DI_ITEM_LEFT_TOP : DI_ITEM_RELCENTER); double alpha = 1.; double scale = nScale / 65536.; - DrawGraphic(tileGetTexture(nTile, true), x, y, flags, alpha, -1, -1, scale, scale, shadeToLight(nShade), TRANSLATION(Translation_Remap, nPalette), style); + DrawGraphic(tileGetTexture(nTile, true), x, y, flags, alpha, -1, -1, scale, scale, STYLE_Translucent, shadeToLight(nShade), TRANSLATION(Translation_Remap, nPalette), style); } void DrawStatMaskedSprite(int nTile, double x, double y, int nShade = 0, int nPalette = 0, unsigned int nStat = 0, int nScale = 65536, int align = DI_SCREEN_AUTO) { @@ -197,7 +197,7 @@ private: int bx = scale(MulScale(w, nScale, 16), nMult, nDiv) + x; double scale = double(bx - x) / w; double sc = nScale / 65536.; - DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, sc, sc, 0xffffffff, 0, STYLE_Translucent, scale); + DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, sc, sc, STYLE_Translucent, 0xffffffff, 0, scale); } diff --git a/source/games/duke/src/sbar_d.cpp b/source/games/duke/src/sbar_d.cpp index ff1d620a7..e55fdea14 100644 --- a/source/games/duke/src/sbar_d.cpp +++ b/source/games/duke/src/sbar_d.cpp @@ -243,9 +243,9 @@ public: // // keys // - if (p->got_access & 1) DrawGraphic(tileGetTexture(ACCESSCARD), -12, -23.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, 0xffffffff, TRANSLATION(Translation_Remap, 0)); - if (p->got_access & 4) DrawGraphic(tileGetTexture(ACCESSCARD), -7 , -21.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, 0xffffffff, TRANSLATION(Translation_Remap, 23)); - if (p->got_access & 2) DrawGraphic(tileGetTexture(ACCESSCARD), -2 , -19.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, 0xffffffff, TRANSLATION(Translation_Remap, 21)); + if (p->got_access & 1) DrawGraphic(tileGetTexture(ACCESSCARD), -12, -23.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 0)); + if (p->got_access & 4) DrawGraphic(tileGetTexture(ACCESSCARD), -7 , -21.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 23)); + if (p->got_access & 2) DrawGraphic(tileGetTexture(ACCESSCARD), -2 , -19.5, DI_ITEM_RIGHT, 1, -1, -1, 0.5, 0.5, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 21)); } @@ -355,15 +355,15 @@ public: format.Format("%3d/%d", num1, num2); } y--; - DrawGraphic(tileGetTexture(THREEBYFIVE + index), x - 7, y, DI_ITEM_LEFT|DI_ITEM_VCENTER, 1, 0, 0, 1, 1, LightForShade(shade - 10), TRANSLATION(Translation_Remap, 7)); + DrawGraphic(tileGetTexture(THREEBYFIVE + index), x - 7, y, DI_ITEM_LEFT|DI_ITEM_VCENTER, 1, 0, 0, 1, 1, STYLE_Translucent, LightForShade(shade - 10), TRANSLATION(Translation_Remap, 7)); auto pe = LightForShade(shade); - DrawGraphic(tileGetTexture(THREEBYFIVE + 10), x - 3, y, DI_ITEM_LEFT | DI_ITEM_VCENTER, 1, 0, 0, 1, 1, pe); + DrawGraphic(tileGetTexture(THREEBYFIVE + 10), x - 3, y, DI_ITEM_LEFT | DI_ITEM_VCENTER, 1, 0, 0, 1, 1, STYLE_Translucent, pe); for (size_t i = 0; i < format.Len(); i++) { if (format[i] != ' ') { char c = format[i] == '/' ? 11 : format[i] - '0'; - DrawGraphic(tileGetTexture(THREEBYFIVE + c), x + 4 * i + (parsedDivisor ? 1 : 0), y, DI_ITEM_LEFT | DI_ITEM_VCENTER, 1, 0, 0, 1, 1, pe); + DrawGraphic(tileGetTexture(THREEBYFIVE + c), x + 4 * i + (parsedDivisor ? 1 : 0), y, DI_ITEM_LEFT | DI_ITEM_VCENTER, 1, 0, 0, 1, 1, STYLE_Translucent, pe); } if (format[i] == '/') { @@ -431,9 +431,9 @@ public: else { auto key = tileGetTexture(ACCESS_ICON); - if (p->got_access & 4) DrawGraphic(key, 275.5, top + 16, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, 0xffffffff, TRANSLATION(Translation_Remap, 23)); - if (p->got_access & 2) DrawGraphic(key, 288.5, top + 16, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, 0xffffffff, TRANSLATION(Translation_Remap, 21)); - if (p->got_access & 1) DrawGraphic(key, 282, top + 23, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, 0xffffffff, TRANSLATION(Translation_Remap, 0)); + if (p->got_access & 4) DrawGraphic(key, 275.5, top + 16, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 23)); + if (p->got_access & 2) DrawGraphic(key, 288.5, top + 16, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 21)); + if (p->got_access & 1) DrawGraphic(key, 282, top + 23, DI_ITEM_OFFSETS, 1, -1, -1, 1, 1, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 0)); } DrawWeaponAmounts(p, 96, top + 15.5); diff --git a/source/games/duke/src/sbar_r.cpp b/source/games/duke/src/sbar_r.cpp index f2d8374b0..5de101c20 100644 --- a/source/games/duke/src/sbar_r.cpp +++ b/source/games/duke/src/sbar_r.cpp @@ -212,9 +212,9 @@ public: // // keys // - if (p->keys[1]) DrawGraphic(tileGetTexture(ACCESSCARD), -28.5, -32 , DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 0)); - if (p->keys[3]) DrawGraphic(tileGetTexture(ACCESSCARD), -21.25, -28.375, DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 23)); - if (p->keys[2]) DrawGraphic(tileGetTexture(ACCESSCARD), -14, -24.75 , DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 21)); + if (p->keys[1]) DrawGraphic(tileGetTexture(ACCESSCARD), -28.5, -32 , DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 0)); + if (p->keys[3]) DrawGraphic(tileGetTexture(ACCESSCARD), -21.25, -28.375, DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 23)); + if (p->keys[2]) DrawGraphic(tileGetTexture(ACCESSCARD), -14, -24.75 , DI_ITEM_BOTTOM, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 21)); } @@ -374,9 +374,9 @@ public: else { auto key = tileGetTexture(ACCESS_ICON); - if (p->keys[3]) DrawGraphic(key, 138, top + 13, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 23)); - if (p->keys[2]) DrawGraphic(key, 152, top + 13, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 21)); - if (p->keys[1]) DrawGraphic(key, 145, top + 21, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, 0xffffffff, TRANSLATION(Translation_Remap, 0)); + if (p->keys[3]) DrawGraphic(key, 138, top + 13, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 23)); + if (p->keys[2]) DrawGraphic(key, 152, top + 13, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 21)); + if (p->keys[1]) DrawGraphic(key, 145, top + 21, DI_ITEM_OFFSETS, 1, -1, -1, scale, scale, STYLE_Translucent, 0xffffffff, TRANSLATION(Translation_Remap, 0)); } int num = (p->GetActor()->s->pal == 1 && p->last_extra < 2) ? 1 : p->last_extra; diff --git a/source/games/sw/src/sbar.cpp b/source/games/sw/src/sbar.cpp index 4da1d6bd0..325c5f6b9 100644 --- a/source/games/sw/src/sbar.cpp +++ b/source/games/sw/src/sbar.cpp @@ -216,7 +216,7 @@ private: } font_pic = font_base[color] + (ch - '0'); - DrawGraphic(tileGetTexture(font_pic), x, ys, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1, shadeToLight(shade)); + DrawGraphic(tileGetTexture(font_pic), x, ys, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1, STYLE_Translucent, shadeToLight(shade)); x += tileWidth(font_pic) + 1; } } @@ -651,7 +651,7 @@ private: for (i = 0, x = COMPASS_X; i < 10; i++) { - DrawGraphic(tileGetTexture(CompassPic[NORM_CANG(start_ang + i)]), x, COMPASS_Y, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1, shadeToLight(CompassShade[i])); + DrawGraphic(tileGetTexture(CompassPic[NORM_CANG(start_ang + i)]), x, COMPASS_Y, DI_ITEM_LEFT_TOP, 1, -1, -1, 1, 1, STYLE_Translucent, shadeToLight(CompassShade[i])); x += x_size; } } diff --git a/wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs b/wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs index bde6114d1..7ece14176 100644 --- a/wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs +++ b/wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs @@ -722,7 +722,7 @@ class OptionMenuSliderBase : OptionMenuItem { } - bool IsGrayed(void) + virtual bool IsGrayed(void) { return mGrayCheck != NULL && !mGrayCheck.GetInt(); } diff --git a/wadsrc/static/zscript/engine/ui/statusbar/statusbarcore.zs b/wadsrc/static/zscript/engine/ui/statusbar/statusbarcore.zs index b405bf95c..2300f33c5 100644 --- a/wadsrc/static/zscript/engine/ui/statusbar/statusbarcore.zs +++ b/wadsrc/static/zscript/engine/ui/statusbar/statusbarcore.zs @@ -105,9 +105,9 @@ class StatusBarCore 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 void DrawTexture(TextureID texture, Vector2 pos, int flags = 0, double Alpha = 1., Vector2 box = (-1, -1), Vector2 scale = (1, 1)); - native void DrawImage(String texture, Vector2 pos, int flags = 0, double Alpha = 1., Vector2 box = (-1, -1), Vector2 scale = (1, 1)); - native void DrawString(HUDFont font, String string, Vector2 pos, int flags = 0, int translation = Font.CR_UNTRANSLATED, double Alpha = 1., int wrapwidth = -1, int linespacing = 4, Vector2 scale = (1, 1), int pt = 0); + native void DrawTexture(TextureID texture, Vector2 pos, int flags = 0, double Alpha = 1., Vector2 box = (-1, -1), Vector2 scale = (1, 1), ERenderStyle style = STYLE_Translucent); + native void DrawImage(String texture, Vector2 pos, int flags = 0, double Alpha = 1., Vector2 box = (-1, -1), Vector2 scale = (1, 1), ERenderStyle style = STYLE_Translucent); + native void DrawString(HUDFont font, String string, Vector2 pos, int flags = 0, int translation = Font.CR_UNTRANSLATED, double Alpha = 1., int wrapwidth = -1, int linespacing = 4, Vector2 scale = (1, 1), int pt = 0, ERenderStyle style = STYLE_Translucent); native double, double, double, double TransformRect(double x, double y, double w, double h, int flags = 0); native void Fill(Color col, double x, double y, double w, double h, int flags = 0); native void SetClipRect(double x, double y, double w, double h, int flags = 0);