2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +00:00

MP1: Migrate from std::bind to lambdas

Provides a more straightforward means of supplying custom behavior in
place. Lambdas also typically optimize better compared to std::bind
objects.
This commit is contained in:
Lioncash
2019-08-14 03:45:28 -04:00
parent cf294db9eb
commit 8b7945e76f
8 changed files with 70 additions and 77 deletions

View File

@@ -79,10 +79,10 @@ void CPauseScreen::InitializeFrameGlue() {
deco->SetColor(color);
}
x34_loadedPauseScreenInstructions->SetMouseDownCallback(std::bind(&CPauseScreen::OnWidgetMouseDown, this,
std::placeholders::_1, std::placeholders::_2));
x34_loadedPauseScreenInstructions->SetMouseUpCallback(std::bind(&CPauseScreen::OnWidgetMouseUp, this,
std::placeholders::_1, std::placeholders::_2));
x34_loadedPauseScreenInstructions->SetMouseDownCallback(
[this](CGuiWidget* caller, bool resume) { OnWidgetMouseDown(caller, resume); });
x34_loadedPauseScreenInstructions->SetMouseUpCallback(
[this](CGuiWidget* caller, bool cancel) { OnWidgetMouseUp(caller, cancel); });
}
bool CPauseScreen::CheckLoadComplete(const CStateManager& mgr) {