Skip to content

Commit

Permalink
Fix Android and iOS builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Jan 14, 2024
1 parent 17ea036 commit 9c8ef70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Source/ui_android/NativeInterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include "http/java_net_URL.h"

CPS2VM* g_virtualMachine = nullptr;
CPS2VM::ProfileFrameDoneSignal::Connection g_ProfileFrameDoneConnection;
Framework::CSignal<void(uint32)>::Connection g_OnNewFrameConnection;
CPS2VM::NewFrameEvent::Connection g_OnNewFrameConnection;
CGSHandler::NewFrameEvent::Connection g_OnGsNewFrameConnection;
int g_currentGsHandlerId = -1;

#define PREF_VIDEO_GS_HANDLER ("video.gshandler")
Expand Down Expand Up @@ -116,7 +116,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_virtualapplications_play_NativeIntero
g_virtualMachine->Initialize();
g_virtualMachine->CreatePadHandler(CPH_Generic::GetFactoryFunction());
#ifdef PROFILE
g_ProfileFrameDoneConnection = g_virtualMachine->ProfileFrameDone.Connect(std::bind(&CStatsManager::OnProfileFrameDone, &CStatsManager::GetInstance(), std::placeholders::_1));
g_OnNewFrameConnection = g_virtualMachine->OnNewFrame.Connect(std::bind(&CStatsManager::OnNewFrame, &CStatsManager::GetInstance(), g_virtualMachine));
#endif
CAppConfig::GetInstance().RegisterPreferenceInteger(PREF_VIDEO_GS_HANDLER, PREFERENCE_VALUE_VIDEO_GS_HANDLER_OPENGL);
CAppConfig::GetInstance().RegisterPreferenceBoolean(PREF_AUDIO_ENABLEOUTPUT, true);
Expand Down Expand Up @@ -221,8 +221,8 @@ extern "C" JNIEXPORT void JNICALL Java_com_virtualapplications_play_NativeIntero
break;
}
g_currentGsHandlerId = gsHandlerId;
g_OnNewFrameConnection = g_virtualMachine->m_ee->m_gs->OnNewFrame.Connect(
std::bind(&CStatsManager::OnNewFrame, &CStatsManager::GetInstance(), g_virtualMachine, std::placeholders::_1));
g_OnGsNewFrameConnection = g_virtualMachine->m_ee->m_gs->OnNewFrame.Connect(
std::bind(&CStatsManager::OnGsNewFrame, &CStatsManager::GetInstance(), std::placeholders::_1));
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions Source/ui_ios/EmulatorViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include "../ui_shared/StatsManager.h"

CPS2VM* g_virtualMachine = nullptr;
CGSHandler::NewFrameEvent::Connection g_newFrameConnection;
CGSHandler::NewFrameEvent::Connection g_gsNewFrameConnection;
#ifdef PROFILE
CPS2VM::ProfileFrameDoneSignal::Connection g_profileFrameDoneConnection;
CPS2VM::NewFrameEvent::Connection g_newFrameConnection;
#endif

@interface EmulatorViewController () <SaveStateDelegate>
Expand Down Expand Up @@ -152,9 +152,9 @@ - (void)viewDidDisappear:(BOOL)animated
g_virtualMachine->Destroy();
delete g_virtualMachine;
g_virtualMachine = nullptr;
g_newFrameConnection.reset();
g_gsNewFrameConnection.reset();
#ifdef PROFILE
g_profileFrameDoneConnection.reset();
g_newFrameConnection.reset();
#endif
}

Expand Down Expand Up @@ -337,9 +337,9 @@ - (void)setupFpsCounterWithBounds:(CGRect)screenBounds
[self.view addSubview:self.profilerStatsLabel];
#endif

g_newFrameConnection = g_virtualMachine->GetGSHandler()->OnNewFrame.Connect(std::bind(&CStatsManager::OnNewFrame, &CStatsManager::GetInstance(), g_virtualMachine, std::placeholders::_1));
g_gsNewFrameConnection = g_virtualMachine->GetGSHandler()->OnNewFrame.Connect(std::bind(&CStatsManager::OnGsNewFrame, &CStatsManager::GetInstance(), std::placeholders::_1));
#ifdef PROFILE
g_profileFrameDoneConnection = g_virtualMachine->ProfileFrameDone.Connect(std::bind(&CStatsManager::OnProfileFrameDone, &CStatsManager::GetInstance(), std::placeholders::_1));
g_newFrameConnection = g_virtualMachine->OnNewFrame.Connect(std::bind(&CStatsManager::OnNewFrame, &CStatsManager::GetInstance(), g_virtualMachine));
#endif
self.fpsCounterTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateFpsCounter) userInfo:nil repeats:YES];
}
Expand Down

0 comments on commit 9c8ef70

Please sign in to comment.