Browse Source

Have SDLWrap::AllocPalette allocate space for 256 colors by default

pull/2867/head
Vladimir Olteanu 5 years ago committed by Anders Jenbo
parent
commit
bcd7f89319
  1. 2
      Source/dx.cpp
  2. 2
      Source/storm/storm_svid.cpp
  3. 2
      Source/utils/sdl_wrap.h

2
Source/dx.cpp

@ -236,7 +236,7 @@ void dx_reinit()
void InitPalette()
{
Palette = SDLWrap::AllocPalette(256);
Palette = SDLWrap::AllocPalette();
}
void BltFast(SDL_Rect *srcRect, SDL_Rect *dstRect)

2
Source/storm/storm_svid.cpp

@ -229,7 +229,7 @@ bool SVidPlayBegin(const char *filename, int flags)
SVidWidth,
SDL_PIXELFORMAT_INDEX8);
SVidPalette = SDLWrap::AllocPalette(256);
SVidPalette = SDLWrap::AllocPalette();
if (SDLC_SetSurfaceColors(SVidSurface.get(), SVidPalette.get()) <= -1) {
ErrSdl();
}

2
Source/utils/sdl_wrap.h

@ -60,7 +60,7 @@ inline SDLTextureUniquePtr CreateTexture(SDL_Renderer *renderer, Uint32 format,
}
#endif
inline SDLPaletteUniquePtr AllocPalette(int ncolors)
inline SDLPaletteUniquePtr AllocPalette(int ncolors = 256)
{
return SDLPaletteUniquePtr { NonNull(SDL_AllocPalette(ncolors)) };
}

Loading…
Cancel
Save