From 8e4e65371d5421552a4bbf3011458fbd48121353 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Oct 2019 00:50:30 +0200 Subject: [PATCH] Typo fixes. --- world/voxel_buffer.cpp | 6 +++--- world/voxel_chunk.cpp | 1 + world/voxel_chunk.h | 11 ++++++----- world/voxel_chunk_prop_data.cpp | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/world/voxel_buffer.cpp b/world/voxel_buffer.cpp index 66f3401..e32f8cf 100644 --- a/world/voxel_buffer.cpp +++ b/world/voxel_buffer.cpp @@ -328,15 +328,15 @@ void VoxelBuffer::add_light(int local_x, int local_y, int local_z, int size, Col //float bf = (color.b / sizef); for (int y = local_y - size; y <= local_y + size; ++y) { - if (y < 0 || y > size_y) + if (y < 0 || y >= size_y) continue; for (int z = local_z - size; z <= local_z + size; ++z) { - if (z < 0 || z > size_z) + if (z < 0 || z >= size_z) continue; for (int x = local_x - size; x <= local_x + size; ++x) { - if (x < 0 || x > size_x) + if (x < 0 || x >= size_x) continue; int lx = x - local_x; diff --git a/world/voxel_chunk.cpp b/world/voxel_chunk.cpp index 56e0bf5..2465d3e 100644 --- a/world/voxel_chunk.cpp +++ b/world/voxel_chunk.cpp @@ -879,6 +879,7 @@ void VoxelChunk::_bind_methods() { BIND_CONSTANT(BUILD_PHASE_DONE); BIND_CONSTANT(BUILD_PHASE_SETUP); + BIND_CONSTANT(BUILD_PHASE_LIGHTS); BIND_CONSTANT(BUILD_PHASE_TERRARIN_MESH); BIND_CONSTANT(BUILD_PHASE_TERRARIN_MESH_COLLIDER); BIND_CONSTANT(BUILD_PHASE_PROP_MESH); diff --git a/world/voxel_chunk.h b/world/voxel_chunk.h index cce8d52..279313d 100644 --- a/world/voxel_chunk.h +++ b/world/voxel_chunk.h @@ -172,11 +172,12 @@ public: enum { BUILD_PHASE_DONE = 0, BUILD_PHASE_SETUP = 1, - BUILD_PHASE_TERRARIN_MESH = 2, - BUILD_PHASE_TERRARIN_MESH_COLLIDER = 3, - BUILD_PHASE_PROP_MESH = 4, - BUILD_PHASE_PROP_COLLIDER = 5, - BUILD_PHASE_MAX = 6 + BUILD_PHASE_LIGHTS = 2, + BUILD_PHASE_TERRARIN_MESH = 3, + BUILD_PHASE_TERRARIN_MESH_COLLIDER = 4, + BUILD_PHASE_PROP_MESH = 5, + BUILD_PHASE_PROP_COLLIDER = 6, + BUILD_PHASE_MAX = 7 }; protected: diff --git a/world/voxel_chunk_prop_data.cpp b/world/voxel_chunk_prop_data.cpp index db2374b..2b2598d 100644 --- a/world/voxel_chunk_prop_data.cpp +++ b/world/voxel_chunk_prop_data.cpp @@ -121,11 +121,11 @@ void VoxelChunkPropData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "snap_axis"), "set_snap_axis", "get_snap_axis"); ClassDB::bind_method(D_METHOD("get_mesh"), &VoxelChunkPropData::get_mesh); - ClassDB::bind_method(D_METHOD("set_mesh", "value"), &VoxelChunkPropData::set_scene); + ClassDB::bind_method(D_METHOD("set_mesh", "value"), &VoxelChunkPropData::set_mesh); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "MeshDataResource"), "set_mesh", "get_mesh"); ClassDB::bind_method(D_METHOD("get_light"), &VoxelChunkPropData::get_light); - ClassDB::bind_method(D_METHOD("set_light", "value"), &VoxelChunkPropData::set_scene); + ClassDB::bind_method(D_METHOD("set_light", "value"), &VoxelChunkPropData::set_light); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "light", PROPERTY_HINT_RESOURCE_TYPE, "VoxelmanPropLight"), "set_light", "get_light"); ClassDB::bind_method(D_METHOD("get_prop"), &VoxelChunkPropData::get_prop);