# HG changeset patch # User Matti Hamalainen # Date 1530308742 -10800 # Node ID a3983da9b8b9a9241a5d8880733183ae8babd5d6 # Parent f8e2728c1b7f7fdd80b9825e93d776f67b0ece35 Constify. diff -r f8e2728c1b7f -r a3983da9b8b9 src/dmtext.h --- a/src/dmtext.h Fri Jun 29 22:16:51 2018 +0300 +++ b/src/dmtext.h Sat Jun 30 00:45:42 2018 +0300 @@ -47,10 +47,10 @@ } DMBitmapFont; -DMBitmapFont *dmNewBitmapFont(int nglyphs, int width, int height); +DMBitmapFont *dmNewBitmapFont(const int nglyphs, const int width, const int height); int dmFreeBitmapFont(DMBitmapFont *font); int dmLoadBitmapFont(DMResource *res, DMBitmapFont **pfont); -int dmSetBitmapFontPalette(DMBitmapFont *font, SDL_Color *pal, int start, int size); +int dmSetBitmapFontPalette(DMBitmapFont *font, const SDL_Color *pal, const int start, const int size); void dmDrawBMTextConst(SDL_Surface *screen, DMBitmapFont *font, BOOL condensed, int mode, int xc, int yc, const char *str); @@ -71,9 +71,9 @@ /* TTF text drawing */ #ifdef DM_GFX_TTF_TEXT -void dmDrawTTFTextConst(SDL_Surface *screen, TTF_Font *font, SDL_Color col, int x, int y, const char *fmt); -void dmDrawTTFTextVA(SDL_Surface *screen, TTF_Font *font, SDL_Color col, int x, int y, const char *fmt, va_list ap); -void dmDrawTTFText(SDL_Surface *screen, TTF_Font *font, SDL_Color col, int x, int y, const char *fmt, ...); +void dmDrawTTFTextConst(SDL_Surface *screen, TTF_Font *font, SDL_Color col, const int xc, const int yc, const char *fmt); +void dmDrawTTFTextVA(SDL_Surface *screen, TTF_Font *font, SDL_Color col, const int xc, const int yc, const char *fmt, va_list ap); +void dmDrawTTFText(SDL_Surface *screen, TTF_Font *font, SDL_Color col, const int xc, const int yc, const char *fmt, ...); #endif diff -r f8e2728c1b7f -r a3983da9b8b9 src/dmtext_bm.c --- a/src/dmtext_bm.c Fri Jun 29 22:16:51 2018 +0300 +++ b/src/dmtext_bm.c Sat Jun 30 00:45:42 2018 +0300 @@ -53,7 +53,7 @@ } -DMBitmapFont *dmNewBitmapFont(int nglyphs, int width, int height) +DMBitmapFont *dmNewBitmapFont(const int nglyphs, const int width, const int height) { DMBitmapFont *font = dmMalloc0(sizeof(DMBitmapFont)); if (font == NULL) @@ -98,7 +98,7 @@ * specify 'start' and 'end' indices and palette array freely, you should * typically use DMFONT_NPALETTE size palette starting at index 0. */ -int dmSetBitmapFontPalette(DMBitmapFont *font, SDL_Color *pal, int start, int size) +int dmSetBitmapFontPalette(DMBitmapFont *font, const SDL_Color *pal, const int start, const int size) { int i; @@ -120,6 +120,7 @@ return DMERR_OK; } + //#define FN_DEBUG int dmLoadBitmapFont(DMResource *res, DMBitmapFont **pfont)