mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-15 03:51:14 +00:00
Remove dynamic_cast (#139)
This commit is contained in:
parent
9d06cd9e53
commit
9e3e039c3f
@ -356,14 +356,7 @@ MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO: This only seems to match if the type is not the same as the type of the
|
||||
// key value of the set. Figure out which type the set (or parameter) actually uses.
|
||||
// Also see call to .find in LegoPathController::FUN_10046050
|
||||
if (auto* locomotionPresenter = dynamic_cast<LegoLocomotionAnimPresenter*>(p_presenter)) {
|
||||
m_presenters.insert(locomotionPresenter);
|
||||
return 1;
|
||||
}
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid locomotion");
|
||||
m_presenters.insert(p_presenter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -372,17 +365,8 @@ MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter)
|
||||
MxU32 LegoPathBoundary::FUN_100586e0(LegoAnimPresenter* p_presenter)
|
||||
{
|
||||
if (p_presenter != NULL) {
|
||||
// TODO: This only seems to match if the type is not the same as the type of the
|
||||
// key value of the set. Figure out which type the set (or parameter) actually uses.
|
||||
// Also see call to .find in LegoPathController::FUN_10046050
|
||||
auto* locomotionPresenter = dynamic_cast<LegoLocomotionAnimPresenter*>(p_presenter);
|
||||
if (!locomotionPresenter) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid locomotion");
|
||||
return 0;
|
||||
}
|
||||
auto it = m_presenters.find(locomotionPresenter);
|
||||
if (it != m_presenters.end()) {
|
||||
m_presenters.erase(it);
|
||||
if (m_presenters.find(p_presenter) != m_presenters.end()) {
|
||||
m_presenters.erase(p_presenter);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user