MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / loadTerminal

Method loadTerminal

src/Engine/Font.cpp:87–107  ·  view source on GitHub ↗

* Generates a pre-defined Codepage 437 (MS-DOS terminal) font. */

Source from the content-addressed store, hash-verified

85 * Generates a pre-defined Codepage 437 (MS-DOS terminal) font.
86 */
87void 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/**

Callers 1

StartStateMethod · 0.80

Calls 3

initFunction · 0.85
setPaletteMethod · 0.45
getSurfaceMethod · 0.45

Tested by

no test coverage detected