Project

General

Profile

Revision 335

more docs

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 = max16(0, mouse_x + p->delta_x);
301
    mouse_x = min16(mouse_x, (int16_t)graph_get_XRes() - 1);
300
    mouse_x = max_16(0, mouse_x + p->delta_x);
301
    mouse_x = min_16(mouse_x, (int16_t)graph_get_XRes() - 1);
302 302

  
303
    mouse_y = max16(0, mouse_y - p->delta_y);
304
    mouse_y = min16(mouse_y, (int16_t)graph_get_YRes() - 1);
303
    mouse_y = max_16(0, mouse_y - p->delta_y);
304
    mouse_y = min_16(mouse_y, (int16_t)graph_get_YRes() - 1);
305 305

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

Also available in: Unified diff