called from moveloop(); sets context.botl if temp hilites have timed out */
| 2276 | |
| 2277 | /* called from moveloop(); sets context.botl if temp hilites have timed out */ |
| 2278 | void |
| 2279 | status_eval_next_unhilite(void) |
| 2280 | { |
| 2281 | int i; |
| 2282 | struct istat_s *curr; |
| 2283 | long next_unhilite, this_unhilite; |
| 2284 | |
| 2285 | gb.bl_hilite_moves = svm.moves; /* simplified; at one point we used to |
| 2286 | * try to encode fractional amounts for |
| 2287 | * multiple moves within same turn */ |
| 2288 | /* figure out whether an unhilight needs to be performed now */ |
| 2289 | next_unhilite = 0L; |
| 2290 | for (i = 0; i < MAXBLSTATS; ++i) { |
| 2291 | curr = &gb.blstats[0][i]; /* blstats[0][*].time==blstats[1][*].time */ |
| 2292 | |
| 2293 | if (curr->chg) { |
| 2294 | struct istat_s *prev = &gb.blstats[1][i]; |
| 2295 | |
| 2296 | if (Is_Temp_Hilite(curr->hilite_rule)) |
| 2297 | curr->time = (gb.bl_hilite_moves + iflags.hilite_delta); |
| 2298 | else |
| 2299 | curr->time = 0L; |
| 2300 | prev->time = curr->time; |
| 2301 | |
| 2302 | curr->chg = prev->chg = FALSE; |
| 2303 | disp.botl = TRUE; |
| 2304 | } |
| 2305 | if (disp.botl) |
| 2306 | continue; /* just process other gb.blstats[][].time and .chg */ |
| 2307 | |
| 2308 | this_unhilite = curr->time; |
| 2309 | if (this_unhilite > 0L |
| 2310 | && (next_unhilite == 0L || this_unhilite < next_unhilite) |
| 2311 | && hilite_reset_needed(curr, this_unhilite + 1L)) { |
| 2312 | next_unhilite = this_unhilite; |
| 2313 | if (next_unhilite < gb.bl_hilite_moves) |
| 2314 | disp.botl = TRUE; |
| 2315 | } |
| 2316 | } |
| 2317 | } |
| 2318 | |
| 2319 | /* called by options handling when 'statushilites' value is changed */ |
| 2320 | void |
no test coverage detected