From 2a183233b484fcbc4b0ee8a0b57d9ab48bb5c9ec Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Sat, 4 Mar 2006 12:58:59 +0000 Subject: [PATCH] Fixes to skin drawing code, in case default.skn wasn't loaded on OS startup git-svn-id: svn://kolibrios.org@53 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/skincode.inc | 19 ++++++++++++++----- kernel/trunk/kernel.asm | 9 +++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/gui/skincode.inc b/kernel/trunk/gui/skincode.inc index 30a8b430da..0aab25df9e 100644 --- a/kernel/trunk/gui/skincode.inc +++ b/kernel/trunk/gui/skincode.inc @@ -53,8 +53,10 @@ ends load_skin: pushad + mov [_skinh],22 mov eax,_skin_file mov edx,skin_data + mov [ebp+SKIN_HEADER.ident],'????' call load_skin_file call parse_skin_data popad @@ -176,6 +178,12 @@ parse_skin_data: .exit: ret +sys_putimage_with_check: + or ebx,ebx + jz @f + call sys_putimage + @@: ret + drawwindow_IV: ;param1 - aw_yes @@ -234,7 +242,7 @@ drawwindow_IV: add ecx,[_skinh] mov ebx, [ebp+SKIN_DATA.left.data] - call sys_putimage + call sys_putimage_with_check mov esi,[esp] mov eax,[esi+8] @@ -243,8 +251,9 @@ drawwindow_IV: cmp eax,[ebp+SKIN_DATA.base.left] jng non_base xor edx,edx - mov ebx,[ebp+SKIN_DATA.base.width] - div ebx + mov ecx,[ebp+SKIN_DATA.base.width] + jecxz non_base + div ecx inc eax @@ -261,7 +270,7 @@ drawwindow_IV: shl edx,16 push eax ebx ecx edx - call sys_putimage + call sys_putimage_with_check pop edx ecx ebx eax dec eax @@ -278,7 +287,7 @@ drawwindow_IV: mov ecx,[ebp+SKIN_DATA.oper.width] shl ecx,16 add ecx,[_skinh] - call sys_putimage + call sys_putimage_with_check mov esi,[esp] diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 0f80014749..e11937dc21 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -3901,6 +3901,15 @@ drawbackground: sys_putimage: + test ecx,0x80008000 + jnz .exit + test ecx,0x0000FFFF + jz .exit + test ecx,0xFFFF0000 + jnz @f + .exit: + ret + @@: ; inc [mouse_pause] cmp [0xfe0c],word 0x12 jne spiv20