Rev 6385 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6385 | Rev 6741 | ||
---|---|---|---|
1 | macro instrument_set m_num, code |
1 | macro instrument_set m_num, code |
2 | { |
2 | { |
3 | local no_instrument |
3 | local no_instrument |
4 | cmp [number_menu],m_num |
4 | cmp [number_menu],m_num |
5 | jne no_instrument |
5 | jne no_instrument |
6 | mov [Current_instrument],code |
6 | mov [Current_instrument],code |
7 | call TakeButtonInstruments |
7 | call TakeButtonInstruments |
8 | jmp end_menu |
8 | jmp end_menu |
9 | no_instrument: |
9 | no_instrument: |
10 | } |
10 | } |
11 | 11 | ||
12 | ;----------------------------------------------------------- |
12 | ;----------------------------------------------------------- |
13 | ;-----------instruments of menu----------------------------- |
13 | ;-----------instruments of menu----------------------------- |
14 | ;----------------------------------------------------------- |
14 | ;----------------------------------------------------------- |
15 | align 4 |
15 | align 4 |
16 | TakeInstruments: |
16 | TakeInstruments: |
17 | ;|||||||||||||||||||FILE|||||||||||||||||||||| |
17 | ;|||||||||||||||||||FILE|||||||||||||||||||||| |
18 | cmp [number_panel],7 |
18 | cmp [number_panel],7 |
19 | jne no_file |
19 | jne no_file |
20 | 20 | ||
21 | ; <<< New >>> |
21 | ; <<< New >>> |
22 | cmp [number_menu],1 |
22 | cmp [number_menu],1 |
23 | jne no_new |
23 | jne no_new |
24 | 24 | ||
25 | call dialog2_draw |
25 | call dialog2_draw |
26 | 26 | ||
27 | mov edx,1000000000000000000000000000000b+1000 |
27 | mov edx,1000000000000000000000000000000b+1000 |
28 | mcall SF_DEFINE_BUTTON,<177,40>,<115,14>, |
28 | mcall SF_DEFINE_BUTTON,<177,40>,<115,14>, |
29 | 29 | ||
30 | mov edx,1000000000000000000000000000000b+1001 |
30 | mov edx,1000000000000000000000000000000b+1001 |
31 | mcall ,,<139,14>, |
31 | mcall ,,<139,14>, |
32 | 32 | ||
33 | mov edx,1000000000000000000000000000000b+1002 |
33 | mov edx,1000000000000000000000000000000b+1002 |
34 | mcall ,,<170,15> |
34 | mcall ,,<170,15> |
35 | 35 | ||
36 | no_activate_space: |
36 | no_activate_space: |
37 | mcall SF_SLEEP, 5 ;fix cpu use 100% |
37 | mcall SF_SLEEP, 5 ;fix cpu use 100% |
38 | mcall SF_WAIT_EVENT |
38 | mcall SF_WAIT_EVENT |
39 | 39 | ||
40 | cmp eax,1 ;redraw window |
40 | cmp eax,1 ;redraw window |
41 | jne @f |
41 | jne @f |
42 | call dialog2_draw |
42 | call dialog2_draw |
43 | jmp no_activate_space |
43 | jmp no_activate_space |
44 | @@: |
44 | @@: |
45 | 45 | ||
46 | cmp eax,3 ;press button |
46 | cmp eax,3 ;press button |
47 | jne no_activate_space |
47 | jne no_activate_space |
48 | 48 | ||
49 | mcall SF_GET_BUTTON |
49 | mcall SF_GET_BUTTON |
50 | shr eax,8 |
50 | shr eax,8 |
51 | 51 | ||
52 | cmp eax,1000 |
52 | cmp eax,1000 |
53 | jl no_activate_space |
53 | jl no_activate_space |
54 | 54 | ||
55 | cmp eax,1000 |
55 | cmp eax,1000 |
56 | jne no_picture_size_x |
56 | jne no_picture_size_x |
57 | 57 | ||
58 | mov eax,180 |
58 | mov eax,180 |
59 | mov ebx,119 |
59 | mov ebx,119 |
60 | mov ecx,5 |
60 | mov ecx,5 |
61 | call dialog_line |
61 | call dialog_line |
62 | 62 | ||
63 | mov eax,string_ |
63 | mov eax,string_ |
64 | mov ebx,13 |
64 | mov ebx,13 |
65 | call find_symvol |
65 | call find_symvol |
66 | 66 | ||
67 | dec eax |
67 | dec eax |
68 | mov [length_number],eax |
68 | mov [length_number],eax |
69 | mov eax,string_ |
69 | mov eax,string_ |
70 | call str_to_int |
70 | call str_to_int |
71 | 71 | ||
72 | mov [Picture_SizeX],eax |
72 | mov [Picture_SizeX],eax |
73 | jmp no_activate_space |
73 | jmp no_activate_space |
74 | ;--------------------------------------------------------------------- |
74 | ;--------------------------------------------------------------------- |
75 | no_picture_size_x: |
75 | no_picture_size_x: |
76 | cmp eax,1001 |
76 | cmp eax,1001 |
77 | jne no_picture_size_y |
77 | jne no_picture_size_y |
78 | 78 | ||
79 | mov eax,180 |
79 | mov eax,180 |
80 | mov ebx,119+24 |
80 | mov ebx,119+24 |
81 | mov ecx,5 |
81 | mov ecx,5 |
82 | call dialog_line |
82 | call dialog_line |
83 | 83 | ||
84 | mov eax,string_ |
84 | mov eax,string_ |
85 | mov ebx,13 |
85 | mov ebx,13 |
86 | call find_symvol |
86 | call find_symvol |
87 | 87 | ||
88 | dec eax |
88 | dec eax |
89 | mov [length_number],eax |
89 | mov [length_number],eax |
90 | mov eax,string_ |
90 | mov eax,string_ |
91 | call str_to_int |
91 | call str_to_int |
92 | 92 | ||
93 | mov [Picture_SizeY],eax |
93 | mov [Picture_SizeY],eax |
94 | jmp no_activate_space |
94 | jmp no_activate_space |
95 | ;--------------------------------------------------------------------- |
95 | ;--------------------------------------------------------------------- |
96 | no_picture_size_y: |
96 | no_picture_size_y: |
97 | cmp eax,1002 |
97 | cmp eax,1002 |
98 | jne no_activate_space |
98 | jne no_activate_space |
99 | 99 | ||
100 | exit_new: |
100 | exit_new: |
101 | mov edx,11100000000000000000000000000000b+1002 |
101 | mov edx,11100000000000000000000000000000b+1002 |
102 | mcall SF_DEFINE_BUTTON,<177,40>,<170,15> |
102 | mcall SF_DEFINE_BUTTON,<177,40>,<170,15> |
103 | 103 | ||
104 | mov edx,11100000000000000000000000000000b+1001 |
104 | mov edx,11100000000000000000000000000000b+1001 |
105 | mcall ,,<139,14> |
105 | mcall ,,<139,14> |
106 | 106 | ||
107 | mov edx,11100000000000000000000000000000b+1000 |
107 | mov edx,11100000000000000000000000000000b+1000 |
108 | mcall ,,<115,14> |
108 | mcall ,,<115,14> |
109 | 109 | ||
110 | ;get memory for new picture |
110 | ;get memory for new picture |
111 | call GetMemory |
111 | call GetMemory |
112 | 112 | ||
113 | and [save_flag],0 |
113 | and [save_flag],0 |
114 | 114 | ||
115 | call cleare_work_arrea |
115 | call cleare_work_arrea |
116 | call drawwin |
116 | call drawwin |
117 | jmp end_menu |
117 | jmp end_menu |
118 | ;--------------------------------------------------------------------- |
118 | ;--------------------------------------------------------------------- |
119 | no_new: |
119 | no_new: |
120 | ; <<< Open >>> |
120 | ; <<< Open >>> |
121 | cmp [number_menu],2 |
121 | cmp [number_menu],2 |
122 | jne no_open |
122 | jne no_open |
123 | 123 | ||
124 | ;--------------------------------------------------------------------- |
124 | ;--------------------------------------------------------------------- |
125 | mov [OpenDialog_data.type],0 ; open |
125 | mov [OpenDialog_data.type],0 ; open |
126 | 126 | ||
127 | push dword OpenDialog_data |
127 | push dword OpenDialog_data |
128 | call [OpenDialog_Start] |
128 | call [OpenDialog_Start] |
129 | 129 | ||
130 | cmp [OpenDialog_data.status],1 |
130 | cmp [OpenDialog_data.status],1 |
131 | jne end_menu |
131 | jne end_menu |
132 | ;--------------------------------------------------------------------- |
132 | ;--------------------------------------------------------------------- |
133 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
133 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
134 | 134 | ||
135 | call load_picture |
135 | call load_picture |
136 | call drawwin |
136 | call drawwin |
137 | jmp end_menu |
137 | jmp end_menu |
138 | ;--------------------------------------------------------------------- |
138 | ;--------------------------------------------------------------------- |
139 | no_open: |
139 | no_open: |
140 | ; <<< Save >>> |
140 | ; <<< Save >>> |
141 | cmp [number_menu],3 |
141 | cmp [number_menu],3 |
142 | jne no_save_ |
142 | jne no_save_ |
143 | 143 | ||
144 | mov al,[save_flag] |
144 | mov al,[save_flag] |
145 | test al,al |
145 | test al,al |
146 | jz end_menu |
146 | jz end_menu |
147 | jmp save_enter |
147 | jmp save_enter |
148 | ;--------------------------------------------------------------------- |
148 | ;--------------------------------------------------------------------- |
149 | no_save_: |
149 | no_save_: |
150 | ; <<< Save as >>> |
150 | ; <<< Save as >>> |
151 | cmp [number_menu],4 |
151 | cmp [number_menu],4 |
152 | jne no_save |
152 | jne no_save |
153 | 153 | ||
154 | ; savedialog drawwin,save1,save2,file_path |
154 | ; savedialog drawwin,save1,save2,file_path |
155 | ;--------------------------------------------------------------------- |
155 | ;--------------------------------------------------------------------- |
156 | ; replace extension to '.bmp' |
156 | ; replace extension to '.png' |
157 | push eax esi |
157 | push eax esi |
158 | mov esi,[OpenDialog_data.filename_area] |
158 | mov esi,[OpenDialog_data.filename_area] |
159 | xor eax,eax |
159 | xor eax,eax |
160 | cld |
160 | cld |
161 | @@: |
161 | @@: |
162 | lodsb |
162 | lodsb |
163 | test eax,eax |
163 | test eax,eax |
164 | jnz @r |
164 | jnz @r |
165 | sub esi,5 |
165 | sub esi,5 |
166 | cmp [esi],byte '.' |
166 | cmp [esi],byte '.' |
167 | jne @f |
167 | jne @f |
168 | mov [esi],dword '.bmp' |
168 | mov [esi],dword '.png' |
169 | @@: |
169 | @@: |
170 | pop esi eax |
170 | pop esi eax |
171 | ;--------------------------------------------------------------------- |
171 | ;--------------------------------------------------------------------- |
172 | mov [OpenDialog_data.type],1 ; save |
172 | mov [OpenDialog_data.type],1 ; save |
173 | stdcall [OpenDialog_Start],OpenDialog_data |
173 | stdcall [OpenDialog_Start],OpenDialog_data |
174 | 174 | ||
175 | cmp [OpenDialog_data.status],1 |
175 | cmp [OpenDialog_data.status],1 |
176 | jne end_menu |
176 | jne end_menu |
177 | ;--------------------------------------------------------------------- |
177 | ;--------------------------------------------------------------------- |
178 | save1: |
178 | save1: |
179 | save_enter: |
179 | save_enter: |
180 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
180 | mcall SF_SET_EVENTS_MASK,0x80000027 ;100111b |
- | 181 | ||
- | 182 | xor al,al |
|
- | 183 | mov edi,file_path |
|
- | 184 | repne scasb |
|
- | 185 | mov eax,[edi-5] |
|
- | 186 | or eax,0x20202000 ;down register |
|
- | 187 | cmp eax,'.png' |
|
- | 188 | jne .end0 |
|
- | 189 | ;create image struct |
|
- | 190 | stdcall [img_create], [Picture_SizeX], [Picture_SizeY], Image.bpp24 |
|
- | 191 | test eax,eax |
|
- | 192 | jz @f |
|
- | 193 | ;copy image |
|
- | 194 | mov edi,[eax+Image.Data] |
|
- | 195 | mov esi,[PointerToPicture] |
|
- | 196 | mov ecx,[Picture_SizeX] |
|
- | 197 | imul ecx,[Picture_SizeY] |
|
- | 198 | imul ecx,3 |
|
- | 199 | rep movsb |
|
- | 200 | ||
- | 201 | ;encode image |
|
- | 202 | stdcall [img_encode], eax, LIBIMG_FORMAT_PNG, 0 |
|
- | 203 | test eax,eax |
|
- | 204 | jz @f |
|
- | 205 | ||
- | 206 | ;copy output image |
|
- | 207 | mov edi,[PointerToEditBufer] |
|
- | 208 | mov esi,eax |
|
- | 209 | mov eax,ecx |
|
- | 210 | rep movsb |
|
- | 211 | @@: |
|
- | 212 | mov ecx,eax |
|
- | 213 | mov eax,file_path |
|
- | 214 | mov ebx,[PointerToEditBufer] |
|
- | 215 | jmp .end1 |
|
- | 216 | .end0: |
|
181 | 217 | ||
182 | call analizing_picture_to_palette |
218 | call analizing_picture_to_palette |
183 | 219 | ||
184 | ;eax => number of colors in picture |
220 | ;eax => number of colors in picture |
185 | mov ebx,[PointerToPicture] |
221 | mov ebx,[PointerToPicture] |
186 | mov ecx,[PointerToEditBufer] |
222 | mov ecx,[PointerToEditBufer] |
187 | mov edx,[PointerToPalette] |
223 | mov edx,[PointerToPalette] |
188 | mov esi,[Picture_SizeX] |
224 | mov esi,[Picture_SizeX] |
189 | mov edi,[Picture_SizeY] |
225 | mov edi,[Picture_SizeY] |
190 | 226 | ||
191 | call coding_bmp |
227 | call coding_bmp |
192 | 228 | ||
193 | mov eax,file_path |
229 | mov eax,file_path |
194 | mov ecx,ebx |
230 | mov ecx,ebx |
195 | mov ebx,[PointerToEditBufer] |
231 | mov ebx,[PointerToEditBufer] |
- | 232 | ||
196 | 233 | .end1: |
|
197 | call save_file |
234 | call save_file |
198 | 235 | ||
199 | mov [save_flag],1 |
236 | mov [save_flag],1 |
200 | call drawwin |
237 | call drawwin |
201 | jmp end_menu |
238 | jmp end_menu |
202 | ;--------------------------------------------------------------------- |
239 | ;--------------------------------------------------------------------- |
203 | no_save: |
240 | no_save: |
204 | ; <<< Exit >>> |
241 | ; <<< Exit >>> |
205 | cmp [number_menu],5 |
242 | cmp [number_menu],5 |
206 | jne no_exit_program |
243 | jne no_exit_program |
207 | 244 | ||
208 | mcall SF_TERMINATE_PROCESS |
245 | mcall SF_TERMINATE_PROCESS |
209 | ;--------------------------------------------------------------------- |
246 | ;--------------------------------------------------------------------- |
210 | no_exit_program: |
247 | no_exit_program: |
211 | no_file: |
248 | no_file: |
212 | ;|||||||||||||||||||||||||||||EDIT||||||||||||||||||||||||| |
249 | ;|||||||||||||||||||||||||||||EDIT||||||||||||||||||||||||| |
213 | cmp [number_panel],6 |
250 | cmp [number_panel],6 |
214 | jne no_edit |
251 | jne no_edit |
215 | 252 | ||
216 | ; <<< Undo >>> |
253 | ; <<< Undo >>> |
217 | cmp [number_menu],1 |
254 | cmp [number_menu],1 |
218 | jne no_undo |
255 | jne no_undo |
219 | 256 | ||
220 | cmp [number_undo],2 ;2 - maximum undo count |
257 | cmp [number_undo],2 ;2 - maximum undo count |
221 | jge end_menu |
258 | jge end_menu |
222 | 259 | ||
223 | ;rotate bufers -1 |
260 | ;rotate bufers -1 |
224 | inc [number_undo] |
261 | inc [number_undo] |
225 | mov eax,[PointerToPicture] |
262 | mov eax,[PointerToPicture] |
226 | mov ebx,[PointerToCopyPicture] |
263 | mov ebx,[PointerToCopyPicture] |
227 | mov ecx,[PointerToCopyPicture2] |
264 | mov ecx,[PointerToCopyPicture2] |
228 | mov [PointerToPicture],ebx |
265 | mov [PointerToPicture],ebx |
229 | mov [PointerToCopyPicture],ecx |
266 | mov [PointerToCopyPicture],ecx |
230 | mov [PointerToCopyPicture2],eax |
267 | mov [PointerToCopyPicture2],eax |
231 | 268 | ||
232 | call MovePictureToWorkScreen |
269 | call MovePictureToWorkScreen |
233 | jmp end_menu |
270 | jmp end_menu |
234 | ;--------------------------------------------------------------------- |
271 | ;--------------------------------------------------------------------- |
235 | no_undo: |
272 | no_undo: |
236 | ; <<< Redo >>> |
273 | ; <<< Redo >>> |
237 | cmp [number_menu],2 |
274 | cmp [number_menu],2 |
238 | jne no_redo |
275 | jne no_redo |
239 | 276 | ||
240 | cmp [number_undo],0 |
277 | cmp [number_undo],0 |
241 | je end_menu |
278 | je end_menu |
242 | 279 | ||
243 | ;rotate bufers +1 |
280 | ;rotate bufers +1 |
244 | dec [number_undo] |
281 | dec [number_undo] |
245 | mov eax,[PointerToPicture] |
282 | mov eax,[PointerToPicture] |
246 | mov ebx,[PointerToCopyPicture] |
283 | mov ebx,[PointerToCopyPicture] |
247 | mov ecx,[PointerToCopyPicture2] |
284 | mov ecx,[PointerToCopyPicture2] |
248 | mov [PointerToPicture],ecx |
285 | mov [PointerToPicture],ecx |
249 | mov [PointerToCopyPicture],eax |
286 | mov [PointerToCopyPicture],eax |
250 | mov [PointerToCopyPicture2],ebx |
287 | mov [PointerToCopyPicture2],ebx |
251 | 288 | ||
252 | call MovePictureToWorkScreen |
289 | call MovePictureToWorkScreen |
253 | jmp end_menu |
290 | jmp end_menu |
254 | ;--------------------------------------------------------------------- |
291 | ;--------------------------------------------------------------------- |
255 | no_redo: |
292 | no_redo: |
256 | ; <<< Copy >>> |
293 | ; <<< Copy >>> |
257 | cmp [number_menu],3 |
294 | cmp [number_menu],3 |
258 | jne no_copy |
295 | jne no_copy |
259 | 296 | ||
260 | mov eax,[crossing_old_x] |
297 | mov eax,[crossing_old_x] |
261 | mov ebx,[crossing_old_y] |
298 | mov ebx,[crossing_old_y] |
262 | 299 | ||
263 | cmp eax,[rectangular_shade_x] |
300 | cmp eax,[rectangular_shade_x] |
264 | jl no_remove_x_copy |
301 | jl no_remove_x_copy |
265 | 302 | ||
266 | mov ecx,[rectangular_shade_x] |
303 | mov ecx,[rectangular_shade_x] |
267 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
304 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
268 | mov [rectangular_shade_x],eax |
305 | mov [rectangular_shade_x],eax |
269 | 306 | ||
270 | no_remove_x_copy: |
307 | no_remove_x_copy: |
271 | cmp ebx,[rectangular_shade_y] |
308 | cmp ebx,[rectangular_shade_y] |
272 | jl no_remove_y_copy |
309 | jl no_remove_y_copy |
273 | 310 | ||
274 | mov ecx,[rectangular_shade_y] |
311 | mov ecx,[rectangular_shade_y] |
275 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
312 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
276 | mov [rectangular_shade_y],ebx |
313 | mov [rectangular_shade_y],ebx |
277 | 314 | ||
278 | no_remove_y_copy: |
315 | no_remove_y_copy: |
279 | mov eax,[crossing_old_x] |
316 | mov eax,[crossing_old_x] |
280 | mov ebx,[crossing_old_y] |
317 | mov ebx,[crossing_old_y] |
281 | mov ecx,[rectangular_shade_x] |
318 | mov ecx,[rectangular_shade_x] |
282 | mov edx,[rectangular_shade_y] |
319 | mov edx,[rectangular_shade_y] |
283 | inc eax |
320 | inc eax |
284 | inc ebx |
321 | inc ebx |
285 | dec ecx |
322 | dec ecx |
286 | dec edx |
323 | dec edx |
287 | 324 | ||
288 | mov [x],eax |
325 | mov [x],eax |
289 | mov [y],ebx |
326 | mov [y],ebx |
290 | mov esi,eax |
327 | mov esi,eax |
291 | mov edi,ebx |
328 | mov edi,ebx |
292 | mov [Dx_],1 |
329 | mov [Dx_],1 |
293 | mov [Dy_],1 |
330 | mov [Dy_],1 |
294 | 331 | ||
295 | sub ecx,eax |
332 | sub ecx,eax |
296 | jnz no_signum_fill_r_x_copy |
333 | jnz no_signum_fill_r_x_copy |
297 | 334 | ||
298 | mov [Dx_],-1 |
335 | mov [Dx_],-1 |
299 | 336 | ||
300 | no_signum_fill_r_x_copy: |
337 | no_signum_fill_r_x_copy: |
301 | sub edx,ebx |
338 | sub edx,ebx |
302 | jnz no_signum_fill_r_y_copy |
339 | jnz no_signum_fill_r_y_copy |
303 | 340 | ||
304 | mov [Dy_],-1 |
341 | mov [Dy_],-1 |
305 | 342 | ||
306 | no_signum_fill_r_y_copy: |
343 | no_signum_fill_r_y_copy: |
307 | mov ebx,[rectangular_shade_y] |
344 | mov ebx,[rectangular_shade_y] |
308 | sub ebx,edi |
345 | sub ebx,edi |
309 | 346 | ||
310 | mov edx,[PointerToEditBufer] |
347 | mov edx,[PointerToEditBufer] |
311 | mov eax,[rectangular_shade_x] |
348 | mov eax,[rectangular_shade_x] |
312 | sub eax,[crossing_old_x] |
349 | sub eax,[crossing_old_x] |
313 | mov [edx],eax ;image.w |
350 | mov [edx],eax ;image.w |
314 | mov eax,[rectangular_shade_y] |
351 | mov eax,[rectangular_shade_y] |
315 | sub eax,[crossing_old_y] |
352 | sub eax,[crossing_old_y] |
316 | mov [edx+4],eax ;image.h |
353 | mov [edx+4],eax ;image.h |
317 | mov dword[edx+8],24 ;bit in pixel |
354 | mov dword[edx+8],24 ;bit in pixel |
318 | add edx,12 ;copy image parametrs |
355 | add edx,12 ;copy image parametrs |
319 | mov [y],edi |
356 | mov [y],edi |
320 | 357 | ||
321 | loop_fill_rectangle_y_copy: |
358 | loop_fill_rectangle_y_copy: |
322 | mov [x],esi |
359 | mov [x],esi |
323 | 360 | ||
324 | loop_fill_rectangle_x_copy: |
361 | loop_fill_rectangle_x_copy: |
325 | push esi edi |
362 | push esi edi |
326 | mov eax,[PointerToPicture] |
363 | mov eax,[PointerToPicture] |
327 | mov ebx,[Picture_SizeX] |
364 | mov ebx,[Picture_SizeX] |
328 | mov esi,[x] |
365 | mov esi,[x] |
329 | mov edi,[y] |
366 | mov edi,[y] |
330 | call GetColorOfPixel |
367 | call GetColorOfPixel |
331 | mov [edx],ax |
368 | mov [edx],ax |
332 | shr eax,16 |
369 | shr eax,16 |
333 | mov [edx+2],al |
370 | mov [edx+2],al |
334 | pop edi esi |
371 | pop edi esi |
335 | 372 | ||
336 | add edx,3 |
373 | add edx,3 |
337 | mov eax,[x] |
374 | mov eax,[x] |
338 | add eax,[Dx_] |
375 | add eax,[Dx_] |
339 | mov [x],eax |
376 | mov [x],eax |
340 | 377 | ||
341 | cmp eax,[rectangular_shade_x] |
378 | cmp eax,[rectangular_shade_x] |
342 | jl loop_fill_rectangle_x_copy |
379 | jl loop_fill_rectangle_x_copy |
343 | 380 | ||
344 | mov eax,[y] |
381 | mov eax,[y] |
345 | add eax,[Dy_] |
382 | add eax,[Dy_] |
346 | mov [y],eax |
383 | mov [y],eax |
347 | 384 | ||
348 | cmp eax,[rectangular_shade_y] |
385 | cmp eax,[rectangular_shade_y] |
349 | jl loop_fill_rectangle_y_copy |
386 | jl loop_fill_rectangle_y_copy |
350 | 387 | ||
351 | ;...todo use system buffer... |
388 | ;...todo use system buffer... |
352 | ;mcall SF_CLIPBOARD,SSF_WRITE_CB,,[PointerToEditBufer] |
389 | ;mcall SF_CLIPBOARD,SSF_WRITE_CB,,[PointerToEditBufer] |
353 | 390 | ||
354 | call MovePictureToWorkScreen |
391 | call MovePictureToWorkScreen |
355 | mov [DrawSprite_flag],1 |
392 | mov [DrawSprite_flag],1 |
356 | jmp end_menu |
393 | jmp end_menu |
357 | ;--------------------------------------------------------------------- |
394 | ;--------------------------------------------------------------------- |
358 | no_copy: |
395 | no_copy: |
359 | ; <<< Paste >>> |
396 | ; <<< Paste >>> |
360 | cmp [number_menu],4 |
397 | cmp [number_menu],4 |
361 | jne no_paste |
398 | jne no_paste |
362 | 399 | ||
363 | mov eax,[crossing_old_x] |
400 | mov eax,[crossing_old_x] |
364 | mov ebx,[crossing_old_y] |
401 | mov ebx,[crossing_old_y] |
365 | 402 | ||
366 | cmp eax,[rectangular_shade_x] |
403 | cmp eax,[rectangular_shade_x] |
367 | jl no_remove_x_paste |
404 | jl no_remove_x_paste |
368 | 405 | ||
369 | mov ecx,[rectangular_shade_x] |
406 | mov ecx,[rectangular_shade_x] |
370 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
407 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
371 | mov [rectangular_shade_x],eax |
408 | mov [rectangular_shade_x],eax |
372 | 409 | ||
373 | no_remove_x_paste: |
410 | no_remove_x_paste: |
374 | cmp ebx,[rectangular_shade_y] |
411 | cmp ebx,[rectangular_shade_y] |
375 | jl no_remove_y_paste |
412 | jl no_remove_y_paste |
376 | 413 | ||
377 | mov ecx,[rectangular_shade_y] |
414 | mov ecx,[rectangular_shade_y] |
378 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
415 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
379 | mov [rectangular_shade_y],ebx |
416 | mov [rectangular_shade_y],ebx |
380 | 417 | ||
381 | no_remove_y_paste: |
418 | no_remove_y_paste: |
382 | mov eax,[crossing_old_x] |
419 | mov eax,[crossing_old_x] |
383 | mov ebx,[crossing_old_y] |
420 | mov ebx,[crossing_old_y] |
384 | mov ecx,[rectangular_shade_x] |
421 | mov ecx,[rectangular_shade_x] |
385 | mov edx,[rectangular_shade_y] |
422 | mov edx,[rectangular_shade_y] |
386 | inc eax |
423 | inc eax |
387 | inc ebx |
424 | inc ebx |
388 | dec ecx |
425 | dec ecx |
389 | dec edx |
426 | dec edx |
390 | 427 | ||
391 | mov [x],eax |
428 | mov [x],eax |
392 | mov [y],ebx |
429 | mov [y],ebx |
393 | mov esi,eax |
430 | mov esi,eax |
394 | mov edi,ebx |
431 | mov edi,ebx |
395 | mov [Dx_],1 |
432 | mov [Dx_],1 |
396 | mov [Dy_],1 |
433 | mov [Dy_],1 |
397 | 434 | ||
398 | sub ecx,eax |
435 | sub ecx,eax |
399 | jnz no_signum_fill_r_x_paste |
436 | jnz no_signum_fill_r_x_paste |
400 | 437 | ||
401 | mov [Dx_],-1 |
438 | mov [Dx_],-1 |
402 | 439 | ||
403 | no_signum_fill_r_x_paste: |
440 | no_signum_fill_r_x_paste: |
404 | sub edx,ebx |
441 | sub edx,ebx |
405 | jnz no_signum_fill_r_y_paste |
442 | jnz no_signum_fill_r_y_paste |
406 | 443 | ||
407 | mov [Dy_],-1 |
444 | mov [Dy_],-1 |
408 | 445 | ||
409 | no_signum_fill_r_y_paste: |
446 | no_signum_fill_r_y_paste: |
410 | mov edx,[PointerToEditBufer] |
447 | mov edx,[PointerToEditBufer] |
411 | cmp dword[edx+8],24 |
448 | cmp dword[edx+8],24 |
412 | jne end_menu |
449 | jne end_menu |
413 | mov eax,[edx] |
450 | mov eax,[edx] |
414 | add eax,[crossing_old_x] |
451 | add eax,[crossing_old_x] |
415 | mov [paste_img_w],eax |
452 | mov [paste_img_w],eax |
416 | mov eax,[edx+4] |
453 | mov eax,[edx+4] |
417 | add eax,[crossing_old_y] |
454 | add eax,[crossing_old_y] |
418 | mov [paste_img_h],eax |
455 | mov [paste_img_h],eax |
419 | add edx,12 ;copy image parametrs |
456 | add edx,12 ;copy image parametrs |
420 | mov [y],edi |
457 | mov [y],edi |
421 | 458 | ||
422 | loop_fill_rectangle_y_paste: |
459 | loop_fill_rectangle_y_paste: |
423 | mov [x],esi |
460 | mov [x],esi |
424 | 461 | ||
425 | loop_fill_rectangle_x_paste: |
462 | loop_fill_rectangle_x_paste: |
426 | push esi edi |
463 | push esi edi |
427 | mov ecx,[edx] |
464 | mov ecx,[edx] |
428 | and ecx,0xffffff ;color |
465 | and ecx,0xffffff ;color |
429 | mov eax,[PointerToPicture] |
466 | mov eax,[PointerToPicture] |
430 | mov ebx,[Picture_SizeX] |
467 | mov ebx,[Picture_SizeX] |
431 | mov esi,[x] |
468 | mov esi,[x] |
432 | mov edi,[y] |
469 | mov edi,[y] |
433 | call PutPixel |
470 | call PutPixel |
434 | pop edi esi |
471 | pop edi esi |
435 | 472 | ||
436 | add edx,3 |
473 | add edx,3 |
437 | 474 | ||
438 | mov eax,[x] |
475 | mov eax,[x] |
439 | add eax,[Dx_] |
476 | add eax,[Dx_] |
440 | cmp eax,[paste_img_w] |
477 | cmp eax,[paste_img_w] |
441 | je no_paste_data_x |
478 | je no_paste_data_x |
442 | mov [x],eax |
479 | mov [x],eax |
443 | cmp eax,[rectangular_shade_x] |
480 | cmp eax,[rectangular_shade_x] |
444 | jl loop_fill_rectangle_x_paste |
481 | jl loop_fill_rectangle_x_paste |
445 | no_paste_data_x: |
482 | no_paste_data_x: |
446 | 483 | ||
447 | mov eax,[y] |
484 | mov eax,[y] |
448 | add eax,[Dy_] |
485 | add eax,[Dy_] |
449 | cmp eax,[paste_img_h] |
486 | cmp eax,[paste_img_h] |
450 | je no_paste_data_y |
487 | je no_paste_data_y |
451 | mov [y],eax |
488 | mov [y],eax |
452 | cmp eax,[rectangular_shade_y] |
489 | cmp eax,[rectangular_shade_y] |
453 | jl loop_fill_rectangle_y_paste |
490 | jl loop_fill_rectangle_y_paste |
454 | no_paste_data_y: |
491 | no_paste_data_y: |
455 | 492 | ||
456 | call MovePictureToWorkScreen |
493 | call MovePictureToWorkScreen |
457 | mov [Paste_flag],1 |
494 | mov [Paste_flag],1 |
458 | jmp end_menu |
495 | jmp end_menu |
459 | ;--------------------------------------------------------------------- |
496 | ;--------------------------------------------------------------------- |
460 | no_paste: |
497 | no_paste: |
461 | ; <<< Cut >>> |
498 | ; <<< Cut >>> |
462 | cmp [number_menu],5 |
499 | cmp [number_menu],5 |
463 | jne no_cut |
500 | jne no_cut |
464 | 501 | ||
465 | mov eax,[crossing_old_x] |
502 | mov eax,[crossing_old_x] |
466 | mov ebx,[crossing_old_y] |
503 | mov ebx,[crossing_old_y] |
467 | 504 | ||
468 | cmp eax,[rectangular_shade_x] |
505 | cmp eax,[rectangular_shade_x] |
469 | jl no_remove_x_cut |
506 | jl no_remove_x_cut |
470 | 507 | ||
471 | mov ecx,[rectangular_shade_x] |
508 | mov ecx,[rectangular_shade_x] |
472 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
509 | mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x |
473 | mov [rectangular_shade_x],eax |
510 | mov [rectangular_shade_x],eax |
474 | 511 | ||
475 | no_remove_x_cut: |
512 | no_remove_x_cut: |
476 | cmp ebx,[rectangular_shade_y] |
513 | cmp ebx,[rectangular_shade_y] |
477 | jl no_remove_y_cut |
514 | jl no_remove_y_cut |
478 | 515 | ||
479 | mov ecx,[rectangular_shade_y] |
516 | mov ecx,[rectangular_shade_y] |
480 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
517 | mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y |
481 | mov [rectangular_shade_y],ebx |
518 | mov [rectangular_shade_y],ebx |
482 | 519 | ||
483 | no_remove_y_cut: |
520 | no_remove_y_cut: |
484 | mov eax,[crossing_old_x] |
521 | mov eax,[crossing_old_x] |
485 | mov ebx,[crossing_old_y] |
522 | mov ebx,[crossing_old_y] |
486 | mov ecx,[rectangular_shade_x] |
523 | mov ecx,[rectangular_shade_x] |
487 | mov edx,[rectangular_shade_y] |
524 | mov edx,[rectangular_shade_y] |
488 | inc eax |
525 | inc eax |
489 | inc ebx |
526 | inc ebx |
490 | dec ecx |
527 | dec ecx |
491 | dec edx |
528 | dec edx |
492 | 529 | ||
493 | mov [x],eax |
530 | mov [x],eax |
494 | mov [y],ebx |
531 | mov [y],ebx |
495 | mov esi,eax |
532 | mov esi,eax |
496 | mov edi,ebx |
533 | mov edi,ebx |
497 | mov [Dx_],1 |
534 | mov [Dx_],1 |
498 | mov [Dy_],1 |
535 | mov [Dy_],1 |
499 | 536 | ||
500 | sub ecx,eax |
537 | sub ecx,eax |
501 | jnz no_signum_fill_r_x |
538 | jnz no_signum_fill_r_x |
502 | 539 | ||
503 | mov [Dx_],-1 |
540 | mov [Dx_],-1 |
504 | 541 | ||
505 | no_signum_fill_r_x: |
542 | no_signum_fill_r_x: |
506 | sub edx,ebx |
543 | sub edx,ebx |
507 | jnz no_signum_fill_r_y |
544 | jnz no_signum_fill_r_y |
508 | 545 | ||
509 | mov [Dy_],-1 |
546 | mov [Dy_],-1 |
510 | 547 | ||
511 | no_signum_fill_r_y: |
548 | no_signum_fill_r_y: |
512 | mov [y],edi |
549 | mov [y],edi |
513 | 550 | ||
514 | loop_fill_rectangle_y: |
551 | loop_fill_rectangle_y: |
515 | mov [x],esi |
552 | mov [x],esi |
516 | 553 | ||
517 | loop_fill_rectangle_x: |
554 | loop_fill_rectangle_x: |
518 | push esi edi |
555 | push esi edi |
519 | mov eax,[PointerToPicture] |
556 | mov eax,[PointerToPicture] |
520 | mov ebx,[Picture_SizeX] |
557 | mov ebx,[Picture_SizeX] |
521 | mov ecx,dword 0xffffff |
558 | mov ecx,dword 0xffffff |
522 | mov esi,[x] |
559 | mov esi,[x] |
523 | mov edi,[y] |
560 | mov edi,[y] |
524 | call PutPixel |
561 | call PutPixel |
525 | pop edi esi |
562 | pop edi esi |
526 | 563 | ||
527 | mov eax,[x] |
564 | mov eax,[x] |
528 | add eax,[Dx_] |
565 | add eax,[Dx_] |
529 | mov [x],eax |
566 | mov [x],eax |
530 | 567 | ||
531 | cmp eax,[rectangular_shade_x] |
568 | cmp eax,[rectangular_shade_x] |
532 | jl loop_fill_rectangle_x |
569 | jl loop_fill_rectangle_x |
533 | 570 | ||
534 | mov eax,[y] |
571 | mov eax,[y] |
535 | add eax,[Dy_] |
572 | add eax,[Dy_] |
536 | mov [y],eax |
573 | mov [y],eax |
537 | 574 | ||
538 | cmp eax,[rectangular_shade_y] |
575 | cmp eax,[rectangular_shade_y] |
539 | jl loop_fill_rectangle_y |
576 | jl loop_fill_rectangle_y |
540 | 577 | ||
541 | call MovePictureToWorkScreen |
578 | call MovePictureToWorkScreen |
542 | jmp end_menu |
579 | jmp end_menu |
543 | ;--------------------------------------------------------------------- |
580 | ;--------------------------------------------------------------------- |
544 | no_cut: |
581 | no_cut: |
545 | ; <<< Cleare all >>> |
582 | ; <<< Cleare all >>> |
546 | cmp [number_menu],6 |
583 | cmp [number_menu],6 |
547 | jne no_cleare_all |
584 | jne no_cleare_all |
548 | 585 | ||
549 | call cleare_work_arrea |
586 | call cleare_work_arrea |
550 | call MovePictureToWorkScreen |
587 | call MovePictureToWorkScreen |
551 | jmp end_menu |
588 | jmp end_menu |
552 | ;--------------------------------------------------------------------- |
589 | ;--------------------------------------------------------------------- |
553 | no_cleare_all: |
590 | no_cleare_all: |
554 | ; <<< To allocate all >>> |
591 | ; <<< To allocate all >>> |
555 | cmp [number_menu],7 |
592 | cmp [number_menu],7 |
556 | jne end_menu |
593 | jne end_menu |
557 | 594 | ||
558 | mov [crossing_old_x],0 |
595 | mov [crossing_old_x],0 |
559 | mov [crossing_old_y],0 |
596 | mov [crossing_old_y],0 |
560 | mov eax,[Picture_SizeX] |
597 | mov eax,[Picture_SizeX] |
561 | mov ebx,[Picture_SizeY] |
598 | mov ebx,[Picture_SizeY] |
562 | dec eax |
599 | dec eax |
563 | dec ebx |
600 | dec ebx |
564 | mov [rectangular_shade_x],eax |
601 | mov [rectangular_shade_x],eax |
565 | mov [rectangular_shade_y],ebx |
602 | mov [rectangular_shade_y],ebx |
566 | mov [Current_instrument],30 |
603 | mov [Current_instrument],30 |
567 | mov [crossing],2 |
604 | mov [crossing],2 |
568 | ;call MovePictureToWorkScreen |
605 | ;call MovePictureToWorkScreen |
569 | jmp end_menu |
606 | jmp end_menu |
570 | ;--------------------------------------------------------------------- |
607 | ;--------------------------------------------------------------------- |
571 | no_edit: |
608 | no_edit: |
572 | ;|||||||||||||||||||||||||INSTRUMENTS|||||||||||||||||||||| |
609 | ;|||||||||||||||||||||||||INSTRUMENTS|||||||||||||||||||||| |
573 | cmp [number_panel],5 |
610 | cmp [number_panel],5 |
574 | jne no_instruments |
611 | jne no_instruments |
575 | 612 | ||
576 | instrument_set 1,10 ; pensil |
613 | instrument_set 1,10 ; pensil |
577 | instrument_set 2,11 ; draw brush |
614 | instrument_set 2,11 ; draw brush |
578 | instrument_set 3,12 ; spray |
615 | instrument_set 3,12 ; spray |
579 | instrument_set 4,13 ; lastik |
616 | instrument_set 4,13 ; lastik |
580 | instrument_set 5,14 ; flood fill |
617 | instrument_set 5,14 ; flood fill |
581 | instrument_set 6,15 ; pipetka |
618 | instrument_set 6,15 ; pipetka |
582 | instrument_set 7,16 ; draw line |
619 | instrument_set 7,16 ; draw line |
583 | instrument_set 8,17 ; draw rectangle |
620 | instrument_set 8,17 ; draw rectangle |
584 | instrument_set 9,18 ; draw circle |
621 | instrument_set 9,18 ; draw circle |
585 | instrument_set 10,19 ; draw ellips |
622 | instrument_set 10,19 ; draw ellips |
586 | instrument_set 11,20 ; draw hard contour |
623 | instrument_set 11,20 ; draw hard contour |
587 | 624 | ||
588 | no_instruments: |
625 | no_instruments: |
589 | ;|||||||||||||||||||||||||FILTERS|||||||||||||||||||||||||| |
626 | ;|||||||||||||||||||||||||FILTERS|||||||||||||||||||||||||| |
590 | cmp [number_panel],4 |
627 | cmp [number_panel],4 |
591 | jne no_filters |
628 | jne no_filters |
592 | 629 | ||
593 | instrument_set 1,23 ; reflection from left to right |
630 | instrument_set 1,23 ; reflection from left to right |
594 | instrument_set 2,24 ; reflection from up to down |
631 | instrument_set 2,24 ; reflection from up to down |
595 | 632 | ||
596 | no_filters: |
633 | no_filters: |
597 | 634 | ||
598 | end_menu: |
635 | end_menu: |
599 | and [number_panel],0 |
636 | and [number_panel],0 |
600 | and [number_menu],0 |
637 | and [number_menu],0 |
601 | jmp still |
638 | jmp still |
602 | ;---------------------------------------------------------------------><><<>><><<>----->----->><><<>----->----->><><<>----->----->><><<>><><<>><><<>><><<>><><<>><><<>><><<>115,14>139,14>170,15>177,40>170,15>139,14>115,14>177,40>><><<> |
639 | ;---------------------------------------------------------------------><><<>><><<>----->----->><><<>----->----->><><<>----->----->><><<>><><<>><><<>><><<>><><<>><><<>><><<>115,14>139,14>170,15>177,40>170,15>139,14>115,14>177,40>><><<> |