Cleaned up extra accessor method
This commit is contained in:
@@ -122,7 +122,7 @@ public class MinimapRenderer implements Disposable{
|
|||||||
float dy = (Core.camera.position.y / tilesize);
|
float dy = (Core.camera.position.y / tilesize);
|
||||||
dx = Mathf.clamp(dx, sz, world.width() - sz);
|
dx = Mathf.clamp(dx, sz, world.width() - sz);
|
||||||
dy = Mathf.clamp(dy, sz, world.height() - sz);
|
dy = Mathf.clamp(dy, sz, world.height() - sz);
|
||||||
float invTexWidth = 1f / texture.getWidth();
|
float invTexWidth = 1f / texture.width;
|
||||||
float invTexHeight = 1f / texture.height;
|
float invTexHeight = 1f / texture.height;
|
||||||
float x = dx - sz, y = world.height() - dy - sz, width = sz * 2, height = sz * 2;
|
float x = dx - sz, y = world.height() - dy - sz, width = sz * 2, height = sz * 2;
|
||||||
region.set(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight);
|
region.set(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public class Shaders{
|
|||||||
setUniformf("u_progress", progress);
|
setUniformf("u_progress", progress);
|
||||||
setUniformf("u_uv", region.u, region.v);
|
setUniformf("u_uv", region.u, region.v);
|
||||||
setUniformf("u_uv2", region.u2, region.v2);
|
setUniformf("u_uv2", region.u2, region.v2);
|
||||||
setUniformf("u_texsize", region.texture.getWidth(), region.texture.height);
|
setUniformf("u_texsize", region.texture.width, region.texture.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ public class Shaders{
|
|||||||
setUniformf("u_uv", region.u, region.v);
|
setUniformf("u_uv", region.u, region.v);
|
||||||
setUniformf("u_uv2", region.u2, region.v2);
|
setUniformf("u_uv2", region.u2, region.v2);
|
||||||
setUniformf("u_time", Time.time());
|
setUniformf("u_time", Time.time());
|
||||||
setUniformf("u_texsize", region.texture.getWidth(), region.texture.height);
|
setUniformf("u_texsize", region.texture.width, region.texture.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class MinimapFragment extends Fragment{
|
|||||||
|
|
||||||
if(renderer.minimap.getTexture() != null){
|
if(renderer.minimap.getTexture() != null){
|
||||||
Draw.color();
|
Draw.color();
|
||||||
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().getWidth();
|
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
|
||||||
TextureRegion reg = Draw.wrap(renderer.minimap.getTexture());
|
TextureRegion reg = Draw.wrap(renderer.minimap.getTexture());
|
||||||
Draw.rect(reg, w/2f + panx*zoom, h/2f + pany*zoom, size, size * ratio);
|
Draw.rect(reg, w/2f + panx*zoom, h/2f + pany*zoom, size, size * ratio);
|
||||||
renderer.minimap.drawEntities(w/2f + panx*zoom - size/2f, h/2f + pany*zoom - size/2f * ratio, size, size * ratio, zoom, true);
|
renderer.minimap.drawEntities(w/2f + panx*zoom - size/2f, h/2f + pany*zoom - size/2f * ratio, size, size * ratio, zoom, true);
|
||||||
@@ -113,7 +113,7 @@ public class MinimapFragment extends Fragment{
|
|||||||
public void toggle(){
|
public void toggle(){
|
||||||
if(Core.settings.getBool("mapcenter")){
|
if(Core.settings.getBool("mapcenter")){
|
||||||
float size = baseSize * zoom * world.width();
|
float size = baseSize * zoom * world.width();
|
||||||
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().getWidth();
|
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
|
||||||
panx = (size/2f - player.x() / (world.width() * tilesize) * size) / zoom;
|
panx = (size/2f - player.x() / (world.width() * tilesize) * size) / zoom;
|
||||||
pany = (size*ratio/2f - player.y() / (world.height() * tilesize) * size*ratio) / zoom;
|
pany = (size*ratio/2f - player.y() / (world.height() * tilesize) * size*ratio) / zoom;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user