* Generates a pre-defined Codepage 437 (MS-DOS terminal) font. */
| 85 | * Generates a pre-defined Codepage 437 (MS-DOS terminal) font. |
| 86 | */ |
| 87 | void Font::loadTerminal() |
| 88 | { |
| 89 | _width = 9; |
| 90 | _height = 16; |
| 91 | _spacing = 0; |
| 92 | _monospace = true; |
| 93 | |
| 94 | SDL_RWops *rw = SDL_RWFromConstMem(dosFont, DOSFONT_SIZE); |
| 95 | SDL_Surface *s = SDL_LoadBMP_RW(rw, 0); |
| 96 | SDL_FreeRW(rw); |
| 97 | _surface = new Surface(s->w, s->h); |
| 98 | SDL_Color terminal[2] = {{0, 0, 0, 0}, {185, 185, 185, 255}}; |
| 99 | _surface->setPalette(terminal, 0, 2); |
| 100 | SDL_BlitSurface(s, 0, _surface->getSurface(), 0); |
| 101 | SDL_FreeSurface(s); |
| 102 | |
| 103 | std::wstring temp = _index; |
| 104 | _index = L" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; |
| 105 | init(); |
| 106 | _index = temp; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | /** |
no test coverage detected