annotate tools/libgutil.c @ 1556:8f06c23e197d last_SDL1

Cosmetics.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 May 2018 05:59:42 +0300
parents 59e9ad13b50e
children ef08af6887b7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1327
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * Common graphics utility functions for tools
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Programmed and designed by Matti 'ccr' Hamalainen
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 * (C) Copyright 2012-2015 Tecnic Software productions (TNSP)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 *
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * Please read file 'COPYING' for information on license and distribution.
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 */
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 #include "libgutil.h"
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 void dmFillRect(SDL_Surface *screen, int x0, int y0, int x1, int y1, Uint32 col)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 SDL_Rect rc;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 rc.x = x0;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 rc.y = y0;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 rc.w = x1 - x0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 rc.h = y1 - y0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 SDL_FillRect(screen, &rc, col);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 void dmDrawHLine(SDL_Surface *screen, int x0, int x1, int yc, const Uint32 col)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 const int bpp = screen->format->BytesPerPixel,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 DM_SWAP(int, x0, x1);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 if (yc < cy0|| yc > cy1 || x1 < cx0 || x0 > cx1) return;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 if (x0 < cx0) x0 = cx0;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 if (x1 > cx1) x1 = cx1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 int x = x1 - x0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 Uint8 *pix = ((Uint8 *) screen->pixels) + yc * screen->pitch + (x0 * bpp);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 switch (screen->format->BitsPerPixel)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 case 8:
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 while (x--)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 *pix++ = col;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 break;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 case 32:
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 Uint32 *p = (Uint32 *) pix;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 while (x--)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 *p++ = col;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 break;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 void dmDrawVLine(SDL_Surface *screen, int y0, int y1, int xc, const Uint32 col)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 const int bpp = screen->format->BytesPerPixel,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 pitch = screen->pitch / bpp,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1,
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 DM_SWAP(int, y0, y1);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 if (xc < cx0 || xc > cx1 || y1 < cy0 || y0 > cy1) return;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 if (y0 < cy0) y0 = cy0;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 if (y1 > cy1) y1 = cy1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 int y = y1 - y0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 Uint8 *pix = ((Uint8 *) screen->pixels) + y0 * screen->pitch + (xc * bpp);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 switch (screen->format->BitsPerPixel)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 case 8:
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 while (y--)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 *pix = col;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 pix += pitch;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 break;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 case 32:
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 Uint32 *p = (Uint32 *) pix;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 while (y--)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 *p = col;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 p += pitch;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 break;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 void dmDrawBox3D(SDL_Surface *screen, int x0, int y0, int x1, int y1, Uint32 ucol, Uint32 dcol)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 dmDrawHLine(screen, x0 , x1 - 1, y0, ucol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 dmDrawHLine(screen, x0 + 1, x1 , y1, dcol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 dmDrawVLine(screen, y0 , y1 - 1, x0, ucol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 dmDrawVLine(screen, y0 + 1, y1 , x1, dcol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103 void dmFillBox3D(SDL_Surface *screen, int x0, int y0, int x1, int y1, Uint32 bgcol, Uint32 ucol, Uint32 dcol)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 SDL_Rect rc;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 rc.x = x0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 rc.y = y0 + 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 rc.w = x1 - x0 - 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 rc.h = y1 - y0 - 1;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 SDL_FillRect(screen, &rc, bgcol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 dmDrawBox3D(screen, x0, y0, x1, y1, ucol, dcol);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 void dmDrawBMTextConstQ(SDL_Surface *screen, DMBitmapFont *font, int mode, int xc, int yc, const char *fmt)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 const char *ptr = fmt;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 DMUnscaledBlitFunc blit = NULL;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 while (*ptr)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 int ch = toupper(*ptr++);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 SDL_Surface *glyph;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 if (ch == '_')
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 xc += 4;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 continue;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133 if (ch >= 0 && ch < font->nglyphs && (glyph = font->glyphs[ch]) != NULL)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 if (blit == NULL)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 blit = dmGetUnscaledBlitFunc(glyph->format, screen->format, mode);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 blit(glyph, xc, yc, screen);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139 xc += font->width;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141 else
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 xc += font->width;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 void dmDrawBMTextVAQ(SDL_Surface *screen, DMBitmapFont *font, int mode, int xc, int yc, const char *fmt, va_list ap)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 char tmp[512];
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 vsnprintf(tmp, sizeof(tmp), fmt, ap);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 dmDrawBMTextConstQ(screen, font, mode, xc, yc, tmp);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 }
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 void dmDrawBMTextQ(SDL_Surface *screen, DMBitmapFont *font, int mode, int xc, int yc, const char *fmt, ...)
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 {
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 va_list ap;
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 va_start(ap, fmt);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 dmDrawBMTextVAQ(screen, font, mode, xc, yc, fmt, ap);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 va_end(ap);
59e9ad13b50e Move common functions to libgutil.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 }