Update new code to match the coding style guidelines

This commit is contained in:
SSimco 2025-07-12 10:18:39 +03:00
parent 68299a98e6
commit b3e05aad1d
35 changed files with 153 additions and 153 deletions

View File

@ -169,7 +169,7 @@ void LoadMainExecutable()
applicationRPX = RPLLoader_LoadFromMemory(rpxData, rpxSize, (char*)_pathToExecutable.c_str());
if (!applicationRPX)
{
WindowSystem::showErrorDialog(_tr("Failed to run this title because the executable is damaged"));
WindowSystem::ShowErrorDialog(_tr("Failed to run this title because the executable is damaged"));
cemuLog_createLogFile(false);
cemuLog_waitForFlush();
exit(0);
@ -354,7 +354,7 @@ uint32 LoadSharedData()
void cemu_initForGame()
{
WindowSystem::updateWindowTitles(false, true, 0.0);
WindowSystem::UpdateWindowTitles(false, true, 0.0);
// input manager apply game profile
InputManager::instance().apply_game_profile();
// log info for launched title
@ -852,7 +852,7 @@ namespace CafeSystem
PPCTimer_waitForInit();
// start system
sSystemRunning = true;
WindowSystem::notifyGameLoaded();
WindowSystem::NotifyGameLoaded();
std::thread t(_LaunchTitleThread);
t.detach();
}

View File

@ -75,7 +75,7 @@ void KeyCache_Prepare()
}
else
{
WindowSystem::showErrorDialog(_tr("Unable to create file keys.txt\nThis can happen if Cemu does not have write permission to its own directory, the disk is full or if anti-virus software is blocking Cemu."), _tr("Error"), WindowSystem::ErrorCategory::KEYS_TXT_CREATION);
WindowSystem::ShowErrorDialog(_tr("Unable to create file keys.txt\nThis can happen if Cemu does not have write permission to its own directory, the disk is full or if anti-virus software is blocking Cemu."), _tr("Error"), WindowSystem::ErrorCategory::KEYS_TXT_CREATION);
}
mtxKeyCache.unlock();
return;
@ -109,7 +109,7 @@ void KeyCache_Prepare()
if( strishex(line) == false )
{
auto errorMsg = _tr("Error in keys.txt at line {}", lineNumber);
WindowSystem::showErrorDialog(errorMsg, WindowSystem::ErrorCategory::KEYS_TXT_CREATION);
WindowSystem::ShowErrorDialog(errorMsg, WindowSystem::ErrorCategory::KEYS_TXT_CREATION);
continue;
}
if(line.size() == 32 )

View File

@ -63,7 +63,7 @@ void PatchErrorHandler::showStageErrorMessageBox()
}
}
WindowSystem::showErrorDialog(errorMsg, _tr("Graphic pack error"), WindowSystem::ErrorCategory::GRAPHIC_PACKS);
WindowSystem::ShowErrorDialog(errorMsg, _tr("Graphic pack error"), WindowSystem::ErrorCategory::GRAPHIC_PACKS);
}
// loads Cemu-style patches (patch_<anything>.asm)

View File

@ -338,7 +338,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b
{
bp->enabled = state;
debugger_updateExecutionBreakpoint(address);
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.UpdateViewThreadsafe();
}
else if (bpItr->isMemBP())
{
@ -360,7 +360,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b
debugger_updateMemoryBreakpoint(bpItr);
else
debugger_updateMemoryBreakpoint(nullptr);
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.UpdateViewThreadsafe();
}
return;
}
@ -497,7 +497,7 @@ void debugger_stepInto(PPCInterpreter_t* hCPU, bool updateDebuggerWindow = true)
debugger_updateExecutionBreakpoint(initialIP);
debuggerState.debugSession.instructionPointer = hCPU->instructionPointer;
if(updateDebuggerWindow)
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
ppcRecompilerEnabled = isRecEnabled;
}
@ -516,7 +516,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU)
// nothing to skip, use step-into
debugger_stepInto(hCPU);
debugger_updateExecutionBreakpoint(initialIP);
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
ppcRecompilerEnabled = isRecEnabled;
return false;
}
@ -524,7 +524,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU)
debugger_createCodeBreakpoint(initialIP + 4, DEBUGGER_BP_T_ONE_SHOT);
// step over current instruction (to avoid breakpoint)
debugger_stepInto(hCPU);
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
// restore breakpoints
debugger_updateExecutionBreakpoint(initialIP);
// run
@ -622,8 +622,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
DebuggerBreakpoint* singleshotBP = debugger_getFirstBP(debuggerState.debugSession.instructionPointer, DEBUGGER_BP_T_ONE_SHOT);
if (singleshotBP)
debugger_deleteBreakpoint(singleshotBP);
g_debuggerDispatcher.notifyDebugBreakpointHit();
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.NotifyDebugBreakpointHit();
g_debuggerDispatcher.UpdateViewThreadsafe();
// reset step control
debuggerState.debugSession.stepInto = false;
debuggerState.debugSession.stepOver = false;
@ -640,14 +640,14 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
break; // if true is returned, continue with execution
}
debugger_createPPCStateSnapshot(hCPU);
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.UpdateViewThreadsafe();
debuggerState.debugSession.stepOver = false;
}
if (debuggerState.debugSession.stepInto)
{
debugger_stepInto(hCPU);
debugger_createPPCStateSnapshot(hCPU);
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.UpdateViewThreadsafe();
debuggerState.debugSession.stepInto = false;
continue;
}
@ -664,8 +664,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU)
debuggerState.debugSession.isTrapped = false;
debuggerState.debugSession.hCPU = nullptr;
g_debuggerDispatcher.updateViewThreadsafe();
g_debuggerDispatcher.notifyRun();
g_debuggerDispatcher.UpdateViewThreadsafe();
g_debuggerDispatcher.NotifyRun();
}
void debugger_shouldBreak(PPCInterpreter_t* hCPU)

