more-shader-refactors #11

Merged
embeddedt merged 9 commits from mitchej123/celeritas:more-shader-refactors into stonecutter 2025-04-26 16:37:18 -04:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit d39ad75fd1 - Show all commits

No files matched your search

@@ -6,7 +6,7 @@ import org.embeddedt.embeddium.api.util.ColorABGR;
public class NativeImageBackedSingleColorTexture extends DynamicTexture {
public NativeImageBackedSingleColorTexture(int red, int green, int blue, int alpha) {
super(create(ColorABGR.pack(alpha, blue, green, red)));
super(create(ColorABGR.pack(red, green, blue, alpha)));
mitchej123 marked this conversation as resolved Outdated
Outdated
Review

Have you tested any of the code paths where ColorABGR has been introduced? The order of the color components is not the same as FastColor, so this should look very wrong...

Have you tested any of the code paths where `ColorABGR` has been introduced? The order of the color components is not the same as `FastColor`, so this should look very wrong...
Outdated
Review

haha whoops

haha whoops
}
public NativeImageBackedSingleColorTexture(int rgba) {
@@ -96,10 +96,10 @@ public class ImageManipulationUtil {
private static int blendColor(int c0, int c1, int c2, int c3, float w0, float w1, float w2, float w3) {
return ColorABGR.pack(
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), ColorABGR.unpackAlpha(c2), ColorABGR.unpackAlpha(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), ColorABGR.unpackBlue(c2), ColorABGR.unpackBlue(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), ColorABGR.unpackRed(c2), ColorABGR.unpackRed(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackGreen(c0), ColorABGR.unpackGreen(c1), ColorABGR.unpackGreen(c2), ColorABGR.unpackGreen(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), ColorABGR.unpackRed(c2), ColorABGR.unpackRed(c3), w0, w1, w2, w3)
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), ColorABGR.unpackBlue(c2), ColorABGR.unpackBlue(c3), w0, w1, w2, w3),
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), ColorABGR.unpackAlpha(c2), ColorABGR.unpackAlpha(c3), w0, w1, w2, w3)
);
}
@@ -109,10 +109,10 @@ public class ImageManipulationUtil {
private static int blendColor(int c0, int c1, float w0, float w1) {
return ColorABGR.pack(
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), w0, w1),
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), w0, w1),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), w0, w1),
blendChannel(ColorABGR.unpackGreen(c0), ColorABGR.unpackGreen(c1), w0, w1),
blendChannel(ColorABGR.unpackRed(c0), ColorABGR.unpackRed(c1), w0, w1)
blendChannel(ColorABGR.unpackBlue(c0), ColorABGR.unpackBlue(c1), w0, w1),
blendChannel(ColorABGR.unpackAlpha(c0), ColorABGR.unpackAlpha(c1), w0, w1)
);
}