consolidate SDL icon changing code
This commit is contained in:
@@ -28,8 +28,6 @@
|
||||
#include "SDL_video.h" // for SDL_Surface
|
||||
#include "SDL_utils.h"
|
||||
#include "Dxerr8.h"
|
||||
#include "SDL_image.h" // for setting icon
|
||||
#include "SDL_rotozoom.h" // for setting icon
|
||||
|
||||
#include "arch/arch.h"
|
||||
|
||||
@@ -358,21 +356,7 @@ bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, i
|
||||
{
|
||||
/* Set SDL window title and icon -before- creating the window */
|
||||
SDL_WM_SetCaption(sWindowTitle, "");
|
||||
|
||||
SDL_Surface *srf = IMG_Load(sIconFile);
|
||||
SDL_SetColorKey( srf, SDL_SRCCOLORKEY, SDL_MapRGB(srf->format, 0xFF, 0, 0xFF));
|
||||
|
||||
/* Windows icons are 32x32 and SDL can't resize them for us, which
|
||||
* causes mask corruption. (Actually, the above icon *is* 32x32;
|
||||
* this is here just in case it changes.) */
|
||||
ConvertSDLSurface(srf, srf->w, srf->h,
|
||||
32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF);
|
||||
zoomSurface(srf, 32, 32);
|
||||
|
||||
SDL_SetAlpha( srf, SDL_SRCALPHA, SDL_ALPHA_OPAQUE );
|
||||
SDL_WM_SetIcon(srf, NULL /* derive from alpha */);
|
||||
SDL_FreeSurface(srf);
|
||||
|
||||
mySDL_WM_SetIcon( sIconFile );
|
||||
|
||||
|
||||
// HACK: On Windows 98, we can't call SDL_SetVideoMode while D3D is full screen.
|
||||
|
||||
Reference in New Issue
Block a user