Core: Change thread startCallback semantics to before reset

This commit is contained in:
Vicki Pfau 2017-08-04 08:17:35 -07:00
parent 1a74924023
commit 41e00148bf
2 changed files with 9 additions and 8 deletions

View File

@ -158,7 +158,6 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
};
core->addCoreCallbacks(core, &callbacks);
core->setSync(core, &threadContext->impl->sync);
core->reset(core);
struct mLogFilter filter;
if (!threadContext->logger.d.filter) {
@ -168,12 +167,13 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
}
mCoreThreadRewindParamsChanged(threadContext);
_changeState(threadContext->impl, THREAD_RUNNING, true);
if (threadContext->startCallback) {
threadContext->startCallback(threadContext);
}
core->reset(core);
_changeState(threadContext->impl, THREAD_RUNNING, true);
if (threadContext->resetCallback) {
threadContext->resetCallback(threadContext);
}

View File

@ -66,10 +66,6 @@ CoreController::CoreController(mCore* core, QObject* parent)
controller->m_override->apply(context->core);
}
if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) {
mCoreDeleteState(context->core, 0);
}
if (controller->m_multiplayer) {
controller->m_multiplayer->attachGame(controller);
}
@ -82,6 +78,11 @@ CoreController::CoreController(mCore* core, QObject* parent)
for (auto action : controller->m_resetActions) {
action();
}
if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) {
mCoreDeleteState(context->core, 0);
}
controller->m_resetActions.clear();
QSize size = controller->screenDimensions();