diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index a5486509c00bf029c02e98fa80e7750db0cd2f58..7aea70fc0a5f9add839ce28ab3bfe334a975fc9f 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
function GenPlayerName (n: Integer): String;
-procedure g_Options_SetDefault();
+procedure g_Options_SetDefault;
+procedure g_Options_SetDefaultVideo;
procedure g_Options_Read(FileName: String);
procedure g_Options_Write(FileName: String);
procedure g_Options_Write_Language(FileName: String);
gSFSFastMode: Boolean;
gDefaultMegawadStart: AnsiString;
gBerserkAutoswitch: Boolean;
+ glNPOTOverride: Boolean = false;
implementation
uses
{$INCLUDE ../nogl/noGLuses.inc}
+ {$IFDEF USE_SDL2}
+ SDL2,
+ {$ENDIF}
e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
- g_items, wadreader, e_graphics, g_touch, SDL2, envvars;
+ g_items, wadreader, e_graphics, g_touch, envvars;
var
machine: Integer;
Result := Copy(Result, 1, 10) + ' ' + IntToStr(n)
end;
+{$IFDEF USE_SDL2}
procedure g_Options_SetDefaultVideo;
-var
- target, closest, display: TSDL_DisplayMode;
- percentage: Integer;
+ var display: TSDL_DisplayMode;
+ {$IFNDEF ANDROID}
+ var target, closest: TSDL_DisplayMode; percentage: Integer;
+ {$ENDIF}
begin
(* Display 0 = Primary display *)
- SDL_GetDesktopDisplayMode(0, @display);
- {$IF DEFINED(ANDROID)}
+ gScreenWidth := 640;
+ gScreenHeight := 480;
+ //gBPP := SDL_BITSPERPIXEL(dispaly.format);
+ gBPP := 32;
+ {$IFDEF ANDROID}
+ gFullScreen := True; (* rotation not allowed? *)
+ {$ELSE}
+ gFullScreen := False;
+ {$ENDIF}
+ if SDL_GetDesktopDisplayMode(0, @display) = 0 then
+ begin
+ {$IFDEF ANDROID}
gScreenWidth := display.w;
gScreenHeight := display.h;
- //gBPP := SDL_BITSPERPIXEL(dispaly.format);
- gBPP := 32;
- gFullScreen := True; (* rotation not allowed? *)
{$ELSE}
(* Window must be smaller than display *)
closest.w := display.w;
gScreenWidth := closest.w;
gScreenHeight := closest.h;
//gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *)
- gBPP := 32;
- gFullScreen := False;
{$ENDIF}
+ end
+ else
+ begin
+ e_LogWritefln('SDL: Failed to get desktop display mode: %s', [SDL_GetError])
+ end;
(* Must be positioned on primary display *)
gWinRealPosX := SDL_WINDOWPOS_CENTERED;
gWinRealPosY := SDL_WINDOWPOS_CENTERED;
e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
g_Console_ResetBinds;
end;
+{$ELSE}
+procedure g_Options_SetDefaultVideo;
+begin
+ gScreenWidth := 640;
+ gScreenHeight := 480;
+ gBPP := 32;
+ gFullScreen := False;
+ gWinRealPosX := 0;
+ gWinRealPosY := 0;
+ gWinMaximized := False;
+ gVSync := True;
+ gTextureFilter := True;
+ glLegacyNPOT := False;
+ e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
+ g_Console_ResetBinds;
+end;
+{$ENDIF}
procedure g_Options_SetDefault();
var
gShowMessages := True;
gRevertPlayers := False;
gChatBubble := 4;
- gPlayerIndicator := True;
gSFSDebug := False;
gSFSFastMode := False;
e_FastScreenshots := True;
(* section MasterServer *)
NetSlistIP := 'mpms.doom2d.org';
NetSlistPort := 25665;
- g_Net_Slist_Set(NetSlistIP, NetSlistPort);
+ g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList);
(* section Server *)
NetServerName := 'Unnamed Server';
ReadInteger(gFreq, 'Freq', 0);
ReadBoolean(gVSync, 'VSync');
ReadBoolean(gTextureFilter, 'TextureFilter');
- ReadBoolean(glLegacyNPOT, 'LegacyCompatible');
+ ReadBoolean(glNPOTOverride, 'LegacyCompatibleForce');
section := 'Sound';
ReadBoolean(gNoSound, 'NoSound');
ReadBoolean(gShowMessages, 'Messages');
ReadBoolean(gRevertPlayers, 'RevertPlayers');
ReadInteger(gChatBubble, 'ChatBubble', 0, 4);
- ReadBoolean(gPlayerIndicator, 'PlayerIndicator');
ReadBoolean(gSFSDebug, 'SFSDebug'); wadoptDebug := gSFSDebug;
ReadBoolean(gSFSFastMode, 'SFSFastMode'); wadoptFast := gSFSFastMode;
ReadBoolean(e_FastScreenshots, 'FastScreenshots');
section := 'MasterServer';
ReadString(NetSlistIP, 'IP');
ReadInteger(NetSlistPort, 'Port', 0, 65535);
- g_Net_Slist_Set(NetSlistIP, NetSlistPort);
+ ReadString(NetSlistList, 'List');
+ g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList);
section := 'Server';
ReadString(NetServerName, 'Name');
config.WriteInt('Video', 'BPP', gBPP);
config.WriteBool('Video', 'VSync', gVSync);
config.WriteBool('Video', 'TextureFilter', gTextureFilter);
- config.WriteBool('Video', 'LegacyCompatible', glLegacyNPOT);
+ config.WriteBool('Video', 'LegacyCompatibleForce', glNPOTOverride);
config.WriteBool('Sound', 'NoSound', gNoSound);
config.WriteInt('Sound', 'SoundLevel', gSoundLevel);
config.WriteBool('Game', 'Messages', gShowMessages);
config.WriteBool('Game', 'RevertPlayers', gRevertPlayers);
config.WriteInt('Game', 'ChatBubble', gChatBubble);
- config.WriteBool('Game', 'PlayerIndicator', gPlayerIndicator);
config.WriteBool('Game', 'SFSDebug', gSFSDebug);
config.WriteBool('Game', 'SFSFastMode', gSFSFastMode);
config.WriteBool('Game', 'FastScreenshots', e_FastScreenshots);
config.WriteStr('MasterServer', 'IP', NetSlistIP);
config.WriteInt('MasterServer', 'Port', NetSlistPort);
+ config.WriteStr('MasterServer', 'List', NetSlistList);
config.WriteStr ('Server', 'Name', NetServerName);
config.WriteStr ('Server', 'Password', NetPassword);