MCPcopy Create free account
hub / github.com/NetHack/NetHack / add_unicode_index

Function add_unicode_index

sys/msdos/font.c:191–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static void
192add_unicode_index(struct BitmapFont *font, uint32 ch, unsigned index)
193{
194 unsigned i, j, k;
195
196 i = (unsigned) (ch >> 16);
197 j = (unsigned) ((ch >> 8) & 0xFF);
198 k = (unsigned) (ch & 0xFF);
199
200 if (font->unicode[i] == NULL) {
201 /* Create the second level node */
202 font->unicode[i] = (unsigned **) alloc(256 * sizeof(unsigned *));
203 memset(font->unicode[i], 0, 256 * sizeof(unsigned *));
204 }
205 if (font->unicode[i][j] == NULL) {
206 /* Create the third level node */
207 font->unicode[i][j] = (unsigned *) alloc(256 * sizeof(unsigned));
208 memset(font->unicode[i][j], 0, 256 * sizeof(unsigned));
209 }
210 font->unicode[i][j][k] = index;
211}
212
213static uint32
214read_u32(const unsigned char *buf)

Callers 1

load_fontFunction · 0.85

Calls 1

allocFunction · 0.50

Tested by

no test coverage detected