Skip to content

Commit

Permalink
Brought over improvements from TBFix
Browse files Browse the repository at this point in the history
  • Loading branch information
chulsupark committed Feb 22, 2017
1 parent 5c07abf commit bbbc9c6
Show file tree
Hide file tree
Showing 14 changed files with 2,677 additions and 350 deletions.
2 changes: 1 addition & 1 deletion tzf_dsound/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define TZF_MAJOR 1
#define TZF_MINOR 8
#define TZF_BUILD 2
#define TZF_BUILD 3
#define TZF_REV 0


Expand Down
68 changes: 62 additions & 6 deletions tzf_dsound/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ struct {
tzf::ParameterInt* rescale_env_shadows;
tzf::ParameterFloat* postproc_ratio;
tzf::ParameterBool* clear_blackbars;
tzf::ParameterBool* auto_apply_changes;
} render;

struct {
Expand Down Expand Up @@ -99,6 +100,12 @@ struct {
tzf::ParameterStringW* texture_set;
} gamepad;

struct {
tzf::ParameterFloat* scale;
tzf::ParameterBool* show_osd_message;
tzf::ParameterBool* show_licenses;
} imgui;


struct {
tzf::ParameterBool* fix_priest;
Expand Down Expand Up @@ -410,6 +417,17 @@ TZF_LoadConfig (std::wstring name)
L"TZFIX.Render",
L"ClearBlackbars" );

render.auto_apply_changes =
static_cast <tzf::ParameterBool *>
(g_ParameterFactory.create_parameter <bool> (
L"Apply Changes Immediately")
);
render.auto_apply_changes->register_to_ini(
dll_ini,
L"TZFIX.Render",
L"AutoApplyChanges"
);


textures.cache =
static_cast <tzf::ParameterBool *>
Expand Down Expand Up @@ -503,6 +521,37 @@ TZF_LoadConfig (std::wstring name)
L"TextureSet" );


imgui.scale =
static_cast <tzf::ParameterFloat *>
(g_ParameterFactory.create_parameter <float> (
L"Font Scale for Config UI")
);
imgui.scale->register_to_ini(
dll_ini,
L"ImGui.General",
L"Scale" );

imgui.show_licenses =
static_cast <tzf::ParameterBool *>
(g_ParameterFactory.create_parameter <bool> (
L"Show License Info")
);
imgui.show_licenses->register_to_ini(
dll_ini,
L"ImGui.General",
L"HasReadLicenses" );

imgui.show_osd_message =
static_cast <tzf::ParameterBool *>
(g_ParameterFactory.create_parameter <bool> (
L"Show OSD Message")
);
imgui.show_osd_message->register_to_ini(
dll_ini,
L"ImGui.General",
L"ShowOSDDisclaimer" );


keyboard.swap_keys =
static_cast <tzf::ParameterStringW *>
(g_ParameterFactory.create_parameter <std::wstring> (
Expand Down Expand Up @@ -604,6 +653,7 @@ TZF_LoadConfig (std::wstring name)
render.aspect_correct_vids->load (config.render.blackbar_videos);
render.aspect_correction->load (config.render.aspect_correction);
render.clear_blackbars->load (config.render.clear_blackbars);
render.auto_apply_changes->load (config.render.auto_apply_changes);

// The video aspect ratio correction option is scheduled for removal anyway, so
// this hack is okay...
Expand All @@ -625,6 +675,10 @@ TZF_LoadConfig (std::wstring name)

gamepad.texture_set->load (config.textures.gamepad);

imgui.scale->load (config.input.ui.scale);
imgui.show_licenses->load (config.input.ui.never_show_eula);
imgui.show_osd_message->load (config.render.osd_disclaimer);

steam.allow_broadcasts->load (config.steam.allow_broadcasts);

keyboard.swap_keys->load (config.keyboard.swap_keys);
Expand Down Expand Up @@ -662,13 +716,10 @@ TZF_SaveConfig (std::wstring name, bool close_config)
framerate.disable_limiter->store (config.framerate.disable_limiter);
framerate.auto_adjust->store (config.framerate.auto_adjust);

//
// Don't store changes to this preference made while the game is running
//
//framerate.target->store (config.framerate.target);
//framerate.battle_target->store (config.framerate.battle_target);
framerate.target->store (config.framerate.target);
framerate.battle_target->store (config.framerate.battle_target);
//framerate.battle_adaptive->store (config.framerate.battle_adaptive);
//framerate.cutscene_target->store (config.framerate.cutscene_target);
framerate.cutscene_target->store (config.framerate.cutscene_target);

render.aspect_addr->store (config.render.aspect_addr);
render.fovy_addr->store (config.render.fovy_addr);
Expand All @@ -682,6 +733,7 @@ TZF_SaveConfig (std::wstring name, bool close_config)
render.postproc_ratio->store (config.render.postproc_ratio);
render.rescale_shadows->store (config.render.shadow_rescale);
render.rescale_env_shadows->store (config.render.env_shadow_rescale);
render.auto_apply_changes->store (config.render.auto_apply_changes);

textures.remaster->store (config.textures.remaster);
textures.cache->store (config.textures.cache);
Expand All @@ -694,6 +746,10 @@ TZF_SaveConfig (std::wstring name, bool close_config)

gamepad.texture_set->store (config.textures.gamepad);

imgui.scale->store (config.input.ui.scale);
imgui.show_licenses->store (config.input.ui.never_show_eula);
imgui.show_osd_message->store (config.render.osd_disclaimer);

steam.allow_broadcasts->store (config.steam.allow_broadcasts);

lua.fix_priest->store (config.lua.fix_priest);
Expand Down
9 changes: 9 additions & 0 deletions tzf_dsound/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ struct tzf_config_t
bool clear_blackbars = true;
int32_t env_shadow_rescale = 0;
bool dump_shaders = false;
bool auto_apply_changes = false;
bool osd_disclaimer = true;
} render;

struct {
Expand All @@ -93,6 +95,13 @@ struct tzf_config_t
bool highlight_debug_tex = true;
} textures;

struct {
struct {
float scale = 1.0f;
bool never_show_eula = false;
} ui;
} input;

struct {
bool visible = false;
} control_panel;
Expand Down
Loading

0 comments on commit bbbc9c6

Please sign in to comment.