Skip to content

Commit

Permalink
feat: Implemented Integer scaling (fixes #1352)
Browse files Browse the repository at this point in the history
Added Integer scaling as an option in the Display panel.
This saves to the config file, and can be set in amiberry.conf as well.
The value 2 can be used in the scaling_method option, to set this as the default.
  • Loading branch information
midwan committed Jun 11, 2024
1 parent 26a2aa8 commit 7482dbf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2244,8 +2244,8 @@ void target_default_options(struct uae_prefs* p, int type)
p->scaling_method = -1; //Default is Auto
if (amiberry_options.default_scaling_method != -1)
{
// only valid values are -1 (Auto), 0 (Nearest) and 1 (Linear)
if (amiberry_options.default_scaling_method == 0 || amiberry_options.default_scaling_method == 1)
// only valid values are -1 (Auto), 0 (Nearest), 1 (Linear) 2 (Integer)
if (amiberry_options.default_scaling_method >= 0 && amiberry_options.default_scaling_method <= 2)
p->scaling_method = amiberry_options.default_scaling_method;
}

Expand Down
2 changes: 2 additions & 0 deletions src/osdep/amiberry_gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ void set_scaling_option(uae_prefs* p, int width, int height)
#else
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
#endif
else if (p->scaling_method == 2)
SDL_RenderSetIntegerScale(AMonitors[0].amiga_renderer, SDL_TRUE);
}

static float SDL2_getrefreshrate(int monid)
Expand Down
2 changes: 1 addition & 1 deletion src/osdep/gui/PanelDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static gcn::StringListModel fullscreen_modes_list(fullscreen_modes);
static const std::vector<std::string> resolution = { "LowRes", "HighRes (normal)", "SuperHighRes" };
static gcn::StringListModel resolution_list(resolution);

static const std::vector<std::string> scaling_method = { "Auto", "Pixelated", "Smooth" };
static const std::vector<std::string> scaling_method = { "Auto", "Pixelated", "Smooth", "Integer" };
static gcn::StringListModel scaling_method_list(scaling_method);

static gcn::Window* grpAmigaScreen;
Expand Down

0 comments on commit 7482dbf

Please sign in to comment.