mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-20 09:17:19 +07:00
Fog block hiding
This commit is contained in:
parent
99b01f3a3c
commit
3c546ec24f
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB |
@ -396,9 +396,10 @@ public class BlockRenderer{
|
||||
|
||||
Draw.z(Layer.block);
|
||||
|
||||
boolean visible = (build == null || !build.inFogTo(pteam)/* || build.wasVisible*/);
|
||||
boolean visible = (build == null || !build.inFogTo(pteam));
|
||||
|
||||
if(block != Blocks.air && visible){
|
||||
//comment wasWasible part for hiding?
|
||||
if(block != Blocks.air && (visible || build.wasVisible)){
|
||||
block.drawBase(tile);
|
||||
Draw.reset();
|
||||
Draw.z(Layer.block);
|
||||
@ -410,8 +411,10 @@ public class BlockRenderer{
|
||||
}
|
||||
|
||||
if(build != null){
|
||||
if(!build.wasVisible) updateShadow(build);
|
||||
build.wasVisible = true;
|
||||
if(visible){
|
||||
if(!build.wasVisible) updateShadow(build);
|
||||
build.wasVisible = true;
|
||||
}
|
||||
|
||||
if(build.damaged()){
|
||||
Draw.z(Layer.blockCracks);
|
||||
@ -432,8 +435,8 @@ public class BlockRenderer{
|
||||
}else if(!visible){
|
||||
//TODO here is the question: should buildings you lost sight of remain rendered? if so, how should this information be stored?
|
||||
//comment lines below for buggy persistence
|
||||
if(build.wasVisible) updateShadow(build);
|
||||
build.wasVisible = false;
|
||||
//if(build.wasVisible) updateShadow(build);
|
||||
//build.wasVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,7 @@ public class EnvRenderers{
|
||||
|
||||
//TODO layer looks better? should not be conditional
|
||||
Draw.z(state.rules.fog ? Layer.fogOfWar + 1 : Layer.weather - 1);
|
||||
Weather.drawNoiseLayers(tex, Color.scarlet, 1000f, 0.23f, 0.4f, 1f, 1f, 0f,
|
||||
4, -1.3f, 0.7f, 0.8f, 0.9f);
|
||||
Weather.drawNoiseLayers(tex, Color.scarlet, 1000f, 0.24f, 0.4f, 1f, 1f, 0f, 4, -1.3f, 0.7f, 0.8f, 0.9f);
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user