Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4228 → Rev 4128

/programs/other/t_edit/t_draw.inc
54,7 → 54,7
call draw_but_icon
or ecx,0x40000000
 
cmp dword[buf],0
cmp byte[buf],0
jne @f
and ecx,0xffff
@@:
356,20 → 356,17
; buf_g24 - áóôåð ñ âûõîäíûì 24 áèòíûì ñåðûì èçîáðàæåíèåì
; pixels - ÷èñëî ïèêñåëåé â èçîáðàæåíèè
align 4
proc img_to_gray, buf_rgb:dword, buf_g24:dword, pixels:dword
pushad
proc img_to_gray uses eax ebx ecx edi esi, buf_rgb:dword, buf_g24:dword, pixels:dword
mov esi,[buf_rgb]
mov edi,[buf_g24]
mov ecx,[pixels]
mov ebx,3
@@:
movzx eax,byte[esi]
movzx edx,byte[esi+1]
add eax,edx
movzx edx,byte[esi+2]
add eax,edx
xor edx,edx
div ebx ;shr eax,2
movzx ebx,byte[esi+1]
add eax,ebx
movzx ebx,byte[esi+2]
add eax,ebx
shr eax,2
mov ah,al
mov word[edi],ax
mov byte[edi+2],al
376,7 → 373,6
add esi,3
add edi,3
loop @b
popad
ret
endp