Subversion Repositories Kolibri OS

Rev

Rev 1958 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1958 Rev 2163
Line 65... Line 65...
65
.1:
65
.1:
66
	mov  [eax],dword 100
66
	mov  [eax],dword 100
67
	mov  [zoom_factors],dword zoom_factors.100
67
	mov  [zoom_factors],dword zoom_factors.100
68
	mov  eax,[eax]
68
	mov  eax,[eax]
69
	jmp   zoom_plus.2
69
	jmp   zoom_plus.2
70
	
-
 
71
;	call calculate_arrows_offset
-
 
72
;	call draw_zoom_factors
-
 
73
;	jmp  red
-
 
74
;---------------------------------------------------------------------
70
;---------------------------------------------------------------------
75
scaling:
71
scaling:
76
	mov  eax,[soi]
72
	mov  eax,[soi]
77
	test eax,eax
73
	test eax,eax
78
	jz   still
74
	jz   still
Line 112... Line 108...
112
	ret
108
	ret
113
;---------------------------
109
;---------------------------
114
.fill_for_L_R:
110
.fill_for_L_R:
115
	cmp   [no_fill],1
111
	cmp   [no_fill],1
116
	je   @f
112
	je   @f
117
;	xor  eax,eax
-
 
118
;	mov  [no_fill],al
-
 
119
;	ret
-
 
120
;@@:
-
 
121
	pusha
113
	pusha
122
	mov   ebx,[image_start_coordinates]
114
	mov   ebx,[image_start_coordinates]
123
	mov   ecx,ebx
115
	mov   ecx,ebx
124
	shl   ecx,16
116
	shl   ecx,16
125
	mov   bx,ax
117
	mov   bx,ax
Line 128... Line 120...
128
	mov   ax,bx
120
	mov   ax,bx
129
	ror   ebx,16
121
	ror   ebx,16
130
	add   bx,ax
122
	add   bx,ax
131
	add   bx,[wa_width_2]
123
	add   bx,[wa_width_2]
132
	mov   ax,[wa_width_1]
124
	mov   ax,[wa_width_1]
133
;	add   ax,5
-
 
134
	sub   ax,bx
125
	sub   ax,bx
135
	rol   ebx,16
126
	rol   ebx,16
136
	mov   bx,ax
127
	mov   bx,ax
137
	mcall 13,,,[fill_color]  ;0xffffff
128
	mcall 13,,,[fill_color]  ;0xffffff
138
	popa
129
	popa
Line 140... Line 131...
140
	ret
131
	ret
141
;---------------------------
132
;---------------------------
142
.fill_for_U_D:
133
.fill_for_U_D:
143
	cmp   [no_fill],1
134
	cmp   [no_fill],1
144
	je   @f
135
	je   @f
145
;	xor  eax,eax
-
 
146
;	mov  [no_fill],al
-
 
147
;	ret
-
 
148
;@@:
-
 
149
	pusha
136
	pusha
150
	mov   ebx,[image_start_coordinates]
137
	mov   ebx,[image_start_coordinates]
151
	mov   ecx,ebx
138
	mov   ecx,ebx
152
	shl   ecx,16
139
	shl   ecx,16
153
	mov   cx,ax
140
	mov   cx,ax
Line 220... Line 207...
220
;	mov eax,image_file
207
;	mov eax,image_file
221
;	mov  edx,[scaling_mode]
208
;	mov  edx,[scaling_mode]
222
	movzx  esi,byte [filtering_flag]
209
	movzx  esi,byte [filtering_flag]
223
;	mov  edi,[background_color]
210
;	mov  edi,[background_color]
Line -... Line 211...
-
 
211
 
224
 
212
	push	dword 0				; eax - crop size
225
	push	dword [background_color]	;edi - background color
213
	push	dword [background_color]	; edi - background color
226
	push	esi	; esi - filtering
214
	push	esi				; esi - filtering
227
	push	dword [scaling_mode]	;edx - scaling mode
215
	push	dword [scaling_mode]		; edx - scaling mode
228
	push	ecx	; ecx - start_coordinates
216
	push	ecx				; ecx - start_coordinates
Line 295... Line 283...
295
	test ax,ax
283
	test ax,ax
296
	jz  @f
284
	jz  @f
297
	add  edx,eax
285
	add  edx,eax
298
	call .fill_for_U_D
286
	call .fill_for_U_D
299
@@:
287
@@:
300
	mov   esi,[img_resolution]
288
;	mov   esi,[img_resolution]
301
    cmp   [img_resolution_2],15
