Mirai's Miscellaneous Misadventures

M53 / core / ground.c

1/* license: AGPLv3 or later */
2/* copyright 2024 zamfofex */
3
4#include "../mimimi.h"
5
6unsigned char mimimi_ground_tile(struct mimimi_ground *ground, int x,
7    int y)
8{
9    if (x < 0)
10        return 0;
11    if (y < 0)
12        return 0;
13    if (x >= ground->width)
14        return 0;
15    if (y >= ground->height)
16        return 0;
17    return ground->tiles[x + y * ground->width];
18}