Skip to content

Commit

Permalink
Date: Thu, 24 Jun 2004 15:13:40 +0300 (EEST)
Browse files Browse the repository at this point in the history
From: Martin_Storsj?
Subject: Small patches for SDL/win32

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).
  • Loading branch information
slouken committed Jun 25, 2004
1 parent f2b4544 commit 4666996
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/video/windx5/SDL_dx5video.c
Expand Up @@ -1323,19 +1323,15 @@ 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));
ddsd.dwSize = sizeof(ddsd);
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) ) {
Expand Down

0 comments on commit 4666996

Please sign in to comment.