mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-14 22:03:27 +01:00
improve debug logs
This commit is contained in:
parent
79cfe0f466
commit
e3e7dc22e1
@ -27,6 +27,7 @@ void dbg_dump_dds_caps(DWORD caps);
|
||||
void dbg_dump_dds_flags(DWORD flags);
|
||||
void dbg_dump_dds_blt_fast_flags(DWORD flags);
|
||||
void dbg_dump_dds_lock_flags(DWORD flags);
|
||||
void dbg_dump_di_scm_flags(DWORD flags);
|
||||
char* dbg_d3d9_hr_to_str(HRESULT hr);
|
||||
char* dbg_mes_to_str(int id);
|
||||
void __cdecl dbg_invoke_watson(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t);
|
||||
|
22
src/debug.c
22
src/debug.c
@ -3,6 +3,7 @@
|
||||
#include <stdio.h>
|
||||
#include <d3d9.h>
|
||||
#include <time.h>
|
||||
#include "directinput.h"
|
||||
#include "ddraw.h"
|
||||
#include "dd.h"
|
||||
#include "ddsurface.h"
|
||||
@ -1086,6 +1087,27 @@ void dbg_dump_dds_lock_flags(DWORD flags)
|
||||
#endif
|
||||
}
|
||||
|
||||
void dbg_dump_di_scm_flags(DWORD flags)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (flags & DISCL_EXCLUSIVE) {
|
||||
TRACE(" DISCL_EXCLUSIVE\n");
|
||||
}
|
||||
if (flags & DISCL_NONEXCLUSIVE) {
|
||||
TRACE(" DISCL_NONEXCLUSIVE\n");
|
||||
}
|
||||
if (flags & DISCL_FOREGROUND) {
|
||||
TRACE(" DISCL_FOREGROUND\n");
|
||||
}
|
||||
if (flags & DISCL_BACKGROUND) {
|
||||
TRACE(" DISCL_BACKGROUND\n");
|
||||
}
|
||||
if (flags & DISCL_NOWINKEY) {
|
||||
TRACE(" DISCL_NOWINKEY\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
char* dbg_d3d9_hr_to_str(HRESULT hr)
|
||||
{
|
||||
#define HR_TO_STR(x) if (x == hr) return #x
|
||||
|
@ -54,6 +54,8 @@ static PROC hook_func(PROC* org_func, PROC new_func)
|
||||
static HRESULT WINAPI fake_did_SetCooperativeLevel(IDirectInputDeviceA* This, HWND hwnd, DWORD dwFlags)
|
||||
{
|
||||
TRACE("DirectInput SetCooperativeLevel(This=%p, hwnd=%p, dwFlags=0x%08X) [%p]\n", This, hwnd, dwFlags, _ReturnAddress());
|
||||
TRACE(" mouse_device = %s\n", This == g_mouse_device ? "TRUE" : "FALSE");
|
||||
dbg_dump_di_scm_flags(dwFlags);
|
||||
|
||||
if (This == g_mouse_device && g_ddraw.ref && (dwFlags & DISCL_EXCLUSIVE))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user