Mercurial > repos > blastem
comparison io.c @ 1197:9bc78bd89567
Minor cleanup to handle_mouse_moved
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 24 Jan 2017 23:16:21 -0800 |
parents | 1ad0ec7e3939 |
children | a6ae693974e0 |
comparison
equal
deleted
inserted
replaced
1196:74e77aec9004 | 1197:9bc78bd89567 |
---|---|
474 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay) | 474 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay) |
475 { | 475 { |
476 if (mouse >= MAX_MICE || !mice[mouse].motion_port) { | 476 if (mouse >= MAX_MICE || !mice[mouse].motion_port) { |
477 return; | 477 return; |
478 } | 478 } |
479 //TODO: relative mode | |
480 switch(current_io->mouse_mode) | 479 switch(current_io->mouse_mode) |
481 { | 480 { |
482 case MOUSE_ABSOLUTE: { | 481 case MOUSE_ABSOLUTE: { |
483 float scale_x = 640.0 / ((float)render_width()); | 482 float scale_x = 640.0 / ((float)render_width()); |
484 float scale_y = 480.0 / ((float)render_height()); | 483 float scale_y = 480.0 / ((float)render_height()); |
495 case MOUSE_CAPTURE: { | 494 case MOUSE_CAPTURE: { |
496 if (current_io->mouse_captured) { | 495 if (current_io->mouse_captured) { |
497 mice[mouse].motion_port->device.mouse.cur_x += deltax; | 496 mice[mouse].motion_port->device.mouse.cur_x += deltax; |
498 mice[mouse].motion_port->device.mouse.cur_y += deltay; | 497 mice[mouse].motion_port->device.mouse.cur_y += deltay; |
499 } | 498 } |
499 break; | |
500 } | 500 } |
501 } | 501 } |
502 } | 502 } |
503 | 503 |
504 int parse_binding_target(char * target, tern_node * padbuttons, tern_node *mousebuttons, int * ui_out, int * padnum_out, int * padbutton_out) | 504 int parse_binding_target(char * target, tern_node * padbuttons, tern_node *mousebuttons, int * ui_out, int * padnum_out, int * padbutton_out) |