mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
Patch DMITool's import to accept pngs with no alpha channel
This commit is contained in:
Binary file not shown.
@@ -189,6 +189,7 @@ public class IconState {
|
||||
px[i] = sl.clone();
|
||||
}
|
||||
|
||||
int channelCount = in.imgInfo.alpha ? 4 : 3;
|
||||
Image[] images = new Image[frames*dirs];
|
||||
for(int imageY=0; imageY<dirs; imageY++) {
|
||||
for(int imageX=0; imageX<frames; imageX++) {
|
||||
@@ -196,11 +197,11 @@ public class IconState {
|
||||
for(int pixelY=0; pixelY<h; pixelY++) {
|
||||
for(int pixelX=0; pixelX<w; pixelX++) {
|
||||
int bY = imageY*h + pixelY;
|
||||
int bX = imageX*4*w + 4*pixelX;
|
||||
int bX = imageX*channelCount*w + channelCount*pixelX;
|
||||
pixels[pixelY][pixelX] = new RGBA(px[bY][bX ],
|
||||
px[bY][bX + 1],
|
||||
px[bY][bX + 2],
|
||||
px[bY][bX + 3]);
|
||||
in.imgInfo.alpha ? px[bY][bX + 3] : 255);
|
||||
}
|
||||
}
|
||||
images[_getIndex(imageY, imageX, dirs)] = new NonPalettedImage(w, h, pixels);
|
||||
|
||||
Reference in New Issue
Block a user