Updated Terraman2D. I added back in texture scale calculations. Now the world uses it.

This commit is contained in:
Relintai 2022-02-26 01:51:53 +01:00
parent e60fceb1d9
commit 05255fd86d
3 changed files with 27 additions and 4 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9f743429d4196bc501c982d6ea7e49eb7ce37f22"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "b0efd71c47eed46ebf1785cc729285d4e8ebc08c"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}}
{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9f743429d4196bc501c982d6ea7e49eb7ce37f22"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "26e6a17e248fcbb0d34fcf7812eaa105409e129c"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}}

View File

@ -7,8 +7,6 @@
[node name="Terrain2DWorldBlocky" type="Terrain2DWorldBlocky" groups=["save"]]
library = ExtResource( 2 )
level_generator = ExtResource( 3 )
cell_size_x = 64
cell_size_y = 64
get_custom_transform = Transform2D( 1, 0.5, -1, 0.5, 0, 0 )
build_flags = 127
script = ExtResource( 1 )

View File

@ -64,7 +64,32 @@ func load_character(file_name: String) -> void:
if spawn_mobs:
generate()
func _create_chunk(x, y, chunk):
if !chunk:
chunk = Terrain2DChunkBlocky.new()
if chunk.job_get_count() == 0:
var tj : Terrain2DTerrain2DJob = Terrain2DTerrain2DJob.new()
var lj : Terrain2DLightJob = Terrain2DLightJob.new()
var pj : Terrain2DProp2DJob = Terrain2DProp2DJob.new()
var mesher : Terrain2DMesherBlocky = Terrain2DMesherBlocky.new()
mesher.texture_scale = 8
tj.set_mesher(mesher)
var liquid_mesher : Terrain2DMesherBlocky = Terrain2DMesherBlocky.new()
liquid_mesher.set_channel_index_type(Terrain2DChunkDefault.DEFAULT_CHANNEL_LIQUID_TYPE)
tj.set_liquid_mesher(liquid_mesher)
pj.set_prop_mesher(Terrain2DMesherBlocky.new())
chunk.job_add(lj)
chunk.job_add(tj)
chunk.job_add(pj)
return ._create_chunk(x, y, chunk)
func generate() -> void:
for x in range(-2, 2):