Browse Source

Fix SDL1 Builds

pull/1645/head
Trihedraf 5 years ago committed by Anders Jenbo
parent
commit
cfd63a9ad0
  1. 2
      Source/DiabloUI/diabloui.cpp
  2. 2
      Source/DiabloUI/selhero.cpp
  3. 2
      Source/controls/controller_motion.h
  4. 2
      Source/controls/game_controls.cpp
  5. 2
      Source/controls/game_controls.h
  6. 8
      Source/storm/storm_sdl_rw.cpp
  7. 2
      Source/storm/storm_svid.cpp
  8. 2
      Source/utils/thread.cpp

2
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

2
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);

2
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);

2
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();
}

2
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();

8
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<std::uint64_t>(-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;

2
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);

2
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

Loading…
Cancel
Save