mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
(cherry picked from commit d8935b27a9)
This commit is contained in:
@@ -526,7 +526,6 @@ int PortalRoomsBSP::evaluate_room_split_plane(int p_room_a_id, int p_room_b_id,
|
||||
int PortalRoomsBSP::evaluate_plane(const VSPortal *p_portal, const Plane &p_plane, const LocalVector<int32_t, int32_t> &p_room_ids, LocalVector<int32_t, int32_t> *r_room_ids_back, LocalVector<int32_t, int32_t> *r_room_ids_front) {
|
||||
int rooms_front = 0;
|
||||
int rooms_back = 0;
|
||||
int rooms_split = 0;
|
||||
|
||||
if (r_room_ids_back) {
|
||||
DEV_ASSERT(!r_room_ids_back->size());
|
||||
@@ -622,8 +621,6 @@ int PortalRoomsBSP::evaluate_plane(const VSPortal *p_portal, const Plane &p_plan
|
||||
if (r_room_ids_back) {
|
||||
r_room_ids_back->push_back(rid);
|
||||
}
|
||||
|
||||
rooms_split++;
|
||||
}
|
||||
|
||||
#undef GODOT_BSP_PUSH_BACK
|
||||
|
||||
@@ -3272,10 +3272,6 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||
|
||||
float distance_adv = _get_normal_advance(light_axis);
|
||||
|
||||
int success_count = 0;
|
||||
|
||||
// uint64_t us = OS::get_singleton()->get_ticks_usec();
|
||||
|
||||
for (int i = 0; i < p_leaf_count; i++) {
|
||||
uint32_t idx = leaves[i];
|
||||
|
||||
@@ -3324,18 +3320,11 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||
light->energy[0] += int32_t(light_r * att * ((cell->albedo >> 16) & 0xFF) / 255.0);
|
||||
light->energy[1] += int32_t(light_g * att * ((cell->albedo >> 8) & 0xFF) / 255.0);
|
||||
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
|
||||
success_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
||||
// print_line("valid cells: " + itos(success_count));
|
||||
|
||||
} break;
|
||||
case VS::LIGHT_OMNI:
|
||||
case VS::LIGHT_SPOT: {
|
||||
// uint64_t us = OS::get_singleton()->get_ticks_usec();
|
||||
|
||||
Vector3 light_pos = light_cache.transform.origin;
|
||||
Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized();
|
||||
|
||||
@@ -3433,7 +3422,6 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
|
||||
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
|
||||
}
|
||||
}
|
||||
//print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
|
||||
}
|
||||
|
||||
if (!p_viewport->hide_canvas) {
|
||||
int i = 0;
|
||||
|
||||
Map<Viewport::CanvasKey, Viewport::CanvasData *> canvas_map;
|
||||
|
||||
Rect2 clip_rect(0, 0, p_viewport->size.x, p_viewport->size.y);
|
||||
@@ -117,8 +115,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
|
||||
RasterizerCanvas::Light *lights_with_mask = nullptr;
|
||||
Rect2 shadow_rect;
|
||||
|
||||
int light_count = 0;
|
||||
|
||||
for (Map<RID, Viewport::CanvasData>::Element *E = p_viewport->canvas_map.front(); E; E = E->next()) {
|
||||
VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get().canvas);
|
||||
|
||||
@@ -164,8 +160,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
|
||||
cl->mask_next_ptr = lights_with_mask;
|
||||
lights_with_mask = cl;
|
||||
}
|
||||
|
||||
light_count++;
|
||||
}
|
||||
|
||||
VSG::canvas_render->light_internal_update(cl->light_internal, cl);
|
||||
@@ -235,7 +229,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
|
||||
}
|
||||
|
||||
VSG::canvas->render_canvas(canvas, xform, canvas_lights, lights_with_mask, clip_rect, canvas_layer_id);
|
||||
i++;
|
||||
|
||||
if (scenario_draw_canvas_bg && E->key().get_layer() >= scenario_canvas_max_layer) {
|
||||
if (!can_draw_3d) {
|
||||
|
||||
Reference in New Issue
Block a user