Bladeren bron

Fixed some tooltips, added Link Dependencies, more int-ness

Brian Fiete 5 jaren geleden
bovenliggende
commit
d0e8332150

+ 1 - 7
Beef.sln

@@ -99,7 +99,6 @@ Global
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Debug|x64.ActiveCfg = Debug|x64
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Debug|x64.Build.0 = Debug|x64
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Debug|x86.ActiveCfg = Debug|Win32
-		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Debug|x86.Build.0 = Debug|Win32
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Release Static CStatic|x64.ActiveCfg = Release_NoDbgInfo|x64
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Release Static CStatic|x86.ActiveCfg = Release_NoDbgInfo|Win32
 		{F8D29C38-D37C-4AF2-8540-2F6E543264F1}.Release Static CStatic|x86.Build.0 = Release_NoDbgInfo|Win32
@@ -198,7 +197,6 @@ Global
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Debug|x64.ActiveCfg = Debug|x64
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Debug|x64.Build.0 = Debug|x64
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Debug|x86.ActiveCfg = Debug|Win32
-		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Debug|x86.Build.0 = Debug|Win32
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Release Static CStatic|x64.ActiveCfg = Release_dll|x64
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Release Static CStatic|x86.ActiveCfg = Release_dll|Win32
 		{53609BB3-D874-465C-AF7B-DF626DB0D89B}.Release Static CStatic|x86.Build.0 = Release_dll|Win32
@@ -231,7 +229,6 @@ Global
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Debug|x64.ActiveCfg = Debug|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Debug|x64.Build.0 = Debug|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Debug|x86.ActiveCfg = Debug|Win32
-		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Debug|x86.Build.0 = Debug|Win32
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Release Static CStatic|x64.ActiveCfg = Release|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Release Static CStatic|x86.ActiveCfg = Release|Win32
 		{29025CF2-07CC-4C25-A672-6324C95AA28E}.Release Static CStatic|x86.Build.0 = Release|Win32
@@ -266,7 +263,6 @@ Global
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Debug|x64.ActiveCfg = Debug|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Debug|x64.Build.0 = Debug|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Debug|x86.ActiveCfg = Debug|Win32
-		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Debug|x86.Build.0 = Debug|Win32
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Release Static CStatic|x64.ActiveCfg = Release|x64
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Release Static CStatic|x86.ActiveCfg = Release|Win32
 		{29025CF2-07CC-4C25-A672-6324C95AA28F}.Release Static CStatic|x86.Build.0 = Release|Win32
@@ -301,7 +297,6 @@ Global
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Debug|x64.ActiveCfg = Debug|x64
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Debug|x64.Build.0 = Debug|x64
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Debug|x86.ActiveCfg = Debug|Win32
-		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Debug|x86.Build.0 = Debug|Win32
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Release Static CStatic|x64.ActiveCfg = Release|x64
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Release Static CStatic|x86.ActiveCfg = Release|Win32
 		{78BE2825-EF6A-4C57-B22D-FF69EB925359}.Release Static CStatic|x86.Build.0 = Release|Win32
@@ -336,7 +331,6 @@ Global
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Debug|x64.ActiveCfg = Debug|x64
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Debug|x64.Build.0 = Debug|x64
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Debug|x86.ActiveCfg = Debug|Win32
-		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Debug|x86.Build.0 = Debug|Win32
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Release Static CStatic|x64.ActiveCfg = Release|x64
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Release Static CStatic|x86.ActiveCfg = Release|Win32
 		{755663F3-7C3F-4321-ABFF-CB036C0F2C9F}.Release Static CStatic|x86.Build.0 = Release|Win32
@@ -396,7 +390,7 @@ Global
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		VD_Solution = <?xml version="1.0" encoding="utf-16"?>|§r|§n<DocumentsSolution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">|§r|§n  <m_persistedPinnedDocumentGroupLabels>|§r|§n    <string>X86</string>|§r|§n  </m_persistedPinnedDocumentGroupLabels>|§r|§n</DocumentsSolution>
 		SolutionGuid = {460361DC-9F40-4AE7-B647-82D5D69B70DC}
+		VD_Solution = <?xml version="1.0" encoding="utf-16"?>|§r|§n<DocumentsSolution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">|§r|§n  <m_persistedPinnedDocumentGroupLabels>|§r|§n    <string>X86</string>|§r|§n  </m_persistedPinnedDocumentGroupLabels>|§r|§n</DocumentsSolution>
 	EndGlobalSection
 EndGlobal

+ 2 - 3
BeefLibs/Beefy2D/BeefProj.toml

@@ -5,9 +5,9 @@ Name = "Beefy2D"
 DefaultNamespace = ""
 
 [Configs.Debug.Win32]
-OtherLinkFlags = ""
+OtherLinkFlags = "$(LinkFlags) \"$(ProjectDir)/dist/BeefySysLib32_d.lib\""
+PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/BeefySysLib32_d.dll\")", "CopyToDependents(\"$(ProjectDir)/dist/BeefySysLib32_d.pdb\")"]
 PreprocessorMacros = ["DEBUG", "BF32"]
-OptimizationLevel = "O0"
 
 [Configs.Debug.Win64]
 OtherLinkFlags = "$(LinkFlags) \"$(ProjectDir)/dist/BeefySysLib64_d.lib\""
