Stop calling face_text_pos() for faces that don't need to have text in

them anyway. It's slow and pointless.

[originally from svn r9155]
This commit is contained in:
Simon Tatham
2011-04-23 11:44:41 +00:00
parent 8713e2fa81
commit 079e0d1328

View File

@ -3735,10 +3735,12 @@ static void game_redraw_in_rect(drawing *dr, game_drawstate *ds,
draw_rect(dr, x, y, w, h, COL_BACKGROUND); draw_rect(dr, x, y, w, h, COL_BACKGROUND);
for (i = 0; i < g->num_faces; i++) { for (i = 0; i < g->num_faces; i++) {
if (state->clues[i] >= 0) {
face_text_bbox(ds, g, &g->faces[i], &bx, &by, &bw, &bh); face_text_bbox(ds, g, &g->faces[i], &bx, &by, &bw, &bh);
if (boxes_intersect(x, y, w, h, bx, by, bw, bh)) if (boxes_intersect(x, y, w, h, bx, by, bw, bh))
game_redraw_clue(dr, ds, state, i); game_redraw_clue(dr, ds, state, i);
} }
}
for (phase = 0; phase < NPHASES; phase++) { for (phase = 0; phase < NPHASES; phase++) {
for (i = 0; i < g->num_edges; i++) { for (i = 0; i < g->num_edges; i++) {
edge_bbox(ds, g, &g->edges[i], &bx, &by, &bw, &bh); edge_bbox(ds, g, &g->edges[i], &bx, &by, &bw, &bh);