Ver Fonte

implement is_paused

mikymod há 12 anos atrás
pai
commit
dafd4ac728
3 ficheiros alterados com 16 adições e 1 exclusões
  1. 7 1
      engine/Device.cpp
  2. 3 0
      engine/Device.h
  3. 6 0
      engine/os/android/AndroidDevice.cpp

+ 7 - 1
engine/Device.cpp

@@ -169,7 +169,7 @@ bool Device::init(int argc, char** argv)
 	#endif
 
 	g_main_thread.start();
-	g_main_thread.join();
+	// g_main_thread.join();
 
 	return true;
 }
@@ -351,6 +351,12 @@ bool Device::is_init() const
 	return m_is_init;
 }
 
+//-----------------------------------------------------------------------------
+bool Device::is_paused() const
+{
+	return m_is_paused;
+}
+
 //-----------------------------------------------------------------------------
 Filesystem* Device::filesystem()
 {

+ 3 - 0
engine/Device.h

@@ -77,6 +77,9 @@ public:
 	/// Returns whether the engine is correctly initialized
 	bool					is_init() const;
 
+	/// Returns wheter the engine is paused
+	bool 					is_paused() const;
+
 	/// Return the number of frames rendered from the first
 	/// call to Device::start()
 	uint64_t				frame_count() const;

+ 6 - 0
engine/os/android/AndroidDevice.cpp

@@ -75,6 +75,12 @@ extern "C" JNIEXPORT bool JNICALL Java_crown_android_CrownLib_isDeviceRunning(JN
 	return device()->is_running();
 }
 
+//-----------------------------------------------------------------------------
+extern "C" JNIEXPORT bool JNICALL Java_crown_android_CrownLib_isDevicePaused(JNIEnv* /*env*/, jobject /*obj*/)
+{
+	return device()->is_paused();
+}
+
 //-----------------------------------------------------------------------------
 extern "C" JNIEXPORT void JNICALL Java_crown_android_CrownLib_frame(JNIEnv* /*env*/, jobject /*obj*/)
 {