Rev 6354 | Rev 6357 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6354 | IgorA | 1 | macro square_width_put |
2 | { |
||
3 | local .no_put_to_screen |
||
4 | local .next_color_put |
||
5 | local .vertical_width_put |
||
6 | local .horizontal_width_put |
||
7 | |||
8 | mov ebx,[ReserveArray] |
||
9 | mov eax,[ebx] |
||
10 | test eax,eax |
||
11 | jz .no_put_to_screen |
||
12 | mov ecx,[ebx] |
||
13 | add ebx,4 |
||
14 | xor ebp,ebp |
||
15 | |||
16 | .next_color_put: |
||
17 | ;put saved pixels in ReserveArray |
||
18 | push ecx |
||
19 | mov [counter2],5 |
||
20 | mov edi,[ebx] |
||
21 | push edi |
||
22 | .vertical_width_put: |
||
23 | mov [counter],5 |
||
24 | |||
25 | .horizontal_width_put: |
||
26 | mov edx,[ebx+4807*4+ebp] |
||
27 | ;and edx,0xffffff |
||
28 | mov [edi],dx |
||
29 | shr edx,16 |
||
30 | mov [edi+2],dl |
||
31 | |||
32 | add edi,3 |
||
33 | add ebp,4 |
||
34 | dec [counter] |
||
35 | jnz .horizontal_width_put |
||
36 | |||
37 | mov ecx,[Picture_SizeX] |
||
38 | sub ecx,5 |
||
39 | lea ecx,[ecx+ecx*2] |
||
40 | add edi,ecx |
||
41 | dec [counter2] |
||
42 | jnz .vertical_width_put |
||
43 | pop edi |
||
44 | pop ecx |
||
45 | |||
46 | add ebx,4 |
||
47 | dec ecx |
||
48 | jnz .next_color_put |
||
49 | |||
50 | .no_put_to_screen: |
||
51 | } |
||
52 | |||
53 | macro square_width_save |
||
54 | { |
||
55 | local .next_color_save |
||
56 | local .vertical_width_save |
||
57 | local .horizontal_width_save |
||
58 | mov ebx,[ReserveArray] |
||
59 | mov [ebx],eax |
||
60 | mov ecx,eax |
||
61 | add ebx,4 |
||
62 | xor ebp,ebp |
||
63 | |||
64 | .next_color_save: |
||
65 | ;save color of pixel in ReserveArray |
||
66 | push ecx |
||
67 | mov [counter2],5 |
||
68 | mov edi,[ebx] |
||
69 | .vertical_width_save: |
||
70 | mov [counter],5 |
||
71 | |||
72 | .horizontal_width_save: |
||
73 | mov eax,edi |
||
74 | mov edx,[eax] |
||
75 | ;and edx,0xffffff |
||
76 | mov [ebx+4807*4+ebp],dx |
||
77 | shr edx,16 |
||
78 | mov [ebx+4807*4+2+ebp],dl |
||
79 | |||
80 | add edi,3 |
||
81 | add ebp,4 |
||
82 | dec [counter] |
||
83 | jnz .horizontal_width_save |
||
84 | |||
85 | mov ecx,[Picture_SizeX] |
||
86 | sub ecx,5 |
||
87 | lea ecx,[ecx+ecx*2] |
||
88 | add edi,ecx |
||
89 | dec [counter2] |
||
90 | jnz .vertical_width_save |
||
91 | pop ecx |
||
92 | |||
93 | add ebx,4 |
||
94 | dec ecx |
||
95 | jnz .next_color_save |
||
96 | } |
||
97 | |||
6355 | IgorA | 98 | macro draw_calc_pixels brush |
99 | { |
||
100 | local .next_pixel_put |
||
101 | local .vertical_width |
||
102 | local .horizontal_width |
||
103 | local .no_draw_pixel |
||
104 | |||
105 | mov ebx,[ReserveArray] |
||
106 | mov ecx,[ebx] |
||
107 | mov edx,[Color] |
||
108 | mov esi,[Color] |
||
109 | shr edx,16 |
||
110 | add ebx,4 |
||
111 | mov edi,[line_width] |
||
112 | dec edi |
||
113 | imul edi,25 |
||
114 | add edi,brush |
||
115 | .next_pixel_put: |
||
116 | |||
117 | mov eax,[ebx] |
||
118 | push eax |
||
119 | push ecx |
||
120 | xor ebp,ebp |
||
121 | mov [counter2],5 |
||
122 | |||
123 | .vertical_width: |
||
124 | mov [counter],5 |
||
125 | |||
126 | .horizontal_width: |
||
127 | xor ecx,ecx |
||
128 | mov cl,byte[edi+ebp] |
||
129 | test cl,cl |
||
130 | jz .no_draw_pixel |
||
131 | mov [eax],si |
||
132 | mov [eax+2],dl |
||
133 | .no_draw_pixel: |
||
134 | add eax,3 |
||
135 | inc ebp |
||
136 | dec [counter] |
||
137 | jnz .horizontal_width |
||
138 | |||
139 | mov ecx,[Picture_SizeX] |
||
140 | sub ecx,5 |
||
141 | lea ecx,[ecx+ecx*2] |
||
142 | add eax,ecx |
||
143 | dec [counter2] |
||
144 | jnz .vertical_width |
||
145 | |||
146 | pop ecx |
||
147 | pop eax |
||
148 | add ebx,4 |
||
149 | dec ecx |
||
150 | jnz .next_pixel_put |
||
151 | } |
||
152 | |||
255 | heavyiron | 153 | ;----------------------------------------------------------- |
154 | ;-----instruments of panel(icon's instruments)-------------- |
||
155 | ;----------------------------------------------------------- |
||
156 | TakeButtonInstruments: |
||
157 | |||
158 | mov eax,[Current_instrument] |
||
159 | |||
160 | ;*************************brush 1*********************** |
||
161 | cmp eax,40 |
||
162 | jne no_brush1 |
||
163 | |||
164 | mov [Brush_SizeX],4 |
||
165 | mov [Brush_SizeY],4 |
||
166 | mov [Number_Brush],0 |
||
167 | mov ebx,[Last_instrument] |
||
168 | mov [Current_instrument],ebx |
||
169 | |||
170 | mov [line_width],1 |
||
171 | |||
172 | jmp still |
||
173 | no_brush1: |
||
174 | |||
175 | ;*************************brush 2*********************** |
||
176 | cmp eax,41 |
||
177 | jne no_brush2 |
||
178 | |||
179 | mov [Brush_SizeX],6 |
||
180 | mov [Brush_SizeY],4 |
||
181 | mov [Number_Brush],1 |
||
182 | mov ebx,[Last_instrument] |
||
183 | mov [Current_instrument],ebx |
||
184 | |||
185 | mov [line_width],2 |
||
186 | |||
187 | jmp still |
||
188 | no_brush2: |
||
189 | |||
190 | ;*************************brush 3*********************** |
||
191 | cmp eax,42 |
||
192 | jne no_brush3 |
||
193 | |||
194 | mov [Brush_SizeX],8 |
||
195 | mov [Brush_SizeY],7 |
||
196 | mov [Number_Brush],2 |
||
197 | mov ebx,[Last_instrument] |
||
198 | mov [Current_instrument],ebx |
||
199 | |||
200 | mov [line_width],3 |
||
201 | |||
202 | jmp still |
||
203 | no_brush3: |
||
204 | |||
6354 | IgorA | 205 | ;*************************brush 4*********************** |
255 | heavyiron | 206 | cmp eax,43 |
207 | jne no_brush4 |
||
208 | |||
209 | mov [Brush_SizeX],14 |
||
210 | mov [Brush_SizeY],14 |
||
211 | mov [Number_Brush],3 |
||
212 | mov ebx,[Last_instrument] |
||
213 | mov [Current_instrument],ebx |
||
214 | |||
215 | mov [line_width],4 |
||
216 | |||
217 | jmp still |
||
218 | no_brush4: |
||
219 | |||
6354 | IgorA | 220 | ;*************************brush 5*********************** |
255 | heavyiron | 221 | cmp eax,44 |
222 | jne no_brush5 |
||
223 | |||
224 | mov [Brush_SizeX],6 |
||
225 | mov [Brush_SizeY],6 |
||
226 | mov [Number_Brush],4 |
||
227 | mov ebx,[Last_instrument] |
||
228 | mov [Current_instrument],ebx |
||
229 | |||
230 | mov [line_width],5 |
||
231 | |||
232 | jmp still |
||
233 | no_brush5: |
||
234 | |||
235 | ;*************************pensil************************ |
||
236 | cmp eax,10 |
||
237 | jne no_pensil |
||
238 | |||
239 | mov al,[exit_from_work_arrea] |
||
240 | |||
241 | test al,al |
||
242 | jz no_exit_from_work_arrea |
||
243 | |||
244 | and [Activate_instrument],0 |
||
245 | and [exit_from_work_arrea],0 |
||
246 | |||
247 | no_exit_from_work_arrea: |
||
248 | |||
249 | mov al,[Activate_instrument] |
||
250 | |||
251 | test al,al |
||
252 | jnz no_activated_later |
||
253 | |||
254 | call GetScreenCordinats |
||
255 | mov eax,[ScreenX] |
||
256 | mov ebx,[ScreenY] |
||
257 | add eax,[PosX] |
||
258 | add ebx,[PosY] |
||
259 | mov [OldX],eax |
||
260 | mov [OldY],ebx |
||
261 | |||
262 | no_activated_later: |
||
263 | |||
6352 | IgorA | 264 | ; mov eax,[MaxWorkScreen_SizeX] ??? |
265 | ; mov ebx,[MaxWorkScreen_SizeY] ??? |
||
255 | heavyiron | 266 | |
267 | mov eax,[PointerToPicture] |
||
268 | mov ebx,[ReserveArray] |
||
269 | mov ecx,[Picture_SizeX] |
||
270 | mov edx,[OldX] |
||
271 | shl edx,16 |
||
272 | add edx,[OldY] |
||
273 | mov esi,[ScreenX] |
||
274 | mov edi,[ |