diff --git a/Editor/AGS.Editor/AGSEditor.cs b/Editor/AGS.Editor/AGSEditor.cs index 61bd811734d..e894e907bb7 100644 --- a/Editor/AGS.Editor/AGSEditor.cs +++ b/Editor/AGS.Editor/AGSEditor.cs @@ -784,22 +784,15 @@ private void DefineMacrosAccordingToGameSettings(IPreprocessor preprocessor) { preprocessor.DefineMacro("DEBUG", "1"); } - if (_game.Settings.EnforceObjectBasedScript) - { - preprocessor.DefineMacro("STRICT", "1"); - } - if (_game.Settings.EnforceNewStrings) - { - preprocessor.DefineMacro("STRICT_STRINGS", "1"); - } - if (_game.Settings.EnforceNewAudio) - { - preprocessor.DefineMacro("STRICT_AUDIO", "1"); - } - if (!_game.Settings.UseOldCustomDialogOptionsAPI) - { - preprocessor.DefineMacro("NEW_DIALOGOPTS_API", "1"); - } + // Some settings have become obsolete and now have default values + // EnforceObjectBasedScript => true + preprocessor.DefineMacro("STRICT", "1"); + // EnforceNewStrings => true + preprocessor.DefineMacro("STRICT_STRINGS", "1"); + // EnforceNewAudio => true + preprocessor.DefineMacro("STRICT_AUDIO", "1"); + // UseOldCustomDialogOptionsAPI => false + preprocessor.DefineMacro("NEW_DIALOGOPTS_API", "1"); if (!_game.Settings.UseOldKeyboardHandling) { preprocessor.DefineMacro("NEW_KEYINPUT_API", "1"); diff --git a/Editor/AGS.Editor/Panes/ScintillaWrapper.cs b/Editor/AGS.Editor/Panes/ScintillaWrapper.cs index 6a1ca1b691c..d838de03d05 100644 --- a/Editor/AGS.Editor/Panes/ScintillaWrapper.cs +++ b/Editor/AGS.Editor/Panes/ScintillaWrapper.cs @@ -2017,35 +2017,24 @@ private bool ShowAutoCompleteForEnum(string typeName) private bool ShouldShowThis(ScriptToken token, List defines) { Settings gameSettings = Factory.AGSEditor.CurrentGame.Settings; - if ((token.IfNDefOnly == "STRICT") && (gameSettings.EnforceObjectBasedScript)) + // Some settings have become obsolete and now have default values + // EnforceObjectBasedScript => true + if (token.IfNDefOnly == "STRICT") { return false; } - if ((token.IfDefOnly == "STRICT") && (!gameSettings.EnforceObjectBasedScript)) + // EnforceNewStrings => true + if (token.IfNDefOnly == "STRICT_STRINGS") { return false; } - if ((token.IfNDefOnly == "STRICT_STRINGS") && (gameSettings.EnforceNewStrings)) + // EnforceNewAudio => true + if (token.IfNDefOnly == "STRICT_AUDIO") { return false; } - if ((token.IfDefOnly == "STRICT_STRINGS") && (!gameSettings.EnforceNewStrings)) - { - return false; - } - if ((token.IfNDefOnly == "STRICT_AUDIO") && (gameSettings.EnforceNewAudio)) - { - return false; - } - if ((token.IfDefOnly == "STRICT_AUDIO") && (!gameSettings.EnforceNewAudio)) - { - return false; - } - if ((token.IfNDefOnly == "NEW_DIALOGOPTS_API") && (!gameSettings.UseOldCustomDialogOptionsAPI)) - { - return false; - } - if ((token.IfDefOnly == "NEW_DIALOGOPTS_API") && (gameSettings.UseOldCustomDialogOptionsAPI)) + // UseOldCustomDialogOptionsAPI => false + if (token.IfNDefOnly == "NEW_DIALOGOPTS_API") { return false; } @@ -2086,16 +2075,18 @@ private bool ShouldShowThis(ScriptToken token, List defines) // as precompiler. Instead it makes its own parsing, and somewhat limits perfomance and capabilities. // This is (one) reason why all those checks are made here explicitly, instead of relying on some // prefetched macro list. + // Some settings have become obsolete and now have default values + // EnforceObjectBasedScript => true if (token.IfNDefOnly != null && token.IfNDefOnly.StartsWith("STRICT_IN_")) { ScriptAPIVersion? v = GetAPIVersionFromString(token.IfNDefOnly.Substring("STRICT_IN_".Length)); - if (v.HasValue && (gameSettings.EnforceObjectBasedScript && v <= gameSettings.ScriptCompatLevelReal)) + if (v.HasValue && (v <= gameSettings.ScriptCompatLevelReal)) return false; } if (token.IfDefOnly != null && token.IfDefOnly.StartsWith("STRICT_IN_")) { ScriptAPIVersion? v = GetAPIVersionFromString(token.IfDefOnly.Substring("STRICT_IN_".Length)); - if (v.HasValue && !(gameSettings.EnforceObjectBasedScript && v <= gameSettings.ScriptCompatLevelReal)) + if (v.HasValue && !(v <= gameSettings.ScriptCompatLevelReal)) return false; } return true; diff --git a/Editor/AGS.Native/NativeDLL.vcxproj b/Editor/AGS.Native/NativeDLL.vcxproj index 4af21eab909..85e353419cc 100644 --- a/Editor/AGS.Native/NativeDLL.vcxproj +++ b/Editor/AGS.Native/NativeDLL.vcxproj @@ -138,6 +138,7 @@ ProgramDatabase true 4013; 4477 + false NDEBUG;%(PreprocessorDefinitions) diff --git a/Solutions/Common.Lib/Common.Lib.vcxproj b/Solutions/Common.Lib/Common.Lib.vcxproj index 07dfbc34910..f285bf11bbe 100644 --- a/Solutions/Common.Lib/Common.Lib.vcxproj +++ b/Solutions/Common.Lib/Common.Lib.vcxproj @@ -281,7 +281,7 @@ Disabled ..\..\Common;..\..\Common\libinclude;..\..\Common\libsrc\alfont-2.0.9;..\..\Common\libsrc\freetype-2.1.3\include;..\..\libsrc\allegro\include;..\..\libsrc\glm;..\..\libsrc\miniz;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;_WINDOWS;_CRT_SECURE_NO_WARNINGS;ALLEGRO_STATICLINK;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebug @@ -321,7 +321,7 @@ Disabled ..\..\Common;..\..\Common\libinclude;..\..\Common\libsrc\alfont-2.0.9;..\..\Common\libsrc\freetype-2.1.3\include;..\..\libsrc\allegro\include;..\..\libsrc\glm;..\..\libsrc\miniz;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;_WINDOWS;_CRT_SECURE_NO_WARNINGS;ALLEGRO_STATICLINK;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebug @@ -486,7 +486,7 @@ Disabled ..\..\Common;..\..\Common\libinclude;..\..\Common\libsrc\alfont-2.0.9;..\..\Common\libsrc\freetype-2.1.3\include;..\..\libsrc\allegro\include;..\..\libsrc\glm;..\..\libsrc\miniz;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;_WINDOWS;_CRT_SECURE_NO_WARNINGS;ALLEGRO_STATICLINK;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebugDLL diff --git a/Solutions/Compiler.Lib/Compiler.Lib.vcxproj b/Solutions/Compiler.Lib/Compiler.Lib.vcxproj index 26f2d674d6a..fdef72fe7b1 100644 --- a/Solutions/Compiler.Lib/Compiler.Lib.vcxproj +++ b/Solutions/Compiler.Lib/Compiler.Lib.vcxproj @@ -85,7 +85,7 @@ Disabled ..\..\Common;..\..\Compiler;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebug @@ -139,7 +139,7 @@ Disabled ..\..\Common;..\..\Compiler;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebugDLL diff --git a/Solutions/Compiler2.Lib/Compiler2.Lib.vcxproj b/Solutions/Compiler2.Lib/Compiler2.Lib.vcxproj index b9143886791..2aa794070dd 100644 --- a/Solutions/Compiler2.Lib/Compiler2.Lib.vcxproj +++ b/Solutions/Compiler2.Lib/Compiler2.Lib.vcxproj @@ -91,7 +91,7 @@ Disabled ..\..\Common;..\..\Compiler;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;WINDOWS_VERSION;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebug @@ -146,7 +146,7 @@ Disabled ..\..\Common;..\..\Compiler;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_LIB;WINDOWS_VERSION;%(PreprocessorDefinitions) - true + false EnableFastChecks MultiThreadedDebugDLL