From 14825618c33b84a2157ba693132e1f5a1e2a9090 Mon Sep 17 00:00:00 2001 From: "Andrey Halyavin (halyavin)" Date: Thu, 19 Jan 2006 09:59:26 +0000 Subject: [PATCH] fix strange button drawing for bright buttons git-svn-id: svn://kolibrios.org@38 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/button.inc | 62 ++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/kernel/trunk/gui/button.inc b/kernel/trunk/gui/button.inc index 31bc317b6f..d0bd2c0938 100644 --- a/kernel/trunk/gui/button.inc +++ b/kernel/trunk/gui/button.inc @@ -1,29 +1,61 @@ max_buttons=4095 dececx: - - push eax push edx push ecx - mov edx,1 - dececl: + mov edx,2 + .loop: - movzx eax,byte [esp+edx] - cmp eax,0x20 - jge @f + cmp byte [esp+edx],0x20 + jae @f mov [esp+edx],byte 0x20 @@: sub [esp+edx],byte 0x20 - add edx,1 - cmp edx,4 - jbe dececl + dec edx + jns .loop pop ecx pop edx - pop eax ret - + +incecx: + push edx + push ecx + + mov edx,2 + .loop: + + cmp byte [esp+edx],0xdf + jbe @f + mov [esp+edx],byte 0xdf + @@: + add [esp+edx],byte 0x20 + + dec edx + jns .loop + pop ecx + pop edx + ret + +incecx2: + push edx + push ecx + + mov edx,2 + .loop: + + cmp byte [esp+edx],0xeb + jbe @f + mov [esp+edx],byte 0xeb + @@: + add [esp+edx],byte 0x14 + + dec edx + jns .loop + pop ecx + pop edx + ret drawbuttonframes: @@ -50,7 +82,7 @@ drawbuttonframes: mov esi,ebx mov edi,0 mov ecx,[esp+0] - add ecx,0x202020 + call incecx call [draw_line] movzx edx,word [esp+8] @@ -74,7 +106,7 @@ drawbuttonframes: pop edx mov edi,0 mov ecx,[esp+0] - add ecx,0x202020 + call incecx call [draw_line] mov esi,edx @@ -164,7 +196,7 @@ sys_button: mov ecx,[4+32+esp+0] cmp [buttontype],dword 0 je @f - add ecx,0x141414 + call incecx2 @@: movzx edi,word [esp]