fallback to software and windowed rendering before giving up

This commit is contained in:
Tim Felgentreff 2017-06-11 11:48:01 +02:00
parent d825d9386d
commit 0988e2dae4
2 changed files with 15 additions and 2 deletions

View file

@ -1031,7 +1031,7 @@ int CServer::Parse_Hello(int h, const CInitMessage_Hello &msg, const CHost &host
{
if (h == -1) { // it is a new client
for (int i = 1; i < PlayerMax - 1; ++i) {
// occupy first available slot
// occupy first available slot, excepting the first slot (the host)
if (serverSetup->CompOpt[i] == 0) {
if (Hosts[i].PlyNr == 0) {
h = i;
@ -1469,7 +1469,7 @@ void NetworkInitClientConnect()
*/
void NetworkServerStartGame()
{
Assert(ServerSetupState.CompOpt[0] == 0);
Assert(ServerSetupState.CompOpt[0] == 0); // the host should be slot 0
// save it first..
LocalSetupState = ServerSetupState;

View file

@ -633,6 +633,19 @@ 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 (UseOpenGL) {
fprintf(stderr, "Re-trying video without OpenGL\n");
UseOpenGL = false;
InitVideoSdl();
return;
}
if (Video.FullScreen) {
fprintf(stderr, "Re-trying video without fullscreen mode\n");
Video.FullScreen = false;
InitVideoSdl();
return;
}
fprintf(stderr, "Could not initialize video, even without fullscreen or OpenGL. Giving up.\n");
exit(1);
}