deal with a few minor errors

This commit is contained in:
Tim Felgentreff 2022-04-27 21:23:43 +02:00
parent 3a0c61d6ad
commit 875f438778
2 changed files with 9 additions and 2 deletions

View file

@ -1152,6 +1152,10 @@ static inline void dither(SDL_Surface *Surface) {
static void applyAlphaGrayscaleToSurface(SDL_Surface **src, int alpha)
{
SDL_Surface *alphaSurface = SDL_CreateRGBSurface(0, (*src)->w, (*src)->h, 32, RMASK, GMASK, BMASK, AMASK);
if (!alphaSurface) {
DebugPrint("%s\n" _C_ SDL_GetError());
Assert(false);
}
SDL_BlitSurface(*src, NULL, alphaSurface, NULL);
SDL_SetSurfaceAlphaMod(alphaSurface, alpha);
SDL_SetSurfaceColorMod(alphaSurface, 0, 0, 0);
@ -1163,6 +1167,10 @@ static void shrinkSurfaceFramesInY(SDL_Surface **src, int shrink, int numFrames,
{
shrink = std::abs(shrink);
SDL_Surface *alphaSurface = SDL_CreateRGBSurface(0, (*src)->w, (*src)->h, 32, RMASK, GMASK, BMASK, AMASK);
if (!alphaSurface) {
DebugPrint("%s\n" _C_ SDL_GetError());
Assert(false);
}
for (int f = 0; f < numFrames; f++) {
int frameX = frameMap[f].x;
int frameY = frameMap[f].y;

View file

@ -225,9 +225,8 @@ Mng *Mng::New(const std::string &name)
mng = new Mng();
mng->name = LibraryFileName(name.c_str());
Assert(mng);
} else {
mng->refcnt++;
}
mng->refcnt++;
return mng;
}