commit 32417a5e76150c402dc6530d8867028c163f9ca2
parent 0da906ef71863c3a044355b9bfc1a46e9519d9f3
Author: rexim <reximkut@gmail.com>
Date: Wed, 7 Jul 2021 16:56:39 +0700
Remove unused SDL code
Diffstat:
2 files changed, 0 insertions(+), 43 deletions(-)
diff --git a/src/sdl_extra.c b/src/sdl_extra.c
@@ -19,47 +19,6 @@ void *scp(void *ptr)
return ptr;
}
-SDL_Surface *surface_from_file(const char *file_path)
-{
- int width, height, n;
- unsigned char *pixels = stbi_load(file_path, &width, &height, &n, STBI_rgb_alpha);
- if (pixels == NULL) {
- fprintf(stderr, "ERROR: could not load file %s: %s\n",
- file_path, stbi_failure_reason());
- exit(1);
- }
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- const Uint32 rmask = 0xff000000;
- const Uint32 gmask = 0x00ff0000;
- const Uint32 bmask = 0x0000ff00;
- const Uint32 amask = 0x000000ff;
-#else // little endian, like x86
- const Uint32 rmask = 0x000000ff;
- const Uint32 gmask = 0x0000ff00;
- const Uint32 bmask = 0x00ff0000;
- const Uint32 amask = 0xff000000;
-#endif
-
- const int depth = 32;
- const int pitch = 4*width;
-
- return scp(SDL_CreateRGBSurfaceFrom(
- (void*)pixels, width, height, depth, pitch,
- rmask, gmask, bmask, amask));
-}
-
-void set_texture_color(SDL_Texture *texture, Uint32 color)
-{
- scc(SDL_SetTextureColorMod(
- texture,
- (color >> (8 * 0)) & 0xff,
- (color >> (8 * 1)) & 0xff,
- (color >> (8 * 2)) & 0xff));
-
- scc(SDL_SetTextureAlphaMod(texture, (color >> (8 * 3)) & 0xff));
-}
-
Vec2f window_size(SDL_Window *window)
{
int w, h;
diff --git a/src/sdl_extra.h b/src/sdl_extra.h
@@ -17,8 +17,6 @@ void scc(int code);
// SDL Check Pointer
void *scp(void *ptr);
-SDL_Surface *surface_from_file(const char *file_path);
-void set_texture_color(SDL_Texture *texture, Uint32 color);
Vec2f window_size(SDL_Window *window);
#endif // SDL_EXTRA_H_