mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2024-11-12 01:10:49 +01:00
iidxhook8: Refactor to use new d3d9 module
This commit is contained in:
parent
f4c0810ee3
commit
d9cc873eec
@ -10,6 +10,8 @@
|
||||
|
||||
#include "cconfig/cconfig-hook.h"
|
||||
|
||||
#include "hook/d3d9.h"
|
||||
|
||||
#include "hooklib/acp.h"
|
||||
#include "hooklib/adapter.h"
|
||||
#include "hooklib/app.h"
|
||||
@ -45,6 +47,32 @@ static const irp_handler_t iidxhook_handlers[] = {
|
||||
bio2_port_dispatch_irp,
|
||||
};
|
||||
|
||||
static const hook_d3d9_irp_handler_t iidxhook_d3d9_handlers[] = {
|
||||
iidxhook_util_d3d9_irp_handler,
|
||||
};
|
||||
|
||||
static void iidxhook8_setup_d3d9_hooks(const struct iidxhook_config_gfx* config_gfx)
|
||||
{
|
||||
struct iidxhook_util_d3d9_config d3d9_config;
|
||||
|
||||
iidxhook_util_d3d9_init_config(&d3d9_config);
|
||||
|
||||
d3d9_config.windowed = config_gfx->windowed;
|
||||
d3d9_config.framed = config_gfx->framed;
|
||||
d3d9_config.override_window_width = config_gfx->window_width;
|
||||
d3d9_config.override_window_height = config_gfx->window_height;
|
||||
d3d9_config.framerate_limit = config_gfx->frame_rate_limit;
|
||||
d3d9_config.pci_vid = config_gfx->pci_id_vid;
|
||||
d3d9_config.pci_pid = config_gfx->pci_id_pid;
|
||||
d3d9_config.scale_back_buffer_width = config_gfx->scale_back_buffer_width;
|
||||
d3d9_config.scale_back_buffer_height = config_gfx->scale_back_buffer_height;
|
||||
d3d9_config.scale_back_buffer_filter = config_gfx->scale_back_buffer_filter;
|
||||
|
||||
iidxhook_util_d3d9_configure(&d3d9_config);
|
||||
|
||||
hook_d3d9_init(iidxhook_d3d9_handlers, lengthof(iidxhook_d3d9_handlers));
|
||||
}
|
||||
|
||||
struct iidxhook8_config_io iidxhook8_config_io;
|
||||
|
||||
static bool my_dll_entry_init(char *sidcode, struct property_node *param)
|
||||
@ -81,23 +109,7 @@ static bool my_dll_entry_init(char *sidcode, struct property_node *param)
|
||||
log_info(IIDXHOOK8_INFO_HEADER);
|
||||
log_info("Initializing iidxhook...");
|
||||
|
||||
if (config_gfx.windowed) {
|
||||
d3d9_set_windowed(config_gfx.framed, config_gfx.window_width,
|
||||
config_gfx.window_height);
|
||||
}
|
||||
|
||||
if (config_gfx.pci_id_pid != 0 && config_gfx.pci_id_vid != 0) {
|
||||
d3d9_set_pci_id(config_gfx.pci_id_pid, config_gfx.pci_id_vid);
|
||||
}
|
||||
|
||||
if (config_gfx.frame_rate_limit > 0) {
|
||||
d3d9_set_frame_rate_limit(config_gfx.frame_rate_limit);
|
||||
}
|
||||
|
||||
if (config_gfx.scale_back_buffer_width > 0 && config_gfx.scale_back_buffer_height > 0) {
|
||||
d3d9_scale_back_buffer(config_gfx.scale_back_buffer_width, config_gfx.scale_back_buffer_height,
|
||||
config_gfx.scale_back_buffer_filter);
|
||||
}
|
||||
iidxhook8_setup_d3d9_hooks(&config_gfx);
|
||||
|
||||
/* Start up IIDXIO.DLL */
|
||||
if (!iidxhook8_config_io.disable_bio2_emu) {
|
||||
@ -187,7 +199,6 @@ BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
|
||||
|
||||
acp_hook_init();
|
||||
adapter_hook_init();
|
||||
d3d9_hook_init();
|
||||
|
||||
end:
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user