Project

General

Profile

Revision 323

more stuff

View differences:

proj_func.c
297 297
static int16_t mouse_x = 0, mouse_y = 0;
298 298

  
299 299
void (update_mouse)(struct packet *p) {
300
    mouse_x = max(0, mouse_x + p->delta_x);
301
    mouse_x = min(mouse_x, graph_get_XRes() - 1);
300
    mouse_x = max16(0, mouse_x + p->delta_x);
301
    mouse_x = min16(mouse_x, graph_get_XRes() - 1);
302 302

  
303
    mouse_y = max(0, mouse_y - p->delta_y);
304
    mouse_y = min(mouse_y, graph_get_YRes() - 1);
303
    mouse_y = max16(0, mouse_y - p->delta_y);
304
    mouse_y = min16(mouse_y, graph_get_YRes() - 1);
305 305

  
306 306
    key_presses.lb_pressed = p->lb;
307 307
}

Also available in: Unified diff