diff --git a/CMakeLists.txt b/CMakeLists.txt index 15388e93da..8062bcfd50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1676,7 +1676,6 @@ set(LinkCommon ${CoreLibName} ${CMAKE_THREAD_LIBS_INIT} ${nativeExtraLibs}) if(HEADLESS) add_executable(PPSSPPHeadless headless/Headless.cpp - UI/OnScreenDisplay.cpp headless/StubHost.h headless/Compare.cpp headless/Compare.h) @@ -1695,7 +1694,6 @@ if(UNITTEST) unittest/JitHarness.cpp Core/MIPS/ARM/ArmRegCache.cpp Core/MIPS/ARM/ArmRegCacheFPU.cpp - UI/OnScreenDisplay.cpp ) target_link_libraries(unitTest ${COCOA_LIBRARY} ${LinkCommon} Common) diff --git a/Core/Core.cpp b/Core/Core.cpp index d92c88a9e2..8beaecd685 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -57,8 +57,6 @@ static double lastActivity = 0.0; static double lastKeepAwake = 0.0; static GraphicsContext *graphicsContext; -extern InputState input_state; - void Core_SetGraphicsContext(GraphicsContext *ctx) { graphicsContext = ctx; } @@ -152,16 +150,16 @@ bool UpdateScreenScale(int width, int height, bool smallWindow) { return false; } -void UpdateRunLoop() { +void UpdateRunLoop(InputState *input_state) { if (windowHidden && g_Config.bPauseWhenMinimized) { sleep_ms(16); return; } - NativeUpdate(input_state); + NativeUpdate(*input_state); { - lock_guard guard(input_state.lock); - EndInputState(&input_state); + lock_guard guard(input_state->lock); + EndInputState(input_state); } if (GetUIState() != UISTATE_EXIT) { @@ -169,13 +167,13 @@ void UpdateRunLoop() { } } -void Core_RunLoop(GraphicsContext *ctx) { +void Core_RunLoop(GraphicsContext *ctx, InputState *input_state) { graphicsContext = ctx; while ((GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT) { time_update(); #if defined(USING_WIN_UI) double startTime = time_now_d(); - UpdateRunLoop(); + UpdateRunLoop(input_state); // Simple throttling to not burn the GPU in the menu. time_update(); @@ -187,13 +185,13 @@ void Core_RunLoop(GraphicsContext *ctx) { ctx->SwapBuffers(); } #else - UpdateRunLoop(); + UpdateRunLoop(input_state); #endif } while (!coreState && GetUIState() == UISTATE_INGAME) { time_update(); - UpdateRunLoop(); + UpdateRunLoop(input_state); #if defined(USING_WIN_UI) if (!windowHidden && !Core_IsStepping()) { ctx->SwapBuffers(); @@ -234,7 +232,7 @@ static inline void CoreStateProcessed() { } // Some platforms, like Android, do not call this function but handle things on their own. -void Core_Run(GraphicsContext *ctx) +void Core_Run(GraphicsContext *ctx, InputState *input_state) { #if defined(_DEBUG) host->UpdateDisassembly(); @@ -249,7 +247,7 @@ reswitch: if (GetUIState() == UISTATE_EXIT) { return; } - Core_RunLoop(ctx); + Core_RunLoop(ctx, input_state); #if defined(USING_QT_UI) && !defined(MOBILE_DEVICE) return; #else @@ -261,7 +259,7 @@ reswitch: { case CORE_RUNNING: // enter a fast runloop - Core_RunLoop(ctx); + Core_RunLoop(ctx, input_state); break; // We should never get here on Android. diff --git a/Core/Core.h b/Core/Core.h index 8b8edfa699..5398853de4 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -21,10 +21,11 @@ #include "Core/CoreParameter.h" class GraphicsContext; +struct InputState; // called from emu thread -void UpdateRunLoop(); -void Core_Run(GraphicsContext *ctx); +void UpdateRunLoop(GraphicsContext *input_state); +void Core_Run(GraphicsContext *ctx, InputState *input_state); void Core_Stop(); void Core_ErrorPause(); // For platforms that don't call Core_Run diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index ca0bc3b90a..d3a1474c6c 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -1,5 +1,4 @@ #include "i18n/i18n.h" -#include "UI/OnScreenDisplay.h" #include "Common/StringUtils.h" #include "Common/ChunkFile.h" #include "Common/FileUtil.h" @@ -7,6 +6,7 @@ #include "Core/CoreParameter.h" #include "Core/CwCheat.h" #include "Core/Config.h" +#include "Core/Host.h" #include "Core/MIPS/MIPS.h" #include "Core/ELF/ParamSFO.h" #include "Core/System.h" @@ -50,7 +50,7 @@ static void __CheatStart() { } if (!File::Exists(activeCheatFile)) { I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Unable to create cheat file, disk may be full")); + host->NotifyUserMessage(err->T("Unable to create cheat file, disk may be full")); } } diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 463715de81..162fb0c1e1 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -19,6 +19,7 @@ #include "base/logging.h" #include "Common/ChunkFile.h" #include "Core/Config.h" +#include "Core/Host.h" #include "Core/Reporting.h" #include "Core/System.h" #include "Core/Dialog/SavedataParam.h" @@ -30,7 +31,6 @@ #include "Core/ELF/ParamSFO.h" #include "Core/HW/MemoryStick.h" #include "Core/Util/PPGeDraw.h" -#include "UI/OnScreenDisplay.h" #include "image/png_load.h" @@ -372,7 +372,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &save if (!pspFileSystem.GetFileInfo(dirPath).exists) { if (!pspFileSystem.MkDir(dirPath)) { I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Unable to write savedata, disk may be full")); + host->NotifyUserMessage(err->T("Unable to write savedata, disk may be full")); } } @@ -397,7 +397,7 @@ bool SavedataParam::Save(SceUtilitySavedataParam* param, const std::string &save if (EncryptData(decryptMode, cryptedData, &cryptedSize, &aligned_len, cryptedHash, (HasKey(param) ? param->key : 0)) != 0) { I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Save encryption failed. This save won't work on real PSP"), 6.0f); + host->NotifyUserMessage(err->T("Save encryption failed. This save won't work on real PSP"), 6.0f); ERROR_LOG(SCEUTILITY,"Save encryption failed. This save won't work on real PSP"); delete[] cryptedData; cryptedData = 0; @@ -642,8 +642,8 @@ void SavedataParam::LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, u8 // Don't notify the user if we're not going to upgrade the save. if (!g_Config.bEncryptSave) { I18NCategory *di = GetI18NCategory("Dialog"); - osm.Show(di->T("When you save, it will load on a PSP, but not an older PPSSPP"), 6.0f); - osm.Show(di->T("Old savedata detected"), 6.0f); + host->NotifyUserMessage(di->T("When you save, it will load on a PSP, but not an older PPSSPP"), 6.0f); + host->NotifyUserMessage(di->T("Old savedata detected"), 6.0f); } } else { if (decryptMode == 5 && prevCryptMode == 3) { diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 329172b4c1..03a6385190 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -26,8 +26,8 @@ #include "Core/FileSystems/ISOFileSystem.h" #include "Core/HLE/sceKernel.h" #include "Core/HW/MemoryStick.h" +#include "Core/Host.h" #include "Core/Reporting.h" -#include "UI/OnScreenDisplay.h" #ifdef _WIN32 #include "Common/CommonWindows.h" @@ -223,7 +223,7 @@ bool DirectoryFileHandle::Open(std::string &basePath, std::string &fileName, Fil if (w32err == ERROR_DISK_FULL || w32err == ERROR_NOT_ENOUGH_QUOTA) { // This is returned when the disk is full. I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Disk full while writing data")); + host->NotifyUserMessage(err->T("Disk full while writing data")); error = SCE_KERNEL_ERROR_ERRNO_NO_PERM; } } @@ -278,7 +278,7 @@ bool DirectoryFileHandle::Open(std::string &basePath, std::string &fileName, Fil } else if (errno == ENOSPC) { // This is returned when the disk is full. I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Disk full while writing data")); + host->NotifyUserMessage(err->T("Disk full while writing data")); error = SCE_KERNEL_ERROR_ERRNO_NO_PERM; } #endif @@ -333,13 +333,13 @@ size_t DirectoryFileHandle::Write(const u8* pointer, s64 size) } if (diskFull) { - // Sign extend on 64-bit. ERROR_LOG(FILESYS, "Disk full"); I18NCategory *err = GetI18NCategory("Error"); - osm.Show(err->T("Disk full while writing data")); + host->NotifyUserMessage(err->T("Disk full while writing data")); // We only return an error when the disk is actually full. // When writing this would cause the disk to be full, so it wasn't written, we return 0. if (MemoryStick_FreeSpace() == 0) { + // Sign extend on 64-bit. return (size_t)(s64)(s32)SCE_KERNEL_ERROR_ERRNO_DEVICE_NO_FREE_SPACE; } } diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index b57a711218..e2a0aa54ed 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -24,10 +24,10 @@ #include #include "util/text/parsers.h" #include "Core/Core.h" +#include "Core/Host.h" #include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/sceKernelThread.h" #include "Core/HLE/sceKernelMemory.h" -#include "UI/OnScreenDisplay.h" #include "proAdhoc.h" #include "i18n/i18n.h" @@ -1419,7 +1419,7 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){ iResult = getaddrinfo(g_Config.proAdhocServer.c_str(),0,NULL,&resultAddr); if (iResult != 0) { ERROR_LOG(SCENET, "DNS Error (%s)\n", g_Config.proAdhocServer.c_str()); - osm.Show("DNS Error connecting to " + g_Config.proAdhocServer, 8.0f); + host->NotifyUserMessage("DNS Error connecting to " + g_Config.proAdhocServer, 8.0f); return iResult; } for (ptr = resultAddr; ptr != NULL; ptr = ptr->ai_next) { @@ -1442,7 +1442,7 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){ char buffer[512]; snprintf(buffer, sizeof(buffer), "Socket error (%i) when connecting to %s/%u.%u.%u.%u:%u", errno, g_Config.proAdhocServer.c_str(), sip[0], sip[1], sip[2], sip[3], ntohs(server_addr.sin_port)); ERROR_LOG(SCENET, "%s", buffer); - osm.Show(std::string(buffer), 8.0f); + host->NotifyUserMessage(buffer, 8.0f); return iResult; } @@ -1458,7 +1458,7 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){ changeBlockingMode(metasocket, 1); // Change to non-blocking if (sent > 0) { I18NCategory *n = GetI18NCategory("Networking"); - osm.Show(n->T("Network Initialized"), 1.0); + host->NotifyUserMessage(n->T("Network Initialized"), 1.0); return 0; } else{ diff --git a/Core/Host.h b/Core/Host.h index 6395769ff1..45c83c9c5c 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -64,6 +64,8 @@ public: virtual bool CanCreateShortcut() {return false;} virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title) {return false;} + virtual void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) {} + // Used for headless. virtual bool ShouldSkipUI() { return false; } virtual void SendDebugOutput(const std::string &output) {} diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index 7b3391d903..74a698b58a 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -20,7 +20,6 @@ #include "base/mutex.h" #include "base/timeutil.h" -#include "base/NativeApp.h" #include "i18n/i18n.h" #include "Common/FileUtil.h" @@ -44,7 +43,6 @@ #include "Core/MIPS/JitCommon/JitBlockCache.h" #include "HW/MemoryStick.h" #include "GPU/GPUState.h" -#include "UI/OnScreenDisplay.h" namespace SaveState { @@ -380,11 +378,7 @@ namespace SaveState void NextSlot() { - I18NCategory *sy = GetI18NCategory("System"); g_Config.iCurrentStateSlot = (g_Config.iCurrentStateSlot + 1) % NUM_SLOTS; - std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), g_Config.iCurrentStateSlot + 1); - osm.Show(msg); - NativeMessageReceived("slotchanged", ""); } void LoadSlot(const std::string &gameFilename, int slot, Callback callback, void *cbUserData) @@ -394,9 +388,8 @@ namespace SaveState Load(fn, callback, cbUserData); } else { I18NCategory *sy = GetI18NCategory("System"); - osm.Show(sy->T("Failed to load state. Error in the file system."), 2.0); if (callback) - callback(false, cbUserData); + callback(false, sy->T("Failed to load state. Error in the file system."), cbUserData); } } @@ -405,7 +398,7 @@ namespace SaveState std::string fn = GenerateSaveSlotFilename(gameFilename, slot, STATE_EXTENSION); std::string shot = GenerateSaveSlotFilename(gameFilename, slot, SCREENSHOT_EXTENSION); if (!fn.empty()) { - auto renameCallback = [=](bool status, void *data) { + auto renameCallback = [=](bool status, const std::string &message, void *data) { if (status) { if (File::Exists(fn)) { File::Delete(fn); @@ -413,17 +406,16 @@ namespace SaveState File::Rename(fn + ".tmp", fn); } if (callback) { - callback(status, data); + callback(status, message, data); } }; // Let's also create a screenshot. SaveScreenshot(shot, Callback(), 0); Save(fn + ".tmp", renameCallback, cbUserData); } else { - I18NCategory *sc = GetI18NCategory("Screen"); - osm.Show("Failed to save state. Error in the file system.", 2.0); + I18NCategory *sy = GetI18NCategory("System"); if (callback) - callback(false, cbUserData); + callback(false, sy->T("Failed to save state. Error in the file system."), cbUserData); } } @@ -569,6 +561,7 @@ namespace SaveState Operation &op = operations[i]; CChunkFileReader::Error result; bool callbackResult; + std::string callbackMessage; std::string reason; I18NCategory *sc = GetI18NCategory("Screen"); @@ -585,16 +578,16 @@ namespace SaveState INFO_LOG(COMMON, "Loading state from %s", op.filename.c_str()); result = CChunkFileReader::Load(op.filename, PPSSPP_GIT_VERSION, state, &reason); if (result == CChunkFileReader::ERROR_NONE) { - osm.Show(sc->T("Loaded State"), 2.0); + callbackMessage = sc->T("Loaded State"); callbackResult = true; hasLoadedState = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { HandleFailure(); - osm.Show(i18nLoadFailure, 2.0); + callbackMessage = i18nLoadFailure; ERROR_LOG(COMMON, "Load state failure: %s", reason.c_str()); callbackResult = false; } else { - osm.Show(sc->T(reason.c_str(), i18nLoadFailure), 2.0); + callbackMessage = sc->T(reason.c_str(), i18nLoadFailure); callbackResult = false; } break; @@ -603,45 +596,48 @@ namespace SaveState INFO_LOG(COMMON, "Saving state to %s", op.filename.c_str()); result = CChunkFileReader::Save(op.filename, g_paramSFO.GetValueString("TITLE"), PPSSPP_GIT_VERSION, state); if (result == CChunkFileReader::ERROR_NONE) { - - osm.Show(sc->T("Saved State"), 2.0); + callbackMessage = sc->T("Saved State"); callbackResult = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { HandleFailure(); - osm.Show(i18nSaveFailure, 2.0); + callbackMessage = i18nSaveFailure; ERROR_LOG(COMMON, "Save state failure: %s", reason.c_str()); callbackResult = false; } else { - osm.Show(i18nSaveFailure, 2.0); + callbackMessage = i18nSaveFailure; callbackResult = false; } break; case SAVESTATE_VERIFY: - INFO_LOG(COMMON, "Verifying save state system"); callbackResult = CChunkFileReader::Verify(state) == CChunkFileReader::ERROR_NONE; + if (callbackResult) { + INFO_LOG(COMMON, "Verified save state system"); + } else { + ERROR_LOG(COMMON, "Save state system verification failed"); + } break; case SAVESTATE_REWIND: INFO_LOG(COMMON, "Rewinding to recent savestate snapshot"); result = rewindStates.Restore(); if (result == CChunkFileReader::ERROR_NONE) { - osm.Show(sc->T("Loaded State"), 2.0); + callbackMessage = sc->T("Loaded State"); callbackResult = true; hasLoadedState = true; } else if (result == CChunkFileReader::ERROR_BROKEN_STATE) { // Cripes. Good news is, we might have more. Let's try those too, better than a reset. if (HandleFailure()) { // Well, we did rewind, even if too much... - osm.Show(sc->T("Loaded State"), 2.0); + callbackMessage = sc->T("Loaded State"); callbackResult = true; hasLoadedState = true; } else { - osm.Show(i18nLoadFailure, 2.0); + callbackMessage = i18nLoadFailure; callbackResult = false; } } else { - osm.Show(i18nLoadFailure, 2.0); + callbackMessage = i18nLoadFailure; callbackResult = false; } break; @@ -660,7 +656,7 @@ namespace SaveState } if (op.callback) - op.callback(callbackResult, op.cbUserData); + op.callback(callbackResult, callbackMessage, op.cbUserData); } if (operations.size()) { // Avoid triggering frame skipping due to slowdown diff --git a/Core/SaveState.h b/Core/SaveState.h index fa6220b224..741593bbba 100644 --- a/Core/SaveState.h +++ b/Core/SaveState.h @@ -23,7 +23,7 @@ namespace SaveState { - typedef std::function Callback; + typedef std::function Callback; static const int NUM_SLOTS = 5; static const char *STATE_EXTENSION = "ppst"; diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 20dd23a266..8cba489400 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -22,13 +22,13 @@ #include "Common/Common.h" #include "Core/Config.h" #include "Core/CoreParameter.h" +#include "Core/Host.h" #include "Core/Reporting.h" #include "Core/ELF/ParamSFO.h" #include "Core/System.h" #include "GPU/Common/FramebufferCommon.h" #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" -#include "UI/OnScreenDisplay.h" // Gross dependency! void CenterDisplayOutputRect(float *x, float *y, float *w, float *h, float origW, float origH, float frameW, float frameH, int rotation) { float outW; @@ -1012,5 +1012,5 @@ void FramebufferManagerCommon::ShowScreenResolution() { messageStream << gr->T("Window Size") << ": "; messageStream << PSP_CoreParameter().pixelWidth << "x" << PSP_CoreParameter().pixelHeight; - osm.Show(messageStream.str(), 2.0f, 0xFFFFFF, -1, true, "resize"); + host->NotifyUserMessage(messageStream.str(), 2.0f, 0xFFFFFF, "resize"); } \ No newline at end of file diff --git a/GPU/Directx9/ShaderManagerDX9.cpp b/GPU/Directx9/ShaderManagerDX9.cpp index 8a90a616b1..8c6fcaa5bf 100644 --- a/GPU/Directx9/ShaderManagerDX9.cpp +++ b/GPU/Directx9/ShaderManagerDX9.cpp @@ -22,12 +22,14 @@ #include #include "helper/global.h" #include "base/logging.h" +#include "i18n/i18n.h" #include "math/lin/matrix4x4.h" #include "math/math_util.h" #include "util/text/utf8.h" #include "Common/Common.h" #include "Core/Config.h" +#include "Core/Host.h" #include "Core/Reporting.h" #include "GPU/Math3D.h" #include "GPU/GPUState.h" @@ -35,7 +37,6 @@ #include "GPU/Directx9/ShaderManagerDX9.h" #include "GPU/Directx9/DrawEngineDX9.h" #include "GPU/Directx9/FramebufferDX9.h" -#include "UI/OnScreenDisplay.h" namespace DX9 { @@ -613,8 +614,9 @@ VSShader *ShaderManagerDX9::ApplyShader(int prim, u32 vertType) { vs = new VSShader(VSID, codeBuffer_, useHWTransform); if (vs->Failed()) { + I18NCategory *gr = GetI18NCategory("Graphics"); ERROR_LOG(HLE, "Shader compilation failed, falling back to software transform"); - osm.Show("hardware transform error - falling back to software", 2.5f, 0xFF3030FF, -1, true); + host->NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF); delete vs; ComputeVertexShaderID(&VSID, vertType, false); diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 8dad33f70d..4cf69c2599 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -46,8 +46,6 @@ #include "GPU/GLES/DrawEngineGLES.h" #include "GPU/GLES/ShaderManager.h" -#include "UI/OnScreenDisplay.h" - // #define DEBUG_READ_PIXELS 1 static const char tex_fs[] = @@ -180,9 +178,9 @@ void FramebufferManager::CompileDraw2DProgram() { } } if (!firstLine.empty()) { - osm.Show("Post-shader error: " + firstLine + "...", 10.0f, 0xFF3090FF); + host->NotifyUserMessage("Post-shader error: " + firstLine + "...", 10.0f, 0xFF3090FF); } else { - osm.Show("Post-shader error, see log for details", 10.0f, 0xFF3090FF); + host->NotifyUserMessage("Post-shader error, see log for details", 10.0f, 0xFF3090FF); } usePostShader_ = false; } else { diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp index 5b3f92c6f6..9e49c236dc 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManager.cpp @@ -26,12 +26,14 @@ #include "base/logging.h" #include "base/timeutil.h" +#include "i18n/i18n.h" #include "math/math_util.h" #include "math/lin/matrix4x4.h" #include "profiler/profiler.h" #include "Common/FileUtil.h" #include "Core/Config.h" +#include "Core/Host.h" #include "Core/Reporting.h" #include "GPU/Math3D.h" #include "GPU/GPUState.h" @@ -39,9 +41,7 @@ #include "GPU/GLES/GLStateCache.h" #include "GPU/GLES/ShaderManager.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "UI/OnScreenDisplay.h" #include "Framebuffer.h" -#include "i18n/i18n.h" Shader::Shader(const char *code, uint32_t glShaderType, bool useHWTransform) : failed_(false), useHWTransform_(useHWTransform) { @@ -845,7 +845,7 @@ Shader *ShaderManager::ApplyVertexShader(int prim, u32 vertType, ShaderID *VSID) if (vs->Failed()) { I18NCategory *gr = GetI18NCategory("Graphics"); ERROR_LOG(G3D, "Shader compilation failed, falling back to software transform"); - osm.Show(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF, -1, true); + host->NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF); delete vs; // TODO: Look for existing shader with the appropriate ID, use that instead of generating a new one - however, need to make sure diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index dfd436e0f8..956acad3a6 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -38,7 +38,6 @@ #include "GPU/GLES/ShaderManager.h" #include "GPU/GLES/DrawEngineGLES.h" #include "GPU/Common/TextureDecoder.h" -#include "UI/OnScreenDisplay.h" #ifdef _M_SSE #include @@ -1917,9 +1916,9 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &repla I18NCategory *err = GetI18NCategory("Error"); if (scaleFactor > 1) { - osm.Show(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f); + host->NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f); } else { - osm.Show(err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f); + host->NotifyUserMessage(err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f); } } else if (err != GL_NO_ERROR) { // We checked the err anyway, might as well log if there is one. diff --git a/GPU/Vulkan/FramebufferVulkan.cpp b/GPU/Vulkan/FramebufferVulkan.cpp index b16a90eab7..4aba64abd1 100644 --- a/GPU/Vulkan/FramebufferVulkan.cpp +++ b/GPU/Vulkan/FramebufferVulkan.cpp @@ -50,8 +50,6 @@ #include "GPU/Vulkan/ShaderManagerVulkan.h" #include "GPU/Vulkan/VulkanUtil.h" -#include "UI/OnScreenDisplay.h" - const VkFormat framebufFormat = VK_FORMAT_R8G8B8A8_UNORM; static const char tex_fs[] = R"(#version 400 diff --git a/GPU/Vulkan/ShaderManagerVulkan.cpp b/GPU/Vulkan/ShaderManagerVulkan.cpp index 18dd767c1e..e0397adc8f 100644 --- a/GPU/Vulkan/ShaderManagerVulkan.cpp +++ b/GPU/Vulkan/ShaderManagerVulkan.cpp @@ -39,7 +39,6 @@ #include "GPU/Vulkan/FramebufferVulkan.h" #include "GPU/Vulkan/FragmentShaderGeneratorVulkan.h" #include "GPU/Vulkan/VertexShaderGeneratorVulkan.h" -#include "UI/OnScreenDisplay.h" VulkanFragmentShader::VulkanFragmentShader(VulkanContext *vulkan, ShaderID id, const char *code, bool useHWTransform) : vulkan_(vulkan), id_(id), failed_(false), useHWTransform_(useHWTransform), module_(0) { diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 446290f917..2d0a03891c 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -42,7 +42,6 @@ #include "GPU/Vulkan/ShaderManagerVulkan.h" #include "GPU/Vulkan/DrawEngineVulkan.h" #include "GPU/Common/TextureDecoder.h" -#include "UI/OnScreenDisplay.h" #ifdef _M_SSE #include @@ -1360,9 +1359,9 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry,VulkanPushBuffe I18NCategory *err = GetI18NCategory("Error"); if (scaleFactor > 1) { - osm.Show(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f); + host->NotifyUserMessage(err->T("Warning: Video memory FULL, reducing upscaling and switching to slow caching mode"), 2.0f); } else { - osm.Show(err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f); + host->NotifyUserMessage(err->T("Warning: Video memory FULL, switching to slow caching mode"), 2.0f); } scaleFactor = 1; diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 8ae678ff14..2f4b139466 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -178,7 +178,7 @@ void MainWindow::closeAct() SetGameTitle(""); } -void SaveStateActionFinished(bool result, void *userdata) +void SaveStateActionFinished(bool result, const std::string &message, void *userdata) { // TODO: Improve messaging? if (!result) diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 06a3446eb6..81669500d5 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -73,6 +73,7 @@ EmuScreen::EmuScreen(const std::string &filename) : bootPending_(true), gamePath_(filename), invalid_(true), quit_(false), pauseTrigger_(false), saveStatePreviewShownTime_(0.0), saveStatePreview_(nullptr) { memset(axisState_, 0, sizeof(axisState_)); + saveStateSlot_ = SaveState::GetCurrentSlot(); } void EmuScreen::bootGame(const std::string &filename) { @@ -217,7 +218,14 @@ void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) { RecreateViews(); } -static void AfterStateLoad(bool success, void *ignored) { +static void AfterSaveStateAction(bool success, const std::string &message, void *) { + if (!message.empty()) { + osm.Show(message, 2.0); + } +} + +static void AfterStateBoot(bool success, const std::string &message, void *ignored) { + AfterSaveStateAction(success, message, ignored); Core_EnableStepping(false); host->UpdateDisassembly(); } @@ -251,7 +259,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) { } else if (!strcmp(message, "boot")) { const char *ext = strrchr(value, '.'); if (ext != nullptr && !strcmp(ext, ".ppst")) { - SaveState::Load(value, &AfterStateLoad); + SaveState::Load(value, &AfterStateBoot); } else { PSP_Shutdown(); bootPending_ = true; @@ -290,22 +298,6 @@ void EmuScreen::sendMessage(const char *message, const char *value) { } else { gstate_c.skipDrawReason &= ~SKIPDRAW_WINDOW_MINIMIZED; } - } else if (!strcmp(message, "slotchanged")) { - if (saveStatePreview_) { - int curSlot = SaveState::GetCurrentSlot(); - std::string fn; - if (SaveState::HasSaveInSlot(gamePath_, curSlot)) { - fn = SaveState::GenerateSaveSlotFilename(gamePath_, curSlot, SaveState::SCREENSHOT_EXTENSION); - } - - saveStatePreview_->SetFilename(fn); - if (!fn.empty()) { - saveStatePreview_->SetVisibility(UI::V_VISIBLE); - saveStatePreviewShownTime_ = time_now_d(); - } else { - saveStatePreview_->SetVisibility(UI::V_GONE); - } - } } } @@ -400,19 +392,20 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) { case VIRTKEY_REWIND: if (SaveState::CanRewind()) { - SaveState::Rewind(); + SaveState::Rewind(&AfterSaveStateAction); } else { osm.Show(sc->T("norewind", "No rewind save states available"), 2.0); } break; case VIRTKEY_SAVE_STATE: - SaveState::SaveSlot(gamePath_, g_Config.iCurrentStateSlot, SaveState::Callback()); + SaveState::SaveSlot(gamePath_, g_Config.iCurrentStateSlot, &AfterSaveStateAction); break; case VIRTKEY_LOAD_STATE: - SaveState::LoadSlot(gamePath_, g_Config.iCurrentStateSlot, SaveState::Callback()); + SaveState::LoadSlot(gamePath_, g_Config.iCurrentStateSlot, &AfterSaveStateAction); break; case VIRTKEY_NEXT_SLOT: SaveState::NextSlot(); + NativeMessageReceived("savestate_displayslot", ""); break; case VIRTKEY_TOGGLE_FULLSCREEN: System_SendMessage("toggle_fullscreen", ""); @@ -806,8 +799,34 @@ void EmuScreen::update(InputState &input) { screenManager()->push(new GamePauseScreen(gamePath_)); } - if (time_now_d() - saveStatePreviewShownTime_ > 2 && saveStatePreview_->GetVisibility() == UI::V_VISIBLE) { - saveStatePreview_->SetVisibility(UI::V_GONE); + if (saveStatePreview_) { + int currentSlot = SaveState::GetCurrentSlot(); + if (saveStateSlot_ != currentSlot) { + saveStateSlot_ = currentSlot; + + std::string fn; + if (SaveState::HasSaveInSlot(gamePath_, currentSlot)) { + fn = SaveState::GenerateSaveSlotFilename(gamePath_, currentSlot, SaveState::SCREENSHOT_EXTENSION); + } + + saveStatePreview_->SetFilename(fn); + if (!fn.empty()) { + saveStatePreview_->SetVisibility(UI::V_VISIBLE); + saveStatePreviewShownTime_ = time_now_d(); + } else { + saveStatePreview_->SetVisibility(UI::V_GONE); + } + } + + if (saveStatePreview_->GetVisibility() == UI::V_VISIBLE) { + double endTime = saveStatePreviewShownTime_ + 2.0; + float alpha = clamp_value((endTime - time_now_d()) * 4.0, 0.0, 1.0); + saveStatePreview_->SetColor(colorAlpha(0x00FFFFFF, alpha)); + + if (time_now_d() - saveStatePreviewShownTime_ > 2) { + saveStatePreview_->SetVisibility(UI::V_GONE); + } + } } } @@ -1012,7 +1031,7 @@ void EmuScreen::autoLoad() { //check if save state has save, if so, load int lastSlot = SaveState::GetNewestSlot(gamePath_); if (g_Config.bEnableAutoLoad && lastSlot != -1) { - SaveState::LoadSlot(gamePath_, lastSlot, SaveState::Callback(), 0); + SaveState::LoadSlot(gamePath_, lastSlot, &AfterSaveStateAction); g_Config.iCurrentStateSlot = lastSlot; } } diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 690f86261a..f530b7e4d5 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -89,4 +89,5 @@ private: double saveStatePreviewShownTime_; AsyncImageFileView *saveStatePreview_; + int saveStateSlot_; }; diff --git a/UI/HostTypes.h b/UI/HostTypes.h index 3d18d9b681..d591a60d58 100644 --- a/UI/HostTypes.h +++ b/UI/HostTypes.h @@ -18,6 +18,7 @@ #pragma once #include "Core/Host.h" +#include "UI/OnScreenDisplay.h" #if !defined(MOBILE_DEVICE) && defined(USING_QT_UI) #include "Core/Debugger/SymbolMap.h" @@ -50,6 +51,10 @@ public: bool IsDebuggingEnabled() override {return false;} bool AttemptLoadSymbolMap() override {return false;} void SetWindowTitle(const char *message) override {} + + void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { + osm.Show(message, duration, color, -1, true, id); + } }; #if !defined(MOBILE_DEVICE) && defined(USING_QT_UI) @@ -126,6 +131,11 @@ public: mainWindow->setWindowTitle(title); } + + void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { + osm.Show(message, duration, color, -1, true, id); + } + bool GPUDebuggingActive() { auto dialogDisplayList = mainWindow->GetDialogDisplaylist(); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 9aea371320..5e5bbb27fc 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -489,8 +489,13 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch } #endif - if (!boot_filename.empty() && stateToLoad != NULL) - SaveState::Load(stateToLoad); + if (!boot_filename.empty() && stateToLoad != NULL) { + SaveState::Load(stateToLoad, [](bool status, const std::string &message, void *) { + if (!message.empty()) { + osm.Show(message, 2.0); + } + }); + } screenManager = new ScreenManager(); if (skipLogo) { @@ -766,6 +771,12 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { g_Config.sNickName = inputboxValue[1]; inputboxValue.clear(); } + if (msg == "savestate_displayslot") { + I18NCategory *sy = GetI18NCategory("System"); + std::string msg = StringFromFormat("%s: %d", sy->T("Savestate Slot"), SaveState::GetCurrentSlot() + 1); + // Show for the same duration as the preview. + osm.Show(msg, 2.0f, 0xFFFFFF, -1, true, "savestate_slot"); + } } void NativeUpdate(InputState &input) { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 609c5b3aef..6be177c889 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -40,6 +40,7 @@ #include "UI/ReportScreen.h" #include "UI/CwCheatScreen.h" #include "UI/MainScreen.h" +#include "UI/OnScreenDisplay.h" #include "UI/GameInfoCache.h" void AsyncImageFileView::GetContentDimensions(const UIContext &dc, float &w, float &h) const { @@ -224,9 +225,15 @@ void SaveSlotView::Draw(UIContext &dc) { UI::LinearLayout::Draw(dc); } +static void AfterSaveStateAction(bool status, const std::string &message, void *) { + if (!message.empty()) { + osm.Show(message, 2.0); + } +} + UI::EventReturn SaveSlotView::OnLoadState(UI::EventParams &e) { g_Config.iCurrentStateSlot = slot_; - SaveState::LoadSlot(gamePath_, slot_, SaveState::Callback(), 0); + SaveState::LoadSlot(gamePath_, slot_, &AfterSaveStateAction); UI::EventParams e2; e2.v = this; OnStateLoaded.Trigger(e2); @@ -235,7 +242,7 @@ UI::EventReturn SaveSlotView::OnLoadState(UI::EventParams &e) { UI::EventReturn SaveSlotView::OnSaveState(UI::EventParams &e) { g_Config.iCurrentStateSlot = slot_; - SaveState::SaveSlot(gamePath_, slot_, SaveState::Callback(), 0); + SaveState::SaveSlot(gamePath_, slot_, &AfterSaveStateAction); UI::EventParams e2; e2.v = this; OnStateSaved.Trigger(e2); @@ -389,7 +396,7 @@ UI::EventReturn GamePauseScreen::OnReportFeedback(UI::EventParams &e) { } UI::EventReturn GamePauseScreen::OnRewind(UI::EventParams &e) { - SaveState::Rewind(SaveState::Callback(), 0); + SaveState::Rewind(&AfterSaveStateAction); screenManager()->finishDialog(this, DR_CANCEL); return UI::EVENT_DONE; diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 596eba30a8..8fbcf5c79f 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -60,6 +60,7 @@ + diff --git a/UI/UI.vcxproj.filters b/UI/UI.vcxproj.filters index 72f02e5b73..4ee956b350 100644 --- a/UI/UI.vcxproj.filters +++ b/UI/UI.vcxproj.filters @@ -132,6 +132,7 @@ Screens + diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index eaf5fc81f5..33ce542869 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -192,7 +192,7 @@ unsigned int WINAPI TheThread(void *) if (!Core_IsActive()) UpdateUIState(UISTATE_MENU); - Core_Run(graphicsContext); + Core_Run(graphicsContext, &input_state); } shutdown: diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index a78d3b784f..c70e7f72de 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -400,7 +400,10 @@ namespace MainWindow { g_Config.iInternalScreenRotation = rotation; } - static void SaveStateActionFinished(bool result, void *userdata) { + static void SaveStateActionFinished(bool result, const std::string &message, void *userdata) { + if (!message.empty()) { + osm.Show(message, 2.0); + } PostMessage(MainWindow::GetHWND(), WM_USER_SAVESTATE_FINISH, 0, 0); } @@ -580,6 +583,7 @@ namespace MainWindow { case ID_FILE_SAVESTATE_NEXT_SLOT: { SaveState::NextSlot(); + NativeMessageReceived("savestate_displayslot", ""); break; } @@ -588,6 +592,7 @@ namespace MainWindow { if (KeyMap::g_controllerMap[VIRTKEY_NEXT_SLOT].empty()) { SaveState::NextSlot(); + NativeMessageReceived("savestate_displayslot", ""); } break; } diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 9121e630b4..d2d7582389 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -34,10 +34,12 @@ #include "input/keycodes.h" #include "util/text/utf8.h" +#include "Common/StringUtils.h" #include "Core/Core.h" #include "Core/Config.h" #include "Core/CoreParameter.h" #include "Core/System.h" +#include "Core/Debugger/SymbolMap.h" #include "Windows/EmuThread.h" #include "Windows/DSoundStream.h" #include "Windows/WindowsHost.h" @@ -54,10 +56,8 @@ #include "Windows/XinputDevice.h" #include "Windows/KeyboardDevice.h" -#include "Core/Debugger/SymbolMap.h" - -#include "Common/StringUtils.h" #include "Windows/main.h" +#include "UI/OnScreenDisplay.h" static const int numCPUs = 1; @@ -348,3 +348,7 @@ void WindowsHost::GoFullscreen(bool viewFullscreen) { void WindowsHost::ToggleDebugConsoleVisibility() { MainWindow::ToggleDebugConsoleVisibility(); } + +void WindowsHost::NotifyUserMessage(const std::string &message, float duration, u32 color, const char *id) { + osm.Show(message, duration, color, -1, true, id); +} diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index ed00d060f0..df95185ddc 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -64,6 +64,8 @@ public: bool CanCreateShortcut() override; bool CreateDesktopShortcut(std::string argumentPath, std::string title) override; + void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override; + void GoFullscreen(bool) override; std::shared_ptr keyboard; diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 1a10dcc739..3cdb8d29b3 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -169,7 +169,6 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/MIPS/IR/IRPassSimplify.cpp \ $(SRC)/Core/MIPS/IR/IRRegCache.cpp \ $(SRC)/UI/ui_atlas.cpp \ - $(SRC)/UI/OnScreenDisplay.cpp \ $(SRC)/ext/libkirk/AES.c \ $(SRC)/ext/libkirk/amctrl.c \ $(SRC)/ext/libkirk/SHA1.c \ @@ -411,6 +410,7 @@ LOCAL_SRC_FILES := \ $(SRC)/UI/TouchControlVisibilityScreen.cpp \ $(SRC)/UI/CwCheatScreen.cpp \ $(SRC)/UI/InstallZipScreen.cpp \ + $(SRC)/UI/OnScreenDisplay.cpp \ $(SRC)/UI/ProfilerDraw.cpp \ $(SRC)/UI/NativeApp.cpp \ $(SRC)/UI/ComboKeyMappingScreen.cpp diff --git a/ext/native/base/BlackberryMain.cpp b/ext/native/base/BlackberryMain.cpp index 3de6a62502..bdf357475a 100644 --- a/ext/native/base/BlackberryMain.cpp +++ b/ext/native/base/BlackberryMain.cpp @@ -348,7 +348,7 @@ void BlackberryMain::runMain() { switchDisplay(screen_ui); } time_update(); - UpdateRunLoop(); + UpdateRunLoop(&input_state); // This handles VSync if (emulating) eglSwapBuffers(egl_disp[screen_emu], egl_surf[screen_emu]); diff --git a/ext/native/base/PCMain.cpp b/ext/native/base/PCMain.cpp index 2f0d1ad995..cead0d7713 100644 --- a/ext/native/base/PCMain.cpp +++ b/ext/native/base/PCMain.cpp @@ -859,7 +859,7 @@ int main(int argc, char *argv[]) { SimulateGamepad(keys, &input_state); input_state.pad_buttons = pad_buttons; UpdateInputState(&input_state, true); - UpdateRunLoop(); + UpdateRunLoop(&input_state); if (g_QuitRequested) break; #if defined(PPSSPP) && !defined(MOBILE_DEVICE) diff --git a/ext/native/base/QtMain.cpp b/ext/native/base/QtMain.cpp index 6cd15fdd84..cad9257f6a 100644 --- a/ext/native/base/QtMain.cpp +++ b/ext/native/base/QtMain.cpp @@ -360,7 +360,7 @@ void MainUI::paintGL() updateAccelerometer(); UpdateInputState(&input_state); time_update(); - UpdateRunLoop(); + UpdateRunLoop(&input_state); } void MainUI::updateAccelerometer() diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 2cf222d05a..19bf4bea1f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -66,14 +66,9 @@ public: struct InputState; // Temporary hacks around annoying linking errors. -void D3D9_SwapBuffers() { } -void GL_SwapBuffers() { } -void GL_SwapInterval(int) { } -void Vulkan_SwapBuffers() {} void NativeUpdate(InputState &input_state) { } void NativeRender(GraphicsContext *graphicsContext) { } void NativeResized() { } -void NativeMessageReceived(const char *message, const char *value) {} std::string System_GetProperty(SystemProperty prop) { return ""; } int System_GetPropertyInt(SystemProperty prop) { return -1; } @@ -82,8 +77,6 @@ bool System_InputBoxGetWString(const wchar_t *title, const std::wstring &default void System_AskForPermission(SystemPermission permission) {} PermissionStatus System_GetPermissionStatus(SystemPermission permission) { return PERMISSION_STATUS_GRANTED; } -InputState input_state; - int printUsage(const char *progname, const char *reason) { if (reason != NULL) diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index c1ae2d41fa..ce1048f8be 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -224,7 +224,6 @@ - @@ -266,7 +265,6 @@ - diff --git a/headless/Headless.vcxproj.filters b/headless/Headless.vcxproj.filters index d699015802..65c3c90c80 100644 --- a/headless/Headless.vcxproj.filters +++ b/headless/Headless.vcxproj.filters @@ -3,7 +3,6 @@ - Windows @@ -28,7 +27,6 @@ - Windows diff --git a/unittest/JitHarness.cpp b/unittest/JitHarness.cpp index 2467a27c0b..f2bd4925e6 100644 --- a/unittest/JitHarness.cpp +++ b/unittest/JitHarness.cpp @@ -33,8 +33,6 @@ struct InputState; // Temporary hacks around annoying linking errors. Copied from Headless. -void D3D9_SwapBuffers() { } -void GL_SwapBuffers() { } void NativeUpdate(InputState &input_state) { } void NativeRender(GraphicsContext *graphicsContext) { } void NativeResized() { } diff --git a/unittest/UnitTest.cpp b/unittest/UnitTest.cpp index 3c8d6ccd40..f1716ab2bd 100644 --- a/unittest/UnitTest.cpp +++ b/unittest/UnitTest.cpp @@ -48,13 +48,8 @@ #include "unittest/TestVertexJit.h" #include "unittest/UnitTest.h" -InputState input_state; - std::string System_GetProperty(SystemProperty prop) { return ""; } int System_GetPropertyInt(SystemProperty prop) { return -1; } -void NativeMessageReceived(const char *message, const char *value) {} -void GL_SwapInterval(int) {} -void Vulkan_SwapBuffers() {} #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923