Skip to content

Commit

Permalink
Fixed input bug. Bad understanding of how the states actually set the…
Browse files Browse the repository at this point in the history
…ir offset to, fixed now
  • Loading branch information
Brandon Danyluk committed May 4, 2017
1 parent a4f0c5c commit f1e7d65
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fe/subsystems/gameState/gameStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ void fe::gameStateMachine::push(baseGameState *newState, stateOptions options)
{
m_endState->m_currentState->onDeactive();
}
// we set the offset here so we can free the memory past the previous state, and behind the current
m_endState->m_offset = fe::memoryManager::get().getStackAllocater().getMarker();


auto listBuf = FE_ALLOC_STACK("StateListAlloc", sizeof(stateList));
m_endState->m_head = new(listBuf) stateList();

Expand All @@ -79,6 +77,9 @@ void fe::gameStateMachine::push(baseGameState *newState, stateOptions options)
m_endState->m_currentState->onActive();
m_endState->m_options = options;

// we set the offset here so we can free the memory past the previous state, and behind the current
m_endState->m_offset = fe::memoryManager::get().getStackAllocater().getMarker();

m_update = false;
}

Expand Down

0 comments on commit f1e7d65

Please sign in to comment.