From a89f782a28fac492b02911537f79cd08b15a2d60 Mon Sep 17 00:00:00 2001 From: skyjake Date: Wed, 24 Jul 2013 10:25:30 +0300 Subject: [PATCH] libcommon|Automap: Further map title position improvements Respect 'hud-face' in Doom, and hide the automap title if the inventory is open in fullscreen in Heretic/Hexen. --- doomsday/plugins/common/src/hu_stuff.cpp | 34 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/doomsday/plugins/common/src/hu_stuff.cpp b/doomsday/plugins/common/src/hu_stuff.cpp index 73653d3496..534f3a4c53 100644 --- a/doomsday/plugins/common/src/hu_stuff.cpp +++ b/doomsday/plugins/common/src/hu_stuff.cpp @@ -35,6 +35,7 @@ #include "hu_menu.h" #include "hu_msg.h" #include "hu_stuff.h" +#include "hu_inventory.h" #include "g_common.h" #include "p_mapsetup.h" #include "p_tick.h" @@ -1570,6 +1571,23 @@ boolean Hu_IsMapTitleVisible(void) return (actualMapTime < 6 * 35) || ST_AutomapIsActive(DISPLAYPLAYER); } +static bool needToRespectStatusBarHeightWhenAutomapOpen(void) +{ +#ifndef __JDOOM64__ + return Hu_IsStatusBarVisible(DISPLAYPLAYER); +#endif + + return false; +} + +static bool needToRespectHudSizeWhenAutomapOpen(void) +{ +#ifdef __JDOOM__ + if(cfg.hudShown[HUD_FACE] && !Hu_IsStatusBarVisible(DISPLAYPLAYER)) return true; +#endif + return false; +} + void Hu_MapTitleDrawer(const RectRaw* portGeometry) { if(!cfg.mapTitle || !portGeometry) return; @@ -1591,14 +1609,24 @@ void Hu_MapTitleDrawer(const RectRaw* portGeometry) { float y = SCREENHEIGHT - 1.2f * Hu_MapTitleHeight(); -#ifndef __JDOOM64__ - if(Hu_IsStatusBarVisible(DISPLAYPLAYER)) +#if __JHERETIC__ || __JHEXEN__ + if(Hu_InventoryIsOpen(DISPLAYPLAYER) && !Hu_IsStatusBarVisible(DISPLAYPLAYER)) + { + // Omit the title altogether while the inventory is open. + return; + } +#endif + + if(needToRespectStatusBarHeightWhenAutomapOpen()) { Size2Raw stBarSize; R_StatusBarSize(DISPLAYPLAYER, &stBarSize); y -= stBarSize.height; } -#endif + else if(needToRespectHudSizeWhenAutomapOpen()) + { + y -= 30 * cfg.hudScale; + } origin.y = portGeometry->size.height * y / float(SCREENHEIGHT); }