Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BeefLibs/corlib/src/Reflection/MethodInfo.bf
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ namespace System.Reflection
void* retData = variantData;

// Struct return? Manually add it as an arg after 'this'. Revisit this - this is architecture-dependent.
#unwarn // unused in aarch64
int unusedRetVal;
FFIType* ffiRetType = null;
if (retType.IsStruct)
Expand Down Expand Up @@ -954,6 +955,7 @@ namespace System.Reflection
void* retData = variantData;

// Struct return? Manually add it as an arg after 'this'. Revisit this - this is architecture-dependent.
#unwarn // unused in aarch64
int unusedRetVal;
FFIType* ffiRetType = null;
if (retType.IsStruct)
Expand Down
1 change: 1 addition & 0 deletions BeefTools/ImgCreate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ if (${WIN32})
)
elseif (${APPLE})
include_directories(
../../BeefySysLib/platform/osx
../../BeefySysLib/platform/darwin
)
file(GLOB SRC_FILES_OS
Expand Down
11 changes: 3 additions & 8 deletions BeefySysLib/platform/linux/LinuxCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,9 @@ class InotifyFileWatchManager : public FileWatchManager

};


FileWatchManager* FileWatchManager::Get()
FileWatchManager* FileWatchManager::Allocate()
{
if (gFileWatchManager == NULL)
{
gFileWatchManager = new InotifyFileWatchManager();
gFileWatchManager->Init();
}
return gFileWatchManager;
return new InotifyFileWatchManager();
}

#endif // BFP_HAS_FILEWATCHER
16 changes: 14 additions & 2 deletions BeefySysLib/platform/posix/PosixCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class FileWatchManager
virtual void Shutdown() = 0;
virtual BfpFileWatcher* WatchDirectory(const char* path, BfpDirectoryChangeFunc callback, BfpFileWatcherFlags flags, void* userData, BfpFileResult* outResult) = 0;
virtual void Remove(BfpFileWatcher* watcher) = 0;
static FileWatchManager* Allocate();

static FileWatchManager* Get();
};

Expand All @@ -117,16 +119,26 @@ class NullFilewatchManager : public FileWatchManager
};

#ifndef BFP_HAS_FILEWATCHER
FileWatchManager* FileWatchManager::Allocate()
{
return new NullFilewatchManager();
}
#endif

FileWatchManager* FileWatchManager::Get()
{
if (gFileWatchManager == NULL)
{
gFileWatchManager = new NullFilewatchManager();
auto fileWatcher = FileWatchManager::Allocate();
if (auto prevValue = __sync_val_compare_and_swap(&gFileWatchManager, NULL, fileWatcher))
{
delete fileWatcher;
return prevValue;
}
gFileWatchManager->Init();
}
return gFileWatchManager;
}
#endif

BfpTimeStamp BfpToTimeStamp(const timespec& ts)
{
Expand Down
23 changes: 8 additions & 15 deletions BeefySysLib/platform/sdl/SdlBFApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,24 @@ struct AdjustedMonRect

static int bfMouseBtnOf[4] = {0, 0, 2, 1}; // Translate SDL mouse buttons to what Beef expects.

static HMODULE gSDLModule;
static HMODULE gSDLImageModule;
static BfpDynLib* gSDLModule;

static HMODULE GetSDLModule(const StringImpl& installDir)
static BfpDynLib* GetSDLModule(const StringImpl& installDir)
{
if (gSDLModule == NULL)
{
#if defined (BF_PLATFORM_WINDOWS)
String loadPath = installDir + "SDL3.dll";
gSDLModule = ::LoadLibraryA(loadPath.c_str());
#elif defined (BF_PLATFORM_LINUX)
String loadPath = "libSDL3.so";
gSDLModule = dlopen(loadPath.c_str(), RTLD_LAZY);
String path = "SDL3";
#ifdef BF_PLATFORM_WINDOWS
path.Insert(0, installDir);
#endif
gSDLModule = BfpDynLib_Load(path.c_str());
if (gSDLModule == NULL)
{
#ifdef BF_PLATFORM_WINDOWS
::MessageBoxA(NULL, "Failed to load SDL3.dll", "FATAL ERROR", MB_OK | MB_ICONERROR);
::ExitProcess(1);
#endif
BF_FATAL("Failed to load libSDL3.so");
BF_FATAL("Failed to load SDL3");
}
}
return gSDLModule;
Expand All @@ -158,11 +155,7 @@ static HMODULE GetSDLModule(const StringImpl& installDir)
template <typename T>
static void BFGetSDLProc(T& proc, const char* name, const StringImpl& installDir)
{
#if defined (BF_PLATFORM_WINDOWS)
proc = (T)::GetProcAddress(GetSDLModule(installDir), name);
#elif defined (BF_PLATFORM_LINUX)
proc = (T)dlsym(GetSDLModule(installDir), name);
#endif
proc = (T)BfpDynLib_GetProcAddress(GetSDLModule(installDir), name);
}

#define BF_GET_SDLPROC(name) BFGetSDLProc(bf_##name, #name, mInstallDir)
Expand Down
13 changes: 9 additions & 4 deletions IDE/dist/shaders/Std.frag
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#version 150 core

uniform sampler2D tex;
uniform sampler2D tex2;
varying vec4 varying_color;
varying vec2 varying_texCoord0;

in vec4 varying_color;
in vec2 varying_texCoord0;

out vec4 fragColor;

void main()
{
vec4 texColor = texture2D(tex, varying_texCoord0);
gl_FragColor = texColor * varying_color;
vec4 texColor = texture(tex, varying_texCoord0);
fragColor = texColor * varying_color;
}
12 changes: 7 additions & 5 deletions IDE/dist/shaders/Std.vert
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#version 150 core

uniform mat4 screenMatrix;

attribute vec4 position;
attribute vec2 texCoord0;
attribute vec4 color;
in vec4 position;
in vec2 texCoord0;
in vec4 color;

varying vec4 varying_color;
varying vec2 varying_texCoord0;
out vec4 varying_color;
out vec2 varying_texCoord0;

void main()
{
Expand Down
12 changes: 8 additions & 4 deletions IDE/dist/shaders/Std_font.frag
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#version 150 core

uniform sampler2D tex;
uniform sampler2D tex2;
varying vec4 varying_color;
varying vec2 varying_texCoord0;
in vec4 varying_color;
in vec2 varying_texCoord0;

out vec4 fragColor;

void main()
{
vec4 texColor = texture2D(tex, varying_texCoord0);
vec4 texColor = texture(tex, varying_texCoord0);
float gray = varying_color.r * 0.299 + varying_color.g * 0.587 + varying_color.b * 0.114;
float a = mix(texColor.a, texColor.r, gray);
gl_FragColor = vec4(a, a, a, a) * varying_color;
fragColor = vec4(a, a, a, a) * varying_color;
}
12 changes: 7 additions & 5 deletions IDE/dist/shaders/Std_font.vert
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#version 150 core

uniform mat4 screenMatrix;

attribute vec4 position;
attribute vec2 texCoord0;
attribute vec4 color;
in vec4 position;
in vec2 texCoord0;
in vec4 color;

varying vec4 varying_color;
varying vec2 varying_texCoord0;
out vec4 varying_color;
out vec2 varying_texCoord0;

void main()
{
Expand Down
Loading