Skip to content

Commit

Permalink
Fixed a bug related to palette conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Aug 28, 2020
1 parent e1c3724 commit 106a846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/dimage/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public class Palette(T) : IPalette {
array[i] = OutputType(data[i]);
result = new Palette!OutputType(array, format, getBitDepth(format));
}
switch (format & !(PixelFormat.BigEndian | PixelFormat.ValidAlpha)) {
switch (format & ~(PixelFormat.BigEndian | PixelFormat.ValidAlpha)) {
case PixelFormat.RGB888:
if(format & PixelFormat.BigEndian)
converter!(RGB888BE);
Expand Down
3 changes: 3 additions & 0 deletions source/dimage/tga.d
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,11 @@ unittest{
mappedRLE = TGA.load!VFile(virtualFile);
std.stdio.writeln("Load from virtual file was successful");
compareImages(mappedUnc, mappedRLE);

{
Palette!RGBA5551 p = cast(Palette!RGBA5551)mappedUnc.palette;
p.convTo(PixelFormat.ARGB8888);
p.convTo(PixelFormat.RGBA8888);
//std.stdio.writeln(mappedUnc.getHeader);
foreach_reverse (c ; p) {
}
Expand Down

0 comments on commit 106a846

Please sign in to comment.