Compiling. Online and rollback work. Replays broken currently

This commit is contained in:
R2DLiu 2020-07-05 22:28:23 -04:00
commit ced28d629d
9 changed files with 51 additions and 7 deletions

View file

@ -582,10 +582,12 @@ PUBLIC
videoogl videoogl
videosoftware videosoftware
videovulkan videovulkan
semver
SlippiLib SlippiLib
vcdcom vcdcom
vcddec vcddec
vcdenc vcdenc
z
PRIVATE PRIVATE
fmt::fmt fmt::fmt

View file

@ -21,6 +21,7 @@
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/CoreTiming.h" #include "Core/CoreTiming.h"
#include "Core/Debugger/Debugger_SymbolMap.h" #include "Core/Debugger/Debugger_SymbolMap.h"
#include "Host.h"
#include "Core/HW/EXI/EXI_DeviceSlippi.h" #include "Core/HW/EXI/EXI_DeviceSlippi.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"
#include "Core/HW/SystemTimers.h" #include "Core/HW/SystemTimers.h"
@ -44,15 +45,14 @@
//#define LOCAL_TESTING //#define LOCAL_TESTING
//#define CREATE_DIFF_FILES //#define CREATE_DIFF_FILES
extern std::unique_ptr<SlippiPlaybackStatus> g_playbackStatus;
extern std::unique_ptr<SlippiReplayComm> g_replayComm;
namespace ExpansionInterface { namespace ExpansionInterface {
static std::unordered_map<u8, std::string> slippi_names; static std::unordered_map<u8, std::string> slippi_names;
static std::unordered_map<u8, std::string> slippi_connect_codes; static std::unordered_map<u8, std::string> slippi_connect_codes;
extern std::unique_ptr<SlippiPlaybackStatus> g_playbackStatus;
extern std::unique_ptr<SlippiReplayComm> g_replayComm;
template <typename T> bool isFutureReady(std::future<T>& t) template <typename T> bool isFutureReady(std::future<T>& t)
{ {
return t.wait_for(std::chrono::seconds(0)) == std::future_status::ready; return t.wait_for(std::chrono::seconds(0)) == std::future_status::ready;
@ -1988,7 +1988,7 @@ void CEXISlippi::handleLogInRequest()
if (!logInRes) if (!logInRes)
{ {
//#ifndef LINUX_LOCAL_DEV //#ifndef LINUX_LOCAL_DEV
//main_frame->LowerRenderWindow(); SLIPPITODO: figure out replacement. Host_LowerWindow();
//#endif //#endif
user->OpenLogInPage(); user->OpenLogInPage();
user->ListenForLogIn(); user->ListenForLogIn();
@ -2007,7 +2007,7 @@ void CEXISlippi::handleUpdateAppRequest()
#else #else
// main_frame->LowerRenderWindow(); SLIPPITODO: figure out replacement // mainwindow hide render widget // main_frame->LowerRenderWindow(); SLIPPITODO: figure out replacement // mainwindow hide render widget
user->UpdateApp(); user->UpdateApp();
main_frame->DoExit(); Host_Exit();
#endif #endif
} }
@ -2036,7 +2036,7 @@ void CEXISlippi::prepareOnlineStatus()
// Write connect code (10 bytes) // Write connect code (10 bytes)
std::string connectCode = userInfo.connectCode; std::string connectCode = userInfo.connectCode;
char shiftJisHashtag[] = { (char)0x81, (char)0x94, (char)0x00 }; char shiftJisHashtag[] = { '\x81', '\x94', '\x00' };
connectCode.resize(CONNECT_CODE_LENGTH); connectCode.resize(CONNECT_CODE_LENGTH);
connectCode = ReplaceAll(connectCode, "#", shiftJisHashtag); connectCode = ReplaceAll(connectCode, "#", shiftJisHashtag);
auto codeBuf = connectCode.c_str(); auto codeBuf = connectCode.c_str();

View file

@ -44,3 +44,5 @@ void Host_UpdateMainFrame();
void Host_UpdateTitle(const std::string& title); void Host_UpdateTitle(const std::string& title);
void Host_YieldToUI(); void Host_YieldToUI();
void Host_TitleChanged(); void Host_TitleChanged();
void Host_LowerWindow();
void Host_Exit();

View file

@ -106,6 +106,9 @@ void Host_TitleChanged()
#endif #endif
} }
void Host_LowerWindow() {}
void Host_Exit() {}
static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options) static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
{ {
std::string platform_name = static_cast<const char*>(options.get("platform")); std::string platform_name = static_cast<const char*>(options.get("platform"));

View file

@ -173,3 +173,13 @@ void Host_TitleChanged()
Discord::UpdateDiscordPresence(); Discord::UpdateDiscordPresence();
#endif #endif
} }
void Host_LowerWindow()
{
Host::GetInstance()->RequestLowerWindow();
}
void Host_Exit()
{
Host::GetInstance()->RequestExit();
}

View file

@ -37,6 +37,8 @@ signals:
void RequestRenderSize(int w, int h); void RequestRenderSize(int w, int h);
void UpdateDisasmDialog(); void UpdateDisasmDialog();
void NotifyMapLoaded(); void NotifyMapLoaded();
void RequestLowerWindow();
void RequestExit();
private: private:
Host(); Host();

View file

@ -57,7 +57,8 @@ RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent)
resize(w / dpr, h / dpr); resize(w / dpr, h / dpr);
}); });
connect(Host::GetInstance(), &Host::RequestLowerWindow, this, &RenderWidget::LowerWindow);
connect(Host::GetInstance(), &Host::RequestExit, this, &RenderWidget::Exit);
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) { connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
if (state == Core::State::Running) if (state == Core::State::Running)
SetImGuiKeyMap(); SetImGuiKeyMap();
@ -334,3 +335,18 @@ void RenderWidget::SetImGuiKeyMap()
for (auto entry : key_map) for (auto entry : key_map)
ImGui::GetIO().KeyMap[entry[0]] = entry[1] & 0x1FF; ImGui::GetIO().KeyMap[entry[0]] = entry[1] & 0x1FF;
} }
void RenderWidget::LowerWindow()
{
if (Config::Get(Config::MAIN_RENDER_TO_MAIN))
return;
lower();
}
void RenderWidget::Exit()
{
close();
}

View file

@ -29,6 +29,7 @@ signals:
void SizeChanged(int new_width, int new_height); void SizeChanged(int new_width, int new_height);
void FocusChanged(bool focus); void FocusChanged(bool focus);
private: private:
void HandleCursorTimer(); void HandleCursorTimer();
void OnHideCursorChanged(); void OnHideCursorChanged();
@ -38,6 +39,8 @@ private:
void SetImGuiKeyMap(); void SetImGuiKeyMap();
void dragEnterEvent(QDragEnterEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override; void dropEvent(QDropEvent* event) override;
void LowerWindow();
void Exit();
static constexpr int MOUSE_HIDE_DELAY = 3000; static constexpr int MOUSE_HIDE_DELAY = 3000;
QTimer* m_mouse_timer; QTimer* m_mouse_timer;

View file

@ -49,3 +49,9 @@ void Host_YieldToUI()
void Host_TitleChanged() void Host_TitleChanged()
{ {
} }
void Host_LowerWindow()
{
}
void Host_Exit()
{
}