forked from cafeberry/cafeberry
chore: cleanup function names & update gdraw resolution
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <message_dialog.h>
|
||||
#elif _WINDOWS64
|
||||
#include "Windows64\Windows64_Minecraft.h"
|
||||
string m_LastControllerType = "mrow";
|
||||
#endif
|
||||
|
||||
// 4J Stu - Enable this to override the Iggy Allocator
|
||||
@@ -50,8 +49,12 @@ string m_LastControllerType = "mrow";
|
||||
|
||||
#endif
|
||||
|
||||
CRITICAL_SECTION UIController::ms_reloadSkinCS;
|
||||
bool UIController::ms_bReloadSkinCSInitialised = false;
|
||||
#ifdef _WINDOWS64
|
||||
string m_LastControllerType = "mrow";
|
||||
#endif
|
||||
|
||||
CRITICAL_SECTION UIController::ms_reloadSkinsCS;
|
||||
bool UIController::ms_bReloadSkinsCSInitialised = false;
|
||||
|
||||
DWORD UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME;
|
||||
|
||||
@@ -165,7 +168,7 @@ static void RADLINK DeallocateFunction ( void * alloc_callback_user_data , void
|
||||
UIController::UIController()
|
||||
{
|
||||
m_uiDebugConsole = NULL;
|
||||
m_reloadSkinThread = NULL;
|
||||
m_reloadSkinsThread = NULL;
|
||||
|
||||
m_navigateToHomeOnReload = false;
|
||||
|
||||
@@ -230,11 +233,11 @@ UIController::UIController()
|
||||
m_bTouchscreenPressed=false;
|
||||
#endif
|
||||
|
||||
if(!ms_bReloadSkinCSInitialised)
|
||||
if(!ms_bReloadSkinsCSInitialised)
|
||||
{
|
||||
// MGH - added to prevent crash loading Iggy movies while the skins were being reloaded
|
||||
InitializeCriticalSection(&ms_reloadSkinCS);
|
||||
ms_bReloadSkinCSInitialised = true;
|
||||
InitializeCriticalSection(&ms_reloadSkinsCS);
|
||||
ms_bReloadSkinsCSInitialised = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,13 +339,13 @@ UITTFFont *UIController::createFont(EFont fontLanguage)
|
||||
{
|
||||
switch(fontLanguage)
|
||||
{
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !(defined _DURANGO || _WINDOWS64)
|
||||
case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DF-DotDotGothic16.ttf", 0x203B); // JPN
|
||||
case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFTT_R5.TTC", 0x203B); // CHT
|
||||
case eFont_Korean: return new UITTFFont("Mojangles_TTF_koKR", "Common/Media/font/KOR/candadite2.ttf", 0x203B); // KOR
|
||||
#else
|
||||
case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DFGMaruGothic-Md.ttf", 0x2022); // JPN
|
||||
#if defined(_DURANGO) || defined(_WINDOWS64)
|
||||
#if (defined _DURANGO || _WINDOWS64)
|
||||
case eFont_SimpChinese: return new UITTFFont("Mojangled_TTF_cnCN", "Common/Media/font/CHS/MSYH.ttf", 0x2022); // CHS
|
||||
#endif
|
||||
case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFHeiMedium-B5.ttf", 0x2022); // CHT
|
||||
@@ -442,9 +445,9 @@ void UIController::tick()
|
||||
{
|
||||
SetupFont(); // If necessary, change font.
|
||||
|
||||
if ( (m_navigateToHomeOnReload || m_bCleanupOnReload) && !ui.IsReloadingSkin() )
|
||||
if ( (m_navigateToHomeOnReload || m_bCleanupOnReload) && !ui.IsReloadingSkins() )
|
||||
{
|
||||
ui.CleanUpSkinReload();
|
||||
ui.CleanUpSkinsReload();
|
||||
|
||||
if (m_navigateToHomeOnReload || !g_NetworkManager.IsInSession())
|
||||
{
|
||||
@@ -501,6 +504,7 @@ void UIController::tick()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
//str1k3r - this is what actually does all the autoswitching
|
||||
void UIController::GetControllerType()
|
||||
{
|
||||
@@ -532,7 +536,7 @@ void UIController::GetControllerType()
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf";
|
||||
}
|
||||
|
||||
//ReloadSingleSkin(eLibrary_ControlTooltips, controlTooltipsPath, (m_fScreenHeight >= 1080.0f) ? L"skinControlTooltipsHD.swf" : L"skinControlTooltips.swf");
|
||||
//ReloadSkin(eLibrary_ControlTooltips, controlTooltipsPath, (m_fScreenHeight >= 1080.0f) ? L"skinControlTooltipsHD.swf" : L"skinControlTooltips.swf");
|
||||
|
||||
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
|
||||
{
|
||||
@@ -575,9 +579,13 @@ wstring UIController::GetTooltipSkinPath()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void UIController::loadSkins()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
wstring tooltipsSkinPath = L"";
|
||||
#endif
|
||||
wstring platformSkinPath = L"";
|
||||
|
||||
#ifdef __PS3__
|
||||
@@ -632,7 +640,7 @@ void UIController::loadSkins()
|
||||
m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf");
|
||||
#ifdef _WINDOWS64
|
||||
//m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf");
|
||||
m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf");
|
||||
#endif
|
||||
m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf");
|
||||
m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf");
|
||||
@@ -649,7 +657,7 @@ void UIController::loadSkins()
|
||||
m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf");
|
||||
#ifdef _WINDOWS64
|
||||
//m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf");
|
||||
m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltips.swf");
|
||||
#endif
|
||||
m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf");
|
||||
m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf");
|
||||
@@ -692,7 +700,8 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN
|
||||
return lib;
|
||||
}
|
||||
|
||||
void UIController::ReloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName)
|
||||
//str1k3r - reloads a single skin
|
||||
void UIController::ReloadSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName)
|
||||
{
|
||||
if(m_iggyLibraries[lib] != IGGY_INVALID_LIBRARY)
|
||||
{
|
||||
@@ -703,7 +712,8 @@ void UIController::ReloadSingleSkin(ELibraries lib, const wstring &skinPath, con
|
||||
m_iggyLibraries[lib] = loadSkin(skinPath, skinName);
|
||||
}
|
||||
|
||||
void UIController::ReloadSkin()
|
||||
//str1k3r - reloads every skin
|
||||
void UIController::ReloadSkins()
|
||||
{
|
||||
// Destroy all scene swf
|
||||
for(unsigned int i = 0; i < eUIGroup_COUNT; ++i)
|
||||
@@ -720,8 +730,8 @@ void UIController::ReloadSkin()
|
||||
m_iggyLibraries[i] = IGGY_INVALID_LIBRARY;
|
||||
}
|
||||
|
||||
m_reloadSkinThread = new C4JThread(reloadSkinThreadProc, (void*)this, "Reload skin thread");
|
||||
m_reloadSkinThread->SetProcessor(CPU_CORE_UI_SCENE);
|
||||
m_reloadSkinsThread = new C4JThread(reloadSkinsThreadProc, (void*)this, "Reload skin thread");
|
||||
m_reloadSkinsThread->SetProcessor(CPU_CORE_UI_SCENE);
|
||||
|
||||
// Navigate to the timer scene so that we can display something while the loading is happening
|
||||
// str1k3r - Exclude this from windows64 as its not needed
|
||||
@@ -731,7 +741,7 @@ void UIController::ReloadSkin()
|
||||
|
||||
// str1k3r - Fixes 4J's issue with the screen staying on the timer scene if on another thread on windows64
|
||||
#ifdef _WINDOWS64
|
||||
m_reloadSkinThread->Run();
|
||||
m_reloadSkinsThread->Run();
|
||||
#endif
|
||||
|
||||
//// Load new skin
|
||||
@@ -747,14 +757,14 @@ void UIController::ReloadSkin()
|
||||
//m_groups[eUIGroup_Fullscreen]->ReloadAll();
|
||||
}
|
||||
|
||||
void UIController::StartReloadSkinThread()
|
||||
void UIController::StartReloadSkinsThread()
|
||||
{
|
||||
if(m_reloadSkinThread) m_reloadSkinThread->Run();
|
||||
if(m_reloadSkinsThread) m_reloadSkinsThread->Run();
|
||||
}
|
||||
|
||||
int UIController::reloadSkinThreadProc(void* lpParam)
|
||||
int UIController::reloadSkinsThreadProc(void* lpParam)
|
||||
{
|
||||
EnterCriticalSection(&ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded
|
||||
EnterCriticalSection(&ms_reloadSkinsCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded
|
||||
UIController *controller = (UIController *)lpParam;
|
||||
// Load new skin
|
||||
controller->loadSkins();
|
||||
@@ -772,25 +782,25 @@ int UIController::reloadSkinThreadProc(void* lpParam)
|
||||
#ifndef _WINDOW64
|
||||
controller->NavigateBack(0, false, eUIScene_COUNT, eUILayer_Tooltips);
|
||||
#endif
|
||||
LeaveCriticalSection(&ms_reloadSkinCS);
|
||||
LeaveCriticalSection(&ms_reloadSkinsCS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool UIController::IsReloadingSkin()
|
||||
bool UIController::IsReloadingSkins()
|
||||
{
|
||||
return m_reloadSkinThread && (!m_reloadSkinThread->hasStarted() || m_reloadSkinThread->isRunning());
|
||||
return m_reloadSkinsThread && (!m_reloadSkinsThread->hasStarted() || m_reloadSkinsThread->isRunning());
|
||||
}
|
||||
|
||||
bool UIController::IsExpectingOrReloadingSkin()
|
||||
bool UIController::IsExpectingOrReloadingSkins()
|
||||
{
|
||||
return Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || Minecraft::GetInstance()->skins->needsUIUpdate() || IsReloadingSkin() || PendingFontChange();
|
||||
return Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || Minecraft::GetInstance()->skins->needsUIUpdate() || IsReloadingSkins() || PendingFontChange();
|
||||
}
|
||||
|
||||
void UIController::CleanUpSkinReload()
|
||||
void UIController::CleanUpSkinsReload()
|
||||
{
|
||||
delete m_reloadSkinThread;
|
||||
m_reloadSkinThread = NULL;
|
||||
delete m_reloadSkinsThread;
|
||||
m_reloadSkinsThread = NULL;
|
||||
|
||||
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
|
||||
{
|
||||
@@ -2645,7 +2655,7 @@ C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT ui
|
||||
EUILayer layer = bIsError?eUILayer_Error:eUILayer_Alert;
|
||||
|
||||
bool completed = false;
|
||||
if(ui.IsReloadingSkin())
|
||||
if(ui.IsReloadingSkins())
|
||||
{
|
||||
// Queue this message box
|
||||
QueuedMessageBoxData *queuedData = new QueuedMessageBoxData();
|
||||
|
||||
Reference in New Issue
Block a user