1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

Working on installer, fixing more Win32 issues

Throwing error on member references with ".." cascade token outside invocations (ie: "ts..mA = 123")
Fixed 'Thread.ModuleTLSIndex' error - which caused us TLS lookup failures in Beef DLLs
Fixed some hotswap errors
Made BeefPerf shut down properly
Fixed an 'int literal' FixIntUnknown issue where rhs was System.Object which caused an illegal boxing
Fixed COFF::LocateSymbol issues with Win32 and also with linking to static libraries - showed up with hot-linking in fmod when hot-adding a floating point mod
Fixed a couple memory leaks
Fixed alignment issue in COFF::ParseCompileUnit
This commit is contained in:
Brian Fiete 2019-09-02 17:39:47 -07:00
parent aad0a640c5
commit b63a243fd7
73 changed files with 2474 additions and 293 deletions

View file

@ -11,6 +11,7 @@ using Beefy.utils;
using Beefy.res;
using Beefy.geom;
using System.Threading;
using Beefy.sound;
#if MONOTOUCH
using MonoTouch;
#endif
@ -61,6 +62,7 @@ namespace Beefy
public bool mStarted;
public ResourceManager mResourceManager ~ delete _;
public SoundManager mSoundManager = new SoundManager() ~ delete _;
public int32 mFPSDrawCount;
public int32 mFPSUpdateCount;
@ -124,6 +126,9 @@ namespace Beefy
[StdCall, CLink]
public static extern void BFApp_RehupMouse();
[StdCall, CLink]
public static extern void* BFApp_GetSoundManager();
UpdateDelegate mUpdateDelegate ~ delete _;
DrawDelegate mDrawDelegate ~ delete _;
@ -467,6 +472,8 @@ namespace Beefy
#endif
BFApp_Init();
mSoundManager.[Friend]mNativeSoundManager = BFApp_GetSoundManager();
Interlocked.Fence();
mInstallDir = new String(BFApp_GetInstallDir());

View file

@ -107,9 +107,7 @@ namespace Beefy.gfx
mClipDisposeProxy.mDisposeProxyDelegate = new => PopClip;
mRenderStateDisposeProxy = new DisposeProxy();
String filePath = scope String();
filePath.Append(BFApp.sApp.mInstallDir, "images/whiteDot.tga");
mWhiteDot = Image.LoadFromFile(filePath);
mWhiteDot = Image.LoadFromFile("!white");
for (int32 i = 0; i < MATIX_STACK_SIZE; i++)
mMatrixStack[i] = Matrix.IdentityMatrix;

View file

@ -4,8 +4,8 @@ using System.Text;
namespace Beefy.res
{
public class SoundGameObject
/*public class SoundGameObject
{
public void* mWwiseObject;
}
}*/
}

View file

@ -0,0 +1,43 @@
using System;
namespace Beefy.sound
{
struct SoundInstance
{
[StdCall, CLink]
public static extern void* BFSoundInstance_Play(void* nativeSoundInstance, bool looping, bool autoRelease);
[StdCall, CLink]
public static extern void BFSoundInstance_Release(void* nativeSoundInstance);
[StdCall, CLink]
public static extern bool BFSoundInstance_IsPlaying(void* nativeSoundInstance);
void* mNativeSoundInstance;
public this(void* nativeSoundInstance)
{
mNativeSoundInstance = nativeSoundInstance;
}
public void Dispose() mut
{
BFSoundInstance_Release(mNativeSoundInstance);
mNativeSoundInstance = null;
}
public void Play(bool looping = false, bool autoRelease = false)
{
if (mNativeSoundInstance == null)
return;
BFSoundInstance_Play(mNativeSoundInstance, looping, autoRelease);
}
public bool IsPlaying()
{
if (mNativeSoundInstance == null)
return false;
return BFSoundInstance_IsPlaying(mNativeSoundInstance);
}
}
}

View file

@ -0,0 +1,43 @@
using System;
namespace Beefy.sound
{
struct SoundSource : int32
{
public bool IsInvalid
{
get
{
return this == (.)-1;
}
}
}
class SoundManager
{
void* mNativeSoundManager;
[StdCall, CLink]
public static extern int32 BFSoundManager_LoadSound(void* nativeSoundManager, char8* fileName);
[StdCall, CLink]
public static extern void* BFSoundManager_GetSoundInstance(void* nativeSoundManager, int32 sfxId);
public SoundSource LoadSound(StringView fileName)
{
return (.)BFSoundManager_LoadSound(mNativeSoundManager, fileName.ToScopeCStr!());
}
public SoundInstance GetSoundInstance(SoundSource soundSource)
{
void* nativeSoundInstance = BFSoundManager_GetSoundInstance(mNativeSoundManager, (.)soundSource);
return .(nativeSoundInstance);
}
public void PlaySound(SoundSource soundSource)
{
let soundInstance = GetSoundInstance(soundSource);
soundInstance.Play(false, true);
}
}
}

View file

@ -15,7 +15,7 @@ namespace Beefy.widgets
{
if ((mMouseOver && mMouseDown) && (mDownImage != null))
g.Draw(mDownImage);
if ((mMouseOver) && (mOverImage != null))
else if ((mMouseOver) && (mOverImage != null))
g.Draw(mOverImage);
else
g.Draw(mImage);

View file

@ -9,8 +9,9 @@ namespace Beefy.widgets
public class LabelWidget : Widget
{
public Font mFont;
public String mLabel;
public String mLabel ~ delete _;
public uint32 mColor = Color.White;
public FontAlign mAlign = .Left;
public override void Draw(Graphics g)
{
@ -18,7 +19,12 @@ namespace Beefy.widgets
g.SetFont(mFont);
using (g.PushColor(mColor))
g.DrawString(mLabel, 0, 0);
g.DrawString(mLabel, 0, 0, mAlign, mWidth);
}
public float CalcWidth()
{
return mFont.GetWidth(mLabel);
}
}
}

View file

@ -102,7 +102,7 @@ namespace Beefy.widgets
{
if ((value.a == 1) && (value.b == 0) && (value.c == 0) && (value.d == 1))
{
mTransformData = null;
DeleteAndNullify!(mTransformData);
mX = value.tx;
mY = value.ty;
}
@ -142,6 +142,11 @@ namespace Beefy.widgets
mOnDeleted(this);
}
public void ClearTransform()
{
DeleteAndNullify!(mTransformData);
}
public void MarkDirty()
{
if (mWidgetWindow != null)

View file

@ -428,7 +428,15 @@ namespace Beefy.widgets
{
var result = mOnHitTest(x, y);
if (result != HitTestResult.NotHandled)
{
if (result != .Client)
{
if (mHasMouseInside)
MouseLeave();
}
return result;
}
}
if (mWindowFlags.HasFlag(Flags.Resizable))
@ -445,7 +453,7 @@ namespace Beefy.widgets
if (!mHasMouseInside)
return;
Widget aWidget = mRootWidget.FindWidgetByCoords(mMouseX, mMouseY);
Widget aWidget = mRootWidget.FindWidgetByCoords(mMouseX, mMouseY);
if (mCaptureWidget != null)
{
bool didSomething = false;