2015-04-14 11:33:57 +00:00
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
using System;
|
2015-04-14 11:33:57 +00:00
|
|
|
|
using System.Collections.Generic;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.IO;
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Config;
|
|
|
|
|
using CodeImp.DoomBuilder.Data;
|
2016-03-16 23:26:53 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Rendering;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
using CodeImp.DoomBuilder.GZBuilder.Data;
|
|
|
|
|
|
2015-04-14 11:33:57 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
2016-04-27 09:13:07 +00:00
|
|
|
|
namespace CodeImp.DoomBuilder.ZDoom
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
|
|
|
|
internal sealed class MapinfoParser : ZDTextParser
|
|
|
|
|
{
|
|
|
|
|
#region ================== Delegates
|
|
|
|
|
|
2015-12-18 10:16:53 +00:00
|
|
|
|
public delegate void IncludeDelegate(MapinfoParser parser, string includefile, bool clearerror);
|
2015-04-14 11:33:57 +00:00
|
|
|
|
public IncludeDelegate OnInclude;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Variables
|
|
|
|
|
|
|
|
|
|
private MapInfo mapinfo;
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
private string mapname;
|
2015-04-14 11:33:57 +00:00
|
|
|
|
private readonly Dictionary<int, string> spawnnums;
|
|
|
|
|
private readonly Dictionary<int, string> doomednums; // <DoomEdNum, <lowercase classname, List of default arguments>>
|
2015-12-17 10:07:28 +00:00
|
|
|
|
private readonly HashSet<string> parsedlumps;
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Properties
|
|
|
|
|
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
internal override ScriptType ScriptType { get { return ScriptType.MAPINFO; } }
|
|
|
|
|
|
2015-04-14 11:33:57 +00:00
|
|
|
|
public MapInfo MapInfo { get { return mapinfo; } }
|
|
|
|
|
public Dictionary<int, string> SpawnNums { get { return spawnnums; } }
|
|
|
|
|
public Dictionary<int, string> DoomEdNums { get { return doomednums; } }
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Constructor
|
|
|
|
|
|
|
|
|
|
public MapinfoParser()
|
|
|
|
|
{
|
2015-04-29 08:36:10 +00:00
|
|
|
|
// Syntax
|
|
|
|
|
whitespace = "\n \t\r\u00A0";
|
2015-05-18 18:49:15 +00:00
|
|
|
|
specialtokens = ",{}=\n";
|
2015-04-29 08:36:10 +00:00
|
|
|
|
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo = new MapInfo();
|
|
|
|
|
spawnnums = new Dictionary<int, string>();
|
|
|
|
|
doomednums = new Dictionary<int, string>();
|
2015-12-21 14:17:47 +00:00
|
|
|
|
parsedlumps = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
2015-04-14 11:33:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2015-04-14 11:33:57 +00:00
|
|
|
|
#region ================== Parsing
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
override public bool Parse(TextResourceData data, bool clearerrors)
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(string.IsNullOrEmpty(mapname)) throw new NotSupportedException("Map name required!");
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
return Parse(data, mapname, clearerrors);
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
public bool Parse(TextResourceData data, string mapname, bool clearerrors)
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
this.mapname = mapname.ToLowerInvariant();
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
|
|
|
|
|
//mxd. Already parsed?
|
|
|
|
|
if(!base.AddTextResource(data))
|
|
|
|
|
{
|
|
|
|
|
if(clearerrors) ClearError();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Cannot process?
|
|
|
|
|
if(!base.Parse(data, clearerrors)) return false;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Keep local data
|
|
|
|
|
Stream localstream = datastream;
|
|
|
|
|
string localsourcename = sourcename;
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
int localsourcelumpindex = sourcelumpindex;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
BinaryReader localreader = datareader;
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
DataLocation locallocation = datalocation;
|
|
|
|
|
string localtextresourcepath = textresourcepath;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// Classic format skip stoppers...
|
|
|
|
|
HashSet<string> breakat = new HashSet<string> { "map", "defaultmap", "adddefaultmap" };
|
|
|
|
|
|
Removed "Paste Properties Options" action.
Added "Paste Properties Special" actions in "Classic" and "Visual" categories. They work the same way as "Paste Special" action.
Added: "Copy Properties", "Paste Properties" and "Paste Properties Special" options are now shown in the Edit menu if current classic mode supports them.
Changed, Paste Properties Special window: only options relevant to current map format are now displayed.
Changed, Paste Properties Special window, UDMF: all UI-managed options are now available.
Fixed: MAPINFO parser was unable to process "include" directives.
Fixed, General interface: selection info was reset to "Nothing selected" after few seconds regardless of current selection.
Fixed, Visual mode: thing bounding boxes were not updated when changing things positions using Randomize mode.
Fixed, Visual mode: event lines were displayed at incorrect height when entering Visual mode for the first time.
Fixed, Texture Browser window: when MixTexturesFlats Game Configuration option is disabled, textures/flats are no longer shown in the Used group when flats/textures with the same names are used in the map.
Fixed(?): probably fixed an exception some users reported when trying to initialize a Classic mode after switching from Visual mode with "Sync cameras" option enabled.
Changed, Game configurations, Thing Categories: a block must have at least one thing category property to be recognized as a thing category.
Changed, Visplane Explorer: the plugin now outputs more info when it fails to initialize vpo.dll.
Cosmetic, Thing Edit window, Doom/Hexen map format: adjusted UI layout so thing flags control no longer displays scrollbars in Hexen map format.
Internal: merged methods from UDMFTools into UniFields, removed UDMFTools.
Updated Inno Setup script (added VC++ 2008 SP1 distributive).
Updated ZDoom_DECORATE.cfg (A_CheckBlock).
Updated documentation (added "System Requirements" page).
2015-10-09 12:38:12 +00:00
|
|
|
|
while(SkipWhitespace(true))
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
string token = ReadToken().ToLowerInvariant();
|
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
|
|
|
|
if(string.IsNullOrEmpty(token) || token == "$gzdb_skip") break;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
switch(token)
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
case "adddefaultmap":
|
|
|
|
|
// Parse properties
|
|
|
|
|
if(!ParseMapBlock()) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "defaultmap":
|
|
|
|
|
// Reset MapInfo
|
|
|
|
|
mapinfo = new MapInfo();
|
|
|
|
|
|
|
|
|
|
// Parse properties
|
|
|
|
|
if(!ParseMapBlock()) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "map":
|
|
|
|
|
// Get map lump name
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
token = ReadToken().ToLowerInvariant();
|
|
|
|
|
if(token != this.mapname)
|
|
|
|
|
{
|
|
|
|
|
// Map number? Try to build map name from it...
|
|
|
|
|
int n;
|
|
|
|
|
if(int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out n))
|
|
|
|
|
{
|
|
|
|
|
token = ((n > 0 && n < 10) ? "map0" + n : "map" + n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Still no dice?
|
|
|
|
|
if(token != this.mapname)
|
|
|
|
|
{
|
|
|
|
|
SkipStructure(breakat);
|
|
|
|
|
continue; // Not finished, search for next "map", "defaultmap" or "adddefaultmap" block
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Try to get map name
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
token = ReadToken();
|
|
|
|
|
if(token.ToLowerInvariant() == "lookup")
|
|
|
|
|
{
|
|
|
|
|
// No dice...
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
ReadToken();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-04-06 22:54:04 +00:00
|
|
|
|
mapinfo.Title = StripQuotes(token);
|
2016-01-11 13:00:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Parse properties
|
|
|
|
|
if(!ParseMapBlock()) return false;
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
|
|
|
|
|
// There is a map entry for current map, which makes it defined
|
|
|
|
|
mapinfo.IsDefined = true;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "include":
|
|
|
|
|
if(!ParseInclude(clearerrors)) return false;
|
|
|
|
|
|
|
|
|
|
// Set our buffers back to continue parsing
|
|
|
|
|
datastream = localstream;
|
|
|
|
|
datareader = localreader;
|
|
|
|
|
sourcename = localsourcename;
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
sourcelumpindex = localsourcelumpindex;
|
|
|
|
|
datalocation = locallocation;
|
|
|
|
|
textresourcepath = localtextresourcepath;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "gameinfo":
|
|
|
|
|
if(!ParseGameInfo()) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "doomednums":
|
|
|
|
|
if(!ParseDoomEdNums()) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "spawnnums":
|
|
|
|
|
if(!ParseSpawnNums()) return false;
|
|
|
|
|
break;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Check values
|
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
|
|
|
|
if(mapinfo.FogDensity > 0 && (mapinfo.FadeColor.Red > 0 || mapinfo.FadeColor.Green > 0 || mapinfo.FadeColor.Blue > 0))
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo.HasFadeColor = true;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
|
|
|
|
if(mapinfo.OutsideFogDensity > 0 && (mapinfo.OutsideFogColor.Red > 0 || mapinfo.OutsideFogColor.Green > 0 || mapinfo.OutsideFogColor.Blue > 0))
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo.HasOutsideFogColor = true;
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2016-04-01 22:23:05 +00:00
|
|
|
|
if(string.IsNullOrEmpty(mapinfo.Sky2) && mapinfo.DoubleSky)
|
2016-03-08 23:31:32 +00:00
|
|
|
|
{
|
|
|
|
|
LogWarning("\"doublesky\" flag is defined without \"Sky2\" property.");
|
|
|
|
|
mapinfo.DoubleSky = false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// All done
|
|
|
|
|
return !this.HasError;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
private bool ParseInclude(bool clearerrors)
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string includelump = StripQuotes(ReadToken(false)); // Don't skip newline
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
//INFO: ZDoom MAPINFO include paths can't be relative ("../mapstuff.txt")
|
|
|
|
|
//or absolute ("d:/project/mapstuff.txt")
|
|
|
|
|
//or have backward slashes ("info\mapstuff.txt")
|
|
|
|
|
//include paths are relative to the first parsed entry, not the current one
|
|
|
|
|
//also include paths may or may not be quoted
|
|
|
|
|
if(!string.IsNullOrEmpty(includelump))
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Absolute paths are not supported...
|
|
|
|
|
if(Path.IsPathRooted(includelump))
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
ReportError("Absolute include paths are not supported by ZDoom");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-03-21 19:41:54 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Relative paths are not supported
|
|
|
|
|
if(includelump.StartsWith(RELATIVE_PATH_MARKER) || includelump.StartsWith(CURRENT_FOLDER_PATH_MARKER) ||
|
|
|
|
|
includelump.StartsWith(ALT_RELATIVE_PATH_MARKER) || includelump.StartsWith(ALT_CURRENT_FOLDER_PATH_MARKER))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Relative include paths are not supported by ZDoom");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Backward slashes are not supported
|
|
|
|
|
if(includelump.Contains(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture)))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Only forward slashes are supported by ZDoom");
|
|
|
|
|
return false;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Check invalid path chars
|
|
|
|
|
if(!CheckInvalidPathChars(includelump)) return false;
|
2015-08-23 23:32:12 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Already parsed?
|
|
|
|
|
if(parsedlumps.Contains(includelump))
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Already parsed \"" + includelump + "\". Check your include directives");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Add to collection
|
|
|
|
|
parsedlumps.Add(includelump);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Callback to parse this file
|
|
|
|
|
if(OnInclude != null)
|
|
|
|
|
{
|
|
|
|
|
OnInclude(this, includelump, clearerrors);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Bail out on error
|
|
|
|
|
if(this.HasError) return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ReportError("Expected filename to include");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
private bool ParseGameInfo()
|
|
|
|
|
{
|
|
|
|
|
if(!NextTokenIs("{")) return false; // Finished with this file
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
while(SkipWhitespace(true))
|
|
|
|
|
{
|
|
|
|
|
string token = ReadToken();
|
|
|
|
|
if(string.IsNullOrEmpty(token))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Failed to find the end of GameInfo block");
|
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
2013-09-11 09:47:53 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(token == "}") break;
|
|
|
|
|
|
|
|
|
|
if(token.ToLowerInvariant() == "skyflatname")
|
|
|
|
|
{
|
|
|
|
|
if(!NextTokenIs("=")) return false; // Finished with this file
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string skyflatname = StripQuotes(ReadToken());
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(string.IsNullOrEmpty(skyflatname))
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected SkyFlatName value");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
General.Map.Config.SkyFlatName = skyflatname.ToUpperInvariant();
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
private bool ParseDoomEdNums()
|
|
|
|
|
{
|
|
|
|
|
if(!NextTokenIs("{")) return false; // Finished with this file
|
|
|
|
|
|
|
|
|
|
while(SkipWhitespace(true))
|
|
|
|
|
{
|
|
|
|
|
string token = ReadToken();
|
|
|
|
|
if(string.IsNullOrEmpty(token))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Failed to find the end of DoomEdNums block");
|
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(token == "}") break;
|
|
|
|
|
|
|
|
|
|
// First must be a number
|
|
|
|
|
int id;
|
|
|
|
|
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out id))
|
|
|
|
|
{
|
|
|
|
|
// Not numeric!
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected DoomEdNums entry number, but got \"" + token + "\"");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Then "="
|
|
|
|
|
if(!NextTokenIs("=")) return false; // Finished with this file
|
|
|
|
|
|
|
|
|
|
// Then actor class
|
|
|
|
|
SkipWhitespace(false);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string classname = StripQuotes(ReadToken());
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(string.IsNullOrEmpty(classname))
|
|
|
|
|
{
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected DoomEdNums class definition");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Possible special and args. We'll skip them
|
|
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
|
|
{
|
|
|
|
|
if(!NextTokenIs(",", false)) break;
|
|
|
|
|
|
|
|
|
|
// Read special name or arg value
|
|
|
|
|
if(!SkipWhitespace(true) || string.IsNullOrEmpty(ReadToken())) return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add to collection?
|
|
|
|
|
if(id != 0) doomednums[id] = classname.ToLowerInvariant();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool ParseSpawnNums()
|
|
|
|
|
{
|
|
|
|
|
if(!NextTokenIs("{")) return false; // Finished with this file
|
|
|
|
|
|
|
|
|
|
while(SkipWhitespace(true))
|
|
|
|
|
{
|
|
|
|
|
string token = ReadToken();
|
|
|
|
|
if(string.IsNullOrEmpty(token))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Failed to find the end of SpawnNums block");
|
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(token == "}") break;
|
|
|
|
|
|
|
|
|
|
// First must be a number
|
|
|
|
|
int id;
|
|
|
|
|
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out id))
|
|
|
|
|
{
|
|
|
|
|
// Not numeric!
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected SpawnNums number, but got \"" + token + "\"");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Then "="
|
|
|
|
|
if(!NextTokenIs("=")) return false; // Finished with this file
|
|
|
|
|
|
|
|
|
|
// Then actor class
|
|
|
|
|
SkipWhitespace(false);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = StripQuotes(ReadToken());
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(string.IsNullOrEmpty(token))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Unable to get SpawnNums entry class definition");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-28 21:21:50 +00:00
|
|
|
|
// Range check
|
|
|
|
|
if((id < General.Map.FormatInterface.MinThingType) || (id > General.Map.FormatInterface.MaxThingType))
|
|
|
|
|
{
|
|
|
|
|
// Out of bounds!
|
|
|
|
|
ReportError("\"" + token + "\" actor's spawn number must be between "
|
|
|
|
|
+ General.Map.FormatInterface.MinThingType + " and " + General.Map.FormatInterface.MaxThingType);
|
|
|
|
|
return false; // Finished with this file
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Add to collection
|
|
|
|
|
spawnnums[id] = token.ToLowerInvariant();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Map block parsing
|
|
|
|
|
|
|
|
|
|
private bool ParseMapBlock()
|
|
|
|
|
{
|
|
|
|
|
bool classicformat = !NextTokenIs("{", false);
|
|
|
|
|
|
|
|
|
|
// Track brace level
|
2016-07-17 00:00:29 +00:00
|
|
|
|
int bracelevel = (classicformat ? 0 : 1); // Track map block opening brace
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Parse required values
|
|
|
|
|
while(SkipWhitespace(true))
|
|
|
|
|
{
|
|
|
|
|
string token = ReadToken().ToLowerInvariant();
|
|
|
|
|
switch(token)
|
|
|
|
|
{
|
|
|
|
|
//TODO: are there any other blocks available in the classic format?..
|
|
|
|
|
case "map": case "defaultmap": case "adddefaultmap":
|
|
|
|
|
if(classicformat)
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// We parsed too greadily, step back
|
|
|
|
|
DataStream.Seek(-token.Length - 1, SeekOrigin.Current);
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Finished with this block
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
2014-12-03 23:15:26 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
ReportError("Unexpected token \"" + token + "\"");
|
2015-12-17 10:07:28 +00:00
|
|
|
|
return false;
|
2013-09-11 08:49:45 +00:00
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
case "sky2": case "sky1":
|
|
|
|
|
if(!ParseSky(token)) return false;
|
|
|
|
|
break;
|
2013-09-11 08:49:45 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
case "outsidefog": case "fade":
|
|
|
|
|
if(!ParseFade(token)) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "horizwallshade": case "vertwallshade":
|
|
|
|
|
if(!ParseWallShade(token)) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "outsidefogdensity": case "fogdensity":
|
|
|
|
|
if(!ParseFogDensity(token)) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "doublesky":
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo.DoubleSky = true;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "evenlighting":
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo.EvenLighting = true;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "smoothlighting":
|
2015-04-14 11:33:57 +00:00
|
|
|
|
mapinfo.SmoothLighting = true;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2016-06-19 21:17:46 +00:00
|
|
|
|
case "lightmode":
|
|
|
|
|
if(!ParseLightMode()) return false;
|
|
|
|
|
break;
|
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
case "}": return true; // Block end
|
|
|
|
|
|
|
|
|
|
case "{": // Skip inner blocks
|
2015-08-23 23:32:12 +00:00
|
|
|
|
bracelevel++;
|
|
|
|
|
if(bracelevel > 1)
|
|
|
|
|
{
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
token = ReadToken();
|
|
|
|
|
if(token == "{") bracelevel++;
|
|
|
|
|
else if(token == "}") bracelevel--;
|
|
|
|
|
} while(!string.IsNullOrEmpty(token) && bracelevel > 1);
|
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
break;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2015-12-21 14:17:47 +00:00
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool ParseSky(string skytype)
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string token = StripQuotes(ReadToken());
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// New format
|
|
|
|
|
if(token == "=")
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// Should be sky texture name
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = StripQuotes(ReadToken());
|
2016-01-11 13:00:52 +00:00
|
|
|
|
bool gotcomma = (token.IndexOf(",", StringComparison.Ordinal) != -1);
|
|
|
|
|
if(gotcomma) token = token.Replace(",", "");
|
|
|
|
|
string skytexture = token.ToUpperInvariant();
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrEmpty(skytexture))
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
ReportError("Expected " + skytype + " texture name");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-12-21 14:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(skytype == "sky1")
|
|
|
|
|
mapinfo.Sky1 = skytexture;
|
|
|
|
|
else
|
|
|
|
|
mapinfo.Sky2 = skytexture;
|
2015-12-21 14:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Check if we have scrollspeed
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
if(!gotcomma && token == ",")
|
|
|
|
|
{
|
|
|
|
|
gotcomma = true;
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
}
|
2015-12-21 14:17:47 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(gotcomma)
|
|
|
|
|
{
|
|
|
|
|
float scrollspeed = 0;
|
|
|
|
|
if(!ReadSignedFloat(token, ref scrollspeed))
|
2015-12-21 14:17:47 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Not numeric!
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected " + skytype + " scroll speed value, but got \"" + token + "\"");
|
2015-12-21 14:17:47 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(skytype == "sky1")
|
|
|
|
|
mapinfo.Sky1ScrollSpeed = scrollspeed;
|
|
|
|
|
else
|
|
|
|
|
mapinfo.Sky2ScrollSpeed = scrollspeed;
|
|
|
|
|
}
|
|
|
|
|
else
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
datastream.Seek(-token.Length - 1, SeekOrigin.Current); // Step back and try parsing this token again
|
2015-04-14 11:33:57 +00:00
|
|
|
|
}
|
2015-05-23 21:40:21 +00:00
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Old format
|
|
|
|
|
else
|
2015-05-23 21:40:21 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Token should be sky1/2 name
|
|
|
|
|
if(string.IsNullOrEmpty(token))
|
2015-05-23 21:40:21 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
ReportError("Expected " + skytype + " texture name");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-05-23 21:40:21 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(skytype == "sky1")
|
|
|
|
|
mapinfo.Sky1 = token.ToUpperInvariant();
|
|
|
|
|
else
|
|
|
|
|
mapinfo.Sky2 = token.ToUpperInvariant();
|
2015-05-23 21:40:21 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Try to read scroll speed
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
float scrollspeed = 0;
|
|
|
|
|
if(!ReadSignedFloat(token, ref scrollspeed))
|
|
|
|
|
{
|
|
|
|
|
// Not numeric!
|
|
|
|
|
datastream.Seek(-token.Length - 1, SeekOrigin.Current); // Step back and try parsing this token again
|
|
|
|
|
return true;
|
2015-05-23 21:40:21 +00:00
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
if(skytype == "sky1")
|
|
|
|
|
mapinfo.Sky1ScrollSpeed = scrollspeed;
|
|
|
|
|
else
|
|
|
|
|
mapinfo.Sky2ScrollSpeed = scrollspeed;
|
2015-05-23 21:40:21 +00:00
|
|
|
|
}
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool ParseFade(string fadetype)
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// New format?
|
|
|
|
|
if(token == "=")
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Get the color value
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string colorval = StripQuotes(token).ToLowerInvariant().Replace(" ", "");
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(string.IsNullOrEmpty(colorval))
|
|
|
|
|
{
|
|
|
|
|
ReportError("Expected " + fadetype + " color value");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Try to get the color...
|
2016-03-16 23:26:53 +00:00
|
|
|
|
PixelColor color = new PixelColor();
|
|
|
|
|
if(GetColorFromString(colorval, ref color))
|
2016-01-11 13:00:52 +00:00
|
|
|
|
{
|
|
|
|
|
if(fadetype == "fade")
|
2016-03-16 23:26:53 +00:00
|
|
|
|
mapinfo.FadeColor = color.ToColorValue();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
else
|
2016-03-16 23:26:53 +00:00
|
|
|
|
mapinfo.OutsideFogColor = color.ToColorValue();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
}
|
|
|
|
|
else //...or not
|
|
|
|
|
{
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Failed to parse " + fadetype + " value from string \"" + colorval + "\"");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
private bool ParseWallShade(string shadetype)
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string token = ReadToken();
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// New format
|
|
|
|
|
if(token == "=")
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
token = ReadToken();
|
2016-01-11 13:00:52 +00:00
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
int val = 0;
|
|
|
|
|
if(!ReadSignedInt(token, ref val))
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Not numeric!
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected " + shadetype + " value, but got \"" + token + "\"");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
if(shadetype == "vertwallshade")
|
|
|
|
|
mapinfo.VertWallShade = General.Clamp(val, -255, 255);
|
|
|
|
|
else
|
|
|
|
|
mapinfo.HorizWallShade = General.Clamp(val, -255, 255);
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
private bool ParseFogDensity(string densitytype)
|
|
|
|
|
{
|
2016-06-19 21:17:46 +00:00
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
if(!NextTokenIs("=")) return false; // New format only
|
2016-01-11 13:00:52 +00:00
|
|
|
|
SkipWhitespace(true);
|
2016-04-06 22:54:04 +00:00
|
|
|
|
string token = ReadToken();
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
2016-01-11 13:00:52 +00:00
|
|
|
|
int val;
|
|
|
|
|
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out val))
|
2015-04-14 11:33:57 +00:00
|
|
|
|
{
|
2016-01-11 13:00:52 +00:00
|
|
|
|
// Not numeric!
|
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
|
|
|
|
ReportError("Expected " + densitytype + " value, but got \"" + token + "\"");
|
2016-01-11 13:00:52 +00:00
|
|
|
|
return false;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2015-04-14 11:33:57 +00:00
|
|
|
|
|
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
|
|
|
|
if(densitytype == "fogdensity") mapinfo.FogDensity = val;
|
|
|
|
|
else mapinfo.OutsideFogDensity = val;
|
2016-01-11 13:00:52 +00:00
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-19 21:17:46 +00:00
|
|
|
|
private bool ParseLightMode()
|
|
|
|
|
{
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
if(!NextTokenIs("=")) return false; // New format only
|
|
|
|
|
SkipWhitespace(true);
|
|
|
|
|
string token = ReadToken();
|
|
|
|
|
|
|
|
|
|
int val;
|
|
|
|
|
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out val))
|
|
|
|
|
{
|
|
|
|
|
// Not numeric!
|
|
|
|
|
ReportError("Expected LightMode value, but got \"" + token + "\"");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Store
|
|
|
|
|
mapinfo.LightMode = (MapInfo.GZDoomLightMode)val;
|
|
|
|
|
|
|
|
|
|
// All done here
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-14 11:33:57 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
2012-06-01 10:17:47 +00:00
|
|
|
|
}
|