a-game

2D platformer written from scratch.
Log | Files | Refs | README | LICENSE

commit ef1685de9fa7f96b31a142a9e6b5702b3e80c33f
parent 04f66552f3f8729dca24fc5ca8cf1ec8f4552033
Author: Amin Mesbah <dev@aminmesbah.com>
Date:   Fri,  5 Jul 2019 19:46:27 -0700

Use eigengrau for the background color

Diffstat:
Msrc/am_math.h | 10++++++++++
Msrc/game.c | 4+++-
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/am_math.h b/src/am_math.h @@ -270,6 +270,16 @@ internal inline v3 math_v3_s(v3 vec1, v3 vec2) return math_v3_a(vec1, math_v3_negate(vec2)); } +internal inline v3 math_v3_from_rgb(i32 rgb) +{ + v3 result = { + .x = ((rgb >> 16) & 0xFF) / 255.0f, + .y = ((rgb >> 8) & 0xFF) / 255.0f, + .z = ((rgb >> 0) & 0xFF) / 255.0f, + }; + return result; +} + internal inline bool math_v4v4_eq(v4 vec1, v4 vec2) { for (u8 i = 0; i < 4; ++i) diff --git a/src/game.c b/src/game.c @@ -597,7 +597,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga } else { - color = (v3) {0.3f, 0.3f, 0.3f}; + color = (math_v3_from_rgb(0x16161D)); } renderer_job_enqueue( @@ -613,6 +613,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga } } +#if 0 // texture test { m4 model = math_m4_init_id(); @@ -634,6 +635,7 @@ void game_update_and_render(struct GameMemory *game_memory, struct GameInput *ga .layer = RENDER_LAYER_DEBUG, }); } +#endif renderer_jobs_sort(&game_state->renderer, &game_state->world_allocator); renderer_jobs_draw(&game_state->renderer);