fix compilation with SDL only

This commit is contained in:
Tim Felgentreff 2019-03-31 11:26:53 +02:00
parent e61f85de6f
commit cca234f955
4 changed files with 8 additions and 2 deletions

View file

@ -730,6 +730,7 @@ static bool CommandKey(int key)
KeyScrollState |= ScrollRight;
break;
#if defined(USE_OPENGL) || defined(USE_GLES)
case SDLK_SLASH:
case SDLK_BACKSLASH:
if (KeyModifiers & ModifierAlt) {
@ -740,7 +741,7 @@ static bool CommandKey(int key)
}
}
break;
#endif
default:
if (HandleCommandKey(key)) {
break;

View file

@ -1648,6 +1648,7 @@ void CFiller::Load()
}
}
#if defined(USE_OPENGL) || defined(USE_GLES)
bool CGraphic::DeleteColorCyclingTextures() {
if (!ColorCyclingTextures) return false;
for (int i = 1; i < NumColorCycles; i++) {
@ -1662,5 +1663,5 @@ bool CGraphic::DeleteColorCyclingTextures() {
ColorCyclingTextures = NULL;
return true;
}
#endif
//@}

View file

@ -639,12 +639,14 @@ void InitVideoSdl()
if (TheScreen == NULL) {
fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
Video.Width, Video.Height, Video.Depth, SDL_GetError());
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
fprintf(stderr, "Re-trying video without OpenGL\n");
UseOpenGL = false;
InitVideoSdl();
return;
}
#endif
if (Video.FullScreen) {
fprintf(stderr, "Re-trying video without fullscreen mode\n");
Video.FullScreen = false;

View file

@ -394,10 +394,12 @@ void AddColorCyclingRange(unsigned int begin, unsigned int end)
void SetColorCycleAll(bool value)
{
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
// FIXME: In OpenGL-mode, we can only cycle the tileset graphic
return;
}
#endif
CColorCycling::GetInstance().ColorCycleAll = value;
}