Răsfoiți Sursa

Merge branch 'master' of github.com:taylor001/crown

Daniele Bartolini 10 ani în urmă
părinte
comite
45b06360df
5 a modificat fișierele cu 79 adăugiri și 34 ștergeri
  1. 2 2
      README.md
  2. 63 30
      genie/crown.lua
  3. 2 0
      genie/genie.lua
  4. 4 2
      genie/toolchain.lua
  5. 8 0
      src/device.cpp

+ 2 - 2
README.md

@@ -5,7 +5,7 @@ Lightweight and flexible cross-platform game engine.
 
 
 It is a general purpose data-driven game engine, written from scratch with a minimalistic and data-oriented design philosophy in mind.
 It is a general purpose data-driven game engine, written from scratch with a minimalistic and data-oriented design philosophy in mind.
 
 
-It is loosely inspired by Bitsquid engine and its design principles; the current Lua API is similar to that of Bitsquid but this engine is *not* meant to be its clone *nor* to be API compatible with it.
+It is loosely inspired by Bitsquid (now Stingray) engine and its design principles; the current Lua API is similar to that of Bitsquid but this engine is *not* meant to be its clone *nor* to be API compatible with it.
 
 
 ##Supported platforms
 ##Supported platforms
 
 
@@ -25,7 +25,7 @@ TCP/IP console with autocomplete and color-coded output highlighting.
 
 
 ##Dependencies
 ##Dependencies
 
 
-PhysX 3.3.x (https://developer.nvidia.com/physx-sdk)
+PhysX 3.3.2+ (https://developer.nvidia.com/physx-sdk)
 
 
 ##Building
 ##Building
 
 

+ 63 - 30
genie/crown.lua

@@ -194,66 +194,99 @@ function crown_project(_name, _kind, _defines)
 				"dl",
 				"dl",
 			}
 			}
 
 
-		configuration { "debug", "linux-*" }
+		configuration { "x32", "debug", "linux-*" }
 			linkoptions {
 			linkoptions {
 				"-rdynamic",
 				"-rdynamic",
 				"-Wl,--start-group $(addprefix -l," ..
 				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelClothCHECKED" ..
-				"	PhysX3CHECKED " ..
-				"	PhysX3CommonCHECKED" ..
+				"	PhysX3CHECKED_x86" ..
+				"	PhysX3CommonCHECKED_x86" ..
+				"	PhysX3CookingCHECKED_x86" ..
+				"	PhysX3CharacterKinematicCHECKED_x86" ..
+				"	PhysX3ExtensionsCHECKED" ..
+				"	PhysX3VehicleCHECKED" ..
+				"	PhysXProfileSDKCHECKED" ..
+				"	PhysXVisualDebuggerSDKCHECKED" ..
 				"	PxTaskCHECKED" ..
 				"	PxTaskCHECKED" ..
-				"	LowLevelCHECKED" ..
-				"	PhysX3CharacterKinematicCHECKED" ..
-				"	PhysX3CookingCHECKED" ..
+				") -Wl,--end-group"
+			}
+
+		configuration { "x64", "debug", "linux-*" }
+			linkoptions {
+				"-rdynamic",
+				"-Wl,--start-group $(addprefix -l," ..
+				"	PhysX3CHECKED_x64" ..
+				"	PhysX3CommonCHECKED_x64" ..
+				"	PhysX3CookingCHECKED_x64" ..
+				"	PhysX3CharacterKinematicCHECKED_x64" ..
 				"	PhysX3ExtensionsCHECKED" ..
 				"	PhysX3ExtensionsCHECKED" ..
 				"	PhysX3VehicleCHECKED" ..
 				"	PhysX3VehicleCHECKED" ..
 				"	PhysXProfileSDKCHECKED" ..
 				"	PhysXProfileSDKCHECKED" ..
 				"	PhysXVisualDebuggerSDKCHECKED" ..
 				"	PhysXVisualDebuggerSDKCHECKED" ..
-				"	PvdRuntimeCHECKED" ..
-				"	SceneQueryCHECKED" ..
-				"	SimulationControllerCHECKED" ..
+				"	PxTaskCHECKED" ..
 				") -Wl,--end-group"
 				") -Wl,--end-group"
 			}
 			}
 
 
