diff --git a/apps/demos/scenery/scenes/ingame.c b/apps/demos/scenery/scenes/ingame.c index a8aa065..d56760d 100644 --- a/apps/demos/scenery/scenes/ingame.c +++ b/apps/demos/scenery/scenes/ingame.c @@ -175,7 +175,7 @@ static uint32_t adler32(const void *buf, size_t buflength) { static void draw_terrain(SceneIngame *scn) { /* used to cull invisible tiles over field of view (to horizon) */ Vec2 const d = vec2_norm((Vec2){ .x = scn->looking_direction.x, .y = scn->looking_direction.z }); - float const c = cosf((float)M_PI_2 * 0.8f); + float const c = cosf((float)M_PI_2 * 0.8f * 0.8f); /* draw terrain in circle */ int32_t const rsi = (int32_t)TERRAIN_RADIUS * (int32_t)TERRAIN_RADIUS; @@ -197,7 +197,7 @@ static void draw_terrain(SceneIngame *scn) { float d2 = heightmap[lx + 1][ly - 1]; float d3 = heightmap[lx][ly - 1]; - draw_quad("/assets/grass.png", + draw_quad("/assets/grass2.png", (Vec3){ (float)x, d0, (float)y }, (Vec3){ (float)x + 1, d1, (float)y }, (Vec3){ (float)x + 1, d2, (float)y - 1 }, @@ -207,7 +207,7 @@ static void draw_terrain(SceneIngame *scn) { if (((float)(adler32(&((Vec2){x, y}), sizeof (Vec2)) % 100) / 100) <= TREE_DENSITY) draw_billboard("/assets/trreez.png", - (Vec3){ (float)x, d0 + 2.f, (float)y }, + (Vec3){ (float)x, d0 + 1.95f, (float)y }, (Vec2){2.f, 2.f}, (Rect){0}, (Color){255, 255, 255, 255}, true); @@ -224,11 +224,15 @@ static void draw_terrain(SceneIngame *scn) { float x = (float)(floorf(scn->pos.x - HALF_TERRAIN_DISTANCE + (float)lx)); float y = (float)(floorf(scn->pos.z - HALF_TERRAIN_DISTANCE + (float)ly)); - float d0 = heightmap[lx][ly]; + float d = heightmap[lx][ly]; - draw_billboard("/assets/grasses/10.png", - (Vec3){ (float)x, d0 + 0.15f, (float)y }, - (Vec2){0.3f, 0.3f}, + draw_billboard("/assets/grasses/25.png", + (Vec3){ + (float)x + (float)((adler32(&((Vec2){x, y}), sizeof (Vec2))) % 32) / 64.0f, + d + 0.2f, + (float)y + (float)((adler32(&((Vec2){y, x}), sizeof (Vec2))) % 32) / 64.0f + }, + (Vec2){0.4f, 0.4f}, (Rect){0}, (Color){255, 255, 255, 255}, true); } @@ -298,7 +302,7 @@ Scene *ingame_scene(State *state) { new_scene->mouse_captured = true; - m_audio(m_set(path, "music/mod65.xm"), + m_audio(m_set(path, "music/woah.ogg"), m_opt(channel, "soundtrack"), m_opt(repeat, true)); diff --git a/data/assets/grass2.png b/data/assets/grass2.png new file mode 100644 index 0000000..edae6aa --- /dev/null +++ b/data/assets/grass2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23a52c723b764e6476fcb606f3f14064a905c5824a8933341c0e99032b7db64a +size 42084 diff --git a/data/assets/grasses/25.png b/data/assets/grasses/25.png new file mode 100644 index 0000000..9834ac3 --- /dev/null +++ b/data/assets/grasses/25.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24479b7141a79050888a361925d2a7f11d0b6811d678dfa1334cfcc2f8a18aa2 +size 13732 diff --git a/data/music/woah.ogg b/data/music/woah.ogg new file mode 100644 index 0000000..7a92dcf --- /dev/null +++ b/data/music/woah.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c89ba101cdfcd10744448b1c214145d036d840dcec09d245a225f441ee2b0de7 +size 2993405