Unix build fixes

This commit is contained in:
Magnus Norddahl 2020-01-06 08:07:52 +01:00
parent 31c7a86758
commit 20f5f01b84
9 changed files with 2254 additions and 2218 deletions

View file

@ -5,4 +5,4 @@ builder:
msbuild -p:Configuration=Debug BuilderMono.sln
native:
g++ -O2 --shared -g3 -o Build/libBuilderNative.so -fPIC -I Source/Native Source/Native/*.cpp Source/Native/gl_load/*.c -lX11 -ldl
g++ -std=c++14 -O2 --shared -g3 -o Build/libBuilderNative.so -fPIC -I Source/Native Source/Native/*.cpp Source/Native/OpenGL/*.cpp Source/Native/OpenGL/gl_load/*.c -lX11 -ldl

File diff suppressed because it is too large Load diff

View file

@ -49,7 +49,7 @@ namespace CodeImp.DoomBuilder.Controls
internal ScriptIconsManager Icons { get; private set; }
internal ScriptResourceDocumentTab OpenResource(ScriptResource resource) { return null; }
internal ScriptResourcesControl ScriptResourcesControl { get; private set; }
//internal ScriptResourcesControl ScriptResourcesControl { get; private set; }
public void DisplayStatus(ScriptStatusType type, string message) { }
public void ShowError(TextResourceErrorItem error) { }

View file

@ -35,7 +35,11 @@ void SetError(const char* fmt, ...)
va_list va;
va_start(va, fmt);
mSetErrorBuffer[0] = 0;
#ifdef WIN32
_vsnprintf(mSetErrorBuffer, sizeof(mSetErrorBuffer) - 1, fmt, va);
#else
vsnprintf(mSetErrorBuffer, sizeof(mSetErrorBuffer) - 1, fmt, va);
#endif
va_end(va);
mSetErrorBuffer[sizeof(mSetErrorBuffer) - 1] = 0;
mLastError = mSetErrorBuffer;

View file

@ -113,6 +113,8 @@ public:
class Backend
{
public:
virtual ~Backend() = default;
static Backend* Get();
virtual RenderDevice* NewRenderDevice(void* disp, void* window) = 0;

View file

@ -329,6 +329,34 @@ std::unique_ptr<IOpenGLContext> IOpenGLContext::Create(void* disp, void* window)
return ctx;
}
#elif defined(__APPLE__)
class OpenGLContext : public IOpenGLContext
{
public:
OpenGLContext(void* window);
~OpenGLContext();
void MakeCurrent() override { }
void ClearCurrent() override { }
void SwapBuffers() override { }
bool IsCurrent() override { return false; }
int GetWidth() const override { return 320; }
int GetHeight() const override { return 200; }
bool IsValid() const { return false; }
private:
};
std::unique_ptr<IOpenGLContext> IOpenGLContext::Create(void* disp, void* window)
{
auto ctx = std::make_unique<OpenGLContext>(window);
if (!ctx->IsValid()) return nullptr;
return ctx;
}
#else
#include <X11/Xlib.h>

View file

@ -39,6 +39,12 @@
#define M_PI 3.14159265358979323846
#endif
#ifdef WIN32
#define FORCEINLINE __forceinline
#else
#define FORCEINLINE
#endif
// This uses a sine table with linear interpolation
// For in-game calculations this is precise enough
// and this code is more than 10x faster than the
@ -51,7 +57,7 @@ struct FFastTrig
static const int REMAINDER = (1 << BITSHIFT) - 1;
float sinetable[2049];
__forceinline double sinq1(uint32_t bangle)
FORCEINLINE double sinq1(uint32_t bangle)
{
unsigned int index = bangle >> BITSHIFT;

File diff suppressed because it is too large Load diff

View file

@ -159,7 +159,6 @@
<EmbeddedResource Include="Resources\Gauge.png" />
<Content Include="Resources\Gauge_large.ico" />
<None Include="Resources\Heatmap_pal.png" />
<EmbeddedResource Include="Resources\vpo.dll" />
<None Include="Resources\Solidsegs_pal.png" />
<None Include="Resources\Openings_pal.png" />
<None Include="Resources\Visplanes_pal.png" />