static void RENDER_CallBack( GFX_CallBackFunctions_t function ) { if (function == GFX_CallBackStop) { RENDER_Halt( ); return; } else if (function == GFX_CallBackRedraw) { return; } else if ( function == GFX_CallBackReset) { GFX_EndUpdate( 0 ); RENDER_Reset(); } else { E_Exit("Unhandled GFX_CallBackReset %d", function ); } }
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh) { RENDER_Halt( ); if (!width || !height || width > SCALER_MAXWIDTH || height > SCALER_MAXHEIGHT) { return; } if ( ratio > 1 ) { double target = height * ratio + 0.025; ratio = target / height; } else { //This would alter the width of the screen, we don't care about rounding errors here } render.src.width=width; render.src.height=height; render.src.bpp=bpp; render.src.dblw=dblw; render.src.dblh=dblh; render.src.fps=fps; render.src.ratio=ratio; RENDER_Reset( ); }
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double scrn_ratio) { RENDER_Halt( ); if (!width || !height || width > SCALER_MAXWIDTH || height > SCALER_MAXHEIGHT) { return; } // figure out doublewidth/height values bool dblw = false; bool dblh = false; double ratio = (((double)width)/((double)height))/scrn_ratio; if(ratio > 1.6) { dblh=true; ratio /= 2.0; } else if(ratio < 0.75) { dblw=true; ratio *= 2.0; } else if(!dblw && !dblh && (width < 370) && (height < 280)) { dblw=true; dblh=true; } //LOG_MSG("pixratio %1.3f, dw %s, dh %s",ratio,dblw?"true":"false",dblh?"true":"false"); if ( ratio > 1.0 ) { double target = height * ratio + 0.1; ratio = target / height; } else { //This would alter the width of the screen, we don't care about rounding errors here } render.src.width=width; render.src.height=height; render.src.bpp=bpp; render.src.dblw=dblw; render.src.dblh=dblh; render.src.fps=fps; render.src.ratio=ratio; render.src.scrn_ratio=scrn_ratio; RENDER_Reset( ); }