diff src/dmtext_bm.c @ 1557:5e5f75b45f8d

Initial port to SDL2. Many things will not work now.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 May 2018 06:00:50 +0300
parents e06abfde6c39
children a3983da9b8b9
line wrap: on
line diff
--- a/src/dmtext_bm.c	Sun May 13 05:59:42 2018 +0300
+++ b/src/dmtext_bm.c	Sun May 13 06:00:50 2018 +0300
@@ -113,7 +113,7 @@
         SDL_Surface *glyph = font->glyphs[i];
         if (glyph != NULL)
         {
-            SDL_SetColors(glyph, pal, start, size);
+            SDL_SetPaletteColors(glyph->format->palette, pal, start, size);
         }
     }
 
@@ -224,7 +224,7 @@
         for (n = 0; n < DMFONT_NPALETTE; n++)
         {
             pal[n].r = pal[n].g = pal[n].b = 0;
-            pal[n].unused = n > 0 ? 255 : 0;
+            pal[n].a = n > 0 ? 255 : 0;
         }
 
         if (tsfont)
@@ -272,15 +272,13 @@
             // Allocate bitmap
             font->glyphs[index] = glyph = SDL_CreateRGBSurface(
                 SDL_SWSURFACE, width, height,
-                BitsPerPixel, Rmask, Gmask,
-                Bmask,
-                Amask);
+                BitsPerPixel, Rmask, Gmask, Bmask, Amask);
 
             if (glyph == NULL)
                 return DMERR_MALLOC;
 
             if (BitsPerPixel == 8)
-                SDL_SetColors(glyph, pal, 0, DMFONT_NPALETTE);
+                SDL_SetPaletteColors(glyph->format->palette, pal, 0, DMFONT_NPALETTE);
 
             // Read pixel data
             pixels = glyph->pixels;