return aspect;
}
-static int res_match(int w)
-{
- if (currprefs.gfx_vresolution == VRES_NONDOUBLE) {
- if (currprefs.gfx_resolution == RES_HIRES) {
- w *= 2;
- } else if (currprefs.gfx_resolution == RES_SUPERHIRES) {
- w *= 4;
- }
- } else {
- if (currprefs.gfx_resolution == RES_LORES) {
- w /= 2;
- } else if (currprefs.gfx_resolution == RES_SUPERHIRES) {
- w *= 2;
- }
- }
- return w;
-}
-
void getfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height, int aw, int ah, int scale, int *mode, int temp_width, int temp_height)
{
struct AmigaMonitor *mon = &AMonitors[monid];
filter_horiz_zoom_mult = 1.0;
filter_vert_zoom_mult = 1.0;
- maxw = res_match(maxw);
-
float multadd = 1.0f / (1 << currprefs.gf[idx].gfx_filter_integerscalelimit);
if (cw2 > maxw || ch2 > maxh) {
while (cw2 / mult - adjw > maxw || ch2 / mult - adjh > maxh) {
while (cw2 * (mult + multadd) - adjw <= maxw && ch2 * (mult + multadd) - adjh <= maxh) {
mult += multadd;
}
+
float multx = mult, multy = mult;
// if width is smaller than height, double width (programmed modes)
if (cw2 * (mult + multadd) - adjw <= maxw && cw2 < ch2) {
multx += multadd;
}
+ // if width is >2.5x height, double height (non-doublescanned superhires)
+ if (ch2 * (mult + multadd) - adjh <= maxh && cw2 > ch2 * 2.5) {
+ multy += multadd;
+ }
maxw = (int)((maxw + multx - multadd) / multx);
maxh = (int)((maxh + multy - multadd) / multy);
}
if (mon->scalepicasso == RTG_MODE_INTEGER_SCALE) {
int divx = mon->currentmode.native_width / srcwidth;
int divy = mon->currentmode.native_height / srcheight;
- int mul = !divx || !divy ? 1 : (divx > divy ? divy : divx);
- SetRect(dr, 0, 0, mon->currentmode.native_width / mul, mon->currentmode.native_height / mul);
- int xx = (mon->currentmode.native_width / mul - srcwidth) / 2;
- int yy = (mon->currentmode.native_height / mul - srcheight) / 2;
+ float mul = (float)(!divx || !divy ? 1 : (divx > divy ? divy : divx));
+ if (!divx || !divy) {
+ if ((float)mon->currentmode.native_width / srcwidth <= 0.95f || ((float)mon->currentmode.native_height / srcheight <= 0.95f)) {
+ mul = 0.5f;
+ }
+ if ((float)mon->currentmode.native_width / srcwidth <= 0.45f || ((float)mon->currentmode.native_height / srcheight <= 0.45f)) {
+ mul = 0.25f;
+ }
+ }
+ SetRect(dr, 0, 0, (int)(mon->currentmode.native_width / mul), (int)(mon->currentmode.native_height / mul));
+ int xx = (int)((mon->currentmode.native_width / mul - srcwidth) / 2);
+ int yy = (int)((mon->currentmode.native_height / mul - srcheight) / 2);
picasso_offset_x = -xx;
picasso_offset_y = -yy;
- mx = (float)mul;
- my = (float)mul;
+ mx = mul;
+ my = mul;
outwidth = srcwidth;
outheight = srcheight;
*mode = 1;