-		configuration { "development", "linux-*" }
+		configuration { "x32", "development", "linux-*" }
 			linkoptions
 			linkoptions
 			{
 			{
 				"-rdynamic",
 				"-rdynamic",
 				"-Wl,--start-group $(addprefix -l," ..
 				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelClothPROFILE" ..
-				"	PhysX3PROFILE " ..
-				"	PhysX3CommonPROFILE" ..
+				"	PhysX3PROFILE_x86" ..
+				"	PhysX3CommonPROFILE_x86" ..
+				"	PhysX3CookingPROFILE_x86" ..
+				"	PhysX3CharacterKinematicPROFILE_x86" ..
+				"	PhysX3ExtensionsPROFILE" ..
+				"	PhysX3VehiclePROFILE" ..
+				"	PhysXProfileSDKPROFILE" ..
+				"	PhysXVisualDebuggerSDKPROFILE" ..
 				"	PxTaskPROFILE" ..
 				"	PxTaskPROFILE" ..
-				"	LowLevelPROFILE" ..
-				"	PhysX3CharacterKinematicPROFILE" ..
-				"	PhysX3CookingPROFILE" ..
+				") -Wl,--end-group"
+			}
+
+		configuration { "x64", "development", "linux-*" }
+			linkoptions
+			{
+				"-rdynamic",
+				"-Wl,--start-group $(addprefix -l," ..
+				"	PhysX3PROFILE_x64" ..
+				"	PhysX3CommonPROFILE_x64" ..
+				"	PhysX3CookingPROFILE_x64" ..
+				"	PhysX3CharacterKinematicPROFILE_x64" ..
 				"	PhysX3ExtensionsPROFILE" ..
 				"	PhysX3ExtensionsPROFILE" ..
 				"	PhysX3VehiclePROFILE" ..
 				"	PhysX3VehiclePROFILE" ..
 				"	PhysXProfileSDKPROFILE" ..
 				"	PhysXProfileSDKPROFILE" ..
 				"	PhysXVisualDebuggerSDKPROFILE" ..
 				"	PhysXVisualDebuggerSDKPROFILE" ..
-				"	PvdRuntimePROFILE" ..
-				"	SceneQueryPROFILE" ..
-				"	SimulationControllerPROFILE" ..
+				"	PxTaskPROFILE" ..
 				") -Wl,--end-group"
 				") -Wl,--end-group"
 			}
 			}
 
 
-		configuration { "release", "linux-*" }
+		configuration { "x32", "release", "linux-*" }
 			linkoptions {
 			linkoptions {
 				"-Wl,--start-group $(addprefix -l," ..
 				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelCloth" ..
-				"	PhysX3 " ..
-				"	PhysX3Common" ..
+				"	PhysX3_x86" ..
+				"	PhysX3Common_x86" ..
+				"	PhysX3Cooking_x86" ..
+				"	PhysX3CharacterKinematic_x86" ..
+				"	PhysX3Extensions" ..
+				"	PhysX3Vehicle" ..
+				"	PhysXProfileSDK" ..
+				"	PhysXVisualDebuggerSDK" ..
 				"	PxTask" ..
 				"	PxTask" ..
-				"	LowLevel" ..
-				"	PhysX3CharacterKinematic" ..
-				"	PhysX3Cooking" ..
+				") -Wl,--end-group"
+			}
+
+		configuration { "x64", "release", "linux-*" }
+			linkoptions {
+				"-Wl,--start-group $(addprefix -l," ..
+				"	PhysX3_x64" ..
+				"	PhysX3Common_x64" ..
+				"	PhysX3Cooking_x64" ..
+				"	PhysX3CharacterKinematic_x64" ..
 				"	PhysX3Extensions" ..
 				"	PhysX3Extensions" ..
 				"	PhysX3Vehicle" ..
 				"	PhysX3Vehicle" ..
 				"	PhysXProfileSDK" ..
 				"	PhysXProfileSDK" ..
 				"	PhysXVisualDebuggerSDK" ..
 				"	PhysXVisualDebuggerSDK" ..
-				"	PvdRuntime" ..
-				"	SceneQuery" ..
-				"	SimulationController" ..
+				"	PxTask" ..
 				") -Wl,--end-group"
 				") -Wl,--end-group"
 			}
 			}
 
 