View File

@ -18,12 +18,12 @@
class DebuggerCallbacks
{
public:
virtual void updateViewThreadsafe() {}
virtual void notifyDebugBreakpointHit() {}
virtual void notifyRun() {}
virtual void moveIP() {}
virtual void notifyModuleLoaded(void* module) {}
virtual void notifyModuleUnloaded(void* module) {}
virtual void UpdateViewThreadsafe() {}
virtual void NotifyDebugBreakpointHit() {}
virtual void NotifyRun() {}
virtual void MoveIP() {}
virtual void NotifyModuleLoaded(void* module) {}
virtual void NotifyModuleUnloaded(void* module) {}
virtual ~DebuggerCallbacks() = default;
};
@ -36,46 +36,46 @@ class DebuggerDispatcher
DebuggerCallbacks* m_callbacks = &s_defaultDebuggerCallbacks;
public:
void setDebuggerCallbacks(DebuggerCallbacks* debuggerCallbacks)
void SetDebuggerCallbacks(DebuggerCallbacks* debuggerCallbacks)
{
cemu_assert_debug(m_callbacks == &s_defaultDebuggerCallbacks);
m_callbacks = debuggerCallbacks;
}
void clearDebuggerCallbacks()
void ClearDebuggerCallbacks()
{
cemu_assert_debug(m_callbacks != &s_defaultDebuggerCallbacks);
m_callbacks = &s_defaultDebuggerCallbacks;
}
void updateViewThreadsafe()
void UpdateViewThreadsafe()
{
m_callbacks->updateViewThreadsafe();
m_callbacks->UpdateViewThreadsafe();
}
void notifyDebugBreakpointHit()
void NotifyDebugBreakpointHit()
{
m_callbacks->notifyDebugBreakpointHit();
m_callbacks->NotifyDebugBreakpointHit();
}
void notifyRun()
void NotifyRun()
{
m_callbacks->notifyRun();
m_callbacks->NotifyRun();
}
void moveIP()
void MoveIP()
{
m_callbacks->moveIP();
m_callbacks->MoveIP();
}
void notifyModuleLoaded(void* module)
void NotifyModuleLoaded(void* module)
{
m_callbacks->notifyModuleLoaded(module);
m_callbacks->NotifyModuleLoaded(module);
}
void notifyModuleUnloaded(void* module)
void NotifyModuleUnloaded(void* module)
{
m_callbacks->notifyModuleUnloaded(module);
m_callbacks->NotifyModuleUnloaded(module);
}
} extern g_debuggerDispatcher;

View File

@ -519,17 +519,17 @@ void LatteOverlay_render(bool pad_view)
return;
sint32 w = 0, h = 0;
if (pad_view && WindowSystem::isPadWindowOpen())
WindowSystem::getPadWindowPhysSize(w, h);
if (pad_view && WindowSystem::IsPadWindowOpen())
WindowSystem::GetPadWindowPhysSize(w, h);
else
WindowSystem::getWindowPhysSize(w, h);
WindowSystem::GetWindowPhysSize(w, h);
if (w == 0 || h == 0)
return;
const Vector2f window_size{ (float)w,(float)h };
float fontDPIScale = !pad_view ? WindowSystem::getWindowDPIScale() : WindowSystem::getPadDPIScale();
float fontDPIScale = !pad_view ? WindowSystem::GetWindowDPIScale() : WindowSystem::GetPadDPIScale();
float overlayFontSize = 14.0f * (float)config.overlay.text_scale / 100.0f * fontDPIScale;

View File

@ -106,12 +106,12 @@ void LattePerformanceMonitor_frameEnd()
if (isFirstUpdate)
{
LatteOverlay_updateStats(0.0, 0, 0);
WindowSystem::updateWindowTitles(false, false, 0.0);
WindowSystem::UpdateWindowTitles(false, false, 0.0);
}
else
{
LatteOverlay_updateStats(fps, drawCallCounter / elapsedFrames, fastDrawCallCounter / elapsedFrames);
WindowSystem::updateWindowTitles(false, false, fps);
WindowSystem::UpdateWindowTitles(false, false, fps);
}
}
}

