mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 08:18:13 +07:00
Fixed #8680
This commit is contained in:
@ -209,6 +209,8 @@ public class Renderer implements ApplicationListener{
|
|||||||
landTime = 0f;
|
landTime = 0f;
|
||||||
graphics.clear(Color.black);
|
graphics.clear(Color.black);
|
||||||
}else{
|
}else{
|
||||||
|
minimap.update();
|
||||||
|
|
||||||
if(shakeTime > 0){
|
if(shakeTime > 0){
|
||||||
float intensity = shakeIntensity * (settings.getInt("screenshake", 4) / 4f) * 0.75f;
|
float intensity = shakeIntensity * (settings.getInt("screenshake", 4) / 4f) * 0.75f;
|
||||||
camShakeOffset.setToRandomDirection().scl(Mathf.random(intensity));
|
camShakeOffset.setToRandomDirection().scl(Mathf.random(intensity));
|
||||||
|
@ -68,26 +68,26 @@ public class MinimapRenderer{
|
|||||||
});
|
});
|
||||||
|
|
||||||
Events.on(BuildTeamChangeEvent.class, event -> update(event.build.tile));
|
Events.on(BuildTeamChangeEvent.class, event -> update(event.build.tile));
|
||||||
|
}
|
||||||
|
|
||||||
Events.run(Trigger.update, () -> {
|
public void update(){
|
||||||
//updates are batched to occur every 2 frames
|
//updates are batched to occur every 2 frames
|
||||||
if((updateCounter += Time.delta) >= updateInterval){
|
if((updateCounter += Time.delta) >= updateInterval){
|
||||||
updateCounter %= updateInterval;
|
updateCounter %= updateInterval;
|
||||||
|
|
||||||
updates.each(pos -> {
|
updates.each(pos -> {
|
||||||
Tile tile = world.tile(pos);
|
Tile tile = world.tile(pos);
|
||||||
if(tile == null) return;
|
if(tile == null) return;
|
||||||
|
|
||||||
int color = colorFor(tile);
|
int color = colorFor(tile);
|
||||||
pixmap.set(tile.x, pixmap.height - 1 - tile.y, color);
|
pixmap.set(tile.x, pixmap.height - 1 - tile.y, color);
|
||||||
|
|
||||||
//yes, this calls glTexSubImage2D every time, with a 1x1 region
|
//yes, this calls glTexSubImage2D every time, with a 1x1 region
|
||||||
Pixmaps.drawPixel(texture, tile.x, pixmap.height - 1 - tile.y, color);
|
Pixmaps.drawPixel(texture, tile.x, pixmap.height - 1 - tile.y, color);
|
||||||
});
|
});
|
||||||
|
|
||||||
updates.clear();
|
updates.clear();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pixmap getPixmap(){
|
public Pixmap getPixmap(){
|
||||||
|
Reference in New Issue
Block a user