| 4284 | } |
| 4285 | |
| 4286 | NetHackQtGlyphs::NetHackQtGlyphs() |
| 4287 | { |
| 4288 | const char* tile_file = "nhtiles.bmp"; |
| 4289 | if ( iflags.wc_tile_file ) |
| 4290 | tile_file = iflags.wc_tile_file; |
| 4291 | |
| 4292 | if (!img.load(tile_file)) { |
| 4293 | tile_file = "x11tiles"; |
| 4294 | if (!img.load(tile_file)) { |
| 4295 | QString msg; |
| 4296 | msg.sprintf("Cannot load x11tiles or nhtiles.bmp"); |
| 4297 | QMessageBox::warning(0, "IO Error", msg); |
| 4298 | } else { |
| 4299 | tiles_per_row = TILES_PER_ROW; |
| 4300 | if (img.width()%tiles_per_row) { |
| 4301 | impossible( |
| 4302 | "Tile file \"%s\" has %d columns, not multiple of row count (%d)", |
| 4303 | tile_file, img.width(), tiles_per_row); |
| 4304 | } |
| 4305 | } |
| 4306 | } else { |
| 4307 | tiles_per_row = 40; |
| 4308 | } |
| 4309 | |
| 4310 | if ( iflags.wc_tile_width ) |
| 4311 | tilefile_tile_W = iflags.wc_tile_width; |
| 4312 | else |
| 4313 | tilefile_tile_W = img.width() / tiles_per_row; |
| 4314 | if ( iflags.wc_tile_height ) |
| 4315 | tilefile_tile_H = iflags.wc_tile_height; |
| 4316 | else |
| 4317 | tilefile_tile_H = tilefile_tile_W; |
| 4318 | |
| 4319 | setSize(tilefile_tile_W, tilefile_tile_H); |
| 4320 | } |
| 4321 | |
| 4322 | void NetHackQtGlyphs::drawGlyph(QPainter& painter, int glyph, int x, int y) |
| 4323 | { |
nothing calls this directly
no test coverage detected