Skip to content

Commit

Permalink
Added "FIT 4:3" scaling option keeping TV aspect
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jan 25, 2017
1 parent 83c50d5 commit 8d09e36
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pfba/gui/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Config::Config(const std::string &cfgPath) {

// default rom config
options_gui.push_back(Option("ROM", {"ROM"}, 0, Option::Index::MENU_ROM_OPTIONS, Option::Type::MENU));
options_gui.push_back(Option("SCALING", {"NONE", "2X", "FIT", "FULL"}, 1, Option::Index::ROM_SCALING));
options_gui.push_back(Option("SCALING", {"NONE", "2X", "FIT", "FULL", "FIT 4:3"}, 4, Option::Index::ROM_SCALING));
options_gui.push_back(
Option("FILTER", {"POINT", "LINEAR"}, 0, Option::Index::ROM_FILTER));
Option("FILTER", {"POINT", "LINEAR"}, 1, Option::Index::ROM_FILTER));
options_gui.push_back(
Option("SHADER", {"NONE", "SHARP", "SHARP+SCAN", "LCD3X", "AAA", "SCALE2X"}, 2, Option::Index::ROM_SHADER));
options_gui.push_back(Option("ROTATION", {"OFF", "ON"}, 0, Option::Index::ROM_ROTATION));
Expand Down
2 changes: 1 addition & 1 deletion pfba/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int RunOneFrame(bool bDraw, int bDrawFps, int fps) {
} else if ((players[0].state & Input::Key::KEY_COIN)
&& (players[0].state & Input::Key::KEY_UP)) {
int scaling = gui->GetConfig()->GetRomValue(Option::Index::ROM_SCALING) + 1;
if (scaling <= 3) {
if (scaling <= 4) {
int index = gui->GetConfig()->GetOptionPos(gui->GetConfig()->GetRomOptions(),
Option::Index::ROM_SCALING);
gui->GetConfig()->GetRomOptions()->at(index).value = scaling;
Expand Down
14 changes: 14 additions & 0 deletions pfba/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ void Video::Scale() {
}
break;

case 4: // fit 4:3
if(rotation == 0 || rotation == 180) {
scale.h = window.h;
scale.w = (int) (((float) scale.h * 4.0) / 3.0);
if(scale.w > window.w) {
scale.w = window.w;
scale.h = (int) (((float) scale.w * 3.0) / 4.0);
}
} else {
scale.w = window.h;
scale.h = (int) (((float) scale.w * 4.0) / 3.0);
}
break;

default:
break;
}
Expand Down

0 comments on commit 8d09e36

Please sign in to comment.