2002-11-18 21:37:58 +00:00
|
|
|
#include "../../stdafx.h"
|
|
|
|
|
|
2003-02-14 18:50:44 +00:00
|
|
|
#include "SDL_image.h"
|
2002-11-18 21:37:58 +00:00
|
|
|
#include "LoadingWindow_SDL.h"
|
|
|
|
|
|
|
|
|
|
#include "loading.xpm"
|
|
|
|
|
|
|
|
|
|
LoadingWindow_SDL::LoadingWindow_SDL()
|
|
|
|
|
{
|
|
|
|
|
/* Initialize the SDL library */
|
|
|
|
|
if( SDL_InitSubSystem(SDL_INIT_VIDEO) < 0 )
|
2003-01-18 03:05:51 +00:00
|
|
|
RageException::Throw( "Couldn't initialize SDL: %s\n", SDL_GetError() );
|
2002-11-18 21:37:58 +00:00
|
|
|
|
|
|
|
|
/* Load the BMP file into a surface */
|
|
|
|
|
SDL_Surface *image = IMG_ReadXPMFromArray(loading);
|
|
|
|
|
if( image == NULL )
|
2003-01-18 03:05:51 +00:00
|
|
|
RageException::Throw("Couldn't load loading.bmp: %s\n",SDL_GetError());
|
2002-11-18 21:37:58 +00:00
|
|
|
|
|
|
|
|
/* Initialize the display in a 640x480 16-bit mode */
|
|
|
|
|
loading_screen = SDL_SetVideoMode(image->w, image->h, 16, SDL_SWSURFACE|SDL_ANYFORMAT|SDL_NOFRAME);
|
|
|
|
|
if( loading_screen == NULL )
|
2003-01-18 03:05:51 +00:00
|
|
|
RageException::Throw( "Couldn't initialize loading window: %s\n", SDL_GetError() );
|
2002-11-18 21:37:58 +00:00
|
|
|
|
|
|
|
|
/* Blit onto the screen surface */
|
|
|
|
|
SDL_BlitSurface(image, NULL, loading_screen, NULL);
|
|
|
|
|
|
|
|
|
|
/* Free the allocated BMP surface */
|
|
|
|
|
SDL_FreeSurface(image);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LoadingWindow_SDL::~LoadingWindow_SDL()
|
|
|
|
|
{
|
|
|
|
|
SDL_QuitSubSystem( SDL_INIT_VIDEO );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LoadingWindow_SDL::Paint()
|
|
|
|
|
{
|
|
|
|
|
SDL_UpdateRect(loading_screen, 0,0,0,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Chris Danford
|
|
|
|
|
* Glenn Maynard
|
|
|
|
|
*/
|