Parcourir la source

Fix build on Android

Daniele Bartolini il y a 12 ans
Parent
commit
df50d86c65
2 fichiers modifiés avec 37 ajouts et 23 suppressions
  1. 12 0
      engine/Android.mk
  2. 25 23
      engine/Device.cpp

+ 12 - 0
engine/Android.mk

@@ -58,6 +58,7 @@ LOCAL_SRC_FILES :=\
 	core/mem/LinearAllocator.cpp\
 	core/mem/ProxyAllocator.cpp\
 	core/mem/StackAllocator.cpp\
+	core/mem/PoolAllocator.cpp\
 	core/mem/Memory.cpp\
 \
 	core/settings/FloatSetting.cpp\
@@ -103,11 +104,22 @@ LOCAL_SRC_FILES :=\
 	lua/LuaFloatSetting.cpp\
 	lua/LuaStringSetting.cpp\
 	lua/LuaResourcePackage.cpp\
+	lua/LuaUnit.cpp\
+	lua/LuaCamera.cpp\
+	lua/LuaWorld.cpp\
+	lua/LuaMesh.cpp\
+	lua/LuaSprite.cpp\
 \
 	audio/sles/SLESRenderer.cpp\
 \
 	Camera.cpp\
 	Device.cpp\
+	Mesh.cpp\
+	RenderWorld.cpp\
+	SceneGraph.cpp\
+	Sprite.cpp\
+	Unit.cpp\
+	World.cpp\
 \
 
 LOCAL_C_INCLUDES	:=\

+ 25 - 23
engine/Device.cpp

@@ -474,33 +474,35 @@ void Device::compile(const char* , const char* , const char* )
 //-----------------------------------------------------------------------------
 void Device::reload(const char* type, const char* name)
 {
-	TempAllocator4096 temp;
-	DynamicString filename(temp);
-	filename += name;
-	filename += '.';
-	filename += type;
-
-	if (!m_bundle_compiler->compile(m_bundle_dir, m_source_dir, filename.c_str()))
-	{
-		Log::d("Compilation failed.");
-		return;
-	}
-
-	uint32_t type_hash = hash::murmur2_32(type, string::strlen(type), 0);
-
-	switch (type_hash)
-	{
-		case LUA_TYPE:
+	#if defined(LINUX) || defined(WINDOWS)
+		TempAllocator4096 temp;
+		DynamicString filename(temp);
+		filename += name;
+		filename += '.';
+		filename += type;
+
+		if (!m_bundle_compiler->compile(m_bundle_dir, m_source_dir, filename.c_str()))
 		{
-			m_lua_environment->load_and_execute(name);
-			break;
+			Log::d("Compilation failed.");
+			return;
 		}
-		default:
+
+		uint32_t type_hash = hash::murmur2_32(type, string::strlen(type), 0);
+
+		switch (type_hash)
 		{
-			CE_ASSERT(false, "Oops, unknown resource type: %s", type);
-			break;
+			case LUA_TYPE:
+			{
+				m_lua_environment->load_and_execute(name);
+				break;
+			}
+			default:
+			{
+				CE_ASSERT(false, "Oops, unknown resource type: %s", type);
+				break;
+			}
 		}
-	}
+	#endif
 }
 //-------------------------------------------------------------------------
 void Device::read_engine_settings()