1
0
Fork 0

Fix not giving bad updaterects during an unfinished screenupdate

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2462
This commit is contained in:
Sjoerd van der Berg 2006-01-30 15:02:34 +00:00
parent b33bfb80d9
commit 5866acbba2
4 changed files with 16 additions and 9 deletions

View file

@ -77,7 +77,7 @@ extern Render_t render;
void RENDER_DrawLine( const void *src );
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh);
bool RENDER_StartUpdate(void);
void RENDER_EndUpdate(void);
void RENDER_EndUpdate( bool fullUpdate );
void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: render.cpp,v 1.36 2006-01-30 09:58:07 harekiet Exp $ */
/* $Id: render.cpp,v 1.37 2006-01-30 15:02:33 harekiet Exp $ */
#include <sys/types.h>
#include <dirent.h>
@ -155,7 +155,7 @@ bool RENDER_StartUpdate(void) {
return true;
}
void RENDER_EndUpdate(void) {
void RENDER_EndUpdate( bool fullUpdate ) {
if (!render.updating)
return;
render.scale.cacheHandler = RENDER_EmptyCacheHandler;
@ -182,7 +182,7 @@ void RENDER_EndUpdate(void) {
CAPTURE_AddImage( render.src.width, render.src.height, render.src.bpp, pitch,
flags, render.src.fps, scalerSourceCache.b8[0], (Bit8u*)&render.pal.rgb );
}
GFX_EndUpdate( Scaler_ChangedLines );
GFX_EndUpdate( fullUpdate ? Scaler_ChangedLines : 0);
render.updating=false;
}
@ -207,8 +207,10 @@ static Bitu MakeAspectTable(Bitu height,double scaley,Bitu miny) {
}
void RENDER_ReInit( bool stopIt ) {
if (render.updating)
RENDER_EndUpdate();
if (render.updating) {
/* Still updating the current screen, shut it down correctly */
RENDER_EndUpdate( false );
}
if (stopIt)
return;
@ -376,7 +378,7 @@ void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool
render.active=false;
return;
}
RENDER_EndUpdate();
RENDER_EndUpdate( false );
render.src.width=width;
render.src.height=height;
render.src.bpp=bpp;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.96 2006-01-30 09:58:07 harekiet Exp $ */
/* $Id: sdlmain.cpp,v 1.97 2006-01-30 15:02:33 harekiet Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -686,6 +686,11 @@ void GFX_EndUpdate( const Bit16u *changedLines ) {
rect->y = sdl.clip.y + y;
rect->w = (Bit16u)sdl.draw.width;
rect->h = changedLines[index];
#if 0
if (rect->h + rect->y > sdl.surface->h) {
LOG_MSG("WTF");
}
#endif
y += changedLines[index];
}
index++;

View file

@ -294,7 +294,7 @@ static void VGA_DrawPart(Bitu lines) {
PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts,
(vga.draw.parts_left!=1) ? vga.draw.parts_lines : (vga.draw.lines_total - vga.draw.lines_done));
} else {
RENDER_EndUpdate();
RENDER_EndUpdate( true );
}
}