Fixed most things besides drawing

This commit is contained in:
Anuken
2018-12-22 22:17:28 -05:00
parent 3abfaf1bca
commit 44e4ffbe62
175 changed files with 666 additions and 688 deletions

View File

@@ -10,7 +10,7 @@ import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.OreBlock;
import io.anuke.arc.graphics.Draw;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.Hue;
import static io.anuke.mindustry.Vars.*;
@@ -87,7 +87,7 @@ public class Generators {
image.drawCenter(mech.region);
}
int off = (image.width() - mech.weapon.equipRegion.getRegionWidth())/2;
int off = (image.width() - mech.weapon.equipRegion.getWidth())/2;
image.draw(mech.weapon.equipRegion, -(int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off, false, false);
image.draw(mech.weapon.equipRegion, (int)mech.weaponOffsetX + off, (int)mech.weaponOffsetY + off, true, false);
@@ -112,12 +112,12 @@ public class Generators {
image.draw(type.region);
image.draw(type.weapon.equipRegion,
-(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
-(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getWidth())/2,
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getHeight())/2 + 1,
false, false);
image.draw(type.weapon.equipRegion,
(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getWidth())/2,
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getHeight())/2 + 1,
true, false);
}

View File

@@ -21,7 +21,7 @@ public class Image {
private Color color = new Color();
public Image(BufferedImage atlas, TextureRegion region){
this(atlas, region.getRegionWidth(), region.getRegionHeight());
this(atlas, region.getWidth(), region.getHeight());
draw(region);
}
@@ -69,12 +69,12 @@ public class Image {
/**Draws a region at the center.*/
public void drawCenter(TextureRegion region){
draw(region, (width() - region.getRegionWidth())/2, (height() - region.getRegionHeight())/2, false, false);
draw(region, (width() - region.getWidth())/2, (height() - region.getHeight())/2, false, false);
}
/**Draws a region at the center.*/
public void drawCenter(TextureRegion region, boolean flipx, boolean flipy){
draw(region, (width() - region.getRegionWidth())/2, (height() - region.getRegionHeight())/2, flipx, flipy);
draw(region, (width() - region.getWidth())/2, (height() - region.getHeight())/2, flipx, flipy);
}
/**Draws an image at the top left corner.*/
@@ -108,12 +108,12 @@ public class Image {
graphics.drawImage(atlas,
x, y,
x + region.getRegionWidth(),
y + region.getRegionHeight(),
(flipx ? region.getRegionX() + region.getRegionWidth() : region.getRegionX()) + ofx,
(flipy ? region.getRegionY() + region.getRegionHeight() : region.getRegionY()) + ofy,
(flipx ? region.getRegionX() : region.getRegionX() + region.getRegionWidth()) + ofx,
(flipy ? region.getRegionY() : region.getRegionY() + region.getRegionHeight()) + ofy,
x + region.getWidth(),
y + region.getHeight(),
(flipx ? region.getRegionX() + region.getWidth() : region.getRegionX()) + ofx,
(flipy ? region.getRegionY() + region.getHeight() : region.getRegionY()) + ofy,
(flipx ? region.getRegionX() : region.getRegionX() + region.getWidth()) + ofx,
(flipy ? region.getRegionY() : region.getRegionY() + region.getHeight()) + ofy,
null);
}