Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6378 → Rev 6379

/programs/media/animage/trunk/screen.inc
90,12 → 90,11
 
screen_x_1:
mov ecx,[eax]
and ecx,0xffffff
mov ebp,ecx
shr ecx,16
mov [ebx],bp
mov [ebx+2],cl
add ebx,3;
add ebx,3
add eax,3
dec esi
jnz screen_x_1
114,7 → 113,6
 
screen_x_2:
mov ecx,[eax]
and ecx,0xffffff
mov ebp,ecx
shr ecx,16
mov edx,ebx
128,8 → 126,6
mov [edx+2],cl
mov [edx+3],bp
mov [edx+3+2],cl
add edx,3*2
add edx,[OffsetYBigPixel]
add ebx,3*2
add eax,3
dec esi
149,7 → 145,6
 
screen_x_4:
mov ecx,[eax]
and ecx,0xffffff
mov ebp,ecx
shr ecx,16
mov edx,ebx
191,8 → 186,6
mov [edx+6+2],cl
mov [edx+9],bp
mov [edx+9+2],cl
add edx,3*4
add edx,[OffsetYBigPixel]
add ebx,4*3
add eax,3
dec esi
210,7 → 203,6
 
screen_x:
mov ecx,[eax]
and ecx,0xffffff
mov ebp,ecx
shr ecx,16
;---------------------------------------------------------
243,17 → 235,183
jnz screen_y
 
fps:
mov ebx,[ScreenPointer]
;calculate selection rect
cmp [instrument_used],1
jne .no_selection_rect
mov edx,[rectangular_shade_y]
sub edx,[PosY]
mov ecx,[rectangular_shade_x]
sub ecx,[PosX]
mov ebx,[OldY]
sub ebx,[PosY]
mov eax,[OldX]
sub eax,[PosX]
cmp [k],1
je .zo_1
cmp eax,ecx
jle @f
xchg eax,ecx
@@:
cmp ebx,edx
jle @f
xchg ebx,edx
@@:
inc eax
inc ebx
imul eax,[k]
imul ebx,[k]
imul ecx,[k]
imul edx,[k]
dec eax
dec ebx
.zo_1:
stdcall draw_selection_rect, eax,ebx,ecx,edx
.no_selection_rect:
 
mov ecx,[WorkScreen_SizeX]
shl ecx,16
add ecx,[WorkScreen_SizeY]
mov edx,((ci_edit_wnd_x_pos+ci_edit_wnd_border) shl 16)\
+ (ci_edit_wnd_y_pos+ci_edit_wnd_border)
mcall SF_PUT_IMAGE
mcall SF_PUT_IMAGE, [ScreenPointer]
ret
;----------------------------------------------------------
align 4
proc draw_selection_rect, x0:dword, y0:dword, x1:dword, y1:dword
mov eax,0xffff3fff ;2:2
mov edx,0xff1f ;1:1
 
mov edi,[x0]
mov ebx,[y0]
mov ecx,[x1]
cmp edi,ecx
jle @f
xchg edi,ecx
@@:
call draw_line_h
mov ebx,[y1]
call draw_line_h
 
mov edi,[x0]
mov ecx,[y0]
cmp ebx,ecx
jle @f
xchg ebx,ecx
@@:
call draw_line_w
mov edi,[x1]
call draw_line_w
ret
endp
 
;input:
; eax - color1(g,r):color2(g,r)
; dx - color1(b):color2(b)
; edi - x0
; ebx - y0
; ecx - x1 (x1 >= x0)
align 4
draw_line_h:
cmp edi,ecx
je .end_f
cmp ecx,1
jl .end_f
cmp edi,[WorkScreen_SizeX]
jge .end_f
cmp ebx,0
jl .end_f
cmp ebx,[WorkScreen_SizeY]
jge .end_f
push ebx ecx edi
cmp ecx,[WorkScreen_SizeX]
jl @f
mov ecx,[WorkScreen_SizeX]
@@:
cmp edi,0
jge @f
xor edi,edi
@@:
sub ecx,edi
imul ebx,[WorkScreen_SizeX]
add edi,ebx
lea edi,[edi+edi*2]
add edi,[ScreenPointer]
cld
.line_t:
stosw
mov byte[edi],dl
inc edi
bt ecx,1
jc @f
bt ecx,0
jc @f
ror eax,16
ror dx,8
@@:
dec ecx
jnz .line_t
pop edi ecx ebx
.end_f:
ret
 
;input:
; eax - color1(g,r):color2(g,r)
; dx - color1(b):color2(b)
; edi - x0
; ebx - y0
; ecx - y1 (y1 >= y0)
align 4
draw_line_w:
cmp edi,0
jl .end_f
cmp edi,[WorkScreen_SizeX]
jge .end_f
cmp ebx,ecx
je .end_f
cmp ebx,[WorkScreen_SizeY]
jge .end_f
cmp ecx,1
jl .end_f
push ebx ecx edi
cmp ecx,[WorkScreen_SizeY]
jl @f
mov ecx,[WorkScreen_SizeY]
@@:
cmp ebx,0
jge @f
xor ebx,ebx
@@:
sub ecx,ebx
cmp ecx,1
jl .end_f
imul ebx,[WorkScreen_SizeX]
add edi,ebx
lea edi,[edi+edi*2]
add edi,[ScreenPointer]
mov ebx,[WorkScreen_SizeX]
lea ebx,[ebx+ebx*2]
sub ebx,2
cld
.line_r:
stosw
mov byte[edi],dl
add edi,ebx
bt ecx,1
jc @f
bt ecx,0
jc @f
ror eax,16
ror dx,8
@@:
dec ecx
jnz .line_r
pop edi ecx ebx
.end_f:
ret
;----------------------------------------------------------
;--------------------clear screen--------------------------
;----------------------------------------------------------
align 4
cleare_screen:
mov edi,[ScreenPointer]
mov ebx,[WorkScreen_SizeX]