float dw = (float)ds.dstwidth;
float dh = (float)ds.dstheight;
- float w = ds.outwidth;
- float h = ds.outheight;
+ float w = (float)ds.outwidth;
+ float h = (float)ds.outheight;
d3d->fakesize.x = w;
d3d->fakesize.y = h;
float sw = dw / d3d->m_screenWidth;
float sh = dh / d3d->m_screenHeight;
- int xshift = -ds.xoffset;
- int yshift = -ds.yoffset;
+ float xshift = (float)-ds.xoffset;
+ float yshift = (float)-ds.yoffset;
xshift -= (w - d3d->m_screenWidth) / 2;
yshift -= (h - d3d->m_screenHeight) / 2;
D3D_unlocktexture(monid, -1, -1);
}
- recheck(d3d, monid);
-
if (d3d->invalidmode || !d3d->m_device) {
return false;
}
d3d->m_bitmapWidthX = d3d->m_bitmapWidth * d3d->dmultxh;
d3d->m_bitmapHeightX = d3d->m_bitmapHeight * d3d->dmultxv;
+ recheck(d3d, monid);
+
v = CreateTexture(d3d);
if (!v)
return false;
float w = (float)ds.outwidth;
float h = (float)ds.outheight;
- int tx = (dw * gdi->bm.width) / (gdi->wwidth * 2);
- int ty = (dh * gdi->bm.height) / (gdi->wheight * 2);
+ float tx = (dw * gdi->bm.width) / (gdi->wwidth * 2);
+ float ty = (dh * gdi->bm.height) / (gdi->wheight * 2);
float sw = dw / gdi->wwidth;
float sh = dh / gdi->wheight;
- int xshift = -ds.xoffset;
- int yshift = -ds.yoffset;
+ float xshift = (float)-ds.xoffset;
+ float yshift = (float)-ds.yoffset;
xshift -= (w - gdi->wwidth) / 2;
yshift -= (h - gdi->wheight) / 2;
- gdi->xoffset = tx + xshift - gdi->wwidth / 2;
- gdi->yoffset = ty + yshift - gdi->wheight / 2;
+ gdi->xoffset = (int)(tx + xshift - gdi->wwidth / 2);
+ gdi->yoffset = (int)(ty + yshift - gdi->wheight / 2);
gdi->xmult = filterrectmult(gdi->wwidth, w, gdi->dmode);
gdi->ymult = filterrectmult(gdi->wheight, h, gdi->dmode);
store_custom_limits (-1, -1, -1, -1);
ds->mode = 0;
- ds->outwidth = ds->srcwidth;
- ds->outheight = ds->srcheight;
if (mon->screen_is_picasso) {
getrtgfilterdata(monid, ds);
filterxmult = (float)ds->scale;
filterymult = (float)ds->scale;
+ ds->xoffset = 0;
+ ds->yoffset = 0;
+
if (scalemode == AUTOSCALE_STATIC_MAX || scalemode == AUTOSCALE_STATIC_NOMINAL ||
scalemode == AUTOSCALE_INTEGER || scalemode == AUTOSCALE_INTEGER_AUTOSCALE) {
mult += multadd;
}
float multx = mult, multy = mult;
- maxw = maxw * mult;
- maxh = maxh * mult;
+ maxw = (int)(maxw * mult);
+ maxh = (int)(maxh * mult);
} else {
while (((cw2 * (mult + multadd)) / m) - adjw <= maxw && ch2 * (mult + multadd) - adjh <= maxh) {
mult += multadd;
if (ch2 * (mult * 2) - adjh <= maxh && cw2 > ch2 * 2.4) {
multy *= 2;
}
- maxw = (maxw + mult - multadd) / mult;
- maxh = (maxh + mult - multadd) / mult;
+ maxw = (int)((maxw + mult - multadd) / mult);
+ maxh = (int)((maxh + mult - multadd) / mult);
}
}
ds->xoffset += (int)(-filter_horiz_offset * aws);
ds->yoffset += (int)(-filter_vert_offset * ahs);
- diff = ds->dstwidth;
+ diff = ds->outwidth;
filterxmult = ((float)ds->dstwidth * ds->scale) / diff;
- diff = ds->dstheight;
+ diff = ds->outheight;
filterymult = ((float)ds->dstheight * ds->scale) / diff;
goto end;
}
+ } else {
+
+ ds->outwidth = ds->dstwidth;
+ ds->outheight = ds->dstheight;
+ ds->xoffset = (ds->srcwidth - ds->dstwidth) / 2;
+ ds->yoffset = (ds->srcheight - ds->dstheight) / 2;
+
}
cont: