From f75f24b53dd40a0f5afa5f0fb7f07fa968985bf2 Mon Sep 17 00:00:00 2001 From: mightymax Date: Wed, 10 Jan 2007 13:04:39 +0000 Subject: [PATCH] abort of masterbrightness calculation if manipulation factor is 0 --- desmume/src/GPU.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index 48e3c9b54..e104dba4b 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -403,6 +403,9 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) // Apply final brightness adjust (MASTER_BRIGHT) // Reference: http://nocash.emubase.de/gbatek.htm#dsvideo (Under MASTER_BRIGHTNESS) + + /* Mightymax> it should be more effective if the windowmanager applies brightness when drawing */ + /* it will most likly take acceleration, while we are stuck here with CPU power */ switch ((gpu->MASTER_BRIGHT>>14)&3) { // Disabled @@ -415,6 +418,8 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) unsigned int masterBrightFactor = gpu->MASTER_BRIGHT&31; masterBrightFactor = masterBrightFactor > 16 ? 16 : masterBrightFactor; + if (!masterBrightFactor) break ; /* when we wont do anything, we dont need to loop */ + for(i16 = 0; i16 < 256; ++i16) { COLOR dstColor; @@ -446,6 +451,8 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) unsigned int masterBrightFactor = gpu->MASTER_BRIGHT&31; masterBrightFactor = masterBrightFactor > 16 ? 16 : masterBrightFactor; + if (!masterBrightFactor) break ; /* when we wont do anything, we dont need to loop */ + for(i16 = 0; i16 < 256; ++i16) { COLOR dstColor;