Skip to content

Commit

Permalink
added FIT 3:4 option in addition to 4:3 for vertical games
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jan 25, 2017
1 parent 8d09e36 commit 694724e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pfba/gui/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ 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", "FIT 4:3"}, 4, Option::Index::ROM_SCALING));
options_gui.push_back(Option("SCALING", {"NONE", "2X", "FIT", "FULL", "FIT 4:3", "FIT 3:4"}, 5, Option::Index::ROM_SCALING));
options_gui.push_back(
Option("FILTER", {"POINT", "LINEAR"}, 1, Option::Index::ROM_FILTER));
options_gui.push_back(
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 <= 4) {
if (scaling <= 5) {
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 @@ -129,6 +129,20 @@ void Video::Scale() {
}
break;

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

default:
break;
}
Expand Down

0 comments on commit 694724e

Please sign in to comment.