2016-03-22 17:12:51 +03:00
|
|
|
macro instrument_set m_num, code
|
|
|
|
{
|
|
|
|
local no_instrument
|
|
|
|
cmp [number_menu],m_num
|
|
|
|
jne no_instrument
|
|
|
|
mov [Current_instrument],code
|
|
|
|
call TakeButtonInstruments
|
|
|
|
jmp end_menu
|
|
|
|
no_instrument:
|
|
|
|
}
|
|
|
|
|
2006-12-29 17:50:24 +03:00
|
|
|
;-----------------------------------------------------------
|
|
|
|
;-----------instruments of menu-----------------------------
|
|
|
|
;-----------------------------------------------------------
|
2016-03-22 17:12:51 +03:00
|
|
|
align 4
|
2006-12-29 17:50:24 +03:00
|
|
|
TakeInstruments:
|
2010-10-05 00:40:19 +04:00
|
|
|
;|||||||||||||||||||FILE||||||||||||||||||||||
|
|
|
|
cmp [number_panel],7
|
|
|
|
jne no_file
|
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< New >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],1
|
|
|
|
jne no_new
|
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
call dialog2_draw
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov edx,1000000000000000000000000000000b+1000
|
2016-03-16 01:30:18 +03:00
|
|
|
mcall SF_DEFINE_BUTTON,<177,40>,<115,14>,
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov edx,1000000000000000000000000000000b+1001
|
2016-03-21 20:29:30 +03:00
|
|
|
mcall ,,<139,14>,
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov edx,1000000000000000000000000000000b+1002
|
2016-03-21 20:29:30 +03:00
|
|
|
mcall ,,<170,15>
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
no_activate_space:
|
2016-03-21 20:29:30 +03:00
|
|
|
mcall SF_SLEEP, 5 ;fix cpu use 100%
|
2016-03-16 01:30:18 +03:00
|
|
|
mcall SF_WAIT_EVENT
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
cmp eax,1 ;redraw window
|
|
|
|
jne @f
|
|
|
|
call dialog2_draw
|
|
|
|
jmp no_activate_space
|
|
|
|
@@:
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
cmp eax,3 ;press button
|
|
|
|
jne no_activate_space
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-16 01:30:18 +03:00
|
|
|
mcall SF_GET_BUTTON
|
2010-10-05 00:40:19 +04:00
|
|
|
shr eax,8
|
|
|
|
|
|
|
|
cmp eax,1000
|
|
|
|
jl no_activate_space
|
|
|
|
|
|
|
|
cmp eax,1000
|
|
|
|
jne no_picture_size_x
|
|
|
|
|
|
|
|
mov eax,180
|
|
|
|
mov ebx,119
|
|
|
|
mov ecx,5
|
|
|
|
call dialog_line
|
|
|
|
|
|
|
|
mov eax,string_
|
|
|
|
mov ebx,13
|
|
|
|
call find_symvol
|
|
|
|
|
|
|
|
dec eax
|
|
|
|
mov [length_number],eax
|
|
|
|
mov eax,string_
|
2016-03-21 20:29:30 +03:00
|
|
|
call str_to_int
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov [Picture_SizeX],eax
|
|
|
|
jmp no_activate_space
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_picture_size_x:
|
|
|
|
cmp eax,1001
|
|
|
|
jne no_picture_size_y
|
|
|
|
|
|
|
|
mov eax,180
|
|
|
|
mov ebx,119+24
|
|
|
|
mov ecx,5
|
|
|
|
call dialog_line
|
|
|
|
|
|
|
|
mov eax,string_
|
|
|
|
mov ebx,13
|
|
|
|
call find_symvol
|
|
|
|
|
|
|
|
dec eax
|
|
|
|
mov [length_number],eax
|
|
|
|
mov eax,string_
|
2016-03-21 20:29:30 +03:00
|
|
|
call str_to_int
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov [Picture_SizeY],eax
|
|
|
|
jmp no_activate_space
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_picture_size_y:
|
|
|
|
cmp eax,1002
|
|
|
|
jne no_activate_space
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
exit_new:
|
|
|
|
mov edx,11100000000000000000000000000000b+1002
|
2016-03-21 20:29:30 +03:00
|
|
|
mcall SF_DEFINE_BUTTON,<177,40>,<170,15>
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
mov edx,11100000000000000000000000000000b+1001
|
2016-03-21 20:29:30 +03:00
|
|
|
mcall ,,<139,14>
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
mov edx,11100000000000000000000000000000b+1000
|
|
|
|
mcall ,,<115,14>
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
;get memory for new picture
|
2016-03-21 20:29:30 +03:00
|
|
|
call GetMemory
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
and [save_flag],0
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
call cleare_work_arrea
|
|
|
|
call drawwin
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_new:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Open >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],2
|
|
|
|
jne no_open
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-09-30 17:20:36 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
mov [OpenDialog_data.type],0 ; open
|
|
|
|
|
|
|
|
push dword OpenDialog_data
|
|
|
|
call [OpenDialog_Start]
|
|
|
|
|
|
|
|
cmp [OpenDialog_data.status],1
|
2016-03-22 17:12:51 +03:00
|
|
|
jne end_menu
|
2010-09-30 17:20:36 +04:00
|
|
|
;---------------------------------------------------------------------
|
2016-03-16 01:30:18 +03:00
|
|
|
mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b
|
2010-09-30 17:20:36 +04:00
|
|
|
|
2016-03-12 23:39:39 +03:00
|
|
|
call load_picture
|
2016-03-16 01:30:18 +03:00
|
|
|
call drawwin
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_open:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Save >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],3
|
|
|
|
jne no_save_
|
|
|
|
|
|
|
|
mov al,[save_flag]
|
2016-03-22 17:12:51 +03:00
|
|
|
test al,al
|
|
|
|
jz end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
jmp save_enter
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_save_:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Save as >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],4
|
|
|
|
jne no_save
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
; savedialog drawwin,save1,save2,file_path
|
2010-10-01 17:09:54 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; replace extension to '.bmp'
|
|
|
|
push eax esi
|
|
|
|
mov esi,[OpenDialog_data.filename_area]
|
|
|
|
xor eax,eax
|
|
|
|
cld
|
|
|
|
@@:
|
|
|
|
lodsb
|
|
|
|
test eax,eax
|
|
|
|
jnz @r
|
2010-10-05 00:40:19 +04:00
|
|
|
sub esi,5
|
2010-10-01 17:09:54 +04:00
|
|
|
cmp [esi],byte '.'
|
|
|
|
jne @f
|
2010-10-05 00:40:19 +04:00
|
|
|
mov [esi],dword '.bmp'
|
2010-10-01 17:09:54 +04:00
|
|
|
@@:
|
|
|
|
pop esi eax
|
2010-09-30 17:20:36 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
mov [OpenDialog_data.type],1 ; save
|
2016-03-21 20:29:30 +03:00
|
|
|
stdcall [OpenDialog_Start],OpenDialog_data
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2010-09-30 17:20:36 +04:00
|
|
|
cmp [OpenDialog_data.status],1
|
2016-03-22 17:12:51 +03:00
|
|
|
jne end_menu
|
2010-09-30 17:20:36 +04:00
|
|
|
;---------------------------------------------------------------------
|
2010-10-05 00:40:19 +04:00
|
|
|
save1:
|
|
|
|
save_enter:
|
2016-03-16 01:30:18 +03:00
|
|
|
mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
call analizing_picture_to_palette
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
;eax => number of colors in picture
|
|
|
|
mov ebx,[PointerToPicture]
|
|
|
|
mov ecx,[PointerToEditBufer]
|
|
|
|
mov edx,[PointerToPalette]
|
|
|
|
mov esi,[Picture_SizeX]
|
|
|
|
mov edi,[Picture_SizeY]
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
call coding_bmp
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
mov eax,file_path
|
|
|
|
mov ecx,ebx
|
|
|
|
mov ebx,[PointerToEditBufer]
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
call save_file
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
mov [save_flag],1
|
2016-03-22 17:12:51 +03:00
|
|
|
call drawwin
|
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_save:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Exit >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],5
|
|
|
|
jne no_exit_program
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2016-03-17 22:03:33 +03:00
|
|
|
mcall SF_TERMINATE_PROCESS
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_exit_program:
|
|
|
|
no_file:
|
|
|
|
;|||||||||||||||||||||||||||||EDIT|||||||||||||||||||||||||
|
|
|
|
cmp [number_panel],6
|
2016-03-21 20:29:30 +03:00
|
|
|
jne no_edit
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Undo >>>
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [number_menu],1
|
|
|
|
jne no_undo
|
|
|
|
|
2016-03-17 22:03:33 +03:00
|
|
|
cmp [number_undo],2 ;2 - maximum undo count
|
2016-03-23 13:15:41 +03:00
|
|
|
jge end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-17 22:03:33 +03:00
|
|
|
;rotate bufers -1
|
|
|
|
inc [number_undo]
|
|
|
|
mov eax,[PointerToPicture]
|
|
|
|
mov ebx,[PointerToCopyPicture]
|
|
|
|
mov ecx,[PointerToCopyPicture2]
|
|
|
|
mov [PointerToPicture],ebx
|
|
|
|
mov [PointerToCopyPicture],ecx
|
|
|
|
mov [PointerToCopyPicture2],eax
|
2010-10-05 00:40:19 +04:00
|
|
|
|
2016-03-17 22:03:33 +03:00
|
|
|
call MovePictureToWorkScreen
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_undo:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Redo >>>
|
|
|
|
cmp [number_menu],2
|
|
|
|
jne no_redo
|
|
|
|
|
|
|
|
cmp [number_undo],0
|
2016-03-23 13:15:41 +03:00
|
|
|
je end_menu
|
2016-03-21 20:29:30 +03:00
|
|
|
|
|
|
|
;rotate bufers +1
|
|
|
|
dec [number_undo]
|
|
|
|
mov eax,[PointerToPicture]
|
|
|
|
mov ebx,[PointerToCopyPicture]
|
|
|
|
mov ecx,[PointerToCopyPicture2]
|
|
|
|
mov [PointerToPicture],ecx
|
|
|
|
mov [PointerToCopyPicture],eax
|
|
|
|
mov [PointerToCopyPicture2],ebx
|
|
|
|
|
|
|
|
call MovePictureToWorkScreen
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2016-03-21 20:29:30 +03:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_redo:
|
|
|
|
; <<< Copy >>>
|
|
|
|
cmp [number_menu],3
|
2010-10-05 00:40:19 +04:00
|
|
|
jne no_copy
|
|
|
|
|
|
|
|
cmp [instrument_used],1
|
2016-03-23 13:15:41 +03:00
|
|
|
jne end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
cmp [Activate_instrument],0
|
2016-03-23 13:15:41 +03:00
|
|
|
jne end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl no_remove_x_copy
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x
|
|
|
|
mov [rectangular_shade_x],eax
|
|
|
|
|
|
|
|
no_remove_x_copy:
|
|
|
|
cmp ebx,[rectangular_shade_y]
|
|
|
|
jl no_remove_y_copy
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_y]
|
|
|
|
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y
|
|
|
|
mov [rectangular_shade_y],ebx
|
|
|
|
|
|
|
|
no_remove_y_copy:
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov edx,[rectangular_shade_y]
|
|
|
|
inc eax
|
|
|
|
inc ebx
|
|
|
|
dec ecx
|
|
|
|
dec edx
|
|
|
|
|
|
|
|
mov [x],eax
|
|
|
|
mov [y],ebx
|
|
|
|
mov esi,eax
|
|
|
|
mov edi,ebx
|
|
|
|
mov [Dx_],1
|
|
|
|
mov [Dy_],1
|
|
|
|
|
|
|
|
sub ecx,eax
|
|
|
|
jnz no_signum_fill_r_x_copy
|
|
|
|
|
|
|
|
mov [Dx_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_x_copy:
|
|
|
|
sub edx,ebx
|
|
|
|
jnz no_signum_fill_r_y_copy
|
|
|
|
|
|
|
|
mov [Dy_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_y_copy:
|
|
|
|
mov ebx,[rectangular_shade_y]
|
|
|
|
sub ebx,edi
|
|
|
|
|
|
|
|
mov edx,[PointerToEditBufer]
|
|
|
|
mov [y],edi
|
|
|
|
|
|
|
|
loop_fill_rectangle_y_copy:
|
|
|
|
mov [x],esi
|
|
|
|
|
|
|
|
loop_fill_rectangle_x_copy:
|
|
|
|
push esi edi
|
|
|
|
mov eax,[PointerToPicture]
|
|
|
|
mov ebx,[Picture_SizeX]
|
|
|
|
mov esi,[x]
|
|
|
|
mov edi,[y]
|
|
|
|
call GetColorOfPixel
|
|
|
|
mov [edx],ax
|
|
|
|
shr eax,16
|
|
|
|
mov [edx+2],al
|
|
|
|
pop edi esi
|
|
|
|
|
|
|
|
add edx,3
|
|
|
|
mov eax,[x]
|
|
|
|
add eax,[Dx_]
|
|
|
|
mov [x],eax
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl loop_fill_rectangle_x_copy
|
|
|
|
|
|
|
|
mov eax,[y]
|
|
|
|
add eax,[Dy_]
|
|
|
|
mov [y],eax
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_y]
|
|
|
|
jl loop_fill_rectangle_y_copy
|
|
|
|
|
|
|
|
call MovePictureToWorkScreen
|
|
|
|
mov [DrawSprite_flag],1
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_copy:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Paste >>>
|
|
|
|
cmp [number_menu],4
|
2010-10-05 00:40:19 +04:00
|
|
|
jne no_paste
|
|
|
|
|
|
|
|
cmp [instrument_used],1
|
|
|
|
jne no_paste
|
|
|
|
|
|
|
|
cmp [Activate_instrument],0
|
|
|
|
jne no_paste
|
|
|
|
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl no_remove_x_paste
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x
|
|
|
|
mov [rectangular_shade_x],eax
|
|
|
|
|
|
|
|
no_remove_x_paste:
|
|
|
|
cmp ebx,[rectangular_shade_y]
|
|
|
|
jl no_remove_y_paste
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_y]
|
|
|
|
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y
|
|
|
|
mov [rectangular_shade_y],ebx
|
|
|
|
|
|
|
|
no_remove_y_paste:
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov edx,[rectangular_shade_y]
|
|
|
|
inc eax
|
|
|
|
inc ebx
|
|
|
|
dec ecx
|
|
|
|
dec edx
|
|
|
|
|
|
|
|
mov [x],eax
|
|
|
|
mov [y],ebx
|
|
|
|
mov esi,eax
|
|
|
|
mov edi,ebx
|
|
|
|
mov [Dx_],1
|
|
|
|
mov [Dy_],1
|
|
|
|
|
|
|
|
sub ecx,eax
|
|
|
|
jnz no_signum_fill_r_x_paste
|
|
|
|
|
|
|
|
mov [Dx_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_x_paste:
|
|
|
|
sub edx,ebx
|
|
|
|
jnz no_signum_fill_r_y_paste
|
|
|
|
|
|
|
|
mov [Dy_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_y_paste:
|
|
|
|
mov edx,[PointerToEditBufer]
|
|
|
|
mov [y],edi
|
|
|
|
|
|
|
|
loop_fill_rectangle_y_paste:
|
|
|
|
mov [x],esi
|
|
|
|
|
|
|
|
loop_fill_rectangle_x_paste:
|
|
|
|
push esi edi
|
|
|
|
mov ecx,[edx]
|
|
|
|
and ecx,0xffffff ;color
|
|
|
|
mov eax,[PointerToPicture]
|
|
|
|
mov ebx,[Picture_SizeX]
|
|
|
|
mov esi,[x]
|
|
|
|
mov edi,[y]
|
|
|
|
call PutPixel
|
|
|
|
pop edi esi
|
|
|
|
|
|
|
|
add edx,3
|
|
|
|
|
|
|
|
mov eax,[x]
|
|
|
|
add eax,[Dx_]
|
|
|
|
mov [x],eax
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl loop_fill_rectangle_x_paste
|
|
|
|
|
|
|
|
mov eax,[y]
|
|
|
|
add eax,[Dy_]
|
|
|
|
mov [y],eax
|
|
|
|
cmp eax,[rectangular_shade_y]
|
|
|
|
jl loop_fill_rectangle_y_paste
|
|
|
|
|
|
|
|
call MovePictureToWorkScreen
|
|
|
|
mov [Paste_flag],1
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_paste:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Cut >>>
|
|
|
|
cmp [number_menu],5
|
2010-10-05 00:40:19 +04:00
|
|
|
jne no_cut
|
|
|
|
|
|
|
|
cmp [instrument_used],1
|
|
|
|
jne no_cut
|
|
|
|
|
|
|
|
cmp [Activate_instrument],0
|
|
|
|
jne no_cut
|
|
|
|
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl no_remove_x_cut
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x
|
|
|
|
mov [rectangular_shade_x],eax
|
|
|
|
|
|
|
|
no_remove_x_cut:
|
|
|
|
cmp ebx,[rectangular_shade_y]
|
|
|
|
jl no_remove_y_cut
|
|
|
|
|
|
|
|
mov ecx,[rectangular_shade_y]
|
|
|
|
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y
|
|
|
|
mov [rectangular_shade_y],ebx
|
|
|
|
|
|
|
|
no_remove_y_cut:
|
|
|
|
mov eax,[OldX]
|
|
|
|
mov ebx,[OldY]
|
|
|
|
mov ecx,[rectangular_shade_x]
|
|
|
|
mov edx,[rectangular_shade_y]
|
|
|
|
inc eax
|
|
|
|
inc ebx
|
|
|
|
dec ecx
|
|
|
|
dec edx
|
|
|
|
|
|
|
|
mov [x],eax
|
|
|
|
mov [y],ebx
|
|
|
|
mov esi,eax
|
|
|
|
mov edi,ebx
|
|
|
|
mov [Dx_],1
|
|
|
|
mov [Dy_],1
|
|
|
|
|
|
|
|
sub ecx,eax
|
|
|
|
jnz no_signum_fill_r_x
|
|
|
|
|
|
|
|
mov [Dx_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_x:
|
|
|
|
sub edx,ebx
|
|
|
|
jnz no_signum_fill_r_y
|
|
|
|
|
|
|
|
mov [Dy_],-1
|
|
|
|
|
|
|
|
no_signum_fill_r_y:
|
|
|
|
mov [y],edi
|
|
|
|
|
|
|
|
loop_fill_rectangle_y:
|
|
|
|
mov [x],esi
|
|
|
|
|
|
|
|
loop_fill_rectangle_x:
|
|
|
|
push esi edi
|
|
|
|
mov eax,[PointerToPicture]
|
|
|
|
mov ebx,[Picture_SizeX]
|
|
|
|
mov ecx,dword 0xffffff
|
|
|
|
mov esi,[x]
|
|
|
|
mov edi,[y]
|
|
|
|
call PutPixel
|
|
|
|
pop edi esi
|
|
|
|
|
|
|
|
mov eax,[x]
|
|
|
|
add eax,[Dx_]
|
|
|
|
mov [x],eax
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_x]
|
|
|
|
jl loop_fill_rectangle_x
|
|
|
|
|
|
|
|
mov eax,[y]
|
|
|
|
add eax,[Dy_]
|
|
|
|
mov [y],eax
|
|
|
|
|
|
|
|
cmp eax,[rectangular_shade_y]
|
|
|
|
jl loop_fill_rectangle_y
|
|
|
|
|
|
|
|
call MovePictureToWorkScreen
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_cut:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< Cleare all >>>
|
|
|
|
cmp [number_menu],6
|
2010-10-05 00:40:19 +04:00
|
|
|
jne no_cleare_all
|
2006-12-29 17:50:24 +03:00
|
|
|
|
2010-10-05 00:40:19 +04:00
|
|
|
call cleare_work_arrea
|
|
|
|
call MovePictureToWorkScreen
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
no_cleare_all:
|
2016-03-21 20:29:30 +03:00
|
|
|
; <<< To allocate all >>>
|
|
|
|
cmp [number_menu],7
|
2016-03-22 17:12:51 +03:00
|
|
|
jne end_menu ;no_to_allocate_all
|
2010-10-05 00:40:19 +04:00
|
|
|
|
|
|
|
mov [OldX],1
|
|
|
|
mov [OldY],1
|
|
|
|
mov eax,[Picture_SizeX]
|
|
|
|
mov ebx,[Picture_SizeY]
|
|
|
|
dec eax
|
|
|
|
dec ebx
|
|
|
|
mov [rectangular_shade_x],eax
|
|
|
|
mov [rectangular_shade_y],ebx
|
|
|
|
mov [instrument_used],1
|
|
|
|
mov [Activate_instrument],1
|
|
|
|
mov [Current_instrument],30
|
|
|
|
mov [crossing],0
|
|
|
|
; call TakeButtonInstruments
|
|
|
|
; call MovePictureToWorkScreen
|
2016-03-22 17:12:51 +03:00
|
|
|
jmp end_menu
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
;no_to_allocate_all:
|
2016-03-21 20:29:30 +03:00
|
|
|
no_edit:
|
|
|
|
;|||||||||||||||||||||||||INSTRUMENTS||||||||||||||||||||||
|
|
|
|
cmp [number_panel],5
|
|
|
|
jne no_instruments
|
|
|
|
|
2016-03-22 17:12:51 +03:00
|
|
|
instrument_set 1,10 ; pensil
|
|
|
|
instrument_set 2,11 ; draw brush
|
|
|
|
instrument_set 3,12 ; spray
|
|
|
|
instrument_set 4,13 ; lastik
|
|
|
|
instrument_set 5,14 ; flood fill
|
|
|
|
instrument_set 6,15 ; pipetka
|
|
|
|
instrument_set 7,16 ; draw line
|
|
|
|
instrument_set 8,17 ; draw rectangle
|
|
|
|
instrument_set 9,18 ; draw circle
|
|
|
|
instrument_set 10,19 ; draw ellips
|
|
|
|
instrument_set 11,20 ; draw hard contour
|
|
|
|
|
|
|
|
no_instruments:
|
2016-03-21 20:29:30 +03:00
|
|
|
|
2016-03-22 17:12:51 +03:00
|
|
|
end_menu:
|
2016-03-21 20:29:30 +03:00
|
|
|
and [number_panel],0
|
|
|
|
and [number_menu],0
|
|
|
|
jmp still
|
2010-10-05 00:40:19 +04:00
|
|
|
;---------------------------------------------------------------------
|