@@ -18,7 +18,6 @@ PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/BeefySysLib64_d.dll\")",
 [Configs.Release.Win32]
 OtherLinkFlags = ""
 PreprocessorMacros = ["RELEASE", "BF32"]
-OptimizationLevel = "O0"
 
 [Configs.Release.Win64]
 OtherLinkFlags = "$(LinkFlags) $(ProjectDir)/dist/BeefySysLib64.lib"

+ 8 - 3
BeefLibs/Beefy2D/src/BFWindow.bf

@@ -490,15 +490,20 @@ namespace Beefy
             BFWindow_SetMinimumSize(mNativeWindow, minWidth, minHeight, clientSized);
         }
 
-        public virtual void Moved()
-        {            
-            BFWindow_GetPosition(mNativeWindow, out mX, out mY, out mWindowWidth, out mWindowHeight, out mClientX, out mClientY, out mClientWidth, out mClientHeight);
+		public virtual void RehupSize()
+		{
+			BFWindow_GetPosition(mNativeWindow, out mX, out mY, out mWindowWidth, out mWindowHeight, out mClientX, out mClientY, out mClientWidth, out mClientHeight);
 
 			int32 showKind = 0;
 			BFWindow_GetPlacement(mNativeWindow, out mNormX, out mNormY, out mNormWidth, out mNormHeight, out showKind);
 			mShowKind = (.)showKind;
 
 			mIsDirty = true;
+		}
+
+        public virtual void Moved()
+        {            
+            RehupSize();
         }
 
         public virtual void SetClientPosition(float x, float y)

+ 1 - 1
BeefLibs/Beefy2D/src/Utils.bf

@@ -181,7 +181,7 @@ namespace Beefy
 				Thread.Sleep(20);
 			}
 
-			int fileLen = sr.Length;
+			int fileLen = (.)sr.Length;
 			if (sr.TryRead(.((.)outBuffer.PrepareBuffer(fileLen), fileLen)) case .Err(let readErr))
 				return .Err(.FileReadError(readErr));
 

+ 2 - 2
BeefLibs/Beefy2D/src/theme/dark/DarkTabbedView.bf

@@ -721,10 +721,10 @@ namespace Beefy.theme.dark
                         TabButton foundTab = FindWidgetByCoords(x, y) as TabButton;
                         if ((foundTab != null) && (foundTab != dockable))
                         {
-                            int32 foundIndex = mTabs.IndexOf(foundTab);
+                            int foundIndex = mTabs.IndexOf(foundTab);
                             if (foundIndex != -1)
                             {
-                                int32 dragIndex = mTabs.IndexOf((TabButton)dockable);
+                                int dragIndex = mTabs.IndexOf((TabButton)dockable);
 
                                 mTabs[dragIndex] = mTabs[foundIndex];
                                 mTabs[foundIndex] = (TabButton)dockable;

+ 10 - 3
BeefLibs/Beefy2D/src/utils/StructuredData.bf

@@ -1409,8 +1409,7 @@ namespace Beefy.utils
 				{
 					bool forceAllInline = namedValues is InlineNamedValues;
 
-					//bool needsHeader = false;
-					if ((!outStr.IsEmpty) || (nameStack.Count > 0))
+					/*if ((!outStr.IsEmpty) || (nameStack.Count > 0))
 					{
 						int valueIdx = namedValues.mValueIdx;
 
@@ -1432,7 +1431,9 @@ namespace Beefy.utils
 
 						if (needsHeader)
 							EncodeHeader();
-					}	
+					}*/
+
+					bool needsHeader = ((!outStr.IsEmpty) || (nameStack.Count > 0));
 						
 					for (int pass = 0; pass < 2; pass++)
 					{
@@ -1484,6 +1485,12 @@ namespace Beefy.utils
 
 							if (doValuesInline && isInlinePass)
 							{
+								if (needsHeader)
+								{
+									EncodeHeader();
+									needsHeader = false;
+								}
+
 								EncodeName(key);
 								outStr.Append(" = ");
 								EncodeObject(value);

+ 4 - 4
BeefLibs/Beefy2D/src/widgets/Composition.bf

@@ -59,7 +59,7 @@ namespace Beefy.widgets
             entry.mFrame = frame;
             entry.mValue = value;
 
-            int32 index = mEntries.BinarySearch(entry, sEntryComparer);
+            int index = mEntries.BinarySearch(entry, sEntryComparer);
             if (index >= 0)
             {
                 isNewKeyframe = false;
@@ -80,7 +80,7 @@ namespace Beefy.widgets
             entry.mFrame = frame;
             entry.mValue = default(T);
 
-            int32 index = mEntries.BinarySearch(entry, sEntryComparer);
+            int index = mEntries.BinarySearch(entry, sEntryComparer);
             mEntries.RemoveAt(index);
         }
 
@@ -112,7 +112,7 @@ namespace Beefy.widgets
             Entry find;
             find.mValue = default(T);
             find.mFrame = frame;
-            int32 index = mEntries.BinarySearch(find, sEntryComparer);
+            int index = mEntries.BinarySearch(find, sEntryComparer);
             if (index >= 0)
                 return mEntries[index].mValue;
 
@@ -589,7 +589,7 @@ namespace Beefy.widgets
 
                             if (childInst.mItemDef.mFollowingItemDef != null)
                             {
-                                int32 followingIdx = mItemDef.mChildItemDefs.IndexOf(childInst.mItemDef.mFollowingItemDef);
+                                int followingIdx = mItemDef.mChildItemDefs.IndexOf(childInst.mItemDef.mFollowingItemDef);
                                 data.Add("Follow", followingIdx);
                             }
 

+ 1 - 1
BeefLibs/Beefy2D/src/widgets/DockingFrame.bf

@@ -266,7 +266,7 @@ namespace Beefy.widgets
         // Used when an embedded docking frame gets down to just a single widget
         public virtual void ReplaceDockedWidget(DockedWidget dockedWidget, DockedWidget replaceWidget)
         {
-            int32 index = mDockedWidgets.IndexOf(dockedWidget);
+            int index = mDockedWidgets.IndexOf(dockedWidget);
             RemoveWidget(dockedWidget);
             mDockedWidgets[index] = replaceWidget;
             AddWidget(replaceWidget);

+ 4 - 4
BeefLibs/Beefy2D/src/widgets/ListView.bf

@@ -487,7 +487,7 @@ namespace Beefy.widgets
             return CreateChildItemAtIndex((mChildItems != null) ? mChildItems.Count : 0);
         }
 
-        public int32 GetIndexOfChild(ListViewItem item)
+        public int GetIndexOfChild(ListViewItem item)
         {
             return mChildItems.IndexOf(item);
         }
@@ -508,7 +508,7 @@ namespace Beefy.widgets
 
         public virtual void RemoveChildItem(ListViewItem item, bool deleteItem = true)
         {
-            int32 idx = mChildItems.IndexOf(item);
+            int idx = mChildItems.IndexOf(item);
             RemoveChildItemAt(idx, deleteItem);
         }
 
@@ -899,7 +899,7 @@ namespace Beefy.widgets
                     for (int32 i = 0; i < numIterations; i++)
                         KeyDown(KeyCode.Down, false);
                 case KeyCode.Up:
-					int32 idx = selectedItem.mParentItem.mChildItems.IndexOf(selectedItem);
+					int idx = selectedItem.mParentItem.mChildItems.IndexOf(selectedItem);
 					if (idx > 0)
 					{
 					    newSelection = selectedItem.mParentItem.mChildItems[idx - 1];
@@ -919,7 +919,7 @@ namespace Beefy.widgets
                         while (selectedItem != mRoot)
                         {
                             var childItems = selectedItem.mParentItem.mChildItems;
-                            int32 idx = childItems.IndexOf(selectedItem);
+                            int idx = childItems.IndexOf(selectedItem);
                             if (idx < childItems.Count - 1)
                             {
                                 newSelection = childItems[idx + 1];

+ 4 - 0
BeefLibs/Beefy2D/src/widgets/Widget.bf

@@ -424,6 +424,8 @@ namespace Beefy.widgets
                     Widget child = mChildWidgets[anIdx];                
                     Debug.Assert(child.mParent == this);
 
+					int startDepth = g.mMatrixStackIdx;
+
                     if (child.mTransformData != null)
                     {                        
                         Matrix m = child.Transform;
@@ -437,6 +439,8 @@ namespace Beefy.widgets
                     child.DrawAll(g);
 
                     g.PopMatrix();
+
+					Debug.Assert(startDepth == g.mMatrixStackIdx);
                 }
             }
 

+ 54 - 41
BeefLibs/Beefy2D/src/widgets/WidgetWindow.bf

@@ -108,7 +108,7 @@ namespace Beefy.widgets
 	            mRootWidget.mWidgetWindow = this;
 	            mRootWidget.InitChildren();
 	            mRootWidget.AddedToParent();
-	            Moved(); // Rehup size
+				RehupSize();
 			}
         }
 
@@ -192,52 +192,58 @@ namespace Beefy.widgets
         {
             base.PreDraw(g);
 
-            g.mMatrix.Set(mScaleMatrix);            
+            g.mMatrix.Set(mScaleMatrix);
+			g.mMatrixStack[g.mMatrixStackIdx] = g.mMatrix;
         }
 
+		public override void RehupSize()
+		{
+			base.RehupSize();
+
+			if (mWindowFlags.HasFlag(Flags.ScaleContent))
+			{
+			    float scaleX = mClientWidth / (float)mContentClientWidth;
+			    float scaleY = mClientHeight / (float)mContentClientHeight;
+
+			    if (scaleX > scaleY)
+			    {
+			        float scale = scaleY;
+			        mScaleMatrix.a = scale;
+			        mScaleMatrix.b = 0;
+			        mScaleMatrix.c = 0;
+			        mScaleMatrix.d = scale;
+			        mScaleMatrix.tx = (int32)(mClientWidth - (scale * mContentClientWidth)) / 2;
+			        mScaleMatrix.ty = 0;
+			    }
+			    else
+			    {
+			        float scale = scaleX;
+			        mScaleMatrix.a = scale;
+			        mScaleMatrix.b = 0;
+			        mScaleMatrix.c = 0;
+			        mScaleMatrix.d = scale;
+			        mScaleMatrix.tx = 0;
+			        mScaleMatrix.ty = (int32)(mClientHeight - (scale * mContentClientHeight)) / 2;
+			    }
+
+			    mInvScaleMatrix.Set(mScaleMatrix);
+			    mInvScaleMatrix.Invert();
+			    mRootWidget.Resize(0, 0, mContentClientWidth, mContentClientHeight);
+			}
+			else
+			{
+			    mInvScaleMatrix = Matrix.IdentityMatrix;
+			    mScaleMatrix = Matrix.IdentityMatrix;
+			    mContentClientWidth = mClientWidth;
+			    mContentClientHeight = mClientHeight;
+			    mRootWidget.Resize(0, 0, mClientWidth, mClientHeight);
+			}
+		}
+
         public override void Moved()
         {
             base.Moved();
 
-            if (mWindowFlags.HasFlag(Flags.ScaleContent))
-            {
-                float scaleX = mClientWidth / (float)mContentClientWidth;
-                float scaleY = mClientHeight / (float)mContentClientHeight;
-
-                if (scaleX > scaleY)
-                {
-                    float scale = scaleY;
-                    mScaleMatrix.a = scale;
-                    mScaleMatrix.b = 0;
-                    mScaleMatrix.c = 0;
-                    mScaleMatrix.d = scale;
-                    mScaleMatrix.tx = (int32)(mClientWidth - (scale * mContentClientWidth)) / 2;
-                    mScaleMatrix.ty = 0;
-                }
-                else
-                {
-                    float scale = scaleX;
-                    mScaleMatrix.a = scale;
-                    mScaleMatrix.b = 0;
-                    mScaleMatrix.c = 0;
-                    mScaleMatrix.d = scale;
-                    mScaleMatrix.tx = 0;
-                    mScaleMatrix.ty = (int32)(mClientHeight - (scale * mContentClientHeight)) / 2;
-                }
-
-                mInvScaleMatrix.Set(mScaleMatrix);
-                mInvScaleMatrix.Invert();
-                mRootWidget.Resize(0, 0, mContentClientWidth, mContentClientHeight);
-            }
-            else
-            {
-                mInvScaleMatrix = Matrix.IdentityMatrix;
-                mScaleMatrix = Matrix.IdentityMatrix;
-                mContentClientWidth = mClientWidth;
-                mContentClientHeight = mClientHeight;
-                mRootWidget.Resize(0, 0, mClientWidth, mClientHeight);
-            }            
-
             mOnWindowMoved(this);
             sOnWindowMoved(this);
         }
@@ -755,5 +761,12 @@ namespace Beefy.widgets
 			newMouseWindow.CaptureMouse();
 			mMouseFlags = default;
 		}
+		
+		public void SetContentSize(int width, int height)
+		{
+			mContentClientWidth = (.)width;
+			mContentClientHeight = (.)height;
+			RehupSize();
+		}
     }
 }

+ 9 - 9
BeefLibs/corlib/src/Collections/Generic/List.bf

@@ -418,36 +418,36 @@ namespace System.Collections.Generic
 			return Enumerator(this);
 		}
 
-		public int_cosize FindIndex(Predicate<T> match)
+		public int FindIndex(Predicate<T> match)
 		{
-			for (int_cosize i = 0; i < mSize; i++)
+			for (int i = 0; i < mSize; i++)
 				if (match(mItems[i]))
 					return i;
 			return -1;
 		}
 
-		public int_cosize IndexOf(T item)
+		public int IndexOf(T item)
 		{
 			//return Array.IndexOf(mItems, item, 0, mSize);
 			for (int i = 0; i < mSize; i++)
 				if (mItems[i] == item)
-					return (int_cosize)i;
+					return i;
 			return -1;
 		}
 
-		public int_cosize IndexOf(T item, int index)
+		public int IndexOf(T item, int index)
 		{
 			for (int i = index; i < mSize; i++)
 				if (mItems[i] == item)
-					return (int_cosize)i;
+					return i;
 			return -1;
 		}
 
-		public int_cosize IndexOf(T item, int index, int count)
+		public int IndexOf(T item, int index, int count)
 		{
 			for (int i = index; i < index + count; i++)
 				if (mItems[i] == item)
-					return (int_cosize)i;
+					return i;
 			return -1;
 		}
 
@@ -571,7 +571,7 @@ namespace System.Collections.Generic
 
 		public bool Remove(T item)
 		{
-			int_cosize index = IndexOf(item);
+			int index = IndexOf(item);
 			if (index >= 0)
 			{
 				RemoveAt(index);

+ 21 - 2
BeefLibs/corlib/src/Event.bf

@@ -26,7 +26,26 @@ namespace System
 			}
 		}
 
-		public int32 Count
+		public bool IsEmpty
+		{
+			get
+			{
+				Object data = Internal.UnsafeCastToObject((void*)(mData & sDataMask));
+
+				if (data == null)
+					return true;
+
+				var type = data.GetType();
+				if (type == typeof(List<T>))
+				{
+					var list = (List<T>)data;
+					return list.Count == 0;
+				}
+				return false;
+			}
+		}
+
+		public int Count
 		{
 			get
 			{
@@ -39,7 +58,7 @@ namespace System
 				if (type == typeof(List<T>))
 				{
 					var list = (List<T>)data;
-					return (int32)list.Count;
+					return list.Count;
 				}
 				return 1;
 			}

+ 4 - 2
BeefLibs/corlib/src/Reflection/MethodInfo.bf

@@ -80,8 +80,10 @@ namespace System.Reflection
 			var retType = Type.GetType(mMethodData.mReturnType);
 
 			FFIABI abi = .Default;
-#if BF_PLATFORM_WINDOWS
-			if (mMethodData.mFlags.HasFlag(.StdCall))
+#if BF_PLATFORM_WINDOWS && BF_32_BIT
+			if (mMethodData.mFlags.HasFlag(.ThisCall))
+				abi = .ThisCall;
+			else if (!mMethodData.mFlags.HasFlag(.Static))
 				abi = .StdCall;
 #endif
 

+ 8 - 0
BeefLibs/corlib/src/Result.bf

@@ -110,6 +110,14 @@ namespace System
 			}
 		}
 
