Double outline check
This commit is contained in:
@@ -51,7 +51,7 @@ public class StatusEffects{
|
||||
|
||||
unmoving = new StatusEffect("unmoving"){{
|
||||
color = Pal.gray;
|
||||
speedMultiplier = 0.001f;
|
||||
speedMultiplier = 0f;
|
||||
}};
|
||||
|
||||
slow = new StatusEffect("slow"){{
|
||||
|
||||
@@ -100,16 +100,19 @@ public abstract class UnlockableContent extends MappableContent{
|
||||
if(region instanceof AtlasRegion at && region.found()){
|
||||
String name = at.name;
|
||||
if(!makeNew || !packer.has(name + "-outline")){
|
||||
PixmapRegion base = Core.atlas.getPixmap(region);
|
||||
var result = Pixmaps.outline(base, outlineColor, outlineRadius);
|
||||
Drawf.checkBleed(result);
|
||||
packer.add(page, name + (makeNew ? "-outline" : ""), result);
|
||||
String regName = name + (makeNew ? "-outline" : "");
|
||||
if(packer.registerOutlined(regName)){
|
||||
PixmapRegion base = Core.atlas.getPixmap(region);
|
||||
var result = Pixmaps.outline(base, outlineColor, outlineRadius);
|
||||
Drawf.checkBleed(result);
|
||||
packer.add(page, regName, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void makeOutline(MultiPacker packer, TextureRegion region, String name, Color outlineColor, int outlineRadius){
|
||||
if(region.found()){
|
||||
if(region.found() && packer.registerOutlined(name)){
|
||||
PixmapRegion base = Core.atlas.getPixmap(region);
|
||||
var result = Pixmaps.outline(base, outlineColor, outlineRadius);
|
||||
Drawf.checkBleed(result);
|
||||
|
||||
@@ -3,12 +3,14 @@ package mindustry.graphics;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.Texture.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.Log.*;
|
||||
import mindustry.*;
|
||||
|
||||
public class MultiPacker implements Disposable{
|
||||
private PixmapPacker[] packers = new PixmapPacker[PageType.all.length];
|
||||
private ObjectSet<String> outlined = new ObjectSet<>();
|
||||
|
||||
public MultiPacker(){
|
||||
for(int i = 0; i < packers.length; i++){
|
||||
@@ -48,6 +50,15 @@ public class MultiPacker implements Disposable{
|
||||
}
|
||||
}
|
||||
|
||||
/** @return whether this image was not already outlined. */
|
||||
public boolean registerOutlined(String named){
|
||||
return outlined.add(named);
|
||||
}
|
||||
|
||||
public boolean isOutlined(String name){
|
||||
return outlined.contains(name);
|
||||
}
|
||||
|
||||
public PixmapPacker getPacker(PageType type){
|
||||
return packers[type.ordinal()];
|
||||
}
|
||||
|
||||
@@ -883,6 +883,12 @@ public class UnitType extends UnlockableContent{
|
||||
makeOutline(PageType.main, packer, outlineTarget, alwaysCreateOutline && region == outlineTarget, outlineColor, outlineRadius);
|
||||
}
|
||||
|
||||
if(sample instanceof Crawlc){
|
||||
for(int i = 0; i < segments; i++){
|
||||
makeOutline(packer, segmentRegions[i], name + "-segment-outline" + i, outlineColor, outlineRadius);
|
||||
}
|
||||
}
|
||||
|
||||
for(Weapon weapon : weapons){
|
||||
if(!weapon.name.isEmpty()){
|
||||
//TODO makeNew isn't really necessary here is it
|
||||
|
||||
Reference in New Issue
Block a user