Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheemsandfriends committed Jan 15, 2025
2 parents 70c6f8a + ed52c32 commit 6e20b50
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion BetterTextureAtlas.jsfl
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ function parseSymbolInstance(instance, itemName)
if (instance.symbolType != "graphic")
{
if (instance.blendMode != null && instance.blendMode != "normal")
jsonStr(key("blend", "B"), instance.blendMode); // TODO: output as indices
jsonVar(key("blend", "B"), parseBlendMode(instance.blendMode)); // TODO: output as indices

var filters = instance.filters;
var hasFilters = (filters != null && filters.length > 0)
Expand All @@ -1806,6 +1806,28 @@ function parseSymbolInstance(instance, itemName)
push('}');
}

function parseBlendMode(blend)
{
switch (blend)
{
case "add": return 0;
case "alpha": return 1;
case "darken": return 2;
case "difference": return 3;
case "erase": return 4;
case "hardlight": return 5;
case "invert": return 6;
case "layer": return 7;
case "lighten": return 8;
case "multiply": return 9;
case "overlay": return 11;
case "screen": return 12;
case "subtract": return 14;
}

return 10; // normal
}

function parseFilters(filters)
{
jsonArray(key("filters", "F"));
Expand Down

0 comments on commit 6e20b50

Please sign in to comment.