+		public T Value
+		{
+			get
+			{
+				return Unwrap();
+			}
+		}
+
 		public static implicit operator Result<T, TErr>(T value)
 		{
 		    return .Ok(value);

+ 1 - 0
BeefLibs/corlib/src/Type.bf

@@ -902,6 +902,7 @@ namespace System.Reflection
 		SpecialName         	=  0x0800,     // Method is special.  Name describes how.
 		StdCall					=  0x1000,
 		FastCall				=  0x2000,
+		ThisCall				=  0x3000, // Purposely resuing StdCall|FastCall
 		Mutating				=  0x4000
 	}
 }

+ 1 - 1
BeefLibs/corlib/src/Windows.bf

@@ -1373,7 +1373,7 @@ namespace System
 		[CLink, StdCall]
 		public static extern HWnd GetActiveWindow();
 
-		[CLink, StdCall]
+		[Import("user32.lib"), CLink, StdCall]
 		public static extern HWnd SetActiveWindow(HWnd wnd);
 
 		[CLink, StdCall]

+ 4 - 3
BeefySysLib/BeefySysLib.vcxproj

@@ -184,13 +184,14 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>BFP_NOEXPORT;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;BFSYSLIB_DYNAMIC;BF_NO_FBX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>./;./platform/win/;./platform/sdl/;third_party/agg-2.4/include;third_party/agg-2.4/include/platform/win32;third_party/;third_party/libffi/i686-pc-cygwin;third_party/libffi/i686-pc-cygwin/include;third_party/libffi/include;third_party/SDL2-2.0.1/include;../extern/fbxsdk/include</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>BP_DYNAMIC;BFP_NOEXPORT;WIN32;_DEBUG;_WINDOWS;_USRDLL;BFSYSLIB_DYNAMIC;BF_NO_FBX;FT2_BUILD_LIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>./;./platform/win/;./platform/sdl/;third_party/agg-2.4/include;third_party/agg-2.4/include/platform/win32;third_party/;third_party/libffi/i686-pc-cygwin;third_party/libffi/i686-pc-cygwin/include;third_party/libffi/include;third_party/SDL2-2.0.1/include;../extern/fbxsdk/include;third_party/freetype/include</AdditionalIncludeDirectories>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <SupportJustMyCode>false</SupportJustMyCode>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <GenerateDebugInformation>DebugFull</GenerateDebugInformation>
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
       <AdditionalLibraryDirectories>../extern/fbxsdk/lib/vs2012/x86/debug</AdditionalLibraryDirectories>
       <AdditionalDependencies>imm32.lib;version.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>

