Просмотр исходного кода

Merge branch 'master' into encoder

Branimir Karadžić 8 лет назад
Родитель
Сommit
d97023ab85

+ 4 - 2
examples/common/entry/entry_android.cpp

@@ -88,7 +88,7 @@ namespace entry
 		int m_argc;
 		const char* const* m_argv;
 
-		static int32_t threadFunc(void* _userData);
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 	};
 
 	class FileReaderAndroid : public bx::FileReaderI
@@ -550,8 +550,10 @@ namespace entry
 		BX_UNUSED(_handle, _lock);
 	}
 
-	int32_t MainThreadEntry::threadFunc(void* _userData)
+	int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
 	{
+		BX_UNUSED(_thread);
+
 		int32_t result = chdir("/sdcard/bgfx/examples/runtime");
 		BX_CHECK(0 == result, "Failed to chdir to dir. android.permission.WRITE_EXTERNAL_STORAGE?", errno);
 

+ 4 - 2
examples/common/entry/entry_glfw.cpp

@@ -230,7 +230,7 @@ namespace entry
 		int m_argc;
 		const char* const* m_argv;
 
-		static int32_t threadFunc(void* _userData);
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 	};
 
 	enum MsgType
@@ -837,8 +837,10 @@ namespace entry
 		glfwPostEmptyEvent();
 	}
 
-	int32_t MainThreadEntry::threadFunc(void* _userData)
+	int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
 	{
+		BX_UNUSED(_thread);
+
 		MainThreadEntry* self = (MainThreadEntry*)_userData;
 		int32_t result = main(self->m_argc, self->m_argv);
 

+ 8 - 5
examples/common/entry/entry_ios.mm

@@ -29,7 +29,7 @@ namespace entry
 		int m_argc;
 		const char* const* m_argv;
 
-		static int32_t threadFunc(void* _userData);
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 	};
 
 	static WindowHandle s_defaultWindow = { 0 };
@@ -63,19 +63,22 @@ namespace entry
 
 	static Context* s_ctx;
 
-	int32_t MainThreadEntry::threadFunc(void* _userData)
+	int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
 	{
+		BX_UNUSED(_thread);
+
 		CFBundleRef mainBundle = CFBundleGetMainBundle();
-		if ( mainBundle != nil )
+		if (mainBundle != nil)
 		{
 			CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
-			if ( resourcesURL != nil )
+			if (resourcesURL != nil)
 			{
 				char path[PATH_MAX];
-				if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
+				if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8*)path, PATH_MAX) )
 				{
 					chdir(path);
 				}
+
 				CFRelease(resourcesURL);
 			}
 		}

+ 7 - 4
examples/common/entry/entry_osx.mm

@@ -66,19 +66,22 @@ namespace entry
 		int m_argc;
 		const char* const* m_argv;
 
-		static int32_t threadFunc(void* _userData)
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 		{
+			BX_UNUSED(_thread);
+
 			CFBundleRef mainBundle = CFBundleGetMainBundle();
-			if ( mainBundle != nil )
+			if (mainBundle != nil)
 			{
 				CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
-				if ( resourcesURL != nil )
+				if (resourcesURL != nil)
 				{
 					char path[PATH_MAX];
-					if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX) )
+					if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8*)path, PATH_MAX) )
 					{
 						chdir(path);
 					}
+
 					CFRelease(resourcesURL);
 				}
 			}

+ 4 - 2
examples/common/entry/entry_sdl.cpp

@@ -249,7 +249,7 @@ namespace entry
 		int m_argc;
 		char** m_argv;
 
-		static int32_t threadFunc(void* _userData);
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 	};
 
 	///
@@ -1090,8 +1090,10 @@ namespace entry
 		sdlPostEvent(SDL_USER_WINDOW_MOUSE_LOCK, _handle, NULL, _lock);
 	}
 
-	int32_t MainThreadEntry::threadFunc(void* _userData)
+	int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
 	{
+		BX_UNUSED(_thread);
+
 		MainThreadEntry* self = (MainThreadEntry*)_userData;
 		int32_t result = main(self->m_argc, self->m_argv);
 

+ 4 - 2
examples/common/entry/entry_x11.cpp

@@ -223,7 +223,7 @@ namespace entry
 		int32_t m_argc;
 		const char* const* m_argv;
 
-		static int32_t threadFunc(void* _userData);
+		static int32_t threadFunc(bx::Thread* _thread, void* _userData);
 	};
 
 	struct Msg
@@ -679,8 +679,10 @@ namespace entry
 
 	static Context s_ctx;
 
-	int32_t MainThreadEntry::threadFunc(void* _userData)
+	int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
 	{
+		BX_UNUSED(_thread);
+
 		MainThreadEntry* self = (MainThreadEntry*)_userData;
 		int32_t result = main(self->m_argc, self->m_argv);
 		s_ctx.m_exit = true;