|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <dttr_config.h>#include <dttr_iso.h>#include <dttr_loader.h>#include <dttr_loader_paths.h>#include <dttr_loader_ui.h>#include <dttr_log.h>#include <dttr_path.h>#include <dttr_sdl.h>#include <SDL3/SDL.h>#include <string.h>#include <windows.h>Go to the source code of this file.
Functions | |
| static bool | utf8_to_wide_path (WCHAR *out, const char *path) |
| static bool | get_full_path (char *out, size_t out_size, const char *path) |
| static bool | get_os_cache_base_dir (char *buf, size_t buf_size) |
| static bool | try_path (WCHAR *out, const WCHAR *dir, const WCHAR *subpath) |
| static bool | try_dir (WCHAR *out, const WCHAR *dir) |
| static void | copy_path (char *out, size_t out_size, const char *path) |
| static bool | extract_iso_file (DTTR_IsoImage *iso, const char *cache_root, const char *iso_path, char *out_path, size_t out_path_size) |
| static bool | extract_iso_game_cache (DTTR_IsoImage *iso, const char *cache_root, char *exe_path, size_t exe_path_size) |
| static bool | resolve_iso_direct (WCHAR *out, const char *iso_path, DTTR_LoaderIsoContext *iso_context) |
| static bool | resolve_iso (WCHAR *out, const char *iso_path, DTTR_LoaderIsoContext *iso_context) |
| static bool | try_configured_path (WCHAR *out, const char *configured_path, DTTR_LoaderIsoContext *iso_context) |
| static void | fill_disc_candidate (DTTR_LoaderUIDiscCandidate *candidate, char drive) |
| static void SDLCALL | browse_callback (void *, const char *const *filelist, int) |
| static bool | wait_for_browse_result () |
| static void | save_selected_path (const char *path) |
| static void | scan_disc_candidates (DTTR_LoaderUIDiscCandidate *candidates, size_t *candidate_count) |
| static bool | try_disc_candidate (WCHAR *out, const DTTR_LoaderUIDiscCandidate *candidate) |
| static bool | run_browse_dialog (DTTR_LoaderUIChoice choice) |
| static bool | try_browsed_path (WCHAR *out, DTTR_LoaderUIChoice choice, DTTR_LoaderIsoContext *iso_context) |
| static bool | try_browse_choice (WCHAR *out, DTTR_LoaderUIChoice choice, DTTR_LoaderIsoContext *iso_context) |
| static bool | prompt_browse_for_path (WCHAR *out, DTTR_LoaderIsoContext *iso_context) |
| bool | DTTR_Loader_ResolveEXEPath (WCHAR *out, const char *configured_path, DTTR_LoaderIsoContext *iso_context) |
Variables | |
| static char | browse_result [MAX_PATH] |
| static HANDLE | browse_event |
Definition at line 264 of file browse.c.
References browse_event, browse_result, copy_path(), and NULL.
Referenced by run_browse_dialog().
|
static |
Definition at line 70 of file browse.c.
References DTTR_Path_CopyString().
Referenced by browse_callback(), resolve_iso_direct(), and save_selected_path().
| bool DTTR_Loader_ResolveEXEPath | ( | WCHAR * | out, |
| const char * | configured_path, | ||
| DTTR_LoaderIsoContext * | iso_context ) |
Definition at line 459 of file browse.c.
References prompt_browse_for_path(), and try_configured_path().
Referenced by dttr_launcher_main().
|
static |
Definition at line 81 of file browse.c.
References DTTR_ISO_ExtractFile(), DTTR_ISO_LastError(), and DTTR_LOG_ERROR.
Referenced by extract_iso_game_cache().
|
static |
Definition at line 97 of file browse.c.
References DTTR_ISO_ExtractTree(), DTTR_ISO_LastError(), DTTR_LoaderISO_GameDataPath(), DTTR_LoaderISO_GameEXEPath(), DTTR_LoaderISO_GamePkgPath(), DTTR_LOG_ERROR, and extract_iso_file().
Referenced by resolve_iso_direct().
|
static |
Definition at line 258 of file browse.c.
References DTTR_LoaderUIDiscCandidate::label, and DTTR_LoaderUIDiscCandidate::path.
Referenced by scan_disc_candidates().
|
static |
Definition at line 25 of file browse.c.
Referenced by resolve_iso_direct().
|
static |
|
static |
Definition at line 421 of file browse.c.
References browse_result, DTTR_LOADER_UI_MAX_DISC_CANDIDATES, DTTR_LoaderUI_ChoiceIsBrowse(), DTTR_LoaderUI_ChoiceIsDisc(), DTTR_LoaderUI_ChooseGameSource(), DTTR_LOG_INFO, save_selected_path(), scan_disc_candidates(), try_browse_choice(), and try_disc_candidate().
Referenced by DTTR_Loader_ResolveEXEPath().
|
static |
Definition at line 205 of file browse.c.
References DTTR_LoaderUI_ShowError(), DTTR_LOG_ERROR, and resolve_iso_direct().
Referenced by try_browsed_path(), and try_configured_path().
|
static |
Definition at line 136 of file browse.c.
References DTTR_LoaderIsoContext::cache_root, copy_path(), DTTR_ISO_Close(), DTTR_ISO_LastError(), DTTR_ISO_Open(), DTTR_LoaderISO_CacheRootForPath(), DTTR_LoaderISO_GameRoot(), DTTR_LOG_ERROR, DTTR_LOG_INFO, extract_iso_game_cache(), DTTR_LoaderIsoContext::game_root, get_full_path(), get_os_cache_base_dir(), DTTR_LoaderIsoContext::is_iso, and utf8_to_wide_path().
Referenced by resolve_iso().
|
static |
Definition at line 352 of file browse.c.
References browse_callback(), browse_event, browse_result, DTTR_LOADER_UI_CHOICE_BROWSE_FOLDER, DTTR_LOG_ERROR, DTTR_SDL_ShowOpenFileDialog(), DTTR_SDL_ShowOpenFolderDialog(), FALSE, NULL, and wait_for_browse_result().
Referenced by try_browse_choice().
|
static |
Definition at line 287 of file browse.c.
References copy_path(), dttr_config, dttr_config_path, DTTR_Config_Save(), and DTTR_LOG_ERROR.
Referenced by prompt_browse_for_path(), and try_disc_candidate().
|
static |
Definition at line 298 of file browse.c.
References DTTR_LOADER_UI_MAX_DISC_CANDIDATES, DWORD, fill_disc_candidate(), and try_dir().
Referenced by prompt_browse_for_path().
|
static |
Definition at line 382 of file browse.c.
References run_browse_dialog(), and try_browsed_path().
Referenced by prompt_browse_for_path().
|
static |
Definition at line 391 of file browse.c.
References browse_result, DTTR_LOADER_UI_CHOICE_BROWSE_ISO, DTTR_LoaderPath_IsISOW(), DTTR_LoaderUI_ShowError(), resolve_iso(), try_dir(), and utf8_to_wide_path().
Referenced by try_browse_choice().
|
static |
Definition at line 230 of file browse.c.
References DTTR_LoaderPath_IsISOW(), DTTR_LOG_ERROR, DTTR_LOG_INFO, resolve_iso(), try_dir(), and utf8_to_wide_path().
Referenced by DTTR_Loader_ResolveEXEPath().
|
static |
Definition at line 57 of file browse.c.
References DTTR_Loader_GameSubpathAt(), DTTR_Loader_GameSubpathCount(), and try_path().
Referenced by scan_disc_candidates(), try_browsed_path(), try_configured_path(), and try_disc_candidate().
|
static |
Definition at line 336 of file browse.c.
References DTTR_LoaderUI_ShowError(), DTTR_LOG_INFO, DTTR_LoaderUIDiscCandidate::path, save_selected_path(), try_dir(), and utf8_to_wide_path().
Referenced by prompt_browse_for_path().
|
static |
|
static |
Definition at line 14 of file browse.c.
Referenced by resolve_iso_direct(), try_browsed_path(), try_configured_path(), and try_disc_candidate().
|
static |
Definition at line 277 of file browse.c.
References browse_event, browse_result, DTTR_SDL_Delay(), and DTTR_SDL_PumpEvents().
Referenced by run_browse_dialog().
|
static |
Definition at line 255 of file browse.c.
Referenced by browse_callback(), run_browse_dialog(), and wait_for_browse_result().
|
static |
Definition at line 254 of file browse.c.
Referenced by browse_callback(), prompt_browse_for_path(), run_browse_dialog(), try_browsed_path(), and wait_for_browse_result().