Better, C++11 style initialization of m_threadContext

This commit is contained in:
Jeffrey Pfau 2014-10-15 01:40:16 -07:00
parent 7d8041cb58
commit ae256542cb
1 changed files with 10 additions and 10 deletions

View File

@ -16,6 +16,15 @@ using namespace QGBA;
GameController::GameController(QObject* parent) GameController::GameController(QObject* parent)
: QObject(parent) : QObject(parent)
, m_drawContext(new uint32_t[256 * 256]) , m_drawContext(new uint32_t[256 * 256])
, m_threadContext {
.state = THREAD_INITIALIZED,
.debugger = 0,
.frameskip = 0,
.bios = 0,
.userData = this,
.rewindBufferCapacity = 0,
.logLevel = -1,
}
, m_activeKeys(0) , m_activeKeys(0)
, m_rom(nullptr) , m_rom(nullptr)
, m_audioThread(new QThread(this)) , m_audioThread(new QThread(this))
@ -25,16 +34,7 @@ GameController::GameController(QObject* parent)
GBAVideoSoftwareRendererCreate(m_renderer); GBAVideoSoftwareRendererCreate(m_renderer);
m_renderer->outputBuffer = (color_t*) m_drawContext; m_renderer->outputBuffer = (color_t*) m_drawContext;
m_renderer->outputBufferStride = 256; m_renderer->outputBufferStride = 256;
m_threadContext = { m_threadContext.renderer = &m_renderer->d;
.state = THREAD_INITIALIZED,
.debugger = 0,
.frameskip = 0,
.bios = 0,
.renderer = &m_renderer->d,
.userData = this,
.rewindBufferCapacity = 0,
.logLevel = -1,
};
GBAInputMapInit(&m_threadContext.inputMap); GBAInputMapInit(&m_threadContext.inputMap);