On perjantai 24 helmikuu 2012, Laurent Sallafranque wrote:
I've uploaded the latest patch for the Videl borders.
Everything is optimized.
I haven't been able to test all the host Bpp possibilities.
Also, if someone could try the TT emulation to verify that nothing is
broken, it would be nice.
IMHO this check:
/* If emulated computer is the TT, we use the same rendering for
display, but without the borders */
if (ConfigureParams.System.nMachineType == MACHINE_TT) {
could be joined with this check:
/* If emulated computer is the FALCON, we must take :
* vw = X area display size and not all the X sreen with the borders
into account
* vh = Y area display size and not all the Y sreen with the borders
into account
*/
if (ConfigureParams.System.nMachineType == MACHINE_FALCON) {
vw = videl.XSize;
vh = videl.YSize;
}
(TT would be the else case)
Clipping is currently done twice, first to actual display area and
then to borders:
-----------------
/* Clip to SDL_Surface dimensions */
int scrwidth = HostScreen_getWidth();
int scrheight = HostScreen_getHeight();
int vw_clip = vw;
int vh_clip = vh;
if (vw>scrwidth) vw_clip = scrwidth;
if (vh>scrheight) vh_clip = scrheight;
...
/* If there's not enough space to display the left border, just
return */
if (vw_clip< videl.leftBorderSize)
return;
/* If there's not enough space for the left border + the graphic
area, we clip */
if (vw_clip< vw + videl.leftBorderSize) {
vw = vw_clip - videl.leftBorderSize;
rightBorderSize = 0;
}
/* if there's not enough space for the left border + the graphic
area + the right border, we clip the border */
else if (vw_clip< vw + videl.leftBorderSize +
videl.rightBorderSize)
rightBorderSize = vw_clip - videl.leftBorderSize - vw;
else
rightBorderSize = videl.rightBorderSize;
/* If there's not enough space to display the upper border, just
return */
if (vh_clip< videl.upperBorderSize)
return;
/* If there's not enough space for the upper border + the graphic
area, we clip */
if (vh_clip< vh + videl.upperBorderSize) {
vh = vh_clip - videl.upperBorderSize;
lowBorderSize = 0;
}
/* if there's not enough space for the upper border + the graphic
area + the lower border, we clip the border */
else if (vh_clip< vh + videl.upperBorderSize +
videl.lowerBorderSize)
lowBorderSize = vh_clip - videl.upperBorderSize - vh;
else
lowBorderSize = videl.lowerBorderSize;
-------------------
Because of this, I think these checks are redundant:
if (v?_clip< videl.*BorderSize)
And shouldn't the display be centered in case clipping is needed instead
of clipping happening just from one border (i.e. take half from both
sides)?
- Eero