From 644658162431229ebbc4489661e754ab6c5f5b6c Mon Sep 17 00:00:00 2001 From: damdoum Date: Mon, 22 Jan 2007 12:41:27 +0000 Subject: [PATCH] toggling layers on/off can now show hidden layers layer enabled -> toggling on=visible off=invisible layer disabled -> toggling on=invisible off=visible --- desmume/src/GPU.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/desmume/src/GPU.c b/desmume/src/GPU.c index a992136e0..b0f1cd75f 100644 --- a/desmume/src/GPU.c +++ b/desmume/src/GPU.c @@ -148,11 +148,15 @@ void GPU_resortBGs(GPU *gpu) memset(gpu->sprWin[i],0, 256); // we don't need to check for windows here... - gpu->LayersEnable[0] = gpu->dispBG[0] && cnt->BG0_Enable && !(gpu->dispCnt.bits.BG0_3D && (gpu->core==0)) ; - gpu->LayersEnable[1] = gpu->dispBG[1] && cnt->BG1_Enable; - gpu->LayersEnable[2] = gpu->dispBG[2] && cnt->BG2_Enable; - gpu->LayersEnable[3] = gpu->dispBG[3] && cnt->BG3_Enable; - gpu->LayersEnable[4] = gpu->dispOBJ && cnt->OBJ_Enable; +// if we tick boxes, invisible layers become invisible & vice versa +#define OP ^ ! +// if we untick boxes, layers become invisible +//#define OP && + gpu->LayersEnable[0] = gpu->dispBG[0] OP(cnt->BG0_Enable && !(gpu->dispCnt.bits.BG0_3D && (gpu->core==0))); + gpu->LayersEnable[1] = gpu->dispBG[1] OP(cnt->BG1_Enable); + gpu->LayersEnable[2] = gpu->dispBG[2] OP(cnt->BG2_Enable); + gpu->LayersEnable[3] = gpu->dispBG[3] OP(cnt->BG3_Enable); + gpu->LayersEnable[4] = gpu->dispOBJ OP(cnt->OBJ_Enable); // KISS ! lower priority first, if same then lower num for (i=0;i