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

Method load

src/Engine/Font.cpp:67–82  ·  view source on GitHub ↗

* Loads the font from a YAML file. * @param node YAML node. */

Source from the content-addressed store, hash-verified

65* @param node YAML node.
66*/
67void Font::load(const YAML::Node &node)
68{
69 _width = node["width"].as<int>(_width);
70 _height = node["height"].as<int>(_height);
71 _spacing = node["spacing"].as<int>(_spacing);
72 _monospace = node["monospace"].as<bool>(_monospace);
73 std::string image = "Language/" + node["image"].as<std::string>();
74
75 Surface *fontTemp = new Surface(_width, _height);
76 fontTemp->loadImage(CrossPlatform::getDataFile(image));
77 _surface = new Surface(fontTemp->getWidth(), fontTemp->getHeight());
78 _surface->setPalette(_palette, 0, 6);
79 fontTemp->blit(_surface);
80 delete fontTemp;
81 init();
82}
83
84/**
85 * Generates a pre-defined Codepage 437 (MS-DOS terminal) font.

Callers 6

updateOptionsFunction · 0.45
loadFunction · 0.45
loadLanguageMethod · 0.45
loadRulesetMethod · 0.45
loadCatMethod · 0.45
loadMIDIMethod · 0.45

Calls 7

getDataFileFunction · 0.85
initFunction · 0.85
loadImageMethod · 0.80
getWidthMethod · 0.45
getHeightMethod · 0.45
setPaletteMethod · 0.45
blitMethod · 0.45

Tested by

no test coverage detected