forked from KolibriOS/kolibrios
function 'buf2d_line_sm' - fix error when the line is 45 degrees
git-svn-id: svn://kolibrios.org@9520 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -13,6 +13,8 @@ include '../../../../../dll.inc'
|
||||
|
||||
buf2d_l equ word[edi+4] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
buf2d_t equ word[edi+6] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
buf2d_w equ dword[edi+8]
|
||||
buf2d_h equ dword[edi+12]
|
||||
buf2d_color equ dword[edi+16] ;梥<> 䮭<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
align 4
|
||||
@@ -21,7 +23,7 @@ start:
|
||||
cmp eax,-1
|
||||
jz button.exit
|
||||
|
||||
mcall 40,0x27
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
stdcall [buf2d_create], buf_0 ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
;<3B><><EFBFBD>㥬 <20><>ࢮ<EFBFBD><E0A2AE>砫<EFBFBD><E7A0AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
stdcall [buf2d_filled_rect_by_size], buf_0, 100-50,70-25, 100,50, 0xffffff ;<3B><><EFBFBD>㥬 <20><>אַ㣮<EFACAE>쭨<EFBFBD>
|
||||
@@ -34,7 +36,7 @@ red_win:
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
@@ -48,21 +50,21 @@ still:
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
;mov edx,0x32000000
|
||||
mov edx,0x33000000
|
||||
mcall 0,(50 shl 16)+330,(30 shl 16)+275,,,caption
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+330,(30 shl 16)+275,,,caption
|
||||
|
||||
stdcall [buf2d_draw], buf_0
|
||||
|
||||
mcall 12,2
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
mcall SF_GET_KEY
|
||||
|
||||
cmp ah,27 ;Esc
|
||||
je button.exit
|
||||
@@ -71,26 +73,30 @@ key:
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
stdcall [buf2d_delete],buf_0 ;㤠<>塞 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall -1 ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
mouse:
|
||||
;<3B><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 37,2 ;get mouse buttons
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON
|
||||
cmp al,1
|
||||
jne @f
|
||||
mcall 37,1 ;get mouse coords
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
shr ebx,16 ;<3B> eax <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> 'x'
|
||||
and eax,0xffff ;<3B> eax <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> 'y'
|
||||
mov edi,buf_0
|
||||
sub ax,buf2d_t ;ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>뢠<EFBFBD> ᬥ饭<E1ACA5><E9A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp eax,buf2d_h
|
||||
jge @f
|
||||
sub bx,buf2d_l
|
||||
cmp ebx,buf2d_w
|
||||
jge @f
|
||||
|
||||
;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨
|
||||
stdcall [buf2d_clear], edi, buf2d_color ;<3B><><EFBFBD>頥<EFBFBD> <20><>࠭ <20><> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD>
|
||||
@@ -164,6 +170,7 @@ system_path db '/sys/lib/'
|
||||
lib0_name db 'buf2d.obj',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
rb 1024
|
||||
stacktop:
|
||||
|
Reference in New Issue
Block a user