Divided the streams mouse and drawing icons

git-svn-id: svn://kolibrios.org@3972 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
GerdtR 2013-10-03 22:53:51 +00:00
parent eb029aae1e
commit dbfd7a4bea
3 changed files with 59 additions and 159 deletions

View File

@ -36,12 +36,15 @@ BegData equ fiStdIco.point
dd 0 ; path dd 0 ; path
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
include 'lang.inc' include 'lang.inc'
include 'lang.inc'
include '../../macros.inc' include '../../macros.inc'
include '../../proc32.inc' include '../../proc32.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../dll.inc' include '../../dll.inc'
;include '../../debug.inc' ;include '../../debug.inc'
include 'bgredraw.inc'
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
START: ; start of execution START: ; start of execution
mcall 68,11 mcall 68,11
@ -128,7 +131,7 @@ START: ; start of execution
call FillIconsOffs call FillIconsOffs
mcall 40,0110000b mcall 40,0100000b
mov eax,[icon_count] mov eax,[icon_count]
mov bl,ICONS_DRAW_COUNTH mov bl,ICONS_DRAW_COUNTH
@ -145,40 +148,17 @@ START: ; start of execution
; mov eax,[IconsOffs+eax*4] ; mov eax,[IconsOffs+eax*4]
; stdcall [ini_del_section],IconIni,eax ; stdcall [ini_del_section],IconIni,eax
; ret ; ret
jmp MSGRedrawIcons ;jmp MSGRedrawIcons
mcall 51,1,BGRedrawThread,stack_bredraw
messages: messages:
mcall 10 mcall 10
sub eax,5 sub eax,6
jz MSGRedrawIcons
dec eax
jz MSGMouse jz MSGMouse
jmp messages jmp messages
MSGRedrawIcons:
mcall 48,5
mov dx,ax
shr eax,16
sub dx,ax
mov [ScreenX],dx
mov ax,bx
shr ebx,16
sub ax,bx
mov [ScreenY],ax
mov ecx,[MaxNumIcon]
test ecx,ecx
jz .NoDraw
xor ebx,ebx
@@: push ecx
stdcall DrawIcon,ebx,0
inc ebx
pop ecx
loop @b
.NoDraw:
jmp messages
MSGMouse: MSGMouse:
mcall 37,0 ;GetMousePos mcall 37,0 ;GetMousePos
@ -260,6 +240,7 @@ LButtonPress:
@@: @@:
;Yield ;Yield
mcall 5,1 ;Sleep 1 mcall 5,1 ;Sleep 1
jmp WaitLB jmp WaitLB
endWaitLB: endWaitLB:
@ -302,6 +283,7 @@ LButtonPress:
MovingIcon: MovingIcon:
stdcall GetNumIcon,[MouseX],[MouseY],-1 stdcall GetNumIcon,[MouseX],[MouseY],-1
mov [SelIcon],eax mov [SelIcon],eax
mov [IconNoDraw],eax
stdcall RestoreBackgrnd,[SelIcon] stdcall RestoreBackgrnd,[SelIcon]
; mov ecx,[MaxNumIcon] ; mov ecx,[MaxNumIcon]
@ -440,6 +422,7 @@ MovingIcon:
mov [bNotSave],1 mov [bNotSave],1
mov [IconNoDraw],-1
jmp messages jmp messages
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
@ -1176,6 +1159,7 @@ IconsFile db ICON_STRIP,0
NameIconsDat db ICONS_DAT,0 NameIconsDat db ICONS_DAT,0
align 4 align 4
MaxNumIcon dd 0 ;ª®«¨ç¥á⢮ ¨ª®­®ª MaxNumIcon dd 0 ;ª®«¨ç¥á⢮ ¨ª®­®ª
IconNoDraw dd -1 ;-1 «¨¡® ­®¬¥à ¨ª®­ª¨, ª®â®àãî ­¥ ­ ¤® à¨á®¢ âì( ª®£¤  ¥ñ â áª îâ :))
bFixIcons dd 1 bFixIcons dd 1
bNotSave dd 0 bNotSave dd 0
@ -1188,6 +1172,7 @@ DlgAddActiv dd 0
IconIni db '/rd/1/icon.ini',0 IconIni db '/rd/1/icon.ini',0
;keyName db 'name',0 ;keyName db 'name',0
keyPath db 'path',0 keyPath db 'path',0
keyParams db 'param',0 keyParams db 'param',0
@ -1454,6 +1439,8 @@ fname_Info rb 1024
stack_dlg: stack_dlg:
align 4 align 4
rb 1024 rb 1024
stack_bredraw:
rb 1024
stack_area: stack_area:
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ENDMEM: ENDMEM:

