From 4597f8543c30b9ddf4ebec504e2a622b02020f91 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Sun, 28 Apr 2013 18:03:55 +0000 Subject: [PATCH] * Video config: changed "Disable hardware acceleration" option to "Create surface in system memory" --- trunk/src/drivers/win/res.rc | 4 ++-- trunk/src/drivers/win/video.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/trunk/src/drivers/win/res.rc b/trunk/src/drivers/win/res.rc index c14973b2..3f0f802a 100644 --- a/trunk/src/drivers/win/res.rc +++ b/trunk/src/drivers/win/res.rc @@ -1758,7 +1758,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,29,154,12 LTEXT "Sync method:",65452,11,112,51,10 COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,66,110,95,50,CBS_DROPDOWNLIST | WS_TABSTOP - CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_FS, + CONTROL "Create surface in system memory",IDC_DISABLE_HW_ACCEL_FS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,127,147,12 LTEXT "Mode:",13,11,67,23,9 EDITTEXT IDC_VIDEOCONFIG_XRES,36,65,27,13,ES_RIGHT @@ -1783,7 +1783,7 @@ BEGIN COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,243,93,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Sync method:",65437,188,112,51,9 COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,243,110,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_WIN, + CONTROL "Create surface in system memory",IDC_DISABLE_HW_ACCEL_WIN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,127,146,12 GROUPBOX "Drawing Area",65494,351,50,154,65,WS_GROUP LTEXT "First line:",65436,367,68,40,9 diff --git a/trunk/src/drivers/win/video.cpp b/trunk/src/drivers/win/video.cpp index 34b1785d..23a4bf96 100644 --- a/trunk/src/drivers/win/video.cpp +++ b/trunk/src/drivers/win/video.cpp @@ -40,7 +40,7 @@ static int bpp; static int vflags; static int veflags; -int disvaccel = 0; // Disable video hardware acceleration. By default it's enabled in both windowed and Fullscreen mode +int disvaccel = 0; // "Create surface in system memory". By default it's off in both windowed and Fullscreen mode int fssync=0; int winsync=0; @@ -144,8 +144,7 @@ static int InitializeDDraw(int fs) color_palette = (PALETTEENTRY*)malloc(256 * sizeof(PALETTEENTRY)); } - //(disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY: - ddrval = DirectDrawCreate((disvaccel&(1<<(fs?1:0)))?(GUID FAR *)DDCREATE_EMULATIONONLY:NULL, &lpDD, NULL); + ddrval = DirectDrawCreate(NULL, &lpDD, NULL); if (ddrval != DD_OK) { //ShowDDErr("Error creating DirectDraw object."); @@ -368,8 +367,9 @@ int SetVideoMode(int fs) ddsdback.dwWidth=256 * specmul; ddsdback.dwHeight=FSettings.TotalScanlines() * specmul; - // create the buffer in system memory. - ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; + if (disvaccel & 1) + // create the buffer in system memory + ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL); if (ddrval != DD_OK) @@ -457,8 +457,9 @@ int SetVideoMode(int fs) ddsdback.dwWidth=256 * specmul; //vmodes[vmod].srect.right; ddsdback.dwHeight=FSettings.TotalScanlines() * specmul; //vmodes[vmod].srect.bottom; - // create the buffer in system memory. - ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; + if (disvaccel & 2) + // create the buffer in system memory + ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY; ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL); if(ddrval!=DD_OK)