From cfd63a9ad084cdf76ad35244990d7078221df578 Mon Sep 17 00:00:00 2001 From: Trihedraf Date: Thu, 22 Apr 2021 04:07:52 -0700 Subject: [PATCH] Fix SDL1 Builds --- Source/DiabloUI/diabloui.cpp | 2 +- Source/DiabloUI/selhero.cpp | 2 +- Source/controls/controller_motion.h | 2 +- Source/controls/game_controls.cpp | 2 +- Source/controls/game_controls.h | 2 +- Source/storm/storm_sdl_rw.cpp | 8 ++++---- Source/storm/storm_svid.cpp | 2 +- Source/utils/thread.cpp | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index 4b9c936a9..21e97f4b3 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -332,7 +332,7 @@ void UiFocusNavigation(SDL_Event *event) char utf8[SDL_TEXTINPUTEVENT_TEXT_SIZE]; utf8[0] = (char)unicode; utf8[1] = '\0'; - selhero_CatToName(utf8, UiTextInput, UiTextInputLen); + SelheroCatToName(utf8, UiTextInput, UiTextInputLen); } } #endif diff --git a/Source/DiabloUI/selhero.cpp b/Source/DiabloUI/selhero.cpp index 8d933633c..dfc45cd4b 100644 --- a/Source/DiabloUI/selhero.cpp +++ b/Source/DiabloUI/selhero.cpp @@ -295,7 +295,7 @@ void SelheroClassSelectorSelect(int value) } memset(selhero_heroInfo.name, '\0', sizeof(selhero_heroInfo.name)); #if defined __3DS__ - ctr_vkbdInput("Enter Hero name..", selhero_GenerateName(selhero_heroInfo.heroclass), selhero_heroInfo.name); + ctr_vkbdInput("Enter Hero name..", SelheroGenerateName(selhero_heroInfo.heroclass), selhero_heroInfo.name); #endif if (ShouldPrefillHeroName()) strncpy(selhero_heroInfo.name, SelheroGenerateName(selhero_heroInfo.heroclass), sizeof(selhero_heroInfo.name) - 1); diff --git a/Source/controls/controller_motion.h b/Source/controls/controller_motion.h index e4ff82410..67010e75e 100644 --- a/Source/controls/controller_motion.h +++ b/Source/controls/controller_motion.h @@ -19,7 +19,7 @@ extern float leftStickX, leftStickY, rightStickX, rightStickY; extern bool leftStickNeedsScaling, rightStickNeedsScaling; // Updates motion state for mouse and joystick sticks. -bool ProcessControllerMotion(const SDL_Event &event, ControllerButtonEvent ctrl_event); +bool ProcessControllerMotion(const SDL_Event &event, ControllerButtonEvent ctrlEvent); // Returns direction of the left thumb stick or DPad (if allow_dpad = true). AxisDirection GetLeftStickOrDpadDirection(bool allow_dpad = true); diff --git a/Source/controls/game_controls.cpp b/Source/controls/game_controls.cpp index 8e34219b1..dd2efdecb 100644 --- a/Source/controls/game_controls.cpp +++ b/Source/controls/game_controls.cpp @@ -208,7 +208,7 @@ bool GetGameAction(const SDL_Event &event, ControllerButtonEvent ctrlEvent, Game return true; case ControllerButton_BUTTON_Y: // Top button #ifdef __3DS__ - if (!ctrl_event.up) { + if (!ctrlEvent.up) { zoomflag = !zoomflag; CalcViewportGeometry(); } diff --git a/Source/controls/game_controls.h b/Source/controls/game_controls.h index dcdf675b2..2d3475df6 100644 --- a/Source/controls/game_controls.h +++ b/Source/controls/game_controls.h @@ -70,7 +70,7 @@ struct GameAction { }; }; -bool GetGameAction(const SDL_Event &event, ControllerButtonEvent ctrl_event, GameAction *action); +bool GetGameAction(const SDL_Event &event, ControllerButtonEvent ctrlEvent, GameAction *action); AxisDirection GetMoveDirection(); diff --git a/Source/storm/storm_sdl_rw.cpp b/Source/storm/storm_sdl_rw.cpp index 6e56410de..b86721cd7 100644 --- a/Source/storm/storm_sdl_rw.cpp +++ b/Source/storm/storm_sdl_rw.cpp @@ -28,7 +28,7 @@ static Sint64 SFileRwSize(struct SDL_RWops *context) #ifndef USE_SDL1 static Sint64 SFileRwSeek(struct SDL_RWops *context, Sint64 offset, int whence) #else -static int SFileRw_seek(struct SDL_RWops *context, int offset, int whence) +static int SFileRwSeek(struct SDL_RWops *context, int offset, int whence) #endif { DWORD swhence; @@ -47,7 +47,7 @@ static int SFileRw_seek(struct SDL_RWops *context, int offset, int whence) } const std::uint64_t pos = SFileSetFilePointer(SFileRwGetHandle(context), offset, swhence); if (pos == static_cast(-1)) { - SDL_Log("SFileRw_seek error: %ud", (unsigned int)SErrGetLastError()); + SDL_Log("SFileRwSeek error: %ud", (unsigned int)SErrGetLastError()); } return pos; } @@ -55,14 +55,14 @@ static int SFileRw_seek(struct SDL_RWops *context, int offset, int whence) #ifndef USE_SDL1 static size_t SFileRwRead(struct SDL_RWops *context, void *ptr, size_t size, size_t maxnum) #else -static int SFileRw_read(struct SDL_RWops *context, void *ptr, int size, int maxnum) +static int SFileRwRead(struct SDL_RWops *context, void *ptr, int size, int maxnum) #endif { DWORD numRead = 0; if (!SFileReadFile(SFileRwGetHandle(context), ptr, maxnum * size, &numRead, nullptr)) { const DWORD errCode = SErrGetLastError(); if (errCode != STORM_ERROR_HANDLE_EOF) { - SDL_Log("SFileRw_read error: %u %u ERROR CODE %u", (unsigned int)size, (unsigned int)maxnum, (unsigned int)errCode); + SDL_Log("SFileRwRead error: %u %u ERROR CODE %u", (unsigned int)size, (unsigned int)maxnum, (unsigned int)errCode); } } return numRead / size; diff --git a/Source/storm/storm_svid.cpp b/Source/storm/storm_svid.cpp index 7f6108507..a07d5fe9f 100644 --- a/Source/storm/storm_svid.cpp +++ b/Source/storm/storm_svid.cpp @@ -408,7 +408,7 @@ bool SVidPlayContinue() { SDL_Surface *outputSurface = GetOutputSurface(); #ifdef USE_SDL1 - const bool is_indexed_output_format = SDLBackport_IsPixelFormatIndexed(output_surface->format); + const bool isIndexedOutputFormat = SDLBackport_IsPixelFormatIndexed(outputSurface->format); #else const Uint32 wndFormat = SDL_GetWindowPixelFormat(ghMainWnd); const bool isIndexedOutputFormat = SDL_ISPIXELFORMAT_INDEXED(wndFormat); diff --git a/Source/utils/thread.cpp b/Source/utils/thread.cpp index e52ef125d..6fd8a676d 100644 --- a/Source/utils/thread.cpp +++ b/Source/utils/thread.cpp @@ -18,7 +18,7 @@ static int SDLCALL ThreadTranslate(void *ptr) SDL_Thread *CreateThread(unsigned int (*handler)(void *), SDL_threadID *threadId) { #ifdef USE_SDL1 - SDL_Thread *ret = SDL_CreateThread(thread_translate, (void *)handler); + SDL_Thread *ret = SDL_CreateThread(ThreadTranslate, (void *)handler); #else SDL_Thread *ret = SDL_CreateThread(ThreadTranslate, nullptr, (void *)handler); #endif