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

Method fix

src/Engine/Font.cpp:260–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void Font::fix(const std::string &file, int width)
261{
262 Surface *s = new Surface(width, 512);
263
264 s->setPalette(_palette, 0, 6);
265 _surface->setPalette(_palette, 0, 6);
266
267 int x = 0;
268 int y = 0;
269 for (size_t i = 0; i < _index.length(); ++i)
270 {
271 SDL_Rect rect = _chars[_index[i]];
272 _surface->getCrop()->x = rect.x;
273 _surface->getCrop()->y = rect.y;
274 _surface->getCrop()->w = rect.w;
275 _surface->getCrop()->h = rect.h;
276 _surface->setX(x);
277 _surface->setY(y);
278 _surface->blit(s);
279 x += _width;
280 if (x == width)
281 {
282 x = 0;
283 y += _height;
284 }
285 }
286
287 SDL_SaveBMP(s->getSurface(), file.c_str());
288}
289
290}

Callers

nothing calls this directly

Calls 6

getCropMethod · 0.80
setPaletteMethod · 0.45
setXMethod · 0.45
setYMethod · 0.45
blitMethod · 0.45
getSurfaceMethod · 0.45

Tested by

no test coverage detected