Skip to content

Commit

Permalink
Aspect ratio correction for nearly everything
Browse files Browse the repository at this point in the history
  • Loading branch information
andon authored and andon committed Mar 2, 2017
1 parent 6063951 commit 700f617
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 92 deletions.
4 changes: 2 additions & 2 deletions include/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#define TBF_MAJOR 0
#define TBF_MINOR 10
#define TBF_BUILD 1
#define TBF_REV 2
#define TBF_BUILD 2
#define TBF_REV 0



Expand Down
11 changes: 11 additions & 0 deletions src/ImGui/control_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,17 @@ TBFix_DrawConfigUI (void)

TBFix_KeybindDialog (&config.keyboard.aspect_ratio);

extern float original_aspect;

if ( original_aspect > config.render.aspect_ratio + 0.001f ||
original_aspect < config.render.aspect_ratio - 0.001f ) {
ImGui::Separator ();

ImGui::Bullet (); ImGui::SameLine ();

ImGui::TextColored (ImVec4 (1.0f, 0.8f, 0.2f, 1.0f), "Aspect Ratio Has Changed Since Startup, for best results return to the title screen.");
}

ImGui::TreePop ();
}

Expand Down
8 changes: 8 additions & 0 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ volatile DWORD __TBF_TLS_INDEX = MAXDWORD;
SKX_SetPluginName_pfn SKX_SetPluginName = nullptr;


// Since changing aspect ratio involves a trip back to the
// title screen, keep track of this to inform the user
// when that is necessary.
float original_aspect = 0.0f;



__declspec (dllexport)
BOOL
Expand Down Expand Up @@ -160,6 +166,8 @@ SKPlugIn_Init (HMODULE hModSpecialK)
TBF_SaveConfig ();
}

original_aspect = config.render.aspect_ratio;

config.system.injector = injector_dll;

SKX_SetPluginName =
Expand Down
Loading

0 comments on commit 700f617

Please sign in to comment.