From: Eric B. <ebo...@us...> - 2002-06-09 18:29:16
|
Update of /cvsroot/alleg/allegro/src/win In directory usw-pr-cvs1:/tmp/cvs-serv8038/src/win Modified Files: Tag: allegro_4_0_branch wddwin.c Log Message: Backported from 4.1.x: - Removed hard-coded references to 'gcc' as the only spelling of the GNU C Compiler - Added an option to disable direct updating in color conversion mode under Windows - Peter got rid of MSDEVDIR in the MSVC makefile - Henrik fixed installation under Cygwin - Henrik updated build instructions for Cygwin - Added a warning in the doc about the use of blocking functions under Windows - Maxime Carey added a Canada (French) keyboard mapping file - Sven prevented Watcom C/C++ from crashing in exswitch, and made fractal faster - Sven added many strings (in particular drivers) to the Swedish translation file - Sven added "BeOS joystick" translation to the Swedish translation file - Sven made it so that makefile.mgw creates system directories Index: wddwin.c =================================================================== RCS file: /cvsroot/alleg/allegro/src/win/wddwin.c,v retrieving revision 1.49.2.1 retrieving revision 1.49.2.2 diff -u -d -r1.49.2.1 -r1.49.2.2 --- wddwin.c 26 Feb 2002 21:59:09 -0000 1.49.2.1 +++ wddwin.c 9 Jun 2002 18:29:13 -0000 1.49.2.2 @@ -101,7 +101,8 @@ static LPDIRECTDRAWSURFACE2 preconv_offscreen_surface = NULL; static RECT working_area; static COLORCONV_BLITTER_FUNC *colorconv_blit = NULL; -static int direct_updating_mode; +static int direct_updating_mode_enabled; /* configuration flag */ +static int direct_updating_mode_on; /* live flag */ static GFX_VTABLE _special_vtable; /* special vtable for offscreen bitmap */ @@ -147,9 +148,11 @@ */ static void handle_window_enter_sysmode_win(void) { - if (colorconv_blit && direct_updating_mode) { - direct_updating_mode = FALSE; - _TRACE("direct updating mode off\n"); + if (direct_updating_mode_enabled && colorconv_blit) { + if (direct_updating_mode_on) { + direct_updating_mode_on = FALSE; + _TRACE("direct updating mode off\n"); + } } } @@ -160,9 +163,11 @@ */ static void handle_window_exit_sysmode_win(void) { - if (colorconv_blit && !direct_updating_mode) { - direct_updating_mode = TRUE; - _TRACE("direct updating mode on\n"); + if (direct_updating_mode_enabled && colorconv_blit) { + if (!direct_updating_mode_on) { + direct_updating_mode_on = TRUE; + _TRACE("direct updating mode on\n"); + } } } @@ -340,7 +345,7 @@ ClientToScreen(allegro_wnd, (LPPOINT)&dest_rect); ClientToScreen(allegro_wnd, (LPPOINT)&dest_rect + 1); - if (!direct_updating_mode || is_not_contained(&dest_rect, &working_area) || + if (!direct_updating_mode_on || is_not_contained(&dest_rect, &working_area) || (GetForegroundWindow() != allegro_wnd)) { /* first blit to the pre-converted offscreen buffer */ if (ddsurf_blit_ex(preconv_offscreen_surface, &src_rect, @@ -455,7 +460,7 @@ return -1; update_window = update_colorconv_window; - direct_updating_mode = TRUE; + direct_updating_mode_on = direct_updating_mode_enabled; } return 0; @@ -531,6 +536,8 @@ { RECT win_size; unsigned char *cmap; + char tmp1[64], tmp2[128]; + AL_CONST char *ddu; HRESULT hr; int i; @@ -665,6 +672,16 @@ /* grab input devices */ win_grab_input(); + + /* read direct updating configuration variable */ + ddu = get_config_string(uconvert_ascii("graphics", tmp1), + uconvert_ascii("disable_direct_updating", tmp2), + NULL); + + if ((ddu) && ((i = ugetc(ddu)) != 0) && ((i == 'y') || (i == 'Y') || (i == '1'))) + direct_updating_mode_enabled = FALSE; + else + direct_updating_mode_enabled = TRUE; _exit_critical(); |