Skip to content

Commit

Permalink
Cleaner separation of dependencies on DolphinWX.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfi1 committed Sep 22, 2021
1 parent 6411a13 commit 0b7c7c1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Source/Core/Core/HW/EXI_DeviceSlippi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
//#include "Core/PatchEngine.h"
#include "Core/PowerPC/PowerPC.h"

// Not clean but idk a better way atm
// #include "DolphinWX/Frame.h"
// #include "DolphinWX/Main.h"
// For LowerRenderWindow
#include "UICommon/UICommon.h"

#define FRAME_INTERVAL 900
#define SLEEP_TIME_MS 8
Expand Down Expand Up @@ -2798,6 +2797,7 @@ void CEXISlippi::handleLogInRequest()
if (!logInRes)
{
// main_frame->LowerRenderWindow();
UICommon::LowerRenderWindow();
user->OpenLogInPage();
user->ListenForLogIn();
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Slippi/SlippiUser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "Common/Common.h"
#include "Core/ConfigManager.h"

// #include "DolphinWX/Frame.h"
// #include "DolphinWX/Main.h"
// for RaiseRenderWindow
#include "UICommon/UICommon.h"

#ifdef __APPLE__
#include "DolphinWX/SlippiAuthWebView/SlippiAuthWebView.h"
Expand Down Expand Up @@ -276,7 +276,7 @@ void SlippiUser::FileListenThread()
if (AttemptLogin())
{
runThread = false;
// main_frame->RaiseRenderWindow();
UICommon::RaiseRenderWindow();
break;
}

Expand Down
7 changes: 7 additions & 0 deletions Source/Core/DolphinNoGUI/MainNoGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ namespace ProcessorInterface
void PowerButton_Tap();
}

namespace UICommon
{
// could do something with PlatformX11?
void RaiseRenderWindow() {}
void LowerRenderWindow() {}
}

class Platform
{
public:
Expand Down
12 changes: 12 additions & 0 deletions Source/Core/DolphinWX/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include "Common/Logging/LogManager.h"
#include "Common/Thread.h"

#include "UICommon/UICommon.h"

#include "Core/Analytics.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
Expand Down Expand Up @@ -92,6 +94,16 @@ std::string wxStringTranslator(const char *);

CFrame *main_frame = nullptr;

void UICommon::LowerRenderWindow()
{
main_frame->LowerRenderWindow();
}

void UICommon::RaiseRenderWindow()
{
main_frame->RaiseRenderWindow();
}

static std::mutex s_init_mutex;

bool DolphinApp::Initialize(int &c, wxChar **v)
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/UICommon/UICommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ void Shutdown();
void CreateDirectories();
void SetUserDirectory(const std::string& custom_path);

void RaiseRenderWindow();
void LowerRenderWindow();

} // namespace UICommon

0 comments on commit 0b7c7c1

Please sign in to comment.