Mirai's Miscellaneous Misadventures

M37 / include / mimimi / ground.h

// copyright 2022 zamfofex
// license: AGPLv3 or later

#ifndef MIMIMI_GROUND_H
#define MIMIMI_GROUND_H

struct mimimi_ground
{
	int width, height;
	unsigned char *tiles;
};

static unsigned char mimimi_ground_tile(struct mimimi_ground *ground, int x, int y)
{
	if (x < 0) return 0;
	if (y < 0) return 0;
	if (x >= ground->width) return 0;
	if (y >= ground->height) return 0;
	return ground->tiles[x + y * ground->width];
}

#endif