Final attempt to fix border drawing

git-svn-id: svn://kolibrios.org@186 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2006-10-18 11:29:50 +00:00
parent 5e5bb72582
commit 85aa5c3167
3 changed files with 98 additions and 91 deletions

View File

@ -270,7 +270,7 @@ drawwindow_IV:
push edx push edx
mov edi,[esp] ; RECTANGLE mov edi,edx
mov ebp,skin_active mov ebp,skin_active
cmp byte [esp+32+4+4],0 cmp byte [esp+32+4+4],0
@ -290,6 +290,7 @@ drawwindow_IV:
; shr esi,1 ; shr esi,1
; and esi,0x007f7f7f ; and esi,0x007f7f7f
mov esi,[ebp+SKIN_DATA.colors.outer] mov esi,[ebp+SKIN_DATA.colors.outer]
or [edi+WDATA.fl_wdrawn], 4
call draw_rectangle call draw_rectangle
mov ecx,3 mov ecx,3
_dw3l: _dw3l:
@ -430,8 +431,13 @@ drawwindow_IV:
mov [eax],bx mov [eax],bx
no_skin_add_button: no_skin_add_button:
pop edi
and [edi+WDATA.fl_wdrawn], not 4
test [edi+WDATA.fl_wdrawn], 2
jz @f
call drawwindowframes2
@@:
add esp,4
popa popa
ret 4 ret 4

View File

@ -705,6 +705,7 @@ drawwindow_I_caption:
drawwindow_I: drawwindow_I:
pushad pushad
or [edx+WDATA.fl_wdrawn], 4
mov esi,[edx+WDATA.cl_frames] ; rectangle mov esi,[edx+WDATA.cl_frames] ; rectangle
mov eax,[edx+WDATA.box.left] mov eax,[edx+WDATA.box.left]
@ -717,6 +718,12 @@ drawwindow_I:
add ebx,[edx+WDATA.box.height] add ebx,[edx+WDATA.box.height]
call draw_rectangle call draw_rectangle
and [edx+WDATA.fl_wdrawn], not 4
test [edx+WDATA.fl_wdrawn], 2
jz @f
call drawwindowframes2
@@:
call drawwindow_I_caption call drawwindow_I_caption
mov edx,[esi+WDATA.box.top] ; inside work area mov edx,[esi+WDATA.box.top] ; inside work area
@ -846,7 +853,13 @@ drawwindow_III:
shr esi,1 shr esi,1
and esi,0x007f7f7f and esi,0x007f7f7f
push esi push esi
or [edi+WDATA.fl_wdrawn], 4
call draw_rectangle call draw_rectangle
and [edi+WDATA.fl_wdrawn], not 4
test [edi+WDATA.fl_wdrawn], 2
jz @f
call drawwindowframes2
@@:
mov ecx,3 mov ecx,3
dw3l: dw3l:
add eax,1*65536-1 add eax,1*65536-1
@ -1645,92 +1658,80 @@ endg
; draw negative window frames ; draw negative window frames
uglobal drawwindowframes2:
moving_wnd dd ? pushad
moving_wnd_redrawed db ? cli
endg jmp drawwindowframes.do
drawwindowframes: drawwindowframes:
mov [moving_wnd], edi pushad
cli
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jnz .ret jnz .ret
cmp [edi+WDATA.fl_redraw], 0 mov eax, [npx]
jz @f cmp eax, [edi+WDATA.box.left]
xor [moving_wnd_redrawed], 1 jnz .nowndframe
jmp .ret mov eax, [npxe]
@@: cmp eax, [edi+WDATA.box.width]
cmp [moving_wnd_redrawed], 0 jnz .nowndframe
jz @f mov eax, [npy]
mov [moving_wnd_redrawed], 0 cmp eax, [edi+WDATA.box.top]
jnz .nowndframe
mov eax, [npye]
cmp eax, [edi+WDATA.box.height]
jnz .nowndframe
xor [edi+WDATA.fl_wdrawn], 2
test [edi+WDATA.fl_wdrawn], 4
jnz .ret
.nowndframe:
.do:
mov edi, 1
mov ecx, 0x01000000
mov eax,[npx]
shl eax,16
add eax,[npx]
add eax,[npxe]
add eax,65536*1-1
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
call [draw_line]
mov eax,[npx]
shl eax,16
add eax,[npx]
add eax,[npxe]
add eax,65536*1-1
mov ebx,[npy]
add ebx,[npye]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
call [draw_line]
mov eax,[npx]
shl eax,16
add eax,[npx]
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
call [draw_line]
mov eax,[npx]
add eax,[npxe]
shl eax,16
add eax,[npx]
add eax,[npxe]
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
call [draw_line]
.ret: .ret:
ret sti
@@:
pushad
mov eax,[npx]
shl eax,16
add eax,[npx]
add eax,[npxe]
add eax,65536*1-1
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
mov ecx,0x01000000
push edi
mov edi,1
call [draw_line]
pop edi
mov eax,[npx]
shl eax,16
add eax,[npx]
add eax,[npxe]
add eax,65536*1-1
mov ebx,[npy]
add ebx,[npye]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
mov ecx,0x01000000
push edi
mov edi,1
call [draw_line]
pop edi
mov eax,[npx]
shl eax,16
add eax,[npx]
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
mov ecx,0x01000000
push edi
mov edi,1
call [draw_line]
pop edi
mov eax,[npx]
add eax,[npxe]
shl eax,16
add eax,[npx]
add eax,[npxe]
mov ebx,[npy]
shl ebx,16
add ebx,[npy]
add ebx,[npye]
mov ecx,0x01000000
push edi
mov edi,1
call [draw_line]
mov edi,[0x3000]
shl edi,5
add edi,window_data
mov [edi+WDATA.fl_wdrawn],byte 1
pop edi
popad popad
ret ret

View File

@ -2696,8 +2696,7 @@ sys_redrawstat:
mov [edx+RECT.bottom],eax mov [edx+RECT.bottom],eax
mov edi,[0x3010] mov edi,[0x3010]
mov [edi-twdw+WDATA.fl_wdrawn], 1 ; no new position & buttons from app or [edi-twdw+WDATA.fl_wdrawn], 1 ; no new position & buttons from app
mov [edi-twdw+WDATA.fl_redraw], 0
call sys_window_mouse call sys_window_mouse
@ -2949,8 +2948,8 @@ sys_set_window:
mov [edi+WDATA.cl_frames],esi mov [edi+WDATA.cl_frames],esi
; check flag (?) ; check flag (?)
cmp [edi+WDATA.fl_wdrawn],1 test [edi+WDATA.fl_wdrawn],1
jz newd jnz newd
push eax push eax
mov eax,[timer_ticks] ;[0xfdf0] mov eax,[timer_ticks] ;[0xfdf0]
@ -2986,9 +2985,10 @@ sys_set_window:
@@: mov esi,[esp+0] @@: mov esi,[esp+0]
add edi, APPDATA.saved_box add edi, APPDATA.saved_box
mov ecx,4 movsd
cld movsd
rep movsd movsd
movsd
pop edi esi ecx pop edi esi ecx
push eax ebx ecx edx push eax ebx ecx edx
@ -3007,7 +3007,7 @@ sys_set_window:
mov [0xf500],byte 0 ; empty button buffer mov [0xf500],byte 0 ; empty button buffer
newd: newd:
; mov [edi+WDATA.fl_redraw],byte 0 ; no redraw mov [edi+WDATA.fl_redraw],byte 0 ; no redraw
mov edx,edi mov edx,edi
ret ret