Skip to content

Commit 00880da

Browse files
Fix misspelling SDL_KeyCode from SDL_Keycode
cheat_screen.h + .cc Use SDL_Keycode, remove unneeded casts
1 parent 01fdb11 commit 00880da

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cheat_screen.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ bool CheatScreen::SharedInput() {
574574
Mouse::mouse_update = false;
575575
while (do_swipe || SDL_PollEvent(&event)) {
576576
int gx, gy;
577-
SDL_KeyCode simulate_key = SDLK_UNKNOWN;
577+
SDL_Keycode simulate_key = SDLK_UNKNOWN;
578578

579579
//
580580
if (do_swipe) {
@@ -1007,9 +1007,9 @@ void CheatScreen::SharedMenu() {
10071007
AddMenuItem(offsetx + 160, offsety5 + 9, SDLK_ESCAPE, " Exit");
10081008
}
10091009

1010-
SDL_KeyCode CheatScreen::CheckHotspots(int mx, int my, int radius) {
1010+
SDL_Keycode CheatScreen::CheckHotspots(int mx, int my, int radius) {
10111011
// Find the nearest hotspot
1012-
SDL_KeyCode nearest = SDLK_UNKNOWN;
1012+
SDL_Keycode nearest = SDLK_UNKNOWN;
10131013
int nearestdist = INT_MAX;
10141014

10151015
for (auto& hs : hotspots) {
@@ -2971,13 +2971,13 @@ void CheatScreen::BusinessMenu(Actor* actor) {
29712971
nextx += 8
29722972
+ AddMenuItem(
29732973
nextx, maxy - offsety - y,
2974-
SDL_KeyCode(SDLK_a + row), " Set");
2974+
SDLK_a + row, " Set");
29752975
nextx += 8
29762976
+ AddMenuItem(
29772977
nextx, maxy - offsety - y,
2978-
SDL_KeyCode(SDLK_i + row), " Location");
2978+
SDLK_i + row, " Location");
29792979
AddMenuItem(
2980-
nextx, maxy - offsety - y, SDL_KeyCode(SDLK_1 + row),
2980+
nextx, maxy - offsety - y, SDLK_1 + row,
29812981
" Clear");
29822982
}
29832983
nextx = offsetx;
@@ -4149,7 +4149,7 @@ bool CheatScreen::TeleportCheck() {
41494149
}
41504150

41514151
int CheatScreen::AddMenuItem(
4152-
int offsetx, int offsety, SDL_KeyCode keycode, const char* label) {
4152+
int offsetx, int offsety, SDL_Keycode keycode, const char* label) {
41534153
int keywidth = 8;
41544154
switch (keycode) {
41554155
case SDLK_UP:
@@ -4325,7 +4325,7 @@ void CheatScreen::WaitButtonsUp() {
43254325
} break;
43264326

43274327
default: {
4328-
// It should be an SDL_KeyCode
4328+
// It should be an SDL_Keycode
43294329
const char* keyname = SDL_GetKeyName(SDL_Keycode(button));
43304330
button_name = buf;
43314331

cheat_screen.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ class CheatScreen {
105105
};
106106

107107
struct Hotspot : TileRect {
108-
SDL_KeyCode keycode;
108+
SDL_Keycode keycode;
109109

110-
Hotspot(SDL_KeyCode keycode, int x, int y, int w, int h)
110+
Hotspot(SDL_Keycode keycode, int x, int y, int w, int h)
111111
: TileRect(x, y, w, h), keycode(keycode) {}
112112
};
113113

@@ -189,7 +189,7 @@ class CheatScreen {
189189
void SharedPrompt();
190190
bool SharedInput();
191191
void SharedMenu();
192-
SDL_KeyCode CheckHotspots(int mx, int my, int radius = 4);
192+
SDL_Keycode CheckHotspots(int mx, int my, int radius = 4);
193193
void PaintHotspots();
194194
void NormalLoop();
195195
void NormalDisplay();
@@ -245,7 +245,7 @@ class CheatScreen {
245245
//! @param label Label of the Menu item
246246
//! @return Width in pixels of the menu item
247247
int AddMenuItem(
248-
int offsetx, int offsety, SDL_KeyCode keycode, const char* label);
248+
int offsetx, int offsety, SDL_Keycode keycode, const char* label);
249249

250250
//! @brief Add a menuitem for left and right cursor keys
251251
//! @param offsetx X coord for the menu item

0 commit comments

Comments
 (0)