289
;	cmp   [img_resolution_2],15
302
    jne  @f
290
;	jne  @f
303
	mov  esi,15
291
;	mov  esi,15
304
@@:
292
;@@:
-
 
293
	mov	eax,[raw_pointer_2]
-
 
294
	mov	esi,[eax+12]
-
 
295
	
305
	mov  eax,[raw_pointer]
296
	mov  eax,[raw_pointer]
306
	mov  edi,[eax+20]
297
	mov  edi,[eax+20]
307
	add  edi,eax
298
	add  edi,eax
308
;	mov  edi,[img_palette]
299
;	mov  edi,[img_palette]
-
 
300
 
309
	xor  ebp,ebp
301
	xor  ebp,ebp
Line 310... Line 302...
310
 
302
 
-
 
303
	mov  ebx,[raw_pointer_2]
-
 
304
	mov	eax,[ebx+28]
Line 311... Line 305...
311
	mov  ebx,[raw_pointer_2]
305
	add	ebx,eax
312
 
306
 
313
	mov  eax,ecx
307
	mov  eax,ecx
314
	test ax,ax
308
	test ax,ax
315
	jz   .no_draw  ;@f
309
	jz   .no_draw  ;@f
316
	shr  eax,16
310
	shr  eax,16
Line 317... Line 311...
317
	test eax,eax
311
	test eax,eax
318
	jz   .no_draw ;@f
312
	jz   .no_draw ;@f
319
	
313
 
320
	cmp  [filtering_flag],0
314
;	cmp  [filtering_flag],0
321
	je   @f
315
;	je   @f
322
	cmp  esi,8
316
;	cmp  esi,8
323
	jne  @f
317
;	jne  @f
324
	mov  esi,24
318
;	mov  esi,24
325
@@:
319
;@@:
326
	mcall 65
320
	mcall 65
327
.no_draw:
321
.no_draw:
Line 339... Line 333...
339
;	
333
;	
340
;	mov  eax,edx
334
;	mov  eax,edx
341
;	and  eax,0xffff
335
;	and  eax,0xffff
342
;	mov  [test4],eax
336
;	mov  [test4],eax
Line 343... Line -...
343
 
-
 
344
	push ebx
337
 
345
	call draw_file_name_to_work_area
-
 
346
	pop  ebx
338
	call draw_file_name_to_work_area
347
	mov  ecx,ebx  ;[raw_pointer_2]
-
 
Line 348... Line 339...
348
	mcall 68,13
339
	mcall 68,13,[raw_pointer_2]
349
	
340
	
-
 
341
	
-
 
342
	xor  eax,eax
350
	
343
	mov  ax,[wa_width_2]
-
 
344
	
-
 
345
	mov  ebx,[img_width]
-
 
346
;	imul eax,100
-
 
347
	call	calculate_relation
-
 
348
	mov  [zoom_auto_factor],eax
-
 
349
	
-
 
350
	ret
-
 
351
;---------------------------------------------------------------------
351
	xor  eax,eax
352
calculate_relation:
352
	mov  ax,[wa_width_2]
353
; relation = X*100/Y
353
;	imul eax,100
354
; eax = eax*100/ebx
354
; ÅÀÕ = ÅÀÕ * 100
355
; ÅÀÕ = ÅÀÕ * 100
355
    shl eax,2      ; óìíîæåíèå íà 4
356
	shl	eax,2      ; óìíîæåíèå íà 4
-
 
357
	lea	eax,[eax+eax*4] ; óìíîæåíèå íà 5
356
    lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
358
	lea	eax,[eax+eax*4] ; óìíîæåíèå íà 5
357
    lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
359
integer_division:
358
	mov  ebx,[img_width]
360
; eax = eax/ebx
359
	test ebx,ebx
361
	test	ebx,ebx
360
	jnz  @f
362
	jnz	@f
361
	inc  ebx
363
	inc	ebx
362
@@:
364
@@:
363
	xor  edx,edx
365
	xor	edx,edx
364
	div  ebx
366
	div	ebx
365
	shl  edx,1
367
;	shl	edx,1
366
	cmp  ebx,edx
368
;	cmp	ebx,edx
367
	jb   @f
-
 
368
	inc  eax
-
 
369
@@:
369
;	jb	@f
370
	mov  [zoom_auto_factor],eax
370
;	inc	eax
371
	
371
;@@:
372
	ret
372
	ret
373
;---------------------------------------------------------------------
373
;---------------------------------------------------------------------