From f87d42f4caf1589668fb2add6e89dd5b564ba001 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 30 Dec 2020 15:31:00 +0100 Subject: Use zero-indexing for physics and render layer names The first layer is now Layer 0 instead of Layer 1, and the last layer is now Layer 19 instead of Layer 20. This helps reference physics and render layers from scripts since layers start from 0 there. --- scene/register_scene_types.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scene') diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 30077aa642..bedbab6d4f 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -936,10 +936,10 @@ void register_scene_types() { OS::get_singleton()->yield(); //may take time to init for (int i = 0; i < 20; i++) { - GLOBAL_DEF("layer_names/2d_render/layer_" + itos(i + 1), ""); - GLOBAL_DEF("layer_names/2d_physics/layer_" + itos(i + 1), ""); - GLOBAL_DEF("layer_names/3d_render/layer_" + itos(i + 1), ""); - GLOBAL_DEF("layer_names/3d_physics/layer_" + itos(i + 1), ""); + GLOBAL_DEF(vformat("layer_names/2d_render/layer_%d", i), ""); + GLOBAL_DEF(vformat("layer_names/2d_physics/layer_%d", i), ""); + GLOBAL_DEF(vformat("layer_names/3d_render/layer_%d", i), ""); + GLOBAL_DEF(vformat("layer_names/3d_physics/layer_%d", i), ""); } bool default_theme_hidpi = GLOBAL_DEF("gui/theme/use_hidpi", false); -- cgit v1.2.3