+ 4 - 4
BeefySysLib/BeefySysLib_static.vcxproj

@@ -99,9 +99,9 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;BFSYSLIB_DYNAMIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>./;./platform/win/;./platform/sdl/;third_party/agg-2.4/include;third_party/agg-2.4/include/platform/win32;third_party/;third_party/libffi/i686-pc-cygwin;third_party/libffi/i686-pc-cygwin/include;third_party/libffi/include;third_party/SDL2-2.0.1/include;../extern/fbxsdk/include</AdditionalIncludeDirectories>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PreprocessorDefinitions>BFP_INTERNAL;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;BF_NO_FBX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>./;./platform/win/;./platform/sdl/;third_party/agg-2.4/include;third_party/agg-2.4/include/platform/win32;third_party/;third_party/libffi/i686-pc-cygwin;third_party/libffi/i686-pc-cygwin/include;third_party/libffi/include;third_party/SDL2-2.0.1/include;../extern/fbxsdk/include;third_party/freetype/include</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -141,7 +141,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;BFSYSLIB_DYNAMIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <AdditionalIncludeDirectories>./; ./platform/win/; ./platform/sdl/; third_party/agg-2.4/include; third_party/agg-2.4/include/platform/win32; third_party/; third_party/libffi/i686-pc-cygwin; third_party/libffi/i686-pc-cygwin/include; third_party/libffi/include; third_party/SDL2-2.0.1/include;;../extern/fbxsdk/include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>

+ 2 - 2
IDE/BeefProj.toml

@@ -25,7 +25,7 @@ OtherLinkFlags = ""
 TargetDirectory = "$(WorkspaceDir)/dist"
 TargetName = "BeefIDE_d"
 OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
-DebugCommandArguments = "-workspace=C:\\Beef\\IDEHelper\\Tests"
+DebugCommandArguments = "-workspace=C:\\Proj\\CycloBuddy"
 DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
 EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
 
@@ -49,7 +49,7 @@ OtherLinkFlags = ""
 TargetDirectory = "$(WorkspaceDir)/dist"
 TargetName = "BeefIDE_d2"
 OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib"
-DebugCommandArguments = "-proddir=C:\\Beef\\IDE\\mintest"
+DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
 DebugWorkingDirectory = "$(ProjectDir)\\dist"
 EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
 

+ 1 - 1
IDE/mintest/mintest2/src/main4.bf

@@ -1,2 +1,2 @@
 using System;
-
+using System.Diagnostics;

+ 1 - 1
IDE/mintest/src/main.bf

