diff --git a/datasrc/ui/gametypes/ctf.png b/datasrc/ui/gametypes/ctf.png index ba8f3daa4..065dfef33 100644 Binary files a/datasrc/ui/gametypes/ctf.png and b/datasrc/ui/gametypes/ctf.png differ diff --git a/datasrc/ui/gametypes/dm.png b/datasrc/ui/gametypes/dm.png index 6daad4abd..7597bd45f 100644 Binary files a/datasrc/ui/gametypes/dm.png and b/datasrc/ui/gametypes/dm.png differ diff --git a/datasrc/ui/gametypes/lms.png b/datasrc/ui/gametypes/lms.png index 62accf598..b0bc60cf0 100644 Binary files a/datasrc/ui/gametypes/lms.png and b/datasrc/ui/gametypes/lms.png differ diff --git a/datasrc/ui/gametypes/lts.png b/datasrc/ui/gametypes/lts.png index f59104f0e..33df32148 100644 Binary files a/datasrc/ui/gametypes/lts.png and b/datasrc/ui/gametypes/lts.png differ diff --git a/datasrc/ui/gametypes/mod.png b/datasrc/ui/gametypes/mod.png index d764a7ee0..4dd48e530 100644 Binary files a/datasrc/ui/gametypes/mod.png and b/datasrc/ui/gametypes/mod.png differ diff --git a/datasrc/ui/gametypes/tdm.png b/datasrc/ui/gametypes/tdm.png index 3195e300e..0ac1eb31e 100644 Binary files a/datasrc/ui/gametypes/tdm.png and b/datasrc/ui/gametypes/tdm.png differ diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 4522e9150..4dba57eff 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -235,9 +235,8 @@ private: public: enum { - GAMEICON_FULL=0, - GAMEICON_ON, - GAMEICON_OFF, + GAMEICON_SIZE=64, + GAMEICON_OLDHEIGHT=192, }; CGameIcon() {}; CGameIcon(const char *pName) : m_Name(pName) {} @@ -247,7 +246,7 @@ private: }; array m_lGameIcons; IGraphics::CTextureHandle m_GameIconDefault; - void DoGameIcon(const char *pName, const CUIRect *pRect, int Type); + void DoGameIcon(const char *pName, const CUIRect *pRect); static int GameIconScan(const char *pName, int IsDir, int DirType, void *pUser); int64 m_LastInput; diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index d18fc26f7..2550ba4d8 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -575,7 +575,7 @@ int CMenus::DoBrowserEntry(const void *pID, CUIRect View, const CServerInfo *pEn CUIRect Icon; Button.VSplitLeft(Button.h, &Icon, &Button); Icon.y -= 0.5f; - DoGameIcon(pEntry->m_aGameType, &Icon, CGameIcon::GAMEICON_FULL); + DoGameIcon(pEntry->m_aGameType, &Icon); // gametype text CTextCursor Cursor; @@ -1872,7 +1872,7 @@ void CMenus::RenderDetailInfo(CUIRect View, const CServerInfo *pInfo) CUIRect Icon; Row.VSplitLeft(Row.h, &Icon, &Row); Icon.y -= 2.0f; - DoGameIcon(pInfo->m_aGameType, &Icon, CGameIcon::GAMEICON_FULL); + DoGameIcon(pInfo->m_aGameType, &Icon); UI()->DoLabelScaled(&Row, pInfo->m_aGameType, FontSize, CUI::ALIGN_LEFT, Row.w, false); // version @@ -2129,7 +2129,7 @@ void CMenus::RenderServerbrowserBottomBox(CUIRect MainView) m_EnterPressed = false; } } -void CMenus::DoGameIcon(const char *pName, const CUIRect *pRect, int Type) +void CMenus::DoGameIcon(const char *pName, const CUIRect *pRect) { char aNameBuf[128]; str_copy(aNameBuf, pName, sizeof(aNameBuf)); @@ -2145,23 +2145,10 @@ void CMenus::DoGameIcon(const char *pName, const CUIRect *pRect, int Type) break; } } - Graphics()->TextureSet(Tex); - Graphics()->QuadsBegin(); - - // select sprite - switch(Type) - { - case CGameIcon::GAMEICON_FULL: - Graphics()->QuadsSetSubset(0.0f, 0.0f, 1.0f, 1.0f/3.0f); - break; - case CGameIcon::GAMEICON_ON: - Graphics()->QuadsSetSubset(0.0f, 1.0f/3.0f, 1.0f, 2.0f/3.0f); - break; - default: // GAMEICON_OFF - Graphics()->QuadsSetSubset(0.0f, 2.0f/3.0f, 1.0f, 1.0f); - } // draw icon + Graphics()->TextureSet(Tex); + Graphics()->QuadsBegin(); IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h); Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsEnd(); @@ -2182,7 +2169,7 @@ int CMenus::GameIconScan(const char *pName, int IsDir, int DirType, void *pUser) char aBuf[512]; str_format(aBuf, sizeof(aBuf), "ui/gametypes/%s", pName); CImageInfo Info; - if(!pSelf->Graphics()->LoadPNG(&Info, aBuf, DirType)) + if(!pSelf->Graphics()->LoadPNG(&Info, aBuf, DirType) || Info.m_Width != CGameIcon::GAMEICON_SIZE || (Info.m_Height != CGameIcon::GAMEICON_SIZE && Info.m_Height != CGameIcon::GAMEICON_OLDHEIGHT)) { str_format(aBuf, sizeof(aBuf), "failed to load gametype icon '%s'", aGameIconName); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); @@ -2192,7 +2179,7 @@ int CMenus::GameIconScan(const char *pName, int IsDir, int DirType, void *pUser) str_format(aBuf, sizeof(aBuf), "loaded gametype icon '%s'", aGameIconName); pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "game", aBuf); - GameIcon.m_IconTexture = pSelf->Graphics()->LoadTextureRaw(Info.m_Width, Info.m_Height, Info.m_Format, Info.m_pData, Info.m_Format, IGraphics::TEXLOAD_LINEARMIPMAPS); + GameIcon.m_IconTexture = pSelf->Graphics()->LoadTextureRaw(CGameIcon::GAMEICON_SIZE, CGameIcon::GAMEICON_SIZE, Info.m_Format, Info.m_pData, Info.m_Format, IGraphics::TEXLOAD_LINEARMIPMAPS); pSelf->m_lGameIcons.add(GameIcon); if(!str_comp_nocase(aGameIconName, "mod")) pSelf->m_GameIconDefault = GameIcon.m_IconTexture;