From 0a6926268b7dca39bf4764dcff89b923818f64a8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 25 Jun 2004 05:24:50 +0000 Subject: [PATCH] =?UTF-8?q?Date:=20Thu,=2024=20Jun=202004=2015:13:40=20+03?= =?UTF-8?q?00=20(EEST)=20From:=20Martin=5FStorsj=EF=BF=BD=20Subject:=20Sma?= =?UTF-8?q?ll=20patches=20for=20SDL/win32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've tried playing with running SDL compiled for Windows with Wine (and WineX) under Linux. It didn't originally work too well, but I somehow managed to make it work. Most of the fixes was patches to Wine(X), but I also found something in video/windx5/SDL_dx5video.c which, as far as I can tell, actually is a bug in SDL. The result from the COM method Release, which returns the new reference count, is compared to DD_OK. Because QueryInterface is called immediately before, the reference count shouldn't be DD_OK (== 0). --- src/video/windx5/SDL_dx5video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/video/windx5/SDL_dx5video.c b/src/video/windx5/SDL_dx5video.c index 4678c2818..ad3ba01ab 100644 --- a/src/video/windx5/SDL_dx5video.c +++ b/src/video/windx5/SDL_dx5video.c @@ -1323,11 +1323,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, SetDDerror("DirectDrawSurface::QueryInterface", result); return(NULL); } - result = IDirectDrawSurface_Release(dd_surface1); - if ( result != DD_OK ) { - SetDDerror("DirectDrawSurface::Release", result); - return(NULL); - } + IDirectDrawSurface_Release(dd_surface1); /* Get the format of the primary DirectDraw surface */ memset(&ddsd, 0, sizeof(ddsd)); @@ -1335,7 +1331,7 @@ SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, ddsd.dwFlags = DDSD_PIXELFORMAT|DDSD_CAPS; result = IDirectDrawSurface3_GetSurfaceDesc(SDL_primary, &ddsd); if ( result != DD_OK ) { - SetDDerror("DirectDrawSurface::Release", result); + SetDDerror("DirectDrawSurface::GetSurfaceDesc", result); return(NULL); } if ( ! (ddsd.ddpfPixelFormat.dwFlags&DDPF_RGB) ) {