From 0c9418aaa51ffa532c6beabfd0145155ba551598 Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 20 Jul 2022 17:36:08 -0400 Subject: [PATCH] fix blendmap loading issue where the map had a full 256 source color set --- libretrogd/src/graphics/blendmap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretrogd/src/graphics/blendmap.rs b/libretrogd/src/graphics/blendmap.rs index 4e78513..d1e0c4f 100644 --- a/libretrogd/src/graphics/blendmap.rs +++ b/libretrogd/src/graphics/blendmap.rs @@ -253,7 +253,7 @@ impl BlendMap { let start_color = reader.read_u8()?; let end_color = reader.read_u8()?; - let num_maps = (end_color - start_color + 1) as usize; + let num_maps = (end_color as usize - start_color as usize + 1); let mut maps = Vec::with_capacity(num_maps); for _ in 0..num_maps {