Rev 8014 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8014 | Rev 8025 | ||
---|---|---|---|
Line 159... | Line 159... | ||
159 | 159 | ||
Line 160... | Line 160... | ||
160 | @@: |
160 | @@: |
161 | int 0x40 |
161 | int 0x40 |
Line 162... | Line 162... | ||
162 | 162 | ||
163 | cmp eax,1 ; redraw request ? |
163 | cmp eax,1 ; redraw event ? |
164 | je red |
164 | je red |
165 | cmp eax,2 ; key in buffer ? |
165 | cmp eax,2 ; key event ? |
166 | je key |
166 | je key |
167 | cmp eax,3 ; button in buffer ? |
167 | cmp eax,3 ; button event ? |
168 | je button |
168 | je button |
169 | cmp eax,6 |
169 | cmp eax,6 ; mouse event ? |
170 | jne @f |
170 | jne @f |
171 | cmp [edit_flag],1 |
171 | cmp [edit_flag],1 ; handle mouse only when edit is active |
- | 172 | jne @f |
|
- | 173 | ||
- | 174 | mov eax,37 |
|
- | 175 | mov ebx,7 ; get mouse scroll |
|
- | 176 | int 0x40 |
|
- | 177 | and eax, 0xFFFF ; check only vertial |
|
- | 178 | cmp eax, 65535 |
|
- | 179 | je button.zoom_in |
|
- | 180 | cmp eax, 1 |
|
- | 181 | je button.zoom_out |
|
172 | jne @f |
182 | |
173 | mov eax,37 |
183 | mov eax,37 |
174 | mov ebx,3 ;read mouse state |
184 | mov ebx,3 ;read mouse state |
175 | int 0x40 |
185 | int 0x40 |
176 | mov [mouse_state],eax |
186 | mov [mouse_state],eax |
Line 206... | Line 216... | ||
206 | 216 | ||
Line 207... | Line 217... | ||
207 | key: ; key |
217 | key: ; key |
208 | mov eax,2 ; just read it and ignore |
218 | mov eax,2 ; just read it and ignore |
209 | int 0x40 |
219 | int 0x40 |
- | 220 | ||
- | 221 | cmp ah, '+' |
|
- | 222 | je button.zoom_in |
|
- | 223 | cmp ah, '=' |
|
- | 224 | je button.zoom_in |
|
- | 225 | cmp ah, '-' |
|
- | 226 | je button.zoom_out |
|
- | 227 | cmp ah, 176 ;left |
|
- | 228 | je add_vec_buttons.x_minus |
|
- | 229 | cmp ah, 179 ;right |
|
- | 230 | je add_vec_buttons.x_plus |
|
- | 231 | cmp ah, 178 ;up |
|
- | 232 | je add_vec_buttons.y_minus |
|
- | 233 | cmp ah, 177 ;down |
|
- | 234 | je add_vec_buttons.y_plus |
|
- | 235 | ||
210 | jmp noclose |
236 | jmp noclose |
Line 211... | Line 237... | ||
211 | 237 | ||
212 | button: ; button |
238 | button: ; button |
213 | mov eax,17 ; get id |
239 | mov eax,17 ; get id |
Line 240... | Line 266... | ||
240 | .next_m6: |
266 | .next_m6: |
241 | ; ah = 5 -> scale- |
267 | ; ah = 5 -> scale- |
242 | cmp ah,5 |
268 | cmp ah,5 |
243 | jne @f |
269 | jne @f |
244 | mov dword[scale],0.7 |
270 | .zoom_out: |
- | 271 | mov dword[scale],0.7 |
|
245 | fninit |
272 | fninit |
246 | fld [rsscale] |
273 | fld [rsscale] |
247 | fmul [scale] |
274 | fmul [scale] |
248 | fstp [rsscale] |
275 | fstp [rsscale] |
249 | 276 | ||
Line 250... | Line 277... | ||
250 | @@: |
277 | @@: |
251 | cmp ah,6 ; ah = 6 -> scale+ |
278 | cmp ah,6 ; ah = 6 -> scale+ |
252 | jne @f |
279 | jne @f |
- | 280 | .zoom_in: |
|
253 | mov dword[scale],1.3 |
281 | mov dword[scale],1.3 |
254 | fninit |
282 | fninit |
255 | fld [rsscale] |
283 | fld [rsscale] |
256 | fmul [scale] |
284 | fmul [scale] |
257 | fstp [rsscale] |
285 | fstp [rsscale] |
Line 355... | Line 383... | ||
355 | cmp [move_flag],0 |
383 | cmp [move_flag],0 |
356 | jne @f |
384 | jne @f |
357 | ; cmp [move_flag],2 |
385 | ; cmp [move_flag],2 |
358 | ; je .set_light1 |
386 | ; je .set_light1 |
359 | sub [vect_y],10 |
387 | .y_minus: |
- | 388 | sub [vect_y],10 |
|
360 | jmp .next |
389 | jmp .next |
361 | @@: |
390 | @@: |
362 | cmp [move_flag],1 |
391 | cmp [move_flag],1 |
363 | jne @f |
392 | jne @f |
364 | sub [yobs],10 ; observator = camera position |
393 | sub [yobs],10 ; observator = camera position |
Line 394... | Line 423... | ||
394 | cmp ah,33 |
423 | cmp ah,33 |
395 | jne .next2 |
424 | jne .next2 |
396 | cmp [move_flag],0 |
425 | cmp [move_flag],0 |
397 | jne @f |
426 | jne @f |
398 | sub [vect_x],10 |
427 | .x_minus: |
- | 428 | sub [vect_x],10 |
|
399 | jmp .next2 |
429 | jmp .next2 |
400 | @@: |
430 | @@: |
401 | cmp [move_flag],1 |
431 | cmp [move_flag],1 |
402 | jne @f |
432 | jne @f |
403 | sub [xobs],10 ; observator = camera position |
433 | sub [xobs],10 ; observator = camera position |
Line 411... | Line 441... | ||
411 | cmp ah,32 |
441 | cmp ah,32 |
412 | jne .next3 |
442 | jne .next3 |
413 | cmp [move_flag],0 |
443 | cmp [move_flag],0 |
414 | jne @f |
444 | jne @f |
415 | add [vect_x],10 |
445 | .x_plus: |
- | 446 | add [vect_x],10 |
|
416 | jmp .next3 |
447 | jmp .next3 |
417 | @@: |
448 | @@: |
418 | cmp [move_flag],1 |
449 | cmp [move_flag],1 |
419 | jne @f |
450 | jne @f |
420 | add [xobs],10 ; observator = camera position |
451 | add [xobs],10 ; observator = camera position |
Line 439... | Line 470... | ||
439 | jne .next5 |
470 | jne .next5 |
440 | cmp [move_flag],0 |
471 | cmp [move_flag],0 |
441 | jne @f |
472 | jne @f |
442 | ; call add_vector |
473 | ; call add_vector |
443 | add [vect_y],10 |
474 | .y_plus: |
- | 475 | add [vect_y],10 |
|
444 | jmp .next5 |
476 | jmp .next5 |
445 | @@: |
477 | @@: |
446 | cmp [move_flag],1 |
478 | cmp [move_flag],1 |
447 | jne @f |
479 | jne @f |
448 | add [yobs],10 ; observator = camera position |
480 | add [yobs],10 ; observator = camera position |