102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
mods_private.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <windows.h>
#include <SDL3/SDL.h>
#include <dttr_mods.h>

Go to the source code of this file.

Data Structures

struct  mod_file_id
struct  loaded_mod

Macros

#define MODS_MAX   32u

Functions

void dttr_mods_init ()
void dttr_mods_tick ()
void dttr_mods_late_init ()
void dttr_mods_frame_begin (const DTTR_Mods_FrameContext *ctx)
void dttr_mods_before_game_frame (const DTTR_Mods_FrameContext *ctx)
void dttr_mods_after_game_frame (const DTTR_Mods_FrameContext *ctx)
void dttr_mods_before_present (const DTTR_Mods_PresentContext *ctx)
void dttr_mods_after_present (const DTTR_Mods_PresentContext *ctx)
void dttr_mods_frame_end (const DTTR_Mods_FrameContext *ctx)
void dttr_mods_imgui_begin (const DTTR_Mods_RenderContext *ctx)
void dttr_mods_imgui_end (const DTTR_Mods_RenderContext *ctx)
void dttr_mods_overlay_visible_changed (bool visible)
void dttr_mods_window_created (const DTTR_Mods_WindowContext *ctx)
void dttr_mods_window_resized (const DTTR_Mods_WindowContext *ctx)
void dttr_mods_window_destroying (const DTTR_Mods_WindowContext *ctx)
void dttr_mods_graphics_device_created (const DTTR_Mods_GraphicsContext *ctx)
void dttr_mods_graphics_device_lost (const DTTR_Mods_GraphicsContext *ctx)
void dttr_mods_graphics_device_restored (const DTTR_Mods_GraphicsContext *ctx)
void dttr_mods_graphics_device_destroying (const DTTR_Mods_GraphicsContext *ctx)
bool dttr_mods_before_event (const SDL_Event *event)
void dttr_mods_after_event (const SDL_Event *event, bool consumed)
void dttr_mods_input_mode_changed (const DTTR_Mods_InputContext *ctx)
bool dttr_mods_should_advance_game_frame ()
void dttr_mods_game_frame_advanced ()
void dttr_mods_game_frame_blocked ()
bool dttr_mods_has_render_game ()
void dttr_mods_render_game (const DTTR_Mods_RenderGameContext *ctx)
void dttr_mods_render (const DTTR_Mods_RenderContext *ctx)
bool dttr_mods_handle_event (const SDL_Event *event)
size_t dttr_mods_loaded_count ()
const char * dttr_mods_loaded_name (size_t index)
DWORD dttr_mods_loaded_elapsed_ms (size_t index)
bool dttr_mods_hot_reload_enabled ()
void dttr_mods_cleanup ()

Macro Definition Documentation

◆ MODS_MAX

#define MODS_MAX   32u

Definition at line 46 of file mods_private.h.

Referenced by load_mod(), and scan_mods().

Function Documentation

◆ dttr_mods_after_event()

void dttr_mods_after_event ( const SDL_Event * event,
bool consumed )

Definition at line 708 of file mods.c.

References event, and MOD_DISPATCH.

◆ dttr_mods_after_game_frame()

void dttr_mods_after_game_frame ( const DTTR_Mods_FrameContext * ctx)

Definition at line 630 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_after_present()

void dttr_mods_after_present ( const DTTR_Mods_PresentContext * ctx)

Definition at line 638 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_before_event()

bool dttr_mods_before_event ( const SDL_Event * event)

Definition at line 704 of file mods.c.

References dispatch_event_until_consumed(), and event.

Referenced by dttr_sidecar_handle_sdl_event().

◆ dttr_mods_before_game_frame()

void dttr_mods_before_game_frame ( const DTTR_Mods_FrameContext * ctx)

Definition at line 626 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_before_present()

void dttr_mods_before_present ( const DTTR_Mods_PresentContext * ctx)

Definition at line 634 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_cleanup()

void dttr_mods_cleanup ( )

Definition at line 788 of file mods.c.

References remove_all_mods().

Referenced by cleanup_runtime().

◆ dttr_mods_frame_begin()

void dttr_mods_frame_begin ( const DTTR_Mods_FrameContext * ctx)

Definition at line 622 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_frame_end()

void dttr_mods_frame_end ( const DTTR_Mods_FrameContext * ctx)

Definition at line 642 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_game_frame_advanced()

void dttr_mods_game_frame_advanced ( )

Definition at line 733 of file mods.c.

References MOD_DISPATCH.

Referenced by tick_main_loop().

