This commit is contained in:
Miloslav Číž 2020-10-08 17:32:59 +02:00
commit aca237d825
2 changed files with 3 additions and 4 deletions

2
game.h
View File

@ -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;

View File

@ -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;