@@ -229,7 +229,7 @@ namespace Hey.Dude.Bro
 
 			PrintF("Hey\n");
 
-			Test2(1, 2, 3, 4);
+			//Test2(1, 2, 3, 4);
 
 			/*IHashable ih = (int32)TypeCode.Boolean;
 			let hashCode = ih.GetHashCode();*/

+ 1 - 331
IDE/mintest/src/main3.bf

@@ -6,342 +6,12 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Threading;
 
-//#define A
-//#define B
-
-struct StructA
-{
-	public int mA;
-
-	public static StructA operator+(StructA lhs, float rhs)
-	{
-		StructA newVal = .();
-		newVal.mA = lhs.mA + (int)rhs;
-		return newVal;
-	}
-}
-
-struct StructB
-{
-	public int mA;
-
-	public static bool operator==(StructA lhs, StructB rhs)
-	{
-		return lhs.mA == rhs.mA;
-	}
-}
-
-
-struct StructC
-{
-	public int mA;
-
-	public static operator StructD(StructC val)
-	{
-		StructD conv;
-		conv.mA = val.mA;
-		return conv;
-	}
-}
-
-struct StructD
-{
-	public int mA;
-
-	public static operator StructD(StructC val)
-	{
-		StructC conv;
-		conv.mA = val.mA;
-		return conv;
-	}
-}
-
-struct StructE
-{
-	public int mA;
-
-	public static operator StructD(StructE val)
-	{
-		StructC conv;
-		conv.mA = val.mA;
-		return conv;
-	}
-}
-
-class ClassA
-{
-	public int mA;
-}
-
-struct StructK
-{
-
-}
-
-struct StructL : StructK
-{
-	public int mA;
-}
-
-struct Checker
-{
-	public static int CheckIt(int* iPtr, int len)
-	{
-		int acc = 0;
-		for (int i < len)
-		{
-			acc += iPtr[i];
-		}
-		return acc;
-	}
-
-	public static int CheckItSpan(int* iPtr, int len)
-	{
-		Span<int> span = .(iPtr, len);
-
-		int acc = 0;
-		for (int i < len)
-		{
-			acc += span[i];
-		}
-		return acc;
-	}
-
-	public static int CheckItSpanOpt(int* iPtr, int len)
-	{
-		OptSpan<int> span = .(iPtr, len);
-
-		int acc = 0;
-		for (int i < len)
-		{
-			acc += span[i];
-		}
-		return acc;
-	}
-}
-
 struct Blurg
 {
-	static int GetHash<T>(T val) where T : IHashable
-	{
-		return val.GetHashCode();
-	}
-
-	public static int32 LongCall(
-		int abcdefghijklmnopqrstuvwxyz0,
-		int abcdefghijklmnopqrstuvwxyz1,
-		int abcdefghijklmnopqrstuvwxyz2,
-		int abcdefghijklmnopqrstuvwxyz3,
-		int abcdefghijklmnopqrstuvwxyz4,
-		int abcdefghijklmnopqrstuvwxyz5,
-		int abcdefghijklmnopqrstuvwxyz6,
-		int abcdefghijklmnopqrstuvwxyz7,
-		int abcdefghijklmnopqrstuvwxyz8,
-		int abcdefghijklmnopqrstuvwxyz9
-		)
-	{
-		return 0;
-	}
-
-	static mixin ScopedAlloc(int size, int align)
-	{
-		//(void*)scope:mixin [Align(align)] uint8[size]* { ? }
-	}
-
-	public static void TestAlloc()
-	{
-		int i = 1;
-		if (i == 1)
-		{
-			int size = 128;
-			scope:: int[size]*;
-		}
-	}
-
-	struct StructA
-	{
-		public int[10] mA;
-
-		public this()
-		{
-			mA = default;
-			void* v = &this;
-		}
-	}
-
-	enum EnumA
-	{
-		case None;
-		case A(StructA sa);
-	}
-
-	enum EnumB
-	{
-		case A;
-		case B(int a, int b);
-	}
-
-	/*[DisableChecks]
-	public static float GetSum<TCount>(float[TCount] vals) where TCount : const int
-	{
-		float total = 0;
-		for (int i < vals.Count)
-			total += vals[i];
-		return total;
-	}
-
-	public static void Max<T, TFunc>(T lhs, T rhs, TFunc func) where TFunc : delegate int(T lhs, T rhs)
-	{
-
-	}*/
-
-	public struct Base
-	{
-		int32 mA;
-		int64 mB;
-	}
-
-	public struct Derived : Base
-	{
-		int8 mC;
-
-		public int GetC()
-		{
-			return mC + 10000;
-		}
-	}
-
-	//static int[] gArr = new .(1, 2, 3, 4, 5, );
-
-	[Checked]
-	public static int32 GetVal()
-	{
-		return 1;
-	}
-
-	[Unchecked]
-	public static int32 GetVal()
-	{
-		return 2;
-	}
-
-	public static int32 GetVal2()
-	{
-		return 3;
-	}
-
-	
-	public static void Test()
-	{
-		//Test_Start
-		Derived dr = .();
-		dr.GetC();
-		Int iVal = (.)123;
-
-		int q = 999;
-
-		//Test_End
-	}
-
-	public static void Test2(int aa, int bb, int cc)
-	{
-		//Test_Start
-		Derived dr2 = .();
-		Int iVal2 = (.)123;
-
-		int q2 = 999;
-
-		String str = scope .();
-
-		//Test_End
-	}
-
-	public static void Recurse(int a)
-	{
-		int b = 234;
-		//Recurse_C
-		int c = 345;
-
-		if (a == 10)
-			return;
-
-		Recurse(a + 1);
-		int d = 100 + a;
-	}
-
-	public static void Test3()
-	{
-		//BreakpointTester_Test
-		int a = 0;
-		int b = 0;
-
-		while (a < 20)
-		{
-			//BreakpointTester_LoopA
-			a++;
-		}
-
-		//BreakpointTester_Recurse
-		Recurse(0);
-	}
-
-	public static void Test4()
-	{
-		//Test_Start
-		Derived dr = .();
-		Int iVal = (.)123;
-
-		int q = 999;
-
-		//Test_End
-	}
-
-	//[DisableObjectAccessChecks]
-	public static void Hey2()
-	{
-		String str = "Hey";
-		    //int len = str.[Friend, DisableObjectAccessChecks]PrivateLength;
-		int len = str.[DisableObjectAccessChecks]Length;
-		 //int len = str.[Friend]GetLength();
-	}				   
-
-	public static mixin Florf(int a, int b)
-	{
-
-	}
-
-	class Zangles
-	{
-		public static int GetMe()
-		{
-			return 99;
-		}
-	}
-
-	public static int sA = 123;
-
-	/*public static void Test<T>(T val)
-	{
-
-	}*/
-
-	public static void Test<T, T2>(T val) where T : Span<T2>
-	{
-
-	}
-
 	public static int32 Hey()
 	{
-		Span<uint8> valSpan = .();
-		StringView sv = "Hey";
-
-		Span<char8> span = sv;
-
-		Test(sv);
-
+		
 		return (int32)123;
 	}
-
 }
 
