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

Method getChar

src/Engine/Font.cpp:180–191  ·  view source on GitHub ↗

* Returns a particular character from the set stored in the font. * @param c Character to use for size/position. * @return Pointer to the font's surface with the respective * cropping rectangle set up. */

Source from the content-addressed store, hash-verified

178 * cropping rectangle set up.
179 */
180Surface *Font::getChar(wchar_t c)
181{
182 if (_chars.find(c) == _chars.end())
183 {
184 return 0;
185 }
186 _surface->getCrop()->x = _chars[c].x;
187 _surface->getCrop()->y = _chars[c].y;
188 _surface->getCrop()->w = _chars[c].w;
189 _surface->getCrop()->h = _chars[c].h;
190 return _surface;
191}
192/**
193 * Returns the maximum width for any character in the font.
194 * @return Width in pixels.

Callers 3

addRowMethod · 0.80
processTextMethod · 0.80
drawMethod · 0.80

Calls 1

getCropMethod · 0.80

Tested by

no test coverage detected