[TESVESSE] Added source for TESVESSE

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1704 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[PROJSite] Removed all text templates and files moved to GitHub in the meta repository.

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1705 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[TESVESSE] Ooops put it in the wrong folder

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1706 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] bugfixes for performance optimization and related changes

* Added wbDefines.inc which is included in all units

* in TES5 wbScriptObject, changed the ElementMap so that FormID comes before Alias, as setting the alias depends on the FormID begin set

* Fixed the implementation of TwbContainer.Assign to take ElementMap order into account (This fixes problems with copying quests that existed before the performance optimizations.)

* In wbImplementation, renamed (virtual) AddIfMissing, CanAssign, and Assign to AddIfMissingInternal, CanAssignInternal, and AssignInternal, and added new (non-virtual) AddIfMissing, CanAssign, and Assign methods to TwbElement which call the virtual ones. This gives a single point of entry for debugging and logging.

* Changed TwbSubRecord.GetValueDef to call DoInit again if required (Fixes the problem reported with copying Quests introduced by the performance optimizations.)

* Added support for logging using CodeSite. wbDefines.inc contains a USE_CODESITE define that can be turned off to compile without having a dependency on CodeSite.

* Added Assign to IwbDef and call it from TwbElement.AssignInternal instead of always performing a SetEditValue(aElement.EditValue), allowing individual Def classes to implement their own assignment code.

* Added IwbFlagDef (individual flags didn't have a Def before), together with other changes this now allows to copy individual flags using drag'n'drop

* Changed methods in TwbLocalizationFile to take a TMemoryStream instead of a TStream (they always got passed a TMemoryStream already) which made it possible to significantly simplify ReadZString

* Added checks to TwbLocalizationFile to prevent RangeCheck errors when trying to read zero length strings.

* Added missing MPL header to wbScriptAdapter

* Changed multiple Boolean fields to a single States set in TwbSubRecord

* optimized TwbMainRecord.ElementChanged and TwbMainRecord.EnsureChildGroup

* fixed the random time that "Background Loader: starting..." was always logged as.

* prevent main window from becoming unresponsive during long copy operations

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1707 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] it helps to actually add the new file... wbDefines.inc included now

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1708 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] minor cleaning improvement

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1709 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] fix for problem with performance optimization without SimpleRecords

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1710 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] Force wbHideUnused to false in xDump. Fixes an issue in array with fixed element size. 
Commented some unused variable and suppressed other compilation warnings.

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1711 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Exp] Synced to r1711.


git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1712 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] bug fix for performance optimization and memory optimization when copying mainrecords

* fix for potential memory overwrite after free in TwbKeepAliveRoot (very important, could result in all sorts of strange crashes and behavior)

* after assigning a whole TwbMainRecord (generally only happens during "copy as x into"), the newly assigned to record writes itself into a stream (the content of which is used as the BasePtr) and frees all elements.

This prevents excessive memory usage as otherwise all elements contained in the mainrecord would not be freed as they are all marked as modified.

The only "disadvantage" is that all elements of a newly copied record don't show up as modified anymore (the modified flag is on each element, freeing them all means that flag gets lost. If the elements are later created on-demand they parse their data out of the memory referenced by the BasePtr of the MainRecord and don't have the modified flag initially).

With this change in place I was able to do deep copy as override on the whole tamriel worldspace in TES5 and memory usage stayed under 1GB. (Without the change, attempting the copy quickly results in an out of memory error when all 4GB address space are used up).

* a new esDestroying flag indicates that TwbElement has started destruction and any operations which could result in a new interface references to the object being acquired should be avoided. (e.g. TwbContainer.ReleaseElements which was called from inside Destroy performed a SelfRef := Self as IwbContainerElementRef).

* a new csReseting flag indicates that a TwbContainer is currently resetting and prevents reentry to the DoReset method and entry to the DoInit while the reset is in progress

* a few additional Asserts check for irregularities involving reference counting (any problems indicated by these asserts should be fixed, but let me know if something goes wrong...)

* TwbBaseCachedFileStream.ReadStringLen could result in a range check error if the length was 0 (happens in TES4 ArchiveInvalidation.bsa)

* Display NaN floats as "NaN" instead of "Default"

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1713 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] fix for problem described at http://forums.nexusmods.com/index.php?/topic/813094-tes5edit/page-247#entry16794069

As a bonus, it is now possible to change the Script/Properties/Property/Type value in the editor and have that change reflected in the Value union.

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1714 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] Moved wbProgramPath from wbInit to wbInterface because I needed it in xDump.
Fixed handling of missing masters (in saves):
  The names are coherent with what I packed with xDump.
  If the empty plugins are not found in Data, they might be with the exe.
  it will not use esp or esm extension, so if the user kill the process there won't be useless plugin left behind.

Implemented WbFlagDef.GetDefTypeName.
Implemented TwbElement.GetElementType, but so it will Assert if ever used.
Cast explicitly strings to AnsString when needed.


git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1715 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Exp] Synced to r1715.

Update to nvse_plugin_xEdit, so it exports properly all eval functions.


git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1716 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] Postpone Group sorting while UpdateCount > 0; Increment UpdateCount during AddIfMissing.

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1717 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] commented out the wbHideUnused removal of elements from StructDoInit and UnionDoInit. Implemented support for actually hiding Unused elements (by making them return True from DontShow)

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1718 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
[Trunk] fix for assign not properly copying structs that have an "OptionalFromElement" assigned.

Part if the bug was that the implementation of TwbArrayDef.GetDefaultSize was backwards:

  if ((arCount = 0) and not Assigned(arCountCallback)) then 
    Result := GetSize(aBasePtr, aEndPtr, aElement) 
  else 
    Result := 0;
   
  It calls GetSize if count is 0 and there is no callback (which then always returns 0), but returns 0 if count is > 0 or there is a callback (in which case GetSize is very likely to return a value > 0).
  
  I assume that fixing this could result in significant changes in behavior (but it's clearly wrong the way it was). So this will need testing.

git-svn-id: http://skyrim-plugin-decoding-project.googlecode.com/svn@1719 bdfc8fb3-84cf-a68a-e902-ed0415cf5604
Merge branch 'master' of https://github.com/TES5Edit/TES5Edit-GoogleCode