Entropie git · main
Entropie festival game; first steps
C 88.5% Markdown 9.1% GLSL 2.3%git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gzentropie/src/world/meadow.h raw
#ifndef WORLD_MEADOW_H
#define WORLD_MEADOW_H
/*
* Grass blades on the meadow, near the eye.
*
* The ground is cut into squares; the squares around the camera get tufts of
* grass (built when first needed, dropped when far away). Each blade stands
* on the ground, sways a little and lies down where people walk (the wear
* map, see terrain.h). No grass on roads and buildings, little on the yard,
* the field and under the pines.
*/
#include "world/world.h"
#define MEADOW_CHUNK 16.0f
#define MEADOW_SIDE 22 /* squares per side: covers TERRAIN_SIZE */
typedef struct {
Mesh chunks[MEADOW_SIDE * MEADOW_SIDE];
bool built[MEADOW_SIDE * MEADOW_SIDE];
int mow_rev, mow_wait; /* the field's mowing last built in, frames since it changed */
} Meadow;
/* Draws the grass around eye, building squares that come into view. */
void Meadow_draw(Meadow *m, const World *world, Renderer *r, Vec3 eye);
void Meadow_destroy(Meadow *m);
#endif /* WORLD_MEADOW_H */