MCPcopy Create free account
hub / github.com/DFHack/dfhack / updateWindow

Method updateWindow

plugins/rendermax/renderer_light.cpp:297–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295 threading.waitForWrites();
296}
297void 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}
322void lightingEngineViewscreen::preRender()
323{
324

Callers 2

Calls 4

getMapViewportFunction · 0.85
invalidateRectMethod · 0.80
sizeMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected