exit on xml parsing fail, xml rewrite

This commit is contained in:
CrazyRedMachine 2023-07-30 18:17:59 +02:00
parent 1716103d34
commit 6950deeccb
3 changed files with 19 additions and 7 deletions

View File

@ -26,7 +26,7 @@
<!-- Premium free (unlimited stages per credit) -->
<pfree __type="bool">0</pfree>
<!-- Press numpad 9 in song to retire instantly, or on result screen to leave game session (thank you for playing) -->
<!-- quick_retire with pfree also enables quick retry: press numpad 8 during song or on result screen to retry (keep holding during option select to skip it) -->
<!-- quick_retire with pfree also enables quick retry: press numpad 8 during song or on result screen to retry (keep holding to skip option select) -->
<quick_retire __type="bool">0</quick_retire>
<!-- Network features -->
@ -59,17 +59,22 @@
<!-- HD resolution for pcb_type=0 (0: no, 1: keep texts as on HD cab (smaller LCD mod), 2: center texts (32" LCD mod) ) -->
<force_hd_resolution __type="u8">0</force_hd_resolution>
<!-- END OF USER SETTINGS -->
<!-- ====================
END OF USER SETTINGS
==================== -->
<!-- EXPERIMENTAL PATCHES -->
<!-- Enable practice mode menu, (r-ran, constant chart speed, slow motion, etc...) -->
<!-- PLEASE USE OFFLINE ONLY -->
<practice_mode __type="bool">0</practice_mode>
<!-- Press 9 on option select screen to go back to song selection (requires pfree and quick_retire) -->
<!-- Press 9 on option select screen to go back to song selection (requires quick_retire) -->
<!-- Note: causes issues with sounds on song select -->
<back_to_song_select __type="bool">0</back_to_song_select>
<!-- DEBUG OPTIONS FOLLOW (GENERALLY SHOULD NOT BE CHANGED UNLESS YOU KNOW WHAT YOU'RE DOING) -->
<!-- ========================================================================================
DEBUG OPTIONS FOLLOW (GENERALLY SHOULD NOT BE CHANGED UNLESS YOU KNOW WHAT YOU'RE DOING)
======================================================================================== -->
<!-- Datecode and Multiboot -->
<!-- Force a different datecode than the one found in ea3-config (yyyymmdd00) -->

View File

@ -3897,7 +3897,11 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
LOG("popnhax: game dll: %s\n",g_game_dll_fn);
LOG("popnhax: config file: %s\n",g_config_fn);
_load_config(g_config_fn, &config, config_psmap);
if (!_load_config(g_config_fn, &config, config_psmap))
{
LOG("FATAL ERROR: Could not parse %s\n", g_config_fn);
return FALSE;
}
if (force_trans_debug)
config.translation_debug = true;

View File

@ -84,17 +84,20 @@ struct property *load_prop_file(const char *filename) {
return config_data;
}
void _load_config(const char *filename, void *dest, const struct property_psmap *psmap) {
bool _load_config(const char *filename, void *dest, const struct property_psmap *psmap) {
struct property *config_xml = load_prop_file(filename);
if (!config_xml) {
printf("Couldn't load xml file: %s\n", filename);
return;
return false;
}
if (!(property_psmap_import(config_xml, nullptr, dest, psmap))) {
printf("Couldn't parse psmap\n");
return false;
}
return true;
}
#endif