From 96b1e0d84475d9b0a4a1fba9ead13a27a167cd28 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Wed, 20 May 2020 20:19:56 +0300 Subject: [PATCH] core/gpu: Remove panic when ObjMode is "Forbidden" Former-commit-id: 90380761357fa7df0769cb487980a405ae2e8265 Former-commit-id: 1cddcb9030b03f3da35a98d56c7a21a6b8eb7530 --- rustboyadvance-core/src/gpu/render/obj.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rustboyadvance-core/src/gpu/render/obj.rs b/rustboyadvance-core/src/gpu/render/obj.rs index 0bd9ebc..3f95579 100644 --- a/rustboyadvance-core/src/gpu/render/obj.rs +++ b/rustboyadvance-core/src/gpu/render/obj.rs @@ -93,6 +93,10 @@ impl Gpu { return; } + if attrs.0.objmode() == ObjMode::Forbidden { + return; + } + let tile_base = OVRAM + 0x20 * (attrs.2.tile() as u32); let (tile_size, pixel_format) = attrs.tile_format(); @@ -182,6 +186,10 @@ impl Gpu { return; } + if attrs.0.objmode() == ObjMode::Forbidden { + return; + } + let tile_base = OVRAM + 0x20 * (attrs.2.tile() as u32); let (tile_size, pixel_format) = attrs.tile_format(); @@ -273,9 +281,7 @@ impl Gpu { ObjMode::Window => { current_obj.window = true; } - ObjMode::Forbidden => { - panic!("Forbidden sprite mode!"); - } + ObjMode::Forbidden => unreachable!(), } }