Shuffle tile assignments to match descriptions, so a red potion isn't * displayed with a blue tile and so on. * * Tile assignments are not saved, and shouldn't be so that a game can * be resumed on an otherwise identical non-tile-using binary, so we have * to reshuffle the assignments from oc_descr_idx information when a game * is restored. So might as well do that the first time instead of
| 32 | * another routine. |
| 33 | */ |
| 34 | staticfn void |
| 35 | shuffle_tiles(void) |
| 36 | { |
| 37 | int i; |
| 38 | short tmp_tilemap[2][NUM_OBJECTS]; |
| 39 | |
| 40 | for (i = 0; i < NUM_OBJECTS; i++) { |
| 41 | tmp_tilemap[0][i] = glyphmap[objects[i].oc_descr_idx |
| 42 | + GLYPH_OBJ_OFF].tileidx; |
| 43 | tmp_tilemap[1][i] = glyphmap[objects[i].oc_descr_idx |
| 44 | + GLYPH_OBJ_PILETOP_OFF].tileidx; |
| 45 | } |
| 46 | for (i = 0; i < NUM_OBJECTS; i++) { |
| 47 | glyphmap[i + GLYPH_OBJ_OFF].tileidx = tmp_tilemap[0][i]; |
| 48 | glyphmap[i + GLYPH_OBJ_PILETOP_OFF].tileidx = tmp_tilemap[1][i]; |
| 49 | } |
| 50 | } |
| 51 | #endif /* TILES_IN_GLYPHMAP */ |
| 52 | |
| 53 | staticfn void |
no outgoing calls
no test coverage detected