Correst time string

This commit is contained in:
Miloslav Ciz 2025-04-29 19:42:01 +02:00
parent 5141a31770
commit d6f483038d

22
game.h
View file

@ -1178,23 +1178,21 @@ void LCR_gameEnd(void)
void LCR_gameTimeToStr(uint32_t timeMS, char *str) void LCR_gameTimeToStr(uint32_t timeMS, char *str)
{ {
str[9] = 0; str[9] = 0;
str[8] = '0' + timeMS % 10; // milliseconds
str[6] = '0' + timeMS % 10; // milliseconds
timeMS /= 10; timeMS /= 10;
str[7] = '0' + timeMS % 10; str[7] = '0' + timeMS % 10;
timeMS /= 10; timeMS /= 10;
str[8] = '0' + timeMS % 10; str[6] = '0' + timeMS % 10;
timeMS /= 10; timeMS /= 10;
str[3] = '0' + (timeMS % 60) / 10; // seconds
str[4] = '0' + timeMS % 10;
str[5] = '\''; str[5] = '\'';
str[4] = '0' + timeMS % 10; // seconds
timeMS = (timeMS / 60) % 100; // minutes timeMS /= 10;
str[3] = '0' + timeMS % 10;
str[0] = '0' + timeMS / 10;
str[1] = '0' + timeMS % 10;
str[2] = '\''; str[2] = '\'';
timeMS /= 60;
str[1] = '0' + timeMS % 10; // minutes
timeMS /= 10;
str[0] = '0' + timeMS % 10;
} }
void LCR_gameDrawPopupMessage(void) void LCR_gameDrawPopupMessage(void)
@ -1355,6 +1353,8 @@ void LCR_gameHandleInput(void)
LCR_LOG1("menu open"); LCR_LOG1("menu open");
LCR_gameSetState(LCR_GAME_STATE_MENU); LCR_gameSetState(LCR_GAME_STATE_MENU);
LCR_game.menu.selectedItem = 0; LCR_game.menu.selectedItem = 0;
LCR_game.menu.selectedTab = 0;
LCR_gameLoadMainMenuItems();
} }
else if (LCR_game.cameraMode == LCR_CAMERA_MODE_FREE) else if (LCR_game.cameraMode == LCR_CAMERA_MODE_FREE)
{ {