Smooth replay finish

This commit is contained in:
Miloslav Ciz 2025-06-23 17:14:29 +02:00
parent 5a44fb515b
commit ab70d727b8
8 changed files with 36 additions and 12 deletions

View file

@ -33,10 +33,9 @@ uint8_t musicBuffer[AUDIO_BUFFER_SIZE];
uint8_t LCR_keyPressed(uint8_t key)
{
#define k(x) sfKeyboard_isKeyPressed(sfKey ## x)
switch (key)
{
#define k(x) sfKeyboard_isKeyPressed(sfKey ## x)
case LCR_KEY_UP: return k(W) || k(Up) || k(Num8); break;
case LCR_KEY_RIGHT: return k(E) || k(Right) || k(Num6); break;
case LCR_KEY_DOWN: return k(S) || k(Down) || k(Num5) || k(Num2); break;
@ -44,6 +43,7 @@ uint8_t LCR_keyPressed(uint8_t key)
case LCR_KEY_A: return k(K) || k(Return); break;
case LCR_KEY_B: return k(L) || k(Escape); break;
default: break;
#undef k
}
return 0;
@ -58,8 +58,8 @@ void LCR_sleep(uint16_t timeMs)
void LCR_drawPixel(unsigned long index, uint16_t color)
{
windowPixels[index] = 0xff000000 | ((color & 0x07e0) << 5) |
(((color << 19) | (color >> 8)) & 0x00f800f8) ;
windowPixels[index] = 0xff000000 | ((color & 0x07e0) << 5) | (((color << 19) |
(color >> 8)) & 0x00f800f8);
}
void printHelp(void)