diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-16 21:44:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:44:26 -0500 |
| commit | ce739f6045ec72127491286ea3f3f21e537c1b55 (patch) | |
| tree | f33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.Client/Common/UI/UILayer.cpp | |
| parent | 255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff) | |
| parent | 5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/Common/UI/UILayer.cpp')
| -rw-r--r-- | Minecraft.Client/Common/UI/UILayer.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index b3cf72a0..e1c388f5 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -102,7 +102,7 @@ void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) bool UILayer::IsSceneInStack(EUIScene scene) { bool inStack = false; - for(int i = m_sceneStack.size() - 1;i >= 0; --i) + for(int i = static_cast<int>(m_sceneStack.size()) - 1; i >= 0; --i) { if(m_sceneStack[i]->getSceneType() == scene) { @@ -118,7 +118,7 @@ bool UILayer::HasFocus(int iPad) bool hasFocus = false; if(m_hasFocus) { - for(int i = m_sceneStack.size() - 1;i >= 0; --i) + for(int i = (int)m_sceneStack.size() - 1; i >= 0; --i) { if(m_sceneStack[i]->stealsFocus() ) { @@ -146,7 +146,7 @@ bool UILayer::hidesLowerScenes() } if(!hidesScenes && !m_sceneStack.empty()) { - for(int i = m_sceneStack.size() - 1;i >= 0; --i) + for(int i = static_cast<int>(m_sceneStack.size()) - 1; i >= 0; --i) { if(m_sceneStack[i]->hidesLowerScenes()) { @@ -197,7 +197,7 @@ bool UILayer::GetMenuDisplayed() bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData) { - UIScene *newScene = NULL; + UIScene *newScene = nullptr; switch(scene) { // Debug @@ -424,7 +424,7 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData) break; }; - if(newScene == NULL) + if(newScene == nullptr) { app.DebugPrintf("WARNING: Scene %d was not created. Add it to UILayer::NavigateToScene\n", scene); return false; @@ -451,7 +451,7 @@ bool UILayer::NavigateBack(int iPad, EUIScene eScene) bool navigated = false; if(eScene < eUIScene_COUNT) { - UIScene *scene = NULL; + UIScene *scene = nullptr; do { scene = m_sceneStack.back(); @@ -523,9 +523,9 @@ UIScene *UILayer::addComponent(int iPad, EUIScene scene, void *initData) return itComp; } } - return NULL; + return nullptr; } - UIScene *newScene = NULL; + UIScene *newScene = nullptr; switch(scene) { @@ -573,7 +573,7 @@ UIScene *UILayer::addComponent(int iPad, EUIScene scene, void *initData) break; }; - if(newScene == NULL) return NULL; + if(newScene == nullptr) return nullptr; m_components.push_back(newScene); @@ -661,12 +661,12 @@ void UILayer::closeAllScenes() } } -// Get top scene on stack (or NULL if stack is empty) +// Get top scene on stack (or nullptr if stack is empty) UIScene *UILayer::GetTopScene() { if(m_sceneStack.size() == 0) { - return NULL; + return nullptr; } else { @@ -789,7 +789,7 @@ UIScene *UILayer::getCurrentScene() } } - return NULL; + return nullptr; } #endif @@ -877,10 +877,10 @@ void UILayer::handleUnlockFullVersion() } } -void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 layerStatic = 0; - __int64 layerDynamic = 0; + int64_t layerStatic = 0; + int64_t layerDynamic = 0; for(auto& it : m_components) { it->PrintTotalMemoryUsage(layerStatic, layerDynamic); @@ -894,10 +894,10 @@ void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) totalDynamic += layerDynamic; } -// Returns the first scene of given type if it exists, NULL otherwise +// Returns the first scene of given type if it exists, nullptr otherwise UIScene *UILayer::FindScene(EUIScene sceneType) { - for (int i = 0; i < m_sceneStack.size(); i++) + for (size_t i = 0; i < m_sceneStack.size(); i++) { if (m_sceneStack[i]->getSceneType() == sceneType) { @@ -905,5 +905,5 @@ UIScene *UILayer::FindScene(EUIScene sceneType) } } - return NULL; + return nullptr; }
\ No newline at end of file |