◆ dttr_mods_game_frame_blocked()

void dttr_mods_game_frame_blocked ( )

Definition at line 737 of file mods.c.

References MOD_DISPATCH.

Referenced by tick_main_loop().

◆ dttr_mods_graphics_device_created()

void dttr_mods_graphics_device_created ( const DTTR_Mods_GraphicsContext * ctx)

Definition at line 670 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_graphics_device_destroying()

void dttr_mods_graphics_device_destroying ( const DTTR_Mods_GraphicsContext * ctx)

Definition at line 682 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_graphics_device_lost()

void dttr_mods_graphics_device_lost ( const DTTR_Mods_GraphicsContext * ctx)

Definition at line 674 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_graphics_device_restored()

void dttr_mods_graphics_device_restored ( const DTTR_Mods_GraphicsContext * ctx)

Definition at line 678 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_handle_event()

bool dttr_mods_handle_event ( const SDL_Event * event)

Definition at line 759 of file mods.c.

References dispatch_event_until_consumed(), and event.

Referenced by dttr_sidecar_handle_sdl_event().

◆ dttr_mods_has_render_game()

bool dttr_mods_has_render_game ( )

Definition at line 741 of file mods.c.

◆ dttr_mods_hot_reload_enabled()

bool dttr_mods_hot_reload_enabled ( )

Definition at line 784 of file mods.c.

References dttr_config.

◆ dttr_mods_imgui_begin()

void dttr_mods_imgui_begin ( const DTTR_Mods_RenderContext * ctx)

Definition at line 646 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_imgui_end()

void dttr_mods_imgui_end ( const DTTR_Mods_RenderContext * ctx)

Definition at line 650 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_init()

void dttr_mods_init ( )

Definition at line 592 of file mods.c.

References DTTR_LOG_INFO, resolve_mods_dir(), and scan_mods().

Referenced by DTTR_Hook_WinMainCallback().

◆ dttr_mods_input_mode_changed()

void dttr_mods_input_mode_changed ( const DTTR_Mods_InputContext * ctx)

Definition at line 712 of file mods.c.

References ctx, and MOD_DISPATCH.

Referenced by DTTR_Hook_WinMainCallback().

◆ dttr_mods_late_init()

void dttr_mods_late_init ( )

Definition at line 618 of file mods.c.

References MOD_DISPATCH.

Referenced by DTTR_Hook_WinMainCallback().

◆ dttr_mods_loaded_count()

size_t dttr_mods_loaded_count ( )

Definition at line 763 of file mods.c.

◆ dttr_mods_loaded_elapsed_ms()

DWORD dttr_mods_loaded_elapsed_ms ( size_t index)

Definition at line 776 of file mods.c.

References DWORD.

◆ dttr_mods_loaded_name()

const char * dttr_mods_loaded_name ( size_t index)

Definition at line 767 of file mods.c.

References loaded_mod::display_name, loaded_mod::filename, and NULL.

◆ dttr_mods_overlay_visible_changed()

void dttr_mods_overlay_visible_changed ( bool visible)

Definition at line 654 of file mods.c.

References MOD_DISPATCH.

Referenced by DTTR_Hook_WinMainCallback().

◆ dttr_mods_render()

void dttr_mods_render ( const DTTR_Mods_RenderContext * ctx)

Definition at line 755 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_render_game()

void dttr_mods_render_game ( const DTTR_Mods_RenderGameContext * ctx)

Definition at line 751 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_should_advance_game_frame()

bool dttr_mods_should_advance_game_frame ( )

Definition at line 716 of file mods.c.

References MOD_WITH_OWNER, and loaded_mod::should_advance_game_frame.

Referenced by tick_main_loop().

◆ dttr_mods_tick()

void dttr_mods_tick ( )

Definition at line 605 of file mods.c.

References attempt_hot_reload_mods(), MOD_WITH_OWNER, and loaded_mod::tick.

Referenced by tick_main_loop().

◆ dttr_mods_window_created()

void dttr_mods_window_created ( const DTTR_Mods_WindowContext * ctx)

Definition at line 658 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_window_destroying()

void dttr_mods_window_destroying ( const DTTR_Mods_WindowContext * ctx)

Definition at line 666 of file mods.c.

References ctx, and MOD_DISPATCH.

◆ dttr_mods_window_resized()

void dttr_mods_window_resized ( const DTTR_Mods_WindowContext * ctx)

Definition at line 662 of file mods.c.

References ctx, and MOD_DISPATCH.