~ruther/CTU-FEE-B0B35APO-Semestral-project

ref: 5644b289fe6fb9561ede6b58e64ac25d6c2f0553 CTU-FEE-B0B35APO-Semestral-project/image-viewer/src/direction.c -rw-r--r-- 310 bytes
5644b289 — František Boháček feat: add option to run on x86 computer with sdl 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "direction.h"

void direction_move_xy(direction_t direction, uint16_t *x, uint16_t *y, int16_t amount) {
  switch (direction) {
  case LEFT:
    *x -= amount;
    break;
  case RIGHT:
    *x += amount;
    break;
  case UP:
    *y -= amount;
    break;
  case DOWN:
    *y += amount;
    break;
  }
}