about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2012-06-10 12:14:41 +0200
committeroy <Tom_Adams@web.de>2013-02-24 17:35:51 +0100
commitb7e5bb54ad77545ae139115a1a64f9ebb7160006 (patch)
tree020e1c8f563e63a7753274a2f2a49d63e3722a94 /src/engine
parent1a62770a5691157f83061eedd2e3ce7d3fa33f62 (diff)
downloadzcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.tar.gz
zcatch-b7e5bb54ad77545ae139115a1a64f9ebb7160006.zip
fixed semaphore on macosx
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/backend_sdl.h10
-rw-r--r--src/engine/client/client.h2
-rw-r--r--src/engine/client/graphics.cpp14
3 files changed, 24 insertions, 2 deletions
diff --git a/src/engine/client/backend_sdl.h b/src/engine/client/backend_sdl.h
index 305453f2..2ef04a1f 100644
--- a/src/engine/client/backend_sdl.h
+++ b/src/engine/client/backend_sdl.h
@@ -30,6 +30,16 @@
 
 	#include <AGL/agl.h>
 
+	class semaphore
+	{
+		SDL_sem *sem;
+	public:
+		semaphore() { sem = SDL_CreateSemaphore(0); }
+		~semaphore() { SDL_DestroySemaphore(sem); }
+		void wait() { SDL_SemWait(sem); }
+		void signal() { SDL_SemPost(sem); }
+	};
+
 	struct SGLContext
 	{
 		AGLContext m_Context;
diff --git a/src/engine/client/client.h b/src/engine/client/client.h
index d958b49a..87e2bc70 100644
--- a/src/engine/client/client.h
+++ b/src/engine/client/client.h
@@ -175,8 +175,6 @@ class CClient : public IClient, public CDemoPlayer::IListner
 		class CHostLookup m_VersionServeraddr;
 	} m_VersionInfo;
 
-	semaphore m_GfxRenderSemaphore;
-	semaphore m_GfxStateSemaphore;
 	volatile int m_GfxState;
 	static void GraphicsThreadProxy(void *pThis) { ((CClient*)pThis)->GraphicsThread(); }
 	void GraphicsThread();
diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp
index bf432356..8816e1ed 100644
--- a/src/engine/client/graphics.cpp
+++ b/src/engine/client/graphics.cpp
@@ -22,6 +22,20 @@
 #include "graphics.h"
 
 
+#if defined(CONF_PLATFORM_MACOSX)
+
+	class semaphore
+	{
+		SDL_sem *sem;
+	public:
+		semaphore() { sem = SDL_CreateSemaphore(0); }
+		~semaphore() { SDL_DestroySemaphore(sem); }
+		void wait() { SDL_SemWait(sem); }
+		void signal() { SDL_SemPost(sem); }
+	};
+#endif
+
+
 static CVideoMode g_aFakeModes[] = {
 	{320,240,8,8,8}, {400,300,8,8,8}, {640,480,8,8,8},
 	{720,400,8,8,8}, {768,576,8,8,8}, {800,600,8,8,8},