View File

@ -838,10 +838,10 @@ sint32 _currentOutputImageHeight = 0;
void LatteRenderTarget_getScreenImageArea(sint32* x, sint32* y, sint32* width, sint32* height, sint32* fullWidth, sint32* fullHeight, bool padView)
{
int w, h;
if(padView && WindowSystem::isPadWindowOpen())
WindowSystem::getPadWindowPhysSize(w, h);
if(padView && WindowSystem::IsPadWindowOpen())
WindowSystem::GetPadWindowPhysSize(w, h);
else
WindowSystem::getWindowPhysSize(w, h);
WindowSystem::GetWindowPhysSize(w, h);
sint32 scaledOutputX;
sint32 scaledOutputY;
@ -999,8 +999,8 @@ void LatteRenderTarget_itHLECopyColorBufferToScanBuffer(MPTR colorBufferPtr, uin
return {pressed && !toggle, pressed && toggle};
};
const bool tabPressed = WindowSystem::isKeyDown(WindowSystem::PlatformKeyCodes::TAB);
const bool ctrlPressed = WindowSystem::isKeyDown(WindowSystem::PlatformKeyCodes::LCONTROL);
const bool tabPressed = WindowSystem::IsKeyDown(WindowSystem::PlatformKeyCodes::TAB);
const bool ctrlPressed = WindowSystem::IsKeyDown(WindowSystem::PlatformKeyCodes::LCONTROL);
const auto [vpad0Active, vpad0Toggle] = getVPADScreenActive(0);
const auto [vpad1Active, vpad1Toggle] = getVPADScreenActive(1);

View File

@ -505,7 +505,7 @@ void LatteShaderCache_ShowProgress(const std::function <bool(void)>& loadUpdateF
continue;
int w, h;
WindowSystem::getWindowPhysSize(w, h);
WindowSystem::GetWindowPhysSize(w, h);
const Vector2f window_size{ (float)w,(float)h };
ImGui_GetFont(window_size.y / 32.0f); // = 24 by default

View File

@ -115,7 +115,7 @@ int Latte_ThreadEntry()
{
SetThreadName("LatteThread");
sint32 w,h;
WindowSystem::getWindowPhysSize(w,h);
WindowSystem::GetWindowPhysSize(w,h);
// renderer
g_renderer->Initialize();

View File

@ -21,35 +21,35 @@
class DefaultOpenGLCanvasCallbacks : public OpenGLCanvasCallbacks
{
} s_defaultOpenGLCanvasCallbacks;
} g_defaultOpenGLCanvasCallbacks;
OpenGLCanvasCallbacks* s_openGLCanvasCallbacks = &s_defaultOpenGLCanvasCallbacks;
OpenGLCanvasCallbacks* g_openGLCanvasCallbacks = &g_defaultOpenGLCanvasCallbacks;
void SetOpenGLCanvasCallbacks(OpenGLCanvasCallbacks* callbacks)
{
cemu_assert_debug(s_openGLCanvasCallbacks == &s_defaultOpenGLCanvasCallbacks);
s_openGLCanvasCallbacks = callbacks;
cemu_assert_debug(g_openGLCanvasCallbacks == &g_defaultOpenGLCanvasCallbacks);
g_openGLCanvasCallbacks = callbacks;
}
void ClearOpenGLCanvasCallbacks()
{
cemu_assert_debug(s_openGLCanvasCallbacks != &s_defaultOpenGLCanvasCallbacks);
s_openGLCanvasCallbacks = &s_defaultOpenGLCanvasCallbacks;
cemu_assert_debug(g_openGLCanvasCallbacks != &g_defaultOpenGLCanvasCallbacks);
g_openGLCanvasCallbacks = &g_defaultOpenGLCanvasCallbacks;
}
bool GLCanvas_HasPadViewOpen()
{
return s_openGLCanvasCallbacks->HasPadViewOpen();
return g_openGLCanvasCallbacks->HasPadViewOpen();
}
bool GLCanvas_MakeCurrent(bool padView)
{
return s_openGLCanvasCallbacks->MakeCurrent(padView);
return g_openGLCanvasCallbacks->MakeCurrent(padView);
}
void GLCanvas_SwapBuffers(bool swapTV, bool swapDRC)
{
s_openGLCanvasCallbacks->SwapBuffers(swapTV, swapDRC);
g_openGLCanvasCallbacks->SwapBuffers(swapTV, swapDRC);
}
#define STRINGIFY2(X) #X
@ -593,9 +593,9 @@ void OpenGLRenderer::DrawBackbufferQuad(LatteTextureView* texView, RendererOutpu
{
int windowWidth, windowHeight;
if (padView)
WindowSystem::getPadWindowPhysSize(windowWidth, windowHeight);
WindowSystem::GetPadWindowPhysSize(windowWidth, windowHeight);
else
WindowSystem::getWindowPhysSize(windowWidth, windowHeight);
WindowSystem::GetWindowPhysSize(windowWidth, windowHeight);
g_renderer->renderTarget_setViewport(0, 0, windowWidth, windowHeight, 0.0f, 1.0f);
g_renderer->ClearColorbuffer(padView);
}

View File

@ -65,9 +65,9 @@ bool Renderer::ImguiBegin(bool mainWindow)
{
sint32 w = 0, h = 0;
if (mainWindow)
WindowSystem::getWindowPhysSize(w, h);
else if (WindowSystem::isPadWindowOpen())
WindowSystem::getPadWindowPhysSize(w, h);
WindowSystem::GetWindowPhysSize(w, h);
else if (WindowSystem::IsPadWindowOpen())
WindowSystem::GetPadWindowPhysSize(w, h);
else
return false;

View File

@ -9,7 +9,7 @@
SwapchainInfoVk::SwapchainInfoVk(bool mainWindow, Vector2i size) : mainWindow(mainWindow), m_desiredExtent(size)
{
auto& windowHandleInfo = mainWindow ? WindowSystem::getWindowInfo().canvas_main : WindowSystem::getWindowInfo().canvas_pad;
auto& windowHandleInfo = mainWindow ? WindowSystem::GetWindowInfo().canvas_main : WindowSystem::GetWindowInfo().canvas_pad;
auto renderer = VulkanRenderer::GetInstance();
m_instance = renderer->GetVkInstance();
m_logicalDevice = renderer->GetLogicalDevice();

View File

@ -111,7 +111,7 @@ std::vector<VulkanRenderer::DeviceInfo> VulkanRenderer::GetDevices()
#if BOOST_OS_WINDOWS
requiredExtensions.emplace_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
#elif BOOST_OS_LINUX
auto backend = WindowSystem::getWindowInfo().window_main.backend;
auto backend = WindowSystem::GetWindowInfo().window_main.backend;
if(backend == WindowSystem::WindowHandleInfo::Backend::X11)
requiredExtensions.emplace_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
#ifdef HAS_WAYLAND
@ -154,7 +154,7 @@ std::vector<VulkanRenderer::DeviceInfo> VulkanRenderer::GetDevices()
throw std::runtime_error("Failed to find a GPU with Vulkan support.");
// create tmp surface to create a logical device
auto surface = CreateFramebufferSurface(instance, WindowSystem::getWindowInfo().window_main);
auto surface = CreateFramebufferSurface(instance, WindowSystem::GetWindowInfo().window_main);
std::vector<VkPhysicalDevice> devices(device_count);
vkEnumeratePhysicalDevices(instance, &device_count, devices.data());
for (const auto& device : devices)
@ -400,7 +400,7 @@ VulkanRenderer::VulkanRenderer()
throw std::runtime_error("Failed to find a GPU with Vulkan support.");
// create tmp surface to create a logical device
auto surface = CreateFramebufferSurface(m_instance, WindowSystem::getWindowInfo().window_main);
auto surface = CreateFramebufferSurface(m_instance, WindowSystem::GetWindowInfo().window_main);
auto& config = GetConfig();
decltype(config.graphic_device_uuid) zero{};
@ -1308,7 +1308,7 @@ std::vector<const char*> VulkanRenderer::CheckInstanceExtensionSupport(FeatureCo
#if BOOST_OS_WINDOWS
requiredInstanceExtensions.emplace_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
#elif BOOST_OS_LINUX
auto backend = WindowSystem::getWindowInfo().window_main.backend;
auto backend = WindowSystem::GetWindowInfo().window_main.backend;
if(backend == WindowSystem::WindowHandleInfo::Backend::X11)
requiredInstanceExtensions.emplace_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
#if HAS_WAYLAND
@ -2744,11 +2744,11 @@ void VulkanRenderer::RecreateSwapchain(bool mainWindow, bool skipCreate)
if (mainWindow)
{
ImGui_ImplVulkan_Shutdown();
WindowSystem::getWindowPhysSize(size.x, size.y);
WindowSystem::GetWindowPhysSize(size.x, size.y);
}
else
{
WindowSystem::getPadWindowPhysSize(size.x, size.y);
WindowSystem::GetPadWindowPhysSize(size.x, size.y);
}
chainInfo.swapchainImageIndex = -1;
@ -2778,9 +2778,9 @@ bool VulkanRenderer::UpdateSwapchainProperties(bool mainWindow)
int width, height;
if (mainWindow)
WindowSystem::getWindowPhysSize(width, height);
WindowSystem::GetWindowPhysSize(width, height);
else
WindowSystem::getPadWindowPhysSize(width, height);
WindowSystem::GetPadWindowPhysSize(width, height);
auto extent = chainInfo.getExtent();
if (width != extent.width || height != extent.height)
stateChanged = true;

View File

@ -92,7 +92,7 @@ void MMURange::mapMem()
if (MemMapper::AllocateMemory(memory_base + baseAddress, size, MemMapper::PAGE_PERMISSION::P_RW, true) == nullptr)
{
std::string errorMsg = _tr("Unable to allocate {} memory", name);
WindowSystem::showErrorDialog(errorMsg, _tr("Error"));
WindowSystem::ShowErrorDialog(errorMsg, _tr("Error"));
#if BOOST_OS_WINDOWS
ExitProcess(-1);
#else
@ -134,7 +134,7 @@ void memory_init()
{
debug_printf("memory_init(): Unable to reserve 4GB of memory\n");
debugBreakpoint();
WindowSystem::showErrorDialog(_tr("Unable to reserve 4GB of memory"), _tr("Error"));
WindowSystem::ShowErrorDialog(_tr("Unable to reserve 4GB of memory"), _tr("Error"));
exit(-1);
}
for (auto& itr : g_mmuRanges)

View File

@ -1795,7 +1795,7 @@ void RPLLoader_UnloadModule(RPLModule* rpl)
RPLLoader_decrementModuleDependencyRefs(rpl);
// save module config for this module in the debugger
g_debuggerDispatcher.notifyModuleUnloaded(rpl);
g_debuggerDispatcher.NotifyModuleUnloaded(rpl);
// release memory
rplLoaderHeap_codeArea2.free(rpl->regionMappingBase_text.GetPtr());
@ -1878,7 +1878,7 @@ void RPLLoader_Link()
RPLLoader_LoadDebugSymbols(rplModuleList[i]);
rplModuleList[i]->isLinked = true; // mark as linked
GraphicPack2::NotifyModuleLoaded(rplModuleList[i]);
g_debuggerDispatcher.notifyModuleLoaded(rplModuleList[i]);
g_debuggerDispatcher.NotifyModuleLoaded(rplModuleList[i]);
}
}

View File

@ -470,7 +470,7 @@ sint32 _KPADRead(uint32 channel, KPADStatus_t* samplingBufs, uint32 length, bety
samplingBufs->wpadErr = WPAD_ERR_NONE;
samplingBufs->data_format = controller->get_data_format();
samplingBufs->devType = controller->get_device_type();
if(!WindowSystem::inputConfigWindowHasFocus())
if(!WindowSystem::InputConfigWindowHasFocus())
{
const auto btn_repeat = padscore::g_padscore.controller_data[channel].btn_repeat;
controller->KPADRead(*samplingBufs, btn_repeat);

View File

@ -263,7 +263,7 @@ namespace vpad
PPCCore_switchToScheduler();
}
if (!WindowSystem::inputConfigWindowHasFocus())
if (!WindowSystem::InputConfigWindowHasFocus())
{
if (channel <= 1 && vpadDelayEnabled)
{

View File

@ -1403,7 +1403,7 @@ void DownloadManager::asyncPackageInstall(Package* package)
reportPackageStatus(package);
checkPackagesState();
// lastly request game list to be refreshed
WindowSystem::refreshGameList();
WindowSystem::RefreshGameList();
return;
}

View File

@ -91,36 +91,36 @@ namespace WindowSystem
GRAPHIC_PACKS = 1,
};
void showErrorDialog(std::string_view message, std::string_view title, std::optional<ErrorCategory> errorCategory = {});
inline void showErrorDialog(std::string_view message, std::optional<ErrorCategory> errorCategory = {})
void ShowErrorDialog(std::string_view message, std::string_view title, std::optional<ErrorCategory> errorCategory = {});
inline void ShowErrorDialog(std::string_view message, std::optional<ErrorCategory> errorCategory = {})
{
showErrorDialog(message, "", errorCategory);
ShowErrorDialog(message, "", errorCategory);
}
void create();
void Create();
WindowInfo& getWindowInfo();
WindowInfo& GetWindowInfo();
void updateWindowTitles(bool isIdle, bool isLoading, double fps);
void getWindowSize(int& w, int& h);
void getPadWindowSize(int& w, int& h);
void getWindowPhysSize(int& w, int& h);
void getPadWindowPhysSize(int& w, int& h);
double getWindowDPIScale();
double getPadDPIScale();
bool isPadWindowOpen();
bool isKeyDown(uint32 key);
bool isKeyDown(PlatformKeyCodes key);
std::string getKeyCodeName(uint32 key);
void UpdateWindowTitles(bool isIdle, bool isLoading, double fps);
void GetWindowSize(int& w, int& h);
void GetPadWindowSize(int& w, int& h);
void GetWindowPhysSize(int& w, int& h);
void GetPadWindowPhysSize(int& w, int& h);
double GetWindowDPIScale();
double GetPadDPIScale();
bool IsPadWindowOpen();
bool IsKeyDown(uint32 key);
bool IsKeyDown(PlatformKeyCodes key);
std::string GetKeyCodeName(uint32 key);
bool inputConfigWindowHasFocus();
bool InputConfigWindowHasFocus();
void notifyGameLoaded();
void notifyGameExited();
void NotifyGameLoaded();
void NotifyGameExited();
void refreshGameList();
void RefreshGameList();
bool isFullScreen();
bool IsFullScreen();
void captureInput(const ControllerState& currentState, const ControllerState& lastState);
void CaptureInput(const ControllerState& currentState, const ControllerState& lastState);
}; // namespace WindowSystem

View File

@ -438,7 +438,7 @@ void MainWindow::OnClose(wxCloseEvent& event)
if(m_game_list)
m_game_list->OnClose(event);
if (!IsMaximized() && !WindowSystem::isFullScreen())
if (!IsMaximized() && !WindowSystem::IsFullScreen())
m_restored_size = GetSize();
SaveSettings();
@ -1641,7 +1641,7 @@ void MainWindow::DestroyCanvas()
void MainWindow::OnSizeEvent(wxSizeEvent& event)
{
if (!IsMaximized() && !WindowSystem::isFullScreen())
if (!IsMaximized() && !WindowSystem::IsFullScreen())
m_restored_size = GetSize();
const wxSize client_size = GetClientSize();
@ -1672,7 +1672,7 @@ void MainWindow::OnDPIChangedEvent(wxDPIChangedEvent& event)
void MainWindow::OnMove(wxMoveEvent& event)
{
if (!IsMaximized() && !WindowSystem::isFullScreen())
if (!IsMaximized() && !WindowSystem::IsFullScreen())
m_restored_position = GetPosition();
if (m_debugger_window && m_debugger_window->IsShown())

View File

@ -14,7 +14,7 @@ VulkanCanvas::VulkanCanvas(wxWindow* parent, const wxSize& size, bool is_main_wi
Bind(wxEVT_PAINT, &VulkanCanvas::OnPaint, this);
Bind(wxEVT_SIZE, &VulkanCanvas::OnResize, this);
auto& canvas = is_main_window ? WindowSystem::getWindowInfo().canvas_main : WindowSystem::getWindowInfo().canvas_pad;
auto& canvas = is_main_window ? WindowSystem::GetWindowInfo().canvas_main : WindowSystem::GetWindowInfo().canvas_pad;
canvas = initHandleContextFromWxWidgetsWindow(this);
#if BOOST_OS_LINUX && HAS_WAYLAND
if (canvas.backend == WindowSystem::WindowHandleInfo::Backend::Wayland)

View File

@ -179,7 +179,7 @@ void BreakpointWindow::OnLeftDClick(wxMouseEvent& event)
const auto item = m_breakpoints->GetItemText(index, ColumnAddress);
const auto address = std::stoul(item.ToStdString(), nullptr, 16);
debuggerState.debugSession.instructionPointer = address;
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
return;
}

View File

@ -270,7 +270,7 @@ DebuggerWindow2::DebuggerWindow2(wxFrame& parent, const wxRect& display_size)
: wxFrame(&parent, wxID_ANY, _("PPC Debugger"), wxDefaultPosition, wxSize(1280, 300), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT),
m_module_address(0)
{
g_debuggerDispatcher.setDebuggerCallbacks(this);
g_debuggerDispatcher.SetDebuggerCallbacks(this);
this->wxWindowBase::SetBackgroundColour(*wxWHITE);
@ -337,7 +337,7 @@ DebuggerWindow2::DebuggerWindow2(wxFrame& parent, const wxRect& display_size)
DebuggerWindow2::~DebuggerWindow2()
{
g_debuggerDispatcher.clearDebuggerCallbacks();
g_debuggerDispatcher.ClearDebuggerCallbacks();
debuggerState.breakOnEntry = false;
g_debugger_window = nullptr;
@ -686,38 +686,38 @@ void DebuggerWindow2::UpdateModuleLabel(uint32 address)
}
}
void DebuggerWindow2::updateViewThreadsafe()
void DebuggerWindow2::UpdateViewThreadsafe()
{
auto* evt = new wxCommandEvent(wxEVT_UPDATE_VIEW);
wxQueueEvent(this, evt);
}
void DebuggerWindow2::notifyDebugBreakpointHit()
void DebuggerWindow2::NotifyDebugBreakpointHit()
{
auto* evt = new wxCommandEvent(wxEVT_BREAKPOINT_HIT);
wxQueueEvent(this, evt);
}
void DebuggerWindow2::notifyRun()
void DebuggerWindow2::NotifyRun()
{
auto* evt = new wxCommandEvent(wxEVT_RUN);
wxQueueEvent(this, evt);
}
void DebuggerWindow2::moveIP()
void DebuggerWindow2::MoveIP()
{
auto* evt = new wxCommandEvent(wxEVT_MOVE_IP);
wxQueueEvent(this, evt);
}
void DebuggerWindow2::notifyModuleLoaded(void* module)
void DebuggerWindow2::NotifyModuleLoaded(void* module)
{
auto* evt = new wxCommandEvent(wxEVT_NOTIFY_MODULE_LOADED);
evt->SetClientData(module);
wxQueueEvent(this, evt);
}
void DebuggerWindow2::notifyModuleUnloaded(void* module)
void DebuggerWindow2::NotifyModuleUnloaded(void* module)
{
auto* evt = new wxCommandEvent(wxEVT_NOTIFY_MODULE_UNLOADED);
evt->SetClientData(module);

View File

@ -92,12 +92,12 @@ private:
void CreateMenuBar();
void UpdateModuleLabel(uint32 address = 0);
void updateViewThreadsafe() override;
void notifyDebugBreakpointHit() override;
void notifyRun() override;
void moveIP() override;
void notifyModuleLoaded(void* module) override;
void notifyModuleUnloaded(void* module) override;
void UpdateViewThreadsafe() override;
void NotifyDebugBreakpointHit() override;
void NotifyRun() override;
void MoveIP() override;
void NotifyModuleLoaded(void* module) override;
void NotifyModuleUnloaded(void* module) override;
XMLDebuggerConfig m_config;
std::vector<std::unique_ptr<XMLDebuggerModuleConfig>> m_modules_storage;

View File

@ -132,5 +132,5 @@ void ModuleWindow::OnLeftDClick(wxMouseEvent& event)
if (address == 0)
return;
debuggerState.debugSession.instructionPointer = address;
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
}

View File

@ -113,7 +113,7 @@ void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
if (address == 0)
return;
debuggerState.debugSession.instructionPointer = address;
g_debuggerDispatcher.moveIP();
g_debuggerDispatcher.MoveIP();
}
void SymbolListCtrl::OnRightClick(wxListEvent& event)

View File

@ -26,7 +26,7 @@ void InputPanel::on_timer(const EmulatedControllerPtr& emulated_controller, cons
const auto mapping = reinterpret_cast<uint64>(element->GetClientData());
// reset mapping
if(std::exchange(m_right_down, false) || WindowSystem::isKeyDown(WindowSystem::PlatformKeyCodes::ESCAPE))
if(std::exchange(m_right_down, false) || WindowSystem::IsKeyDown(WindowSystem::PlatformKeyCodes::ESCAPE))
{
element->SetBackgroundColour(kKeyColourNormalMode);
m_color_backup[element->GetId()] = kKeyColourNormalMode;

View File

@ -41,7 +41,7 @@ void _wxLaunch()
}
#endif
void WindowSystem::create()
void WindowSystem::Create()
{
SetThreadName("cemu");
#if BOOST_OS_WINDOWS
@ -56,7 +56,7 @@ void WindowSystem::create()
#endif
}
void WindowSystem::showErrorDialog(std::string_view message, std::string_view title, std::optional<WindowSystem::ErrorCategory> /*errorId*/)
void WindowSystem::ShowErrorDialog(std::string_view message, std::string_view title, std::optional<WindowSystem::ErrorCategory> /*errorId*/)
{
wxString caption;
if (title.empty())
@ -66,12 +66,12 @@ void WindowSystem::showErrorDialog(std::string_view message, std::string_view ti
wxMessageBox(to_wxString(message), caption, wxOK | wxCENTRE | wxICON_ERROR);
}
WindowSystem::WindowInfo& WindowSystem::getWindowInfo()
WindowSystem::WindowInfo& WindowSystem::GetWindowInfo()
{
return g_window_info;
}
void WindowSystem::updateWindowTitles(bool isIdle, bool isLoading, double fps)
void WindowSystem::UpdateWindowTitles(bool isIdle, bool isLoading, double fps)
{
std::string windowText;
windowText = BUILD_VERSION_WITH_NAME_STRING;
@ -152,13 +152,13 @@ void WindowSystem::updateWindowTitles(bool isIdle, bool isLoading, double fps)
}
}
void WindowSystem::getWindowSize(int& w, int& h)
void WindowSystem::GetWindowSize(int& w, int& h)
{
w = g_window_info.width;
h = g_window_info.height;
}
void WindowSystem::getPadWindowSize(int& w, int& h)
void WindowSystem::GetPadWindowSize(int& w, int& h)
{
if (g_window_info.pad_open)
{
@ -172,13 +172,13 @@ void WindowSystem::getPadWindowSize(int& w, int& h)
}
}
void WindowSystem::getWindowPhysSize(int& w, int& h)
void WindowSystem::GetWindowPhysSize(int& w, int& h)
{
w = g_window_info.phys_width;
h = g_window_info.phys_height;
}
void WindowSystem::getPadWindowPhysSize(int& w, int& h)
void WindowSystem::GetPadWindowPhysSize(int& w, int& h)
{
if (g_window_info.pad_open)
{
@ -192,27 +192,27 @@ void WindowSystem::getPadWindowPhysSize(int& w, int& h)
}
}
double WindowSystem::getWindowDPIScale()
double WindowSystem::GetWindowDPIScale()
{
return g_window_info.dpi_scale;
}
double WindowSystem::getPadDPIScale()
double WindowSystem::GetPadDPIScale()
{
return g_window_info.pad_open ? g_window_info.pad_dpi_scale.load() : 1.0;
}
bool WindowSystem::isPadWindowOpen()
bool WindowSystem::IsPadWindowOpen()
{
return g_window_info.pad_open;
}
bool WindowSystem::isKeyDown(uint32 key)
bool WindowSystem::IsKeyDown(uint32 key)
{
return g_window_info.get_keystate(key);
}
bool WindowSystem::isKeyDown(PlatformKeyCodes platformKey)
bool WindowSystem::IsKeyDown(PlatformKeyCodes platformKey)
{
uint32 key = 0;
@ -262,10 +262,10 @@ bool WindowSystem::isKeyDown(PlatformKeyCodes platformKey)
return false;
}
return WindowSystem::isKeyDown(key);
return WindowSystem::IsKeyDown(key);
}
std::string WindowSystem::getKeyCodeName(uint32 button)
std::string WindowSystem::GetKeyCodeName(uint32 button)
{
#if BOOST_OS_WINDOWS
LONG scan_code = MapVirtualKeyA((UINT)button, MAPVK_VK_TO_VSC_EX);
@ -307,12 +307,12 @@ std::string WindowSystem::getKeyCodeName(uint32 button)
#endif
}
bool WindowSystem::inputConfigWindowHasFocus()
bool WindowSystem::InputConfigWindowHasFocus()
{
return g_inputConfigWindowHasFocus;
}
void WindowSystem::notifyGameLoaded()
void WindowSystem::NotifyGameLoaded()
{
std::shared_lock lock(g_mutex);
if (g_mainFrame)
@ -322,14 +322,14 @@ void WindowSystem::notifyGameLoaded()
}
}
void WindowSystem::notifyGameExited()
void WindowSystem::NotifyGameExited()
{
std::shared_lock lock(g_mutex);
if (g_mainFrame)
g_mainFrame->RestoreSettingsAfterGameExited();
}
void WindowSystem::refreshGameList()
void WindowSystem::RefreshGameList()
{
std::shared_lock lock(g_mutex);
if (g_mainFrame)
@ -338,12 +338,12 @@ void WindowSystem::refreshGameList()
}
}
void WindowSystem::captureInput(const ControllerState& currentState, const ControllerState& lastState)
void WindowSystem::CaptureInput(const ControllerState& currentState, const ControllerState& lastState)
{
HotkeySettings::CaptureInput(currentState, lastState);
}
bool WindowSystem::isFullScreen()
bool WindowSystem::IsFullScreen()
{
return g_window_info.is_fullscreen;
}

View File

@ -122,7 +122,7 @@ ImFont* ImGui_GetFont(float size)
void ImGui_UpdateWindowInformation(bool mainWindow)
{
static std::map<uint32, ImGuiKey> keyboard_mapping;
auto& windowInfo = WindowSystem::getWindowInfo();
auto& windowInfo = WindowSystem::GetWindowInfo();
static uint32 current_key = 0;
ImGuiIO& io = ImGui::GetIO();
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;

View File

@ -67,7 +67,7 @@ const ControllerState& ControllerBase::update_state()
#undef APPLY_AXIS_BUTTON
WindowSystem::captureInput(result, m_last_state);
WindowSystem::CaptureInput(result, m_last_state);
m_last_state = std::move(result);
return m_last_state;

View File

@ -11,14 +11,14 @@ KeyboardController::KeyboardController()
std::string KeyboardController::get_button_name(uint64 button) const
{
return WindowSystem::getKeyCodeName(button);
return WindowSystem::GetKeyCodeName(button);
}
ControllerState KeyboardController::raw_state()
{
ControllerState result{};
boost::container::small_vector<uint32, 16> pressedKeys;
WindowSystem::getWindowInfo().iter_keystates([&pressedKeys](const std::pair<const uint32, bool>& keyState) { if (keyState.second) pressedKeys.emplace_back(keyState.first); });
WindowSystem::GetWindowInfo().iter_keystates([&pressedKeys](const std::pair<const uint32, bool>& keyState) { if (keyState.second) pressedKeys.emplace_back(keyState.first); });
result.buttons.SetPressedButtons(pressedKeys);
return result;
}

View File

@ -286,9 +286,9 @@ void VPADController::update_motion(VPADStatus_t& status)
int w, h;
if (pad_view)
WindowSystem::getPadWindowPhysSize(w, h);
WindowSystem::GetPadWindowPhysSize(w, h);
else
WindowSystem::getWindowPhysSize(w, h);
WindowSystem::GetWindowPhysSize(w, h);
float wx = mousePos.x / w;
float wy = mousePos.y / h;

View File

@ -252,7 +252,7 @@ int main(int argc, char *argv[])
#endif
if (!LaunchSettings::HandleCommandline(argc, argv))
return 0;
WindowSystem::create();
WindowSystem::Create();
return 0;
}
#endif

View File

@ -36,7 +36,7 @@ void mainEmulatorLLE()
memory_initPhysicalLayout();
// start GUI thread
WindowSystem::create();
WindowSystem::Create();
// load kernel ancast image
loadPPCBootrom();
loadEncryptedPPCAncastKernel();