mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 13:56:00 +00:00
SDL API renaming: SDL_surface.h
Fixes https://github.com/libsdl-org/SDL/issues/6884
This commit is contained in:
@@ -123,7 +123,7 @@ initializeTextures(SDL_Renderer *renderer)
|
||||
fatalError("could not ship.bmp");
|
||||
}
|
||||
/* set blue to transparent on the ship */
|
||||
SDL_SetColorKey(bmp_surface, 1,
|
||||
SDL_SetSurfaceColorKey(bmp_surface, 1,
|
||||
SDL_MapRGB(bmp_surface->format, 0, 0, 255));
|
||||
|
||||
/* create ship texture from surface */
|
||||
@@ -137,7 +137,7 @@ initializeTextures(SDL_Renderer *renderer)
|
||||
shipData.rect.w = bmp_surface->w;
|
||||
shipData.rect.h = bmp_surface->h;
|
||||
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_DestroySurface(bmp_surface);
|
||||
|
||||
/* load the space background */
|
||||
bmp_surface = SDL_LoadBMP("space.bmp");
|
||||
@@ -149,7 +149,7 @@ initializeTextures(SDL_Renderer *renderer)
|
||||
if (space == NULL) {
|
||||
fatalError("could not create space texture");
|
||||
}
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_DestroySurface(bmp_surface);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -357,8 +357,8 @@ initializeTexture()
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, bmp_surface_rgba8888->pixels);
|
||||
|
||||
/* free bmp surface and converted bmp surface */
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_FreeSurface(bmp_surface_rgba8888);
|
||||
SDL_DestroySurface(bmp_surface);
|
||||
SDL_DestroySurface(bmp_surface_rgba8888);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -113,7 +113,7 @@ initializeTexture(SDL_Renderer *renderer)
|
||||
fatalError("could not load bmp");
|
||||
}
|
||||
/* set white to transparent on the happyface */
|
||||
SDL_SetColorKey(bmp_surface, 1,
|
||||
SDL_SetSurfaceColorKey(bmp_surface, 1,
|
||||
SDL_MapRGB(bmp_surface->format, 255, 255, 255));
|
||||
|
||||
/* convert RGBA surface to texture */
|
||||
@@ -124,7 +124,7 @@ initializeTexture(SDL_Renderer *renderer)
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
|
||||
/* free up allocated memory */
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_DestroySurface(bmp_surface);
|
||||
}
|
||||
|
||||
int
|
||||
|
@@ -171,7 +171,7 @@ loadFont(void)
|
||||
return 0;
|
||||
} else {
|
||||
/* set the transparent color for the bitmap font (hot pink) */
|
||||
SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
|
||||
SDL_SetSurfaceColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
|
||||
/* now we convert the surface to our desired pixel format */
|
||||
int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */
|
||||
|
||||
@@ -186,8 +186,8 @@ loadFont(void)
|
||||
/* set blend mode for our texture */
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
}
|
||||
SDL_FreeSurface(surface);
|
||||
SDL_FreeSurface(converted);
|
||||
SDL_DestroySurface(surface);
|
||||
SDL_DestroySurface(converted);
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ initializeTexture(SDL_Renderer *renderer)
|
||||
}
|
||||
brush =
|
||||
SDL_CreateTextureFromSurface(renderer, bmp_surface);
|
||||
SDL_FreeSurface(bmp_surface);
|
||||
SDL_DestroySurface(bmp_surface);
|
||||
if (brush == NULL) {
|
||||
fatalError("could not create brush texture");
|
||||
}
|
||||
|
Reference in New Issue
Block a user