diff --git a/.gitignore b/.gitignore index e99af3c34..6e3a5a5be 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ CPackSourceConfig.cmake editor-icons.h oc-icon.h NativeToolsExport.cmake +engine-resource.c # Documentation *.pyc @@ -137,4 +138,4 @@ tests/openclonk_unittest.sln moc_*.cpp qrc_resource.cpp ui_C4ConsoleQt*.h -resource.qrc.depends \ No newline at end of file +resource.qrc.depends diff --git a/CMakeLists.txt b/CMakeLists.txt index fd4176086..dbcc52d28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1347,10 +1347,11 @@ if (APPLE) endif() add_custom_command(TARGET openclonk - POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_bundle_libs" + POST_BUILD COMMAND + "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_bundle_libs" + "$<$:--sysroot=${CMAKE_SYSROOT}>" "$" ) - endif() ############################################################################ diff --git a/cmake/FindFreetype.cmake b/cmake/FindFreetype.cmake index d147b2ca9..95716545c 100644 --- a/cmake/FindFreetype.cmake +++ b/cmake/FindFreetype.cmake @@ -19,11 +19,8 @@ # Use pkg-config if possible instead of doing guesswork like the default CMake module does find_package(PkgConfig QUIET) -if(PKG_CONFIG_FOUND AND NOT APPLE) +if(PKG_CONFIG_FOUND) set(_ft_pkgconfig_args "") - if(FREETYPE_FIND_REQUIRED) - set(_ft_pkgconfig_args "${_ft_pkgconfig_args}REQUIRED ") - endif() if(FREETYPE_FIND_QUIET) set(_ft_pkgconfig_args "${_ft_pkgconfig_args}QUIET ") endif() diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/DefCore.txt b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/DefCore.txt new file mode 100644 index 000000000..f79297a48 --- /dev/null +++ b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/DefCore.txt @@ -0,0 +1,7 @@ +[DefCore] +id=EnvPack_Guidepost2 +Category=C4D_StaticBack +Width=10 +Height=30 +Offset=-5,-15 +StretchGrowth=1 \ No newline at end of file diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Graphics.mesh b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Graphics.mesh new file mode 100644 index 000000000..d1d39bd15 Binary files /dev/null and b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Graphics.mesh differ diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Scene.material b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Scene.material new file mode 100644 index 000000000..3c079248b --- /dev/null +++ b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Scene.material @@ -0,0 +1,28 @@ +material EnvPack_Guidepost2: NormalMap +{ + receive_shadows on + technique + { + pass + { + scene_blend alpha_blend + ambient 1.000000 1.000000 1.000000 1.000000 + diffuse 0.800000 0.799920 0.799920 1.000000 + specular 0.000000 0.000000 0.000000 1.000000 2.250000 + emissive 0.000000 0.000000 0.000000 1.000000 + + texture_unit base + { + texture guidepost2.png + tex_address_mode wrap + filtering trilinear + } + texture_unit normal + { + texture guidepost_normal.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Script.c b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Script.c new file mode 100644 index 000000000..3f5902b12 --- /dev/null +++ b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/Script.c @@ -0,0 +1,8 @@ +/** + @author Nachtfalter +*/ + +protected func Construction() +{ + SetProperty("MeshTransformation", Trans_Mul(Trans_Rotate(RandomX(-180,180),0,10), Trans_Scale(130))); +} \ No newline at end of file diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost2.png b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost2.png new file mode 100644 index 000000000..218f7eee0 Binary files /dev/null and b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost2.png differ diff --git a/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost_normal.png b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost_normal.png new file mode 100644 index 000000000..8ed59a280 Binary files /dev/null and b/planet/Decoration.ocd/Village.ocd/Guidepost2.ocd/guidepost_normal.png differ diff --git a/planet/Objects.ocd/Libraries.ocd/ClonkInventoryControl.ocd/Script.c b/planet/Objects.ocd/Libraries.ocd/ClonkInventoryControl.ocd/Script.c index 433c09296..50b546d85 100644 --- a/planet/Objects.ocd/Libraries.ocd/ClonkInventoryControl.ocd/Script.c +++ b/planet/Objects.ocd/Libraries.ocd/ClonkInventoryControl.ocd/Script.c @@ -362,8 +362,17 @@ private func TryToCollect(object item) var x = item->GetX(); var y = item->GetY(); var name = item->GetName(); - // Try to collect the item. - Collect(item); + + // When pushing a lorry, try to directly collect it into the lorry first. + var vehicle = GetActionTarget(); + if (vehicle && vehicle->~IsContainer() && GetProcedure() == "PUSH") + { + vehicle->Collect(item); + } + + // Otherwise, try to collect the item myself. + if (item && !item->Contained()) + Collect(item); // If anything happened, assume collection. if (!item || item->Contained()) diff --git a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Graphics.mesh b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Graphics.mesh index c2f3d8911..7c12c87d6 100644 Binary files a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Graphics.mesh and b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Graphics.mesh differ diff --git a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Scene.material b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Scene.material index bc37c5145..d868e14f7 100644 --- a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Scene.material +++ b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Scene.material @@ -1,14 +1,21 @@ -material FernGreen +material Sprout { - receive_shadows on - technique - { - pass - { - ambient 0.500000 0.500000 0.500000 1.000000 - diffuse 0.000000 0.400000 0.000000 1.000000 - specular 0.100000 0.100000 0.100000 1.000000 12.500000 - emissive 0.000000 0.000000 0.000000 1.000000 - } - } + receive_shadows on + technique + { + pass + { + ambient 1.0 1.0 1.0 1.0 + diffuse 0.800000011920929 0.800000011920929 0.800000011920929 1.0 + specular 0.5 0.5 0.5 1.0 12.5 + emissive 0.0 0.0 0.0 1.0 + + texture_unit + { + texture Sprout.jpg + tex_address_mode wrap + filtering trilinear + } + } + } } diff --git a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.jpg b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.jpg new file mode 100644 index 000000000..f20f57a93 Binary files /dev/null and b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.jpg differ diff --git a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.skeleton b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.skeleton index 688281620..065cde99b 100644 Binary files a/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.skeleton and b/planet/Objects.ocd/Vegetation.ocd/SproutBerryBush.ocd/Sprout.ocd/Sprout.skeleton differ diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/DefCore.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/DefCore.txt index 6bc49d72b..4a3e620f1 100644 --- a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/DefCore.txt +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/DefCore.txt @@ -2,12 +2,12 @@ id=Tree_Coniferous3_Burned Version=6,0 Category=C4D_StaticBack -Width=38 -Height=100 -Offset=-19,-50 +Width=27 +Height=73 +Offset=-14,-37 Vertices=9 VertexX=0,0,0,0,0,0,0,0,0 -VertexY=53,30,20,10,0,-10,-20,-30,-49 +VertexY=40,25,20,10,0,-10,-20,-25,-36 VertexCNAT=8,16,16,16,16,16,16,16,4 VertexFriction=50,50,25,25,25,25,50,50,50 Mass=80 diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/Graphics.4.png b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/Graphics.4.png index 2347314c4..fbe7c9d7c 100644 Binary files a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/Graphics.4.png and b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous3.ocd/Coniferous3Burned.ocd/Graphics.4.png differ diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/DefCore.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/DefCore.txt new file mode 100644 index 000000000..7de3e5328 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/DefCore.txt @@ -0,0 +1,17 @@ +[DefCore] +id=Tree_Coniferous4_Burned +Version=8,0 +Category=C4D_StaticBack +Width=34 +Height=80 +Offset=-17,-40 +Vertices=9 +VertexX=0,0,0,0,0,0,0,0,0 +VertexY=40,25,20,10,0,-10,-20,-25,-36 +VertexCNAT=8,16,16,16,16,16,16,16,4 +VertexFriction=50,50,25,25,25,25,50,50,50 +Mass=80 +StretchGrowth=1 +Oversize=1 +Float=1 +Rotate=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Graphics.4.png b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Graphics.4.png new file mode 100644 index 000000000..2167f3d87 Binary files /dev/null and b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Graphics.4.png differ diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Script.c new file mode 100644 index 000000000..974c14db2 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/Script.c @@ -0,0 +1,15 @@ +/*-- Yet Another Additional Burned Coniferous Tree --*/ + +#include Library_Plant +#include Library_Tree + +public func IsBurnedTree() +{ + return true; +} + +local Name = "$Name$"; +local Touchable = 0; +local BlastIncinerate = 1; +local ContactIncinerate = 3; +local Components = {Wood = 3}; \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblDE.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblDE.txt new file mode 100644 index 000000000..e5bc526e6 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblDE.txt @@ -0,0 +1 @@ +Name=Verbrannter Nadelbaum diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblUS.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblUS.txt new file mode 100644 index 000000000..718f7b60a --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Coniferous4Burned.ocd/StringTblUS.txt @@ -0,0 +1 @@ +Name=Burned cone tree diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/DefCore.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/DefCore.txt new file mode 100644 index 000000000..650004d13 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/DefCore.txt @@ -0,0 +1,17 @@ +[DefCore] +id=Tree_Coniferous4 +Version=8,0 +Category=C4D_StaticBack +Width=34 +Height=80 +Offset=-17,-40 +Vertices=9 +VertexX=0,0,0,0,0,0,0,0,0 +VertexY=40,25,20,10,0,-10,-20,-25,-36 +VertexCNAT=8,16,16,16,16,16,16,16,4 +VertexFriction=50,50,25,25,25,25,50,50,50 +Mass=100 +StretchGrowth=1 +Oversize=1 +Float=1 +Rotate=1 \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.material b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.material new file mode 100644 index 000000000..2c065ece8 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.material @@ -0,0 +1,26 @@ +material Coniferous4 +{ + receive_shadows on + technique + { + pass + { + cull_hardware none + scene_blend alpha_blend + depth_check on + alpha_rejection greater_equal 128 + + ambient 1.0 1.0 1.0 1.0 + diffuse 1.0 1.0 1.0 1.0 + specular 0.0 0.0 0.0 1.0 12.500000 + emissive 0.0 0.0 0.0 1.0 + + texture_unit + { + texture coniferous4.png + tex_address_mode wrap + filtering trilinear + } + } + } +} diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.mesh b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.mesh new file mode 100644 index 000000000..98f214882 Binary files /dev/null and b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Graphics.mesh differ diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Script.c b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Script.c new file mode 100644 index 000000000..3fe64348b --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/Script.c @@ -0,0 +1,27 @@ +/*-- Yet Another Additional Coniferous Tree --*/ + +#include Library_Plant +#include Library_Tree + +private func SeedChance() { return 500; } +private func SeedArea() { return 400; } +private func SeedAmount() { return 10; } + +local lib_tree_burned = Tree_Coniferous4_Burned; + +public func GetTreetopPosition(pos) +{ + return Shape->Rectangle(-10,-8, 20,10)->GetRandomPoint(pos); +} + +private func Definition(def) +{ + SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(-25000, -8000, 22000), Trans_Rotate(40,0,0,1), Trans_Rotate(-10,1), Trans_Rotate(50,0,1)), def); +} + +local Name = "$Name$"; +local Touchable = 0; +local BlastIncinerate = 2; +local ContactIncinerate = 6; +local NoBurnDecay = 1; +local Components = {Wood = 3}; \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblDE.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblDE.txt new file mode 100644 index 000000000..cda3851e7 --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblDE.txt @@ -0,0 +1 @@ +Name=Nadelbaum \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblUS.txt b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblUS.txt new file mode 100644 index 000000000..e2ec949ce --- /dev/null +++ b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/StringTblUS.txt @@ -0,0 +1 @@ +Name=Cone tree \ No newline at end of file diff --git a/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/coniferous4.png b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/coniferous4.png new file mode 100644 index 000000000..d13a7a00e Binary files /dev/null and b/planet/Objects.ocd/Vegetation.ocd/Trees.ocd/Coniferous4.ocd/coniferous4.png differ diff --git a/tools/osx_bundle_libs b/tools/osx_bundle_libs index 548a48826..0aab727b0 100755 --- a/tools/osx_bundle_libs +++ b/tools/osx_bundle_libs @@ -2,6 +2,29 @@ set -e +_sysroot="${SYSROOT}" + +# Collect options from the command line +for i in "$@"; do + case "$i" in + --sysroot=*) + _sysroot="${i#*=}" + shift + ;; + --) + shift + break + ;; + --*) + echo "$0: Unknown option: $i" >&2 + exit 1 + ;; + *) + break + ;; + esac +done + # Grab information about the bundle from the environment (if XCode) or make # assumptions about the bundle layout (everywhere else) _executable_path="${EXECUTABLE_PATH:-$1}" @@ -22,9 +45,6 @@ _frameworks_folder_path="${FRAMEWORKS_FOLDER_PATH:-${_contents_folder}/Framework _otool="${OTOOL:-otool}" _install_name_tool="${INSTALL_NAME_TOOL:-install_name_tool}" -# This regexp should match every lib we want to bundle. -_libs_to_bundle=".*?/lib(jpeg|GLEW|llvm|SDL|SDL_mixer|freetype|ogg|vorbis|vorbisfile|z\.|png[0-9]*|alut)\.[^ ]+\.dylib" - if [ -n "${TARGET_BUILD_DIR}" ]; then cd "${TARGET_BUILD_DIR}" fi @@ -34,15 +54,24 @@ echo "Bundling libraries..." bundle_dependencies() { _object_path="$1" "${_otool}" -L "${_object_path}" | \ - grep -Eo -- "${_libs_to_bundle}" | \ + awk '/^\t+\// { print $1 }' | \ grep -v '@executable_path.*' | \ while read _library_name; do _library_path="${_library_name}" + # If the library isn't available at the stored path, it may be # stored inside the sysroot (when cross-compiling for example) - if [ ! -e "${_library_path}" -a -n "${SYSROOT}" ]; then - _library_path="${SYSROOT}${_library_path}" + if [ ! -e "${_library_path}" -a -n "${_sysroot}" ]; then + _library_path="${_sysroot}${_library_path}" fi + # If the library still isn't available there, there might be a YAML + # stub instead in more recent SDKs; if we find one of those, the + # library is part of the base install and doesn't need to be bundled + _stub_path="${_library_path%.dylib}.tbd" + if [ ! -e "${_library_path}" -a -e "${_stub_path}" ]; then + continue + fi + # Stop bundling if a lib doesn't exist if [ ! -e "${_library_path}" ]; then echo "Cannot find ${_library_name}." >&2