mirror of
https://gitea.tendokyu.moe/Dniel97/segatools.git
synced 2024-11-23 21:10:57 +01:00
gfxhook: Fix some clang-tidy warnings
This commit is contained in:
parent
0702c306a6
commit
db5b264155
@ -1,7 +1,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "gfxhook/config.h"
|
#include "gfxhook/config.h"
|
||||||
|
@ -3,13 +3,11 @@
|
|||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gfxhook/gfx.h"
|
#include "gfxhook/gfx.h"
|
||||||
#include "gfxhook/util.h"
|
#include "gfxhook/util.h"
|
||||||
|
|
||||||
#include "hook/com-proxy.h"
|
|
||||||
#include "hook/table.h"
|
#include "hook/table.h"
|
||||||
|
|
||||||
#include "hooklib/dll.h"
|
#include "hooklib/dll.h"
|
||||||
@ -157,8 +155,8 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
|
|||||||
{
|
{
|
||||||
DXGI_SWAP_CHAIN_DESC *desc;
|
DXGI_SWAP_CHAIN_DESC *desc;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
LONG width;
|
UINT width;
|
||||||
LONG height;
|
UINT height;
|
||||||
|
|
||||||
dprintf("D3D11: D3D11CreateDeviceAndSwapChain hook hit\n");
|
dprintf("D3D11: D3D11CreateDeviceAndSwapChain hook hit\n");
|
||||||
|
|
||||||
@ -172,8 +170,6 @@ HRESULT WINAPI D3D11CreateDeviceAndSwapChain(
|
|||||||
height = desc->BufferDesc.Height;
|
height = desc->BufferDesc.Height;
|
||||||
} else {
|
} else {
|
||||||
hwnd = NULL;
|
hwnd = NULL;
|
||||||
width = 0;
|
|
||||||
height = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwnd != NULL) {
|
if (hwnd != NULL) {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "hook/com-proxy.h"
|
#include "hook/com-proxy.h"
|
||||||
@ -10,7 +9,6 @@
|
|||||||
|
|
||||||
#include "hooklib/dll.h"
|
#include "hooklib/dll.h"
|
||||||
|
|
||||||
#include "gfxhook/config.h"
|
|
||||||
#include "gfxhook/gfx.h"
|
#include "gfxhook/gfx.h"
|
||||||
#include "gfxhook/util.h"
|
#include "gfxhook/util.h"
|
||||||
|
|
||||||
@ -103,8 +101,6 @@ fail:
|
|||||||
if (d3d9 != NULL) {
|
if (d3d9 != NULL) {
|
||||||
FreeLibrary(d3d9);
|
FreeLibrary(d3d9);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirect3D9 * WINAPI Direct3DCreate9(UINT sdk_ver)
|
IDirect3D9 * WINAPI Direct3DCreate9(UINT sdk_ver)
|
||||||
|
@ -284,8 +284,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
|
|||||||
struct com_proxy *proxy;
|
struct com_proxy *proxy;
|
||||||
IDXGIFactory *real;
|
IDXGIFactory *real;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
LONG width;
|
UINT width;
|
||||||
LONG height;
|
UINT height;
|
||||||
|
|
||||||
dprintf("DXGI: IDXGIFactory::CreateSwapChain hook hit\n");
|
dprintf("DXGI: IDXGIFactory::CreateSwapChain hook hit\n");
|
||||||
|
|
||||||
@ -300,8 +300,6 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
|
|||||||
height = desc->BufferDesc.Height;
|
height = desc->BufferDesc.Height;
|
||||||
} else {
|
} else {
|
||||||
hwnd = NULL;
|
hwnd = NULL;
|
||||||
width = 0;
|
|
||||||
height = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwnd != NULL) {
|
if (hwnd != NULL) {
|
||||||
@ -323,8 +321,8 @@ static HRESULT STDMETHODCALLTYPE my_IDXGIFactory_CreateSwapChain(
|
|||||||
HWND_TOP,
|
HWND_TOP,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
width,
|
(int) width,
|
||||||
height,
|
(int) height,
|
||||||
SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
|
SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
|
||||||
|
|
||||||
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
|
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gfxhook/config.h"
|
#include "gfxhook/config.h"
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include "gfxhook/util.h"
|
#include "gfxhook/util.h"
|
||||||
|
|
||||||
#include "util/dprintf.h"
|
#include "util/dprintf.h"
|
||||||
@ -16,7 +14,7 @@ void gfx_util_ensure_win_visible(HWND hwnd)
|
|||||||
ShowWindow(hwnd, SW_RESTORE);
|
ShowWindow(hwnd, SW_RESTORE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height)
|
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height)
|
||||||
{
|
{
|
||||||
BOOL ok;
|
BOOL ok;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
@ -31,8 +29,8 @@ void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height)
|
|||||||
HWND_TOP,
|
HWND_TOP,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
width,
|
(int) width,
|
||||||
height,
|
(int) height,
|
||||||
SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
|
SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
void gfx_util_ensure_win_visible(HWND hwnd);
|
void gfx_util_ensure_win_visible(HWND hwnd);
|
||||||
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, LONG width, LONG height);
|
void gfx_util_borderless_fullscreen_windowed(HWND hwnd, UINT width, UINT height);
|
||||||
HRESULT gfx_util_frame_window(HWND hwnd);
|
HRESULT gfx_util_frame_window(HWND hwnd);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user