diff --git a/src/game/presentation/states/state_ingame.c b/src/game/presentation/states/state_ingame.c index 5cf669b..d7a94b7 100644 --- a/src/game/presentation/states/state_ingame.c +++ b/src/game/presentation/states/state_ingame.c @@ -84,12 +84,15 @@ static void state_tick(Presentation_State *state) { ctx->simulation_accumulator -= sim_dt; } + // TODO: SS - I believe that this is where we should send game-messages to the clients and the host. + { // TEMP: SS if(IsKeyPressed(KEY_TAB)) { ctx->debug_draw_session_details = !ctx->debug_draw_session_details; } if(IsKeyPressed(KEY_ESCAPE)) { + // TODO: SS - Show pause-menu instead. presentation_state_machine_go_to(&presentation_state_main_menu); } } @@ -99,11 +102,32 @@ uint32_t floor_texture_variant(uint32_t x, uint32_t y, uint32_t seed, uint32_t n return (wang_hash(x * 73856093u ^ y * 19349663u ^ seed)) % num_variants; } -Color get_tint_for_player_id(uint16_t player_id) { +Color get_tint_for_player_id(uint16_t player_id) { // TODO: SS - Could get values from 'the active color-palette'. switch(player_id) { case 0: { return (Color) { 255, 135, 102, 255 }; } + case 1: { + return (Color) { 230, 204, 138, 255 }; + } + case 3: { + return (Color) { 240, 236, 226, 255 }; + } + case 4: { + return (Color) { 77, 106, 148, 255 }; + } + case 5: { + return (Color) { 36, 43, 74, 255 }; + } + case 6: { + return (Color) { 153, 92, 149, 255 }; + } + case 7: { + return (Color) { 245, 79, 79, 255 }; + } + case 8: { + return (Color) { 53, 121, 133, 255 }; + } default: { return (Color) { 82, 33, 110, 255 }; } diff --git a/src/game/presentation/states/state_main_menu.c b/src/game/presentation/states/state_main_menu.c index e033ff1..cace9ce 100644 --- a/src/game/presentation/states/state_main_menu.c +++ b/src/game/presentation/states/state_main_menu.c @@ -14,6 +14,8 @@ static void state_enter(Presentation_State *state) { (void)ctx; ctx->mode = Main_Menu_Mode_Home; + + SetExitKey(KEY_ESCAPE); } static void state_tick(Presentation_State *state) { @@ -163,6 +165,8 @@ static void state_render(Presentation_State *state) { static void state_exit(Presentation_State *state) { (void)state; printf("Exited main menu\n"); + + SetExitKey(KEY_NULL); } Presentation_State presentation_state_main_menu; diff --git a/src/game/session/networking.c b/src/game/session/networking.c index 94c94af..2bc79d2 100644 --- a/src/game/session/networking.c +++ b/src/game/session/networking.c @@ -97,7 +97,7 @@ static bool start_listening(Game_Networking *networking) { assert(networking != NULL); assert(networking->api != NULL); - int listener_id = mp_api_listen(networking->api, listen_callback, (void *)networking); // TODO: SS - Change context. + int listener_id = mp_api_listen(networking->api, listen_callback, (void *)networking); if(listener_id < 0) { return false; } @@ -222,7 +222,8 @@ bool networking_try_join(Game_Networking *networking, Game_Session *session, con // Or, should this client receive the current state of the session? if(received_json != NULL) { - // TODO: SS - Read this json because it might contain valuable information. + // TODO: SS - Read this json. It should contain valuable information about the session. + json_decref(received_json); }