From a5ed2e5cda2ed714d2dc67238eb217c7119e4aa8 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 9 Mar 2025 14:49:14 -0700
Subject: [PATCH] Fixed using backspace in the high score entry
---
netlogic/game.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/netlogic/game.cpp b/netlogic/game.cpp
index 0b537ad..9f48bc3 100644
--- a/netlogic/game.cpp
+++ b/netlogic/game.cpp
@@ -813,10 +813,12 @@ static void DoGameOver(void)
case SDLK_RETURN:
done = true;
break;
+ case SDLK_BACKSPACE:
case SDLK_DELETE:
if ( chars_in_handle ) {
sound->PlaySound(gExplosionSound, 5);
--chars_in_handle;
+ handle[chars_in_handle] = '\0';
}
break;
default:
@@ -831,14 +833,12 @@ static void DoGameOver(void)
} else {
sound->PlaySound(gBonk, 5);
}
- screen->FillRect(x, 300-newyork_height+2,
- w, newyork_height, ourBlack);
-
handle[chars_in_handle] = '\0';
- w = DrawText(x, 300, handle,
- newyork, STYLE_NORM, 0xFF, 0xFF, 0xFF);
- screen->Update();
}
+
+ screen->FillRect(x, 300 - newyork_height + 2, w, newyork_height, ourBlack);
+ w = DrawText(x, 300, handle, newyork, STYLE_NORM, 0xFF, 0xFF, 0xFF);
+ screen->Update();
}
delete newyork;
screen->StopTextInput();