fixed problem with changing video modes on machines that use emulated bpp

This commit is contained in:
uid68803 2004-01-30 16:08:39 +00:00
parent ce08e91586
commit 31eaa2dfff
3 changed files with 5 additions and 8 deletions

View file

@ -611,8 +611,11 @@ bool show_video_mode_dialog(display& disp)
std::vector<std::string> options;
CVideo& video = disp.video();
video.setBitsPerPixel(video.getBpp());
SDL_Rect** modes = SDL_ListModes(video.getSurface()->format,FULL_SCREEN);
SDL_PixelFormat format = *video.getSurface()->format;
format.BitsPerPixel = video.getBpp();
SDL_Rect** modes = SDL_ListModes(&format,FULL_SCREEN);
//the SDL documentation says that a return value of -1 if no dimension
//is available.

View file

@ -254,11 +254,6 @@ SDL_Surface* CVideo::getSurface( void )
bool CVideo::isFullScreen() const { return fullScreen; }
void CVideo::setBitsPerPixel( int bpp )
{
frameBuffer->format->BitsPerPixel = bpp;
}
void CVideo::setBpp( int bpp )
{
this->bpp = bpp;

View file

@ -58,7 +58,6 @@ class CVideo {
struct quit {};
//functions to allow changing video modes when 16BPP is emulated
void setBitsPerPixel( int bpp );
void setBpp( int bpp );
int getBpp();
private: