fix gcc warnings
This commit is contained in:
parent
8c16424af1
commit
24841e9a18
@ -44,6 +44,7 @@ void VoxelGeneratorTest::generate_block(VoxelBlockRequest &input) {
|
||||
generate_block_flat(**input.voxel_buffer, input.origin_in_voxels, input.lod);
|
||||
break;
|
||||
|
||||
default:
|
||||
case MODE_WAVES:
|
||||
generate_block_waves(**input.voxel_buffer, input.origin_in_voxels, input.lod);
|
||||
break;
|
||||
|
@ -390,7 +390,7 @@ void VoxelMesherBlocky::build(VoxelMesher::Output &output, const VoxelMesher::In
|
||||
|
||||
ArraySlice<uint8_t> raw_channel;
|
||||
if (!voxels.get_channel_raw(channel, raw_channel)) {
|
||||
// _
|
||||
/* _
|
||||
// | \
|
||||
// /\ \\
|
||||
// / /|\\\
|
||||
@ -399,7 +399,7 @@ void VoxelMesherBlocky::build(VoxelMesher::Output &output, const VoxelMesher::In
|
||||
// | | )
|
||||
// \ | |
|
||||
// \ /
|
||||
//
|
||||
*/
|
||||
// Case supposedly handled before...
|
||||
ERR_PRINT("Something wrong happened");
|
||||
return;
|
||||
|
@ -102,7 +102,7 @@ inline uint8_t get_border_mask(const Vector3i &pos, const Vector3i &block_size)
|
||||
// 16: -Z
|
||||
// 32: +Z
|
||||
|
||||
for (int i = 0; i < Vector3i::AXIS_COUNT; i++) {
|
||||
for (unsigned int i = 0; i < Vector3i::AXIS_COUNT; i++) {
|
||||
// Close to negative face.
|
||||
if (pos[i] == 0) {
|
||||
mask |= (1 << (i * 2));
|
||||
@ -908,20 +908,20 @@ void VoxelMesherTransvoxel::build_transition(const VoxelBuffer &p_voxels, unsign
|
||||
void VoxelMesherTransvoxel::reset_reuse_cells(Vector3i block_size) {
|
||||
_block_size = block_size;
|
||||
unsigned int deck_area = block_size.x * block_size.y;
|
||||
for (int i = 0; i < _cache.size(); ++i) {
|
||||
for (unsigned int i = 0; i < _cache.size(); ++i) {
|
||||
std::vector<ReuseCell> &deck = _cache[i];
|
||||
deck.resize(deck_area);
|
||||
for (int j = 0; j < deck.size(); ++j) {
|
||||
for (long unsigned int j = 0; j < deck.size(); ++j) {
|
||||
deck[j].vertices.fill(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VoxelMesherTransvoxel::reset_reuse_cells_2d(Vector3i block_size) {
|
||||
for (int i = 0; i < _cache_2d.size(); ++i) {
|
||||
for (unsigned int i = 0; i < _cache_2d.size(); ++i) {
|
||||
std::vector<ReuseTransitionCell> &row = _cache_2d[i];
|
||||
row.resize(block_size.x);
|
||||
for (int j = 0; j < row.size(); ++j) {
|
||||
for (long unsigned int j = 0; j < row.size(); ++j) {
|
||||
row[j].vertices.fill(-1);
|
||||
}
|
||||
}
|
||||
|
@ -880,7 +880,7 @@ void VoxelStreamRegionFiles::_convert_files(Meta new_meta) {
|
||||
int lod;
|
||||
};
|
||||
|
||||
ERR_FAIL_COND(old_stream->load_meta() != OK);
|
||||
ERR_FAIL_COND(old_stream->load_meta() != (int)OK);
|
||||
|
||||
std::vector<PositionAndLod> old_region_list;
|
||||
Meta old_meta = old_stream->_meta;
|
||||
|
@ -280,7 +280,7 @@ void VoxelLodTerrain::stop_updater() {
|
||||
|
||||
_blocks_pending_main_thread_update.clear();
|
||||
|
||||
for (int i = 0; i < _lods.size(); ++i) {
|
||||
for (unsigned int i = 0; i < _lods.size(); ++i) {
|
||||
|
||||
Lod &lod = _lods[i];
|
||||
lod.blocks_pending_update.clear();
|
||||
@ -307,7 +307,7 @@ void VoxelLodTerrain::stop_streamer() {
|
||||
_stream_thread = nullptr;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _lods.size(); ++i) {
|
||||
for (unsigned int i = 0; i < _lods.size(); ++i) {
|
||||
Lod &lod = _lods[i];
|
||||
lod.blocks_to_load.clear();
|
||||
}
|
||||
@ -337,7 +337,7 @@ float VoxelLodTerrain::get_lod_split_scale() const {
|
||||
|
||||
void VoxelLodTerrain::set_lod_count(int p_lod_count) {
|
||||
|
||||
ERR_FAIL_COND(p_lod_count >= VoxelConstants::MAX_LOD);
|
||||
ERR_FAIL_COND(p_lod_count >= (int)VoxelConstants::MAX_LOD);
|
||||
ERR_FAIL_COND(p_lod_count < 1);
|
||||
|
||||
if (get_lod_count() != p_lod_count) {
|
||||
@ -347,7 +347,7 @@ void VoxelLodTerrain::set_lod_count(int p_lod_count) {
|
||||
|
||||
void VoxelLodTerrain::_set_lod_count(int p_lod_count) {
|
||||
|
||||
CRASH_COND(p_lod_count >= VoxelConstants::MAX_LOD);
|
||||
CRASH_COND(p_lod_count >= (int)VoxelConstants::MAX_LOD);
|
||||
CRASH_COND(p_lod_count < 1);
|
||||
|
||||
_lod_count = p_lod_count;
|
||||
@ -365,7 +365,7 @@ void VoxelLodTerrain::_set_lod_count(int p_lod_count) {
|
||||
void VoxelLodTerrain::reset_maps() {
|
||||
// Clears all blocks and reconfigures maps to account for new LOD count and block sizes
|
||||
|
||||
for (int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
for (int lod_index = 0; lod_index < (int)_lods.size(); ++lod_index) {
|
||||
|
||||
Lod &lod = _lods[lod_index];
|
||||
|
||||
@ -447,7 +447,7 @@ void VoxelLodTerrain::_notification(int p_what) {
|
||||
|
||||
case NOTIFICATION_ENTER_WORLD: {
|
||||
World *world = *get_world();
|
||||
for (int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
for (unsigned int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
if (_lods[lod_index].map.is_valid()) {
|
||||
_lods[lod_index].map->for_all_blocks([world](VoxelBlock *block) {
|
||||
block->set_world(world);
|
||||
@ -457,7 +457,7 @@ void VoxelLodTerrain::_notification(int p_what) {
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_WORLD: {
|
||||
for (int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
for (unsigned int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
if (_lods[lod_index].map.is_valid()) {
|
||||
_lods[lod_index].map->for_all_blocks([](VoxelBlock *block) {
|
||||
block->set_world(nullptr);
|
||||
@ -468,7 +468,7 @@ void VoxelLodTerrain::_notification(int p_what) {
|
||||
|
||||
case NOTIFICATION_VISIBILITY_CHANGED: {
|
||||
bool visible = is_visible();
|
||||
for (int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
for (unsigned int lod_index = 0; lod_index < _lods.size(); ++lod_index) {
|
||||
if (_lods[lod_index].map.is_valid()) {
|
||||
_lods[lod_index].map->for_all_blocks([visible](VoxelBlock *block) {
|
||||
block->set_parent_visible(visible);
|
||||
@ -1212,7 +1212,7 @@ void VoxelLodTerrain::_process() {
|
||||
|
||||
{
|
||||
VOXEL_PROFILE_SCOPE(profile_process_receive_mesh_updates_block_update_transitions);
|
||||
for (int dir = 0; dir < mesh_data.transition_surfaces.size(); ++dir) {
|
||||
for (unsigned int dir = 0; dir < mesh_data.transition_surfaces.size(); ++dir) {
|
||||
|
||||
Ref<ArrayMesh> transition_mesh = build_mesh(
|
||||
mesh_data.transition_surfaces[dir],
|
||||
@ -1429,7 +1429,7 @@ uint8_t VoxelLodTerrain::get_transition_mask(Vector3i block_pos, int lod_index)
|
||||
|
||||
uint8_t transition_mask = 0;
|
||||
|
||||
if (lod_index + 1 >= _lods.size()) {
|
||||
if (lod_index + 1 >= (int)_lods.size()) {
|
||||
return transition_mask;
|
||||
}
|
||||
|
||||
@ -1489,7 +1489,7 @@ uint8_t VoxelLodTerrain::get_transition_mask(Vector3i block_pos, int lod_index)
|
||||
// There are always 4 on each side, checking any is enough
|
||||
|
||||
Vector3i upper_neighbor_pos = upper_pos;
|
||||
for (int i = 0; i < Vector3i::AXIS_COUNT; ++i) {
|
||||
for (unsigned int i = 0; i < Vector3i::AXIS_COUNT; ++i) {
|
||||
if (side_normal[i] == -1) {
|
||||
--upper_neighbor_pos[i];
|
||||
} else if (side_normal[i] == 1) {
|
||||
@ -1574,7 +1574,7 @@ Array VoxelLodTerrain::debug_get_last_unexpected_block_drops() const {
|
||||
Array drops;
|
||||
drops.resize(lod.debug_unexpected_block_drops.size());
|
||||
|
||||
for (int j = 0; j < lod.debug_unexpected_block_drops.size(); ++j) {
|
||||
for (unsigned int j = 0; j < lod.debug_unexpected_block_drops.size(); ++j) {
|
||||
drops[j] = lod.debug_unexpected_block_drops[j].to_vec3();
|
||||
}
|
||||
|
||||
|
@ -905,7 +905,7 @@ void VoxelTerrain::_process() {
|
||||
if (
|
||||
block->voxels->is_uniform(VoxelBuffer::CHANNEL_TYPE) &&
|
||||
block->voxels->is_uniform(VoxelBuffer::CHANNEL_SDF) &&
|
||||
block->voxels->get_voxel(0, 0, 0, VoxelBuffer::CHANNEL_TYPE) == air_type) {
|
||||
block->voxels->get_voxel(0, 0, 0, VoxelBuffer::CHANNEL_TYPE) == (uint64_t)air_type) {
|
||||
|
||||
// If we got here, it must have been because of scheduling an update
|
||||
CRASH_COND(block->get_mesh_state() != VoxelBlock::MESH_UPDATE_NOT_SENT);
|
||||
|
@ -360,19 +360,19 @@ void VoxelBuffer::fill_area(uint64_t defval, Vector3i min, Vector3i max, unsigne
|
||||
break;
|
||||
|
||||
case DEPTH_16_BIT:
|
||||
for (unsigned int i = 0; i < area_size.y; ++i) {
|
||||
for (int i = 0; i < area_size.y; ++i) {
|
||||
((uint16_t *)channel.data)[dst_ri + i] = defval;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEPTH_32_BIT:
|
||||
for (unsigned int i = 0; i < area_size.y; ++i) {
|
||||
for (int i = 0; i < area_size.y; ++i) {
|
||||
((uint32_t *)channel.data)[dst_ri + i] = defval;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEPTH_64_BIT:
|
||||
for (unsigned int i = 0; i < area_size.y; ++i) {
|
||||
for (int i = 0; i < area_size.y; ++i) {
|
||||
((uint64_t *)channel.data)[dst_ri + i] = defval;
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user