View File

@ -0,0 +1,44 @@
BGRedrawThread:
mcall 40,010000b
BGRTmessages:
mcall 10
sub eax,5
jz BGRTRedrawIcons
jmp BGRTmessages
BGRTRedrawIcons:
mcall 48,5
mov dx,ax
shr eax,16
sub dx,ax
mov [ScreenX],dx
mov ax,bx
shr ebx,16
sub ax,bx
mov [ScreenY],ax
mov ecx,[MaxNumIcon]
test ecx,ecx
jz .NoDraw
xor ebx,ebx
@@: push ecx
cmp [IconNoDraw],ebx
je .nd
stdcall DrawIcon,ebx,0
.nd:
inc ebx
pop ecx
loop @b
.NoDraw:
jmp BGRTmessages

View File

@ -1,131 +0,0 @@
include 'libimg/libimg.asm'
;¢®§¢à é ¥â 㪠§ â¥«ì ­  ¯ ¬ïâì «¨¡® 0
LoadIcon:
path equ ebp+8
BuffR equ ebp-16
BuffH equ ebp-22
endTablI equ ebp-26
push ebp
mov ebp,esp
add esp,-26
push ebx edi esi
;--------------------------- ¯à®¢¥à塞 - § £à㦥­  «¨ íâ®â ä ©« á ¨ª®­ª®© ------
xor ebx,ebx
.SearchIco:
mov edi,[path]
mov esi,[IcoTable+ebx]
@@: lodsb
scasb
jne @f
test al,al
jnz @b
mov eax,[IcoTable+ebx+4]
pop esi edi ebx
leave
ret 4
@@:
add ebx,8
cmp ebx,50*8
jne @f
xor eax,eax
pop esi edi ebx
leave
ret 4
@@:
cmp [IcoTable+ebx],0
jnz .SearchIco
;-------------------------------------------------------------------------------
mov [endTablI],ebx
m2m dword[fiIcon.path],dword[path]
mcall 70,fiIcon
test eax,eax
jz @f
xor eax,eax
pop esi edi ebx
leave
ret 4
@@:
xor ecx,ecx
mov cx,[BuffH+4]
xor edi,edi
.TestRecord:
cmp word[BuffR],2020h
jne .NextRec
cmp byte[BuffR+2],0
jne .NextRec
lea eax,[BuffR]
stdcall LoadIco32b, [path],eax
pop esi edi ebx
leave
ret 4
.NextRec:
inc edi
mov eax,edi
shl eax,4
add eax,6
mov dword[fiIcon.pos],eax
mcall 70,fiIcon
loop .TestRecord
xor eax,eax
pop esi edi ebx
leave
ret 4
restore path
restore BuffH
restore BuffR
proc LoadIco32b, path,bufHeader
local ImgBuff:DWORD
mov edi,[bufHeader]
cmp dword[edi+8],10A8h
je @f
xor eax,eax
ret
@@:
mcall 68,12,32*32*4*2
mov ebx,[endTablI]
mov [IcoTable+ebx],eax
add eax,4096
mov [IcoTable+ebx+4],eax
mov [ImgBuff],eax
m2m dword[fiIcon.pos],dword[edi+12]
mov dword[fiIcon.size],32*32*4
mcall 70,fiIcon
mov eax,[ImgBuff]
ret
endp
fiIcon:
dd 0
.pos dd 0
dd 0
.size dd 22
.point dd 0
db 0
.path dd 0
IcoTable rd 2*50 ;(name(4), data(4)). End - dword 0