Make pascal engine link to hwengine-future and use WFC generator transitional_engine
authorunC0Rr
Wed, 28 Aug 2024 17:16:23 +0200
branchtransitional_engine
changeset 16052 0fd23fc57947
parent 16051 2003b466b279
child 16053 3402b2185698
Make pascal engine link to hwengine-future and use WFC generator
CMakeLists.txt
hedgewars/CMakeLists.txt
hedgewars/uLandUtils.pas
rust/landgen/src/wavefront_collapse/generator.rs
rust/lib-hwengine-future/Cargo.toml
--- a/CMakeLists.txt	Wed Aug 28 15:34:49 2024 +0200
+++ b/CMakeLists.txt	Wed Aug 28 17:16:23 2024 +0200
@@ -268,7 +268,7 @@
 
 #rust libraries
 add_subdirectory(tools/corrosion)
-corrosion_import_crate(MANIFEST_PATH rust/lib-hedgewars-engine/Cargo.toml)
+corrosion_import_crate(MANIFEST_PATH rust/lib-hwengine-future/Cargo.toml)
 
 
 #maybe this could be merged inside hedgewars/CMakeLists.txt
--- a/hedgewars/CMakeLists.txt	Wed Aug 28 15:34:49 2024 +0200
+++ b/hedgewars/CMakeLists.txt	Wed Aug 28 17:16:23 2024 +0200
@@ -189,7 +189,6 @@
 
 list(APPEND HW_LINK_LIBS physlayer)
 
-
 #opengl 2
 IF(GL2)
     add_definitions(-dGL2)
@@ -246,6 +245,6 @@
 endif()
 
 #even though not actually used, this will trigger relink if any lib changes
-target_link_libraries(hwengine ${HW_LINK_LIBS})
+target_link_libraries(hwengine ${HW_LINK_LIBS} hwengine_future)
 
 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}" DESTINATION ${destination_dir})
--- a/hedgewars/uLandUtils.pas	Wed Aug 28 15:34:49 2024 +0200
+++ b/hedgewars/uLandUtils.pas	Wed Aug 28 17:16:23 2024 +0200
@@ -20,6 +20,8 @@
 implementation
 uses uUtils, uConsts, uVariables, uTypes;
 
+{$linklib hwengine_future}
+
 function  create_empty_game_field(width, height: Longword): pointer; cdecl; external;
 procedure get_game_field_parameters(game_field: pointer; var width: LongInt; var height: LongInt; var play_width: LongInt; var play_height: LongInt); cdecl; external;
 procedure dispose_game_field(game_field: pointer); cdecl; external;
--- a/rust/landgen/src/wavefront_collapse/generator.rs	Wed Aug 28 15:34:49 2024 +0200
+++ b/rust/landgen/src/wavefront_collapse/generator.rs	Wed Aug 28 17:16:23 2024 +0200
@@ -162,6 +162,8 @@
         for tile_description in self.template.tiles.iter() {
             if let Ok(mut tiles) = Self::load_image_tiles(parameters, tile_description) {
                 result.append(&mut tiles);
+            } else {
+                eprintln!("Failed to load a tile!");
             }
         }
 
--- a/rust/lib-hwengine-future/Cargo.toml	Wed Aug 28 15:34:49 2024 +0200
+++ b/rust/lib-hwengine-future/Cargo.toml	Wed Aug 28 17:16:23 2024 +0200
@@ -15,4 +15,4 @@
 
 [lib]
 name = "hwengine_future"
-crate-type = ["staticlib"]
+crate-type = ["cdylib"]