Browse Source

Remove unused SDL code

rexim 4 years ago
parent
commit
32417a5e76
2 changed files with 0 additions and 43 deletions
  1. 0 41
      src/sdl_extra.c
  2. 0 2
      src/sdl_extra.h

+ 0 - 41
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;

+ 0 - 2
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_