mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Fix problem with negative item colors, which mostly come from the java version.
This commit is contained in:
parent
3eb3e2b358
commit
89438a2e2a
@ -38,7 +38,7 @@ const Material = struct {
|
||||
const colors = json.getChild("colors");
|
||||
self.colorPalette = try allocator.alloc(Color, colors.JsonArray.items.len);
|
||||
for(colors.JsonArray.items, self.colorPalette) |item, *color| {
|
||||
const colorInt = item.as(u32, 0xff000000);
|
||||
const colorInt: u32 = @intCast(item.as(i64, 0xff000000) & 0xffffffff);
|
||||
color.* = Color {
|
||||
.r = @intCast(colorInt>>16 & 0xff),
|
||||
.g = @intCast(colorInt>>8 & 0xff),
|
||||
|
Loading…
x
Reference in New Issue
Block a user