mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Remove more ddraw surfaces
This commit is contained in:
parent
cbd1348760
commit
44838d8156
73
pixmap.cpp
73
pixmap.cpp
@ -34,10 +34,6 @@ CPixmap::CPixmap()
|
|||||||
m_mouseSprite = SPRITE_WAIT;
|
m_mouseSprite = SPRITE_WAIT;
|
||||||
m_bBackDisplayed = false;
|
m_bBackDisplayed = false;
|
||||||
|
|
||||||
m_lpDD = NULL;
|
|
||||||
m_lpDDSPrimary = NULL;
|
|
||||||
m_lpDDSBack = NULL;
|
|
||||||
|
|
||||||
for (i = 0; i < MAXCURSORS; i++)
|
for (i = 0; i < MAXCURSORS; i++)
|
||||||
m_lpSDLCursors[i] = nullptr;
|
m_lpSDLCursors[i] = nullptr;
|
||||||
|
|
||||||
@ -59,41 +55,23 @@ CPixmap::~CPixmap()
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ( m_lpDD != NULL )
|
for (i = 0; i < MAXIMAGE; i++)
|
||||||
{
|
{
|
||||||
if ( m_lpDDSPrimary != NULL )
|
if (m_lpSDLCursors[i])
|
||||||
{
|
|
||||||
m_lpDDSPrimary->Release();
|
|
||||||
m_lpDDSPrimary = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_lpDDSBack != NULL )
|
|
||||||
{
|
{
|
||||||
m_lpDDSBack->Release();
|
SDL_FreeCursor (m_lpSDLCursors[i]);
|
||||||
m_lpDDSBack = NULL;
|
m_lpSDLCursors[i] = nullptr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAXIMAGE; i++)
|
for ( i=0 ; i<MAXIMAGE ; i++ )
|
||||||
|
{
|
||||||
|
if ( m_lpSDLTexture[i] != NULL )
|
||||||
{
|
{
|
||||||
if (m_lpSDLCursors[i])
|
SDL_DestroyTexture (m_lpSDLTexture[i]);
|
||||||
{
|
m_lpSDLTexture[i] = NULL;
|
||||||
SDL_FreeCursor (m_lpSDLCursors[i]);
|
|
||||||
m_lpSDLCursors[i] = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for ( i=0 ; i<MAXIMAGE ; i++ )
|
|
||||||
{
|
|
||||||
if ( m_lpSDLTexture[i] != NULL )
|
|
||||||
{
|
|
||||||
SDL_DestroyTexture (m_lpSDLTexture[i]);
|
|
||||||
m_lpSDLTexture[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_lpDD->Release();
|
|
||||||
m_lpDD = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -110,8 +88,6 @@ void CPixmap::SetDebug(bool bDebug)
|
|||||||
bool CPixmap::Create(POINT dim,
|
bool CPixmap::Create(POINT dim,
|
||||||
bool bFullScreen, int mouseType)
|
bool bFullScreen, int mouseType)
|
||||||
{
|
{
|
||||||
HRESULT ddrval;
|
|
||||||
|
|
||||||
m_bFullScreen = bFullScreen;
|
m_bFullScreen = bFullScreen;
|
||||||
m_mouseType = mouseType;
|
m_mouseType = mouseType;
|
||||||
m_dim = dim;
|
m_dim = dim;
|
||||||
@ -121,31 +97,6 @@ bool CPixmap::Create(POINT dim,
|
|||||||
m_clipRect.right = dim.x;
|
m_clipRect.right = dim.x;
|
||||||
m_clipRect.bottom = dim.y;
|
m_clipRect.bottom = dim.y;
|
||||||
|
|
||||||
// Create the main DirectDraw object
|
|
||||||
ddrval = DirectDrawCreate(NULL, &m_lpDD, NULL);
|
|
||||||
if ( ddrval != DD_OK )
|
|
||||||
{
|
|
||||||
OutputDebug("Fatal error: DirectDrawCreate\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ddrval != DD_OK )
|
|
||||||
{
|
|
||||||
OutputDebug("Fatal error: SetCooperativeLevel\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the video mode to 640x480x8.
|
|
||||||
if ( m_bFullScreen )
|
|
||||||
{
|
|
||||||
ddrval = m_lpDD->SetDisplayMode(dim.x, dim.y, 8);
|
|
||||||
if ( ddrval != DD_OK )
|
|
||||||
{
|
|
||||||
OutputDebug("Fatal error: SetDisplayMode\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
pixmap.h
5
pixmap.h
@ -66,11 +66,6 @@ protected:
|
|||||||
int m_mouseSprite;
|
int m_mouseSprite;
|
||||||
bool m_bBackDisplayed;
|
bool m_bBackDisplayed;
|
||||||
|
|
||||||
LPDIRECTDRAW m_lpDD; // DirectDraw object
|
|
||||||
LPDIRECTDRAWSURFACE m_lpDDSPrimary; // DirectDraw primary surface
|
|
||||||
SDL_Surface * m_lpSDLPrimary;
|
|
||||||
LPDIRECTDRAWSURFACE m_lpDDSBack; // DirectDraw back surface
|
|
||||||
SDL_Surface * m_lpSDLBack;
|
|
||||||
SDL_Cursor * m_lpCurrentCursor;
|
SDL_Cursor * m_lpCurrentCursor;
|
||||||
SDL_Cursor * m_lpSDLCursors[MAXCURSORS];
|
SDL_Cursor * m_lpSDLCursors[MAXCURSORS];
|
||||||
SDL_Surface * m_lpSDLBlupi;
|
SDL_Surface * m_lpSDLBlupi;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user