From bdf912fe6ed86beb397fb5fa5fcc1f41ac464dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 8 Oct 2020 17:25:41 +0200 Subject: [PATCH] Fix small bugs --- game.h | 2 +- main_sdl.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/game.h b/game.h index fa78e3b..68eb4b3 100755 --- a/game.h +++ b/game.h @@ -1620,7 +1620,7 @@ void SFG_setAndInitLevel(uint8_t levelNumber) } } - SFG_currentLevel.timeStart = SFG_getTimeMs(); + SFG_currentLevel.timeStart = SFG_game.frameTime; SFG_currentLevel.frameStart = SFG_game.frame; SFG_game.spriteAnimationFrame = 0; diff --git a/main_sdl.c b/main_sdl.c index 1f7826a..72a9b5f 100644 --- a/main_sdl.c +++ b/main_sdl.c @@ -306,10 +306,9 @@ void emscripten_set_main_loop(em_callback_func func, int fps, int simulate_infin uint16_t audioBuff[SFG_SFX_SAMPLE_COUNT]; uint16_t audioPos = 0; -static inline uint16_t mixSamples(uint16_t sample1, uint16_t sample2) +static inline int16_t mixSamples(int16_t sample1, int16_t sample2) { - //return (sample1 + sample2) >> 1; //(sample1 >> 1) + (sample2 >> 1); - return sample1 + sample2; //(sample1 >> 1) + (sample2 >> 1); + return (sample1 + sample2) / 2; } uint8_t musicOn = 1;