diff options
-rw-r--r-- | core/io/image.cpp | 38 | ||||
-rw-r--r-- | editor/editor_node.cpp | 3 | ||||
-rw-r--r-- | servers/physics_2d/area_2d_sw.cpp | 8 | ||||
-rw-r--r-- | servers/physics_3d/area_3d_sw.cpp | 8 |
4 files changed, 35 insertions, 22 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp index 5d46d75efe..873eb66f33 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -3010,26 +3010,28 @@ Image::UsedChannels Image::detect_used_channels(CompressSource p_source) { ERR_FAIL_COND_V(is_compressed(), USED_CHANNELS_RGBA); bool r = false, g = false, b = false, a = false, c = false; - for (int i = 0; i < width; i++) { - for (int j = 0; j < height; j++) { - Color col = get_pixel(i, j); + const uint8_t *data_ptr = data.ptr(); - if (col.r > 0.001) { - r = true; - } - if (col.g > 0.001) { - g = true; - } - if (col.b > 0.001) { - b = true; - } - if (col.a < 0.999) { - a = true; - } + uint32_t data_total = width * height; - if (col.r != col.b || col.r != col.g || col.b != col.g) { - c = true; - } + for (uint32_t i = 0; i < data_total; i++) { + Color col = _get_color_at_ofs(data_ptr, i); + + if (col.r > 0.001) { + r = true; + } + if (col.g > 0.001) { + g = true; + } + if (col.b > 0.001) { + b = true; + } + if (col.a < 0.999) { + a = true; + } + + if (col.r != col.b || col.r != col.g || col.b != col.g) { + c = true; } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c48ea18b9e..156cb6694a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -592,6 +592,9 @@ void EditorNode::_notification(int p_what) { _editor_select(EDITOR_3D); } + // Save the project after opening to mark it as last modified. + ProjectSettings::get_singleton()->save(); + /* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */ } break; diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index 6485c8d1e9..532cb259b3 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -215,7 +215,9 @@ void Area2DSW::call_queries() { for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) { if (E->get().state == 0) { // Nothing happened - E = E->next(); + Map<BodyKey, BodyState>::Element *next = E->next(); + monitored_bodies.erase(E); + E = next; continue; } @@ -250,7 +252,9 @@ void Area2DSW::call_queries() { for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) { if (E->get().state == 0) { // Nothing happened - E = E->next(); + Map<BodyKey, BodyState>::Element *next = E->next(); + monitored_areas.erase(E); + E = next; continue; } diff --git a/servers/physics_3d/area_3d_sw.cpp b/servers/physics_3d/area_3d_sw.cpp index b6c5b3003c..bb4e0ed752 100644 --- a/servers/physics_3d/area_3d_sw.cpp +++ b/servers/physics_3d/area_3d_sw.cpp @@ -215,7 +215,9 @@ void Area3DSW::call_queries() { for (Map<BodyKey, BodyState>::Element *E = monitored_bodies.front(); E;) { if (E->get().state == 0) { // Nothing happened - E = E->next(); + Map<BodyKey, BodyState>::Element *next = E->next(); + monitored_bodies.erase(E); + E = next; continue; } @@ -250,7 +252,9 @@ void Area3DSW::call_queries() { for (Map<BodyKey, BodyState>::Element *E = monitored_areas.front(); E;) { if (E->get().state == 0) { // Nothing happened - E = E->next(); + Map<BodyKey, BodyState>::Element *next = E->next(); + monitored_areas.erase(E); + E = next; continue; } |