mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-11-30 02:56:42 -08:00
Detect D3D9 CreateDevice / CreateDeviceEx failures (#388)
## Link to GitHub Issue, if one exists #345 ## Description of change Show a block of warning text if the game crashes after CreateDevice(Ex) fails. ## Testing Tested by injecting invalid resolution into spicecfg.
This commit is contained in:
1 parent
b487cf2bcf
commit
d3fa27ae4a
3 files changed
+34
-1
No files matched your search
@@ -19,6 +19,7 @@
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "launcher/launcher.h"
|
||||
#include "launcher/options.h"
|
||||
#include "launcher/signal.h"
|
||||
#include "launcher/shutdown.h"
|
||||
#include "misc/clipboard.h"
|
||||
#include "misc/eamuse.h"
|
||||
@@ -775,6 +776,8 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3D9::CreateDevice(
|
||||
|
||||
// log error
|
||||
log_info("graphics::d3d9", "IDirect3D9::CreateDevice failed, hr={}", FMT_HRESULT(ret));
|
||||
launcher::signal::D3D9_CREATE_DEVICE_FAILED = true;
|
||||
launcher::signal::D3D9_CREATE_DEVICE_FAILED_HRESULT = ret;
|
||||
} else if (!D3D9_DEVICE_HOOK_DISABLE) {
|
||||
graphics_hook_window(hFocusWindow, pPresentationParameters);
|
||||
|
||||
@@ -994,6 +997,9 @@ HRESULT STDMETHODCALLTYPE WrappedIDirect3D9::CreateDeviceEx(
|
||||
|
||||
// log error
|
||||
log_warning("graphics::d3d9", "CreateDeviceEx failed, hr={}", FMT_HRESULT(result));
|
||||
launcher::signal::D3D9_CREATE_DEVICE_FAILED = true;
|
||||
launcher::signal::D3D9_CREATE_DEVICE_FAILED_HRESULT = result;
|
||||
|
||||
} else if (!D3D9_DEVICE_HOOK_DISABLE) {
|
||||
graphics_hook_window(hFocusWindow, pPresentationParameters);
|
||||
|
||||
|
||||
Reference in new issue
Block a user