| 295 | threading.waitForWrites(); |
| 296 | } |
| 297 | void lightingEngineViewscreen::updateWindow() |
| 298 | { |
| 299 | std::lock_guard<std::mutex> guard{myRenderer->dataMutex}; |
| 300 | if(lightMap.size()!=myRenderer->lightGrid.size()) |
| 301 | { |
| 302 | reinit(); |
| 303 | myRenderer->invalidate(); |
| 304 | return; |
| 305 | } |
| 306 | |
| 307 | bool isAdventure=(*df::global::gametype==df::game_type::ADVENTURE_ARENA)|| |
| 308 | (*df::global::gametype==df::game_type::ADVENTURE_MAIN); |
| 309 | if(isAdventure) |
| 310 | { |
| 311 | fixAdvMode(adv_mode); |
| 312 | } |
| 313 | |
| 314 | if(doDebug) |
| 315 | std::swap(ocupancy,myRenderer->lightGrid); |
| 316 | else |
| 317 | std::swap(lightMap,myRenderer->lightGrid); |
| 318 | rect2d vp=getMapViewport(); |
| 319 | |
| 320 | myRenderer->invalidateRect(vp.first.x,vp.first.y,vp.second.x-vp.first.x,vp.second.y-vp.first.y); |
| 321 | } |
| 322 | void lightingEngineViewscreen::preRender() |
| 323 | { |
| 324 |
no test coverage detected