From 9956cab1d4cb66b881c937671df2d67908171473 Mon Sep 17 00:00:00 2001 From: riccardom Date: Sat, 9 May 2009 17:00:32 +0000 Subject: [PATCH] Simplify Modify_Layer() by removing some superfluos checks, we really don't care if the layer was already in the state we want now. --- desmume/src/gtk/main.cpp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index bd76fb59b..2bb4423a8 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -1269,42 +1269,22 @@ static void Modify_Layer(GtkToggleAction* action, gpointer data) case MAIN_BG_1: case MAIN_BG_2: case MAIN_BG_3: - if(active == TRUE) { - if (!MainScreen.gpu->dispBG[Layer]) - GPU_addBack(MainScreen.gpu, Layer); - } else { - if (MainScreen.gpu->dispBG[Layer]) - GPU_remove(MainScreen.gpu, Layer); - } - break; case MAIN_OBJ: if(active == TRUE) { - if (!MainScreen.gpu->dispOBJ) - GPU_addBack(MainScreen.gpu, Layer); - } else { - if (MainScreen.gpu->dispOBJ) - GPU_remove(MainScreen.gpu, Layer); + GPU_addBack(MainScreen.gpu, Layer); + } else { + GPU_remove(MainScreen.gpu, Layer); } break; case SUB_BG_0: case SUB_BG_1: case SUB_BG_2: case SUB_BG_3: - if(active == TRUE) { - if (!SubScreen.gpu->dispBG[Layer-SUB_BG_0]) - GPU_addBack(SubScreen.gpu, Layer-SUB_BG_0); - } else { - if (SubScreen.gpu->dispBG[Layer-SUB_BG_0]) - GPU_remove(SubScreen.gpu, Layer-SUB_BG_0); - } - break; case SUB_OBJ: if(active == TRUE) { - if (!SubScreen.gpu->dispOBJ) - GPU_addBack(SubScreen.gpu, Layer-SUB_BG_0); + GPU_addBack(SubScreen.gpu, Layer-SUB_BG_0); } else { - if (SubScreen.gpu->dispOBJ) - GPU_remove(SubScreen.gpu, Layer-SUB_BG_0); + GPU_remove(SubScreen.gpu, Layer-SUB_BG_0); } break; default: