summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c41701)
raw | patch | inline | side by side (parent: 4c41701)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Oct 2019 04:41:42 +0000 (07:41 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Oct 2019 04:42:21 +0000 (07:42 +0300) |
index af65be7947f8374dd5fbf046ba79388446d89ea3..2424efd275529e01e88ab97b5bb970dcf0780cc0 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
'Âåðòèêàëüíàÿ ñèíõðîíèçàöèÿ:'),
('MENU VIDEO FILTER SKY', 'Anisotropic sky',
'Ôèëüòðàöèÿ íåáà:'),
- ('MENU VIDEO LEGACY COMPATIBLE', 'Compatibility with NPOT textures:',
- 'Ñîâìåñòèìîñòü ñ NPOT-òåêñòóðàìè:'),
+ ('MENU VIDEO LEGACY COMPATIBLE', 'Force compatibility with NPOT textures:',
+ 'Ýìóëÿöèÿ NPOT-òåêñòóð:'),
('MENU VIDEO NEED RESTART', 'Video settings will be changed after game restart.',
'Äàííûå íàñòðîéêè âèäåî âñòóïÿò â ñèëó ïîñëå ïåðåçàïóñêà èãðû.'),
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 0269a4c9315d2d700320061cd60f4b02774c4354..45432615c04762ff01a513553de4f9b7822043af 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
e_WriteLog('Releasing engine', TMsgType.Notify);
e_ReleaseEngine();
- e_WriteLog('Releasing Input', TMsgType.Notify);
+ e_WriteLog('Releasing input', TMsgType.Notify);
e_ReleaseInput();
if not gNoSound then
begin
- e_WriteLog('Releasing FMOD', TMsgType.Notify);
+ e_WriteLog('Releasing sound', TMsgType.Notify);
e_ReleaseSoundSystem();
end;
end;
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 2d83a526d2b53d96de91f4bcc2f3fb39169d4ec0..ccc0a556af4ec8cb8c1ec0c6cb46605777fe850f 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
sys_EnableVSync(gVSync);
gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
- glLegacyNPOT := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
+ glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);
menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
if gVSync then ItemIndex := 0 else ItemIndex := 1;
with TGUISwitch(menu.GetControl('swLegacyNPOT')) do
- if not glLegacyNPOT then ItemIndex := 0 else ItemIndex := 1;
+ if not glNPOTOverride then ItemIndex := 0 else ItemIndex := 1;
menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu'));
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index a80d682cc3fdfcc5764377011b4a3d9c2821afe7..1c23bb876ceb5de32288f89577107f1b412531e7 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
gSFSFastMode: Boolean;
gDefaultMegawadStart: AnsiString;
gBerserkAutoswitch: Boolean;
+ glNPOTOverride: Boolean = false;
implementation
ReadInteger(gFreq, 'Freq', 0);
ReadBoolean(gVSync, 'VSync');
ReadBoolean(gTextureFilter, 'TextureFilter');
- ReadBoolean(glLegacyNPOT, 'LegacyCompatible');
+ ReadBoolean(glNPOTOverride, 'LegacyCompatibleForce');
section := 'Sound';
ReadBoolean(gNoSound, 'NoSound');
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);
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 8e6bbe80de9c9ed2f53fd5b3191ee183fa5757ae..afc23e2b1b22a6e22f4adcd9e89cfa154495e10b 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
end;
function GLExtensionList (): SSArray;
- var s: PChar; i, j, num: GLint;
+var
+ s: PChar;
+ i, j, num: GLint;
begin
result := nil;
s := glGetString(GL_EXTENSIONS);
if s <> nil then
begin
- num := 0; i := 0; j := 0;
- while s[i] <> #0 do
+ num := 0;
+ i := 0;
+ j := 0;
+ while (s[i] <> #0) and (s[i] = ' ') do Inc(i);
+ while (s[i] <> #0) do
begin
while (s[i] <> #0) and (s[i] <> ' ') do Inc(i);
- SetLength(result, num + 1);
- result[num] := Copy(s, j, i - j);
+ SetLength(result, num+1);
+ result[num] := Copy(s, j+1, i-j);
while (s[i] <> #0) and (s[i] = ' ') do Inc(i);
j := i;
- Inc(num)
- end
- end
+ Inc(num);
+ end;
+ end;
end;
function GLExtensionSupported (ext: AnsiString): Boolean;
- var i, len: GLint; exts: SSArray;
+var
+ exts: SSArray;
+ e: AnsiString;
begin
result := false;
exts := GLExtensionList();
- if exts <> nil then
+ for e in exts do
begin
- i := 0; len := Length(exts);
- while (i < len) and (exts[i] <> ext) do Inc(i);
- result := i < len
- end
+ //writeln('<', e, '> : [', ext, '] = ', strEquCI1251(e, ext));
+ if (strEquCI1251(e, ext)) then begin result := true; exit; end;
+ end;
end;
procedure PrintGLSupportedExtensions;
{$IFNDEF USE_SYSSTUB}
PrintGLSupportedExtensions;
- glLegacyNPOT := GLExtensionSupported('GL_ARB_texture_non_power_of_two') or GLExtensionSupported('GL_OES_texture_npot');
+ glLegacyNPOT := not (GLExtensionSupported('GL_ARB_texture_non_power_of_two') or GLExtensionSupported('GL_OES_texture_npot'));
{$ELSE}
glLegacyNPOT := False;
{$ENDIF}
- e_logWritefln('NPOT textures: %s', [glLegacyNPOT]);
+ if glNPOTOverride and glLegacyNPOT then
+ begin
+ glLegacyNPOT := true;
+ e_logWriteln('NPOT texture emulation: FORCED');
+ end
+ else
+ begin
+ if (glLegacyNPOT) then e_logWriteln('NPOT texture emulation: enabled')
+ else e_logWriteln('NPOT texture emulation: disabled');
+ end;
gwin_dump_extensions := false;
Init;