Skip to content

Commit

Permalink
Take PREALLOC flag into account when setting video mode (ticket #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
capehill committed May 2, 2019
2 parents 87e20d1 + 91caaae commit b4bd818
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/video/amigaos4/SDL_os4video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ os4video_GetFlagString(Uint32 flags)
if ((flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT) SDL_strlcat(buffer, "OPENGLBLIT ", sizeof(buffer));
if (flags & SDL_RESIZABLE) SDL_strlcat(buffer, "RESIZEABLE ", sizeof(buffer));
if (flags & SDL_NOFRAME) SDL_strlcat(buffer, "NOFRAME ", sizeof(buffer));
if (flags & SDL_PREALLOC) SDL_strlcat(buffer, "PREALLOC", sizeof(buffer));

return buffer;
}
Expand All @@ -1536,7 +1537,7 @@ os4video_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bp
BOOL needResize = FALSE;
int success = TRUE;

const Uint32 flagMask = SDL_HWPALETTE | SDL_DOUBLEBUF | SDL_FULLSCREEN |
const Uint32 flagMask = SDL_HWPALETTE | SDL_DOUBLEBUF | SDL_FULLSCREEN | SDL_PREALLOC |
SDL_OPENGL | SDL_OPENGLBLIT | SDL_RESIZABLE | SDL_NOFRAME | SDL_ANYFORMAT;

dprintf("Requesting new video mode %dx%dx%d\n", width, height, bpp);
Expand All @@ -1551,16 +1552,28 @@ os4video_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bp
if (current->w != width || current->h != height)
{
if (!(current->flags & SDL_FULLSCREEN))
{
dprintf("Requesting window resize\n");
needResize = TRUE;
}
else
{
dprintf("Requesting screen with new size\n");
needNew = TRUE;
}
}

if (current->format->BitsPerPixel != bpp)
{
dprintf("Bits per pixel differ\n");
needNew = TRUE;
}

if ((current->flags & flagMask) ^ flags)
{
dprintf("Surface flags differ\n");
needNew = TRUE;
}
}
else
needNew = TRUE;
Expand Down

0 comments on commit b4bd818

Please sign in to comment.