-

+ 12 - 1
IDE/src/BuildContext.bf

@@ -764,8 +764,17 @@ namespace IDE
 
 				String cacheStr = scope String();
 
-				void AddBuildFileDependency(StringView filePath)
+				void AddBuildFileDependency(StringView filePath, bool resolveString = false)
 				{
+					var filePath;
+
+					if ((resolveString) && (filePath.Contains('$')))
+					{
+						String resolvedFilePath = scope:: String();
+						gApp.ResolveConfigString(gApp.mPlatformName, workspaceOptions, project, options, filePath, "link flags", resolvedFilePath);
+						filePath = resolvedFilePath;
+					}
+
 					int64 fileTime = 0;
 					if (!filePath.IsEmpty)
 						fileTime = File.GetLastWriteTime(filePath).GetValueOrDefault().ToFileTime();
@@ -783,6 +792,8 @@ namespace IDE
 				cacheStr.AppendF("Copyright\t{}\n", project.mWindowsOptions.mCopyright);
 				cacheStr.AppendF("FileVersion\t{}\n", project.mWindowsOptions.mFileVersion);
 				cacheStr.AppendF("ProductVersion\t{}\n", project.mWindowsOptions.mProductVersion);
+				for (var linkDep in options.mBuildOptions.mLinkDependencies)
+					AddBuildFileDependency(linkDep, true);
 
 				String prevCacheStr = scope .();
 				gApp.mBfBuildCompiler.GetBuildValue(projectBuildDir, "Link", prevCacheStr);

+ 2 - 2
IDE/src/IDEApp.bf

@@ -5798,7 +5798,7 @@ namespace IDE
             return sourceViewPanel;            
         }
 
-		int32 GetRecentFilesIdx(String filePath)
+		int GetRecentFilesIdx(String filePath)
 		{
 			return mRecentlyDisplayedFiles.FindIndex(scope (item) => Path.Equals(item, filePath));
 		}
@@ -6006,7 +6006,7 @@ namespace IDE
             if (tabbedView == null)
                 return;
 
