| 258 | } |
| 259 | |
| 260 | void 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 | } |
nothing calls this directly
no test coverage detected