| 324 | |
| 325 | } |
| 326 | void lightingEngineViewscreen::fixAdvMode(int mode) |
| 327 | { |
| 328 | |
| 329 | MapExtras::MapCache mc; |
| 330 | const rgbf dim(levelDim,levelDim,levelDim); |
| 331 | rect2d vp=getMapViewport(); |
| 332 | int window_x=*df::global::window_x; |
| 333 | int window_y=*df::global::window_y; |
| 334 | int window_z=*df::global::window_z; |
| 335 | //mode 0-> make dark non-visible parts |
| 336 | if(mode==0) |
| 337 | { |
| 338 | for(int x=vp.first.x;x<vp.second.x;x++) |
| 339 | for(int y=vp.first.y;y<vp.second.y;y++) |
| 340 | { |
| 341 | df::tile_designation d=mc.designationAt(DFCoord(window_x+x,window_y+y,window_z)); |
| 342 | if(d.bits.pile!=1) |
| 343 | { |
| 344 | lightMap[getIndex(x,y)]=dim; |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | //mode 1-> make everything visible, let the lighting hide stuff |
| 349 | else if(mode==1) |
| 350 | { |
| 351 | for(int x=vp.first.x;x<vp.second.x;x++) |
| 352 | for(int y=vp.first.y;y<vp.second.y;y++) |
| 353 | { |
| 354 | df::tile_designation d=mc.designationAt(DFCoord(window_x+x,window_y+y,window_z)); |
| 355 | d.bits.dig=df::tile_dig_designation::Default;//TODO add union and flag there |
| 356 | d.bits.hidden=0; |
| 357 | d.bits.pile = 1; |
| 358 | mc.setDesignationAt(DFCoord(window_x+x,window_y+y,window_z),d); |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | void lightSource::combine(const lightSource& other) |
| 363 | { |
| 364 | power=blend(power,other.power); |
nothing calls this directly
no test coverage detected