-			int32 recentFileIdx = -1;
+			int recentFileIdx = -1;
             if (sourceViewPanel != null)
             {
                 sourceViewPanel.Dispose();

+ 5 - 0
IDE/src/Project.bf

@@ -1012,6 +1012,8 @@ namespace IDE
 			[Reflect]
 			public BuildCommandTrigger mBuildCommandsOnRun = .Always;
 			[Reflect]
+			public List<String> mLinkDependencies = new List<String>() ~ DeleteContainerAndItems!(_);
+			[Reflect]
 			public List<String> mPreBuildCmds = new List<String>() ~ DeleteContainerAndItems!(_);
 			[Reflect]
 			public List<String> mPostBuildCmds = new List<String>() ~ DeleteContainerAndItems!(_);
@@ -1130,6 +1132,7 @@ namespace IDE
 				Set!(newOptions.mBuildOptions.mTargetName, mBuildOptions.mTargetName);
 				Set!(newOptions.mBuildOptions.mOtherLinkFlags, mBuildOptions.mOtherLinkFlags);
 				Set!(newOptions.mBuildOptions.mCLibType, mBuildOptions.mCLibType);
+				Set!(newOptions.mBuildOptions.mLinkDependencies, mBuildOptions.mLinkDependencies);
 				Set!(newOptions.mBuildOptions.mPreBuildCmds, mBuildOptions.mPreBuildCmds);
 				Set!(newOptions.mBuildOptions.mPostBuildCmds, mBuildOptions.mPostBuildCmds);
 
@@ -1518,6 +1521,7 @@ namespace IDE
 								data.ConditionalAdd("StackSize", options.mBuildOptions.mStackSize, 0);
 								data.ConditionalAdd("BuildCommandsOnCompile", options.mBuildOptions.mBuildCommandsOnCompile, .Always);
 								data.ConditionalAdd("BuildCommandsOnRun", options.mBuildOptions.mBuildCommandsOnRun, .Always);
+								WriteStrings("LinkDependencies", options.mBuildOptions.mLinkDependencies);
 								WriteStrings("PreBuildCmds", options.mBuildOptions.mPreBuildCmds);
 								WriteStrings("PostBuildCmds", options.mBuildOptions.mPostBuildCmds);
 								
@@ -1839,6 +1843,7 @@ namespace IDE
 					options.mBuildOptions.mStackSize = data.GetInt("StackSize");
 					options.mBuildOptions.mBuildCommandsOnCompile = data.GetEnum<BuildCommandTrigger>("BuildCommandsOnCompile", .Always);
 					options.mBuildOptions.mBuildCommandsOnRun = data.GetEnum<BuildCommandTrigger>("BuildCommandsOnRun", .Always);
+					ReadStrings("LinkDependencies", options.mBuildOptions.mLinkDependencies);
 					ReadStrings("PreBuildCmds", options.mBuildOptions.mPreBuildCmds);
 					ReadStrings("PostBuildCmds", options.mBuildOptions.mPostBuildCmds);
 					

+ 1 - 0
IDE/src/ui/DisassemblyPanel.bf

@@ -585,6 +585,7 @@ namespace IDE.ui
 				case 'H':
 					{
 						mSourceHash = SourceHash.Create(.(line, 2));
+						addLineData = false;
 					}
 	            case 'T':
 	                {

+ 2 - 1
IDE/src/ui/ProjectProperties.bf

@@ -680,6 +680,7 @@ namespace IDE.ui
 		    (listViewItem, propEntry) = AddPropertiesItem(root, "C Library", "mBuildOptions.mCLibType");
 			(listViewItem, propEntry) = AddPropertiesItem(root, "Beef Library", "mBuildOptions.mBeefLibType");
 			(listViewItem, propEntry) = AddPropertiesItem(root, "Stack Size", "mBuildOptions.mStackSize");
+			(listViewItem, propEntry) = AddPropertiesItem(root, "Link Dependencies", "mBuildOptions.mLinkDependencies");
 			(listViewItem, propEntry) = AddPropertiesItem(root, "Prebuild Commands", "mBuildOptions.mPreBuildCmds");
 			(listViewItem, propEntry) = AddPropertiesItem(root, "Postbuild Commands", "mBuildOptions.mPostBuildCmds");
 			(listViewItem, propEntry) = AddPropertiesItem(root, "Build Commands on Compile", "mBuildOptions.mBuildCommandsOnCompile");
@@ -752,7 +753,7 @@ namespace IDE.ui
 						}
 						else
 						{
-							int32 idx = mProject.mDependencies.FindIndex(scope (dep) => dep.mProjectName == listViewItem.mLabel);
+							int idx = mProject.mDependencies.FindIndex(scope (dep) => dep.mProjectName == listViewItem.mLabel);
 							if (idx != -1)
 							{
 								delete mProject.mDependencies[idx];

+ 8 - 1
IDE/src/ui/ThreadPanel.bf

@@ -133,6 +133,13 @@ namespace IDE.ui
 				PopupCallStackPanel();
 			}
 		}
+
+		public override bool WantsTooltip(float mouseX, float mouseY)
+		{
+			if ((mColumnIdx == 2) && (mouseX >= mListView.mParent.mWidth - LabelX - GS!(34)))
+				return false;
+			return base.WantsTooltip(mouseX, mouseY);
+		}
 	}
 
 	public class ThreadListView : DarkListView
@@ -357,7 +364,7 @@ namespace IDE.ui
                 }
 
 #unwarn
-                int32 selectedIdx = mListView.GetRoot().GetIndexOfChild(item);
+                int selectedIdx = mListView.GetRoot().GetIndexOfChild(item);
 
                 int32 threadId = int32.Parse(item.mLabel);
                 gApp.mDebugger.SetActiveThread(threadId);                

+ 2 - 2
IDE/src/ui/WatchPanel.bf

@@ -1718,7 +1718,7 @@ namespace IDE.ui
                         CompactChildExpression(source, compactEvalStr);
 
                         var rootItem = mListView.GetRoot();
-                        int32 idx = rootItem.mChildItems.IndexOf(target);
+                        int idx = rootItem.mChildItems.IndexOf(target);
                         if (theEvent.mDragTargetDir > 0)
                             idx += theEvent.mDragTargetDir;
                         var listViewItem = (WatchListViewItem)rootItem.CreateChildItemAtIndex(idx);
@@ -2864,7 +2864,7 @@ namespace IDE.ui
 				var selectedItem = selectedItems[itemIdx];
 			    if ((selectedItem != null) && (selectedItem.mLabel.Length > 0) && (selectedItem.mParentItem == root))
 			    {
-			        int32 idx = root.mChildItems.IndexOf(selectedItem);
+			        int idx = root.mChildItems.IndexOf(selectedItem);
 			        root.RemoveChildItem(selectedItem);
 			        if (idx < root.mChildItems.Count)
 			            root.SelectItemExclusively(root.mChildItems[idx]);