mirror of https://github.com/mgba-emu/mgba.git
Qt: Add API wrapper for VFileMemChunk
This commit is contained in:
parent
3c4929b798
commit
47de013283
|
@ -499,7 +499,7 @@ void CoreController::loadState(int slot) {
|
|||
mCoreThreadRunFunction(&m_threadContext, [](mCoreThread* context) {
|
||||
CoreController* controller = static_cast<CoreController*>(context->userData);
|
||||
if (!controller->m_backupLoadState.isOpen()) {
|
||||
controller->m_backupLoadState = VFileMemChunk(nullptr, 0);
|
||||
controller->m_backupLoadState = VFileDevice::openMemory();
|
||||
}
|
||||
mCoreSaveStateNamed(context->core, controller->m_backupLoadState, controller->m_saveStateFlags);
|
||||
if (mCoreLoadState(context->core, controller->m_stateSlot, controller->m_loadStateFlags)) {
|
||||
|
@ -518,7 +518,7 @@ void CoreController::loadState(const QString& path) {
|
|||
return;
|
||||
}
|
||||
if (!controller->m_backupLoadState.isOpen()) {
|
||||
controller->m_backupLoadState = VFileMemChunk(nullptr, 0);
|
||||
controller->m_backupLoadState = VFileDevice::openMemory();
|
||||
}
|
||||
mCoreSaveStateNamed(context->core, controller->m_backupLoadState, controller->m_saveStateFlags);
|
||||
if (mCoreLoadStateNamed(context->core, vf, controller->m_loadStateFlags)) {
|
||||
|
|
|
@ -518,7 +518,7 @@ bool FrameView::eventFilter(QObject*, QEvent* event) {
|
|||
void FrameView::refreshVl() {
|
||||
QMutexLocker locker(&m_mutex);
|
||||
m_currentFrame = m_nextFrame;
|
||||
m_nextFrame = VFileMemChunk(nullptr, 0);
|
||||
m_nextFrame = VFileDevice::openMemory();
|
||||
if (m_currentFrame) {
|
||||
m_controller->endVideoLog(false);
|
||||
QMetaObject::invokeMethod(this, "newVl");
|
||||
|
|
|
@ -78,9 +78,14 @@ VFile* VFileDevice::open(const QString& path, int mode) {
|
|||
return VFileOpen(path.toUtf8().constData(), mode);
|
||||
}
|
||||
|
||||
VFile* VFileDevice::openMemory() {
|
||||
return VFileMemChunk(nullptr, 0);
|
||||
}
|
||||
|
||||
VDir* VFileDevice::openDir(const QString& path) {
|
||||
return VDirOpen(path.toUtf8().constData());
|
||||
}
|
||||
|
||||
VDir* VFileDevice::openArchive(const QString& path) {
|
||||
return VDirOpenArchive(path.toUtf8().constData());
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
operator VFile*() { return m_vf; }
|
||||
|
||||
static VFile* open(const QString& path, int mode);
|
||||
static VFile* openMemory();
|
||||
static VDir* openDir(const QString& path);
|
||||
static VDir* openArchive(const QString& path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue