jancity/src/terrain/src/update.c

21 lines
438 B
C

#include <terrain.h>
void terrain_update(struct terrain_map *const map)
{
if (map->last_w != screen_w)
{
const int extra = !!(screen_w % TERRAIN_SZ);
map->nx = screen_w / TERRAIN_SZ + extra;
map->last_w = screen_w;
}
if (map->last_h != screen_h)
{
const int extra = !!(screen_h % TERRAIN_SZ);
map->ny = screen_h / TERRAIN_SZ + extra;
map->last_h = screen_h;
}
}