+ 2 - 0
genie/genie.lua

@@ -69,12 +69,14 @@ configuration { "x32", "linux-*" }
 	postbuildcommands {
 	postbuildcommands {
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_DIR .. ".build/linux32/bin",
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x86/luajit " .. CROWN_DIR .. ".build/linux32/bin",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " ..              CROWN_DIR .. ".build/linux32/bin",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " ..              CROWN_DIR .. ".build/linux32/bin",
+		"cp -r " .. "$(PHYSX_SDK_LINUX)/Bin/linux32/libPhysX3* " ..      CROWN_DIR .. ".build/linux32/bin",
 	}
 	}
 
 
 configuration { "x64", "linux-*" }
 configuration { "x64", "linux-*" }
 	postbuildcommands {
 	postbuildcommands {
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_DIR .. ".build/linux64/bin",
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/pre/linux_x64/luajit " .. CROWN_DIR .. ".build/linux64/bin",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " ..              CROWN_DIR .. ".build/linux64/bin",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " ..              CROWN_DIR .. ".build/linux64/bin",
+		"cp -r " .. "$(PHYSX_SDK_LINUX)/Bin/linux64/libPhysX3* " ..      CROWN_DIR .. ".build/linux64/bin",
 	}
 	}
 
 
 configuration { "x32", "vs*" }
 configuration { "x32", "vs*" }

+ 4 - 2
genie/toolchain.lua

@@ -125,7 +125,8 @@ function toolchain(build_dir, lib_dir)
 		objdir (build_dir .. "linux32" .. "/obj")
 		objdir (build_dir .. "linux32" .. "/obj")
 		libdirs {
 		libdirs {
 			lib_dir .. "../.build/linux32/bin",
 			lib_dir .. "../.build/linux32/bin",
-			"$(PHYSX_SDK_LINUX)/Lib/linux32"
+			"$(PHYSX_SDK_LINUX)/Lib/linux32",
+			"$(PHYSX_SDK_LINUX)/Bin/linux32",
 		}
 		}
 		buildoptions {
 		buildoptions {
 			"-m32",
 			"-m32",
@@ -137,7 +138,8 @@ function toolchain(build_dir, lib_dir)
 		objdir (build_dir .. "linux64" .. "/obj")
 		objdir (build_dir .. "linux64" .. "/obj")
 		libdirs {
 		libdirs {
 			lib_dir .. "../.build/linux64/bin",
 			lib_dir .. "../.build/linux64/bin",
-			"$(PHYSX_SDK_LINUX)/Lib/linux64"
+			"$(PHYSX_SDK_LINUX)/Lib/linux64",
+			"$(PHYSX_SDK_LINUX)/Bin/linux64",
 		}
 		}
 		buildoptions {
 		buildoptions {
 			"-m64",
 			"-m64",

+ 8 - 0
src/device.cpp

@@ -205,6 +205,14 @@ void Device::destroy_resource_package(ResourcePackage& package)
 
 
 void Device::reload(StringId64 type, StringId64 name)
 void Device::reload(StringId64 type, StringId64 name)
 {
 {
+	const void* old_resource = _resource_manager->get(type, name);
+	_resource_manager->reload(type, name);
+	const void* new_resource = _resource_manager->get(type, name);
+
+	if (type == SCRIPT_TYPE)
+	{
+		_lua_environment->execute((const LuaResource*)new_resource);
+	}
 }
 }
 
 
 namespace device_globals
 namespace device_globals