mirror of
https://github.com/Relintai/tile_map_backport.git
synced 2024-11-05 10:11:16 +01:00
lock and unlock the image properly.
This commit is contained in:
parent
be575f2917
commit
17955723c3
@ -4539,6 +4539,7 @@ void RTileSetAtlasSource::_update_padded_texture() {
|
|||||||
Ref<Image> image;
|
Ref<Image> image;
|
||||||
image.instance();
|
image.instance();
|
||||||
image->create(size.x, size.y, false, Image::FORMAT_RGBA8);
|
image->create(size.x, size.y, false, Image::FORMAT_RGBA8);
|
||||||
|
image->lock();
|
||||||
|
|
||||||
for (const Map<Vector2i, TileAlternativesData>::Element *kv = tiles.front(); kv; kv = kv->next()) {
|
for (const Map<Vector2i, TileAlternativesData>::Element *kv = tiles.front(); kv; kv = kv->next()) {
|
||||||
for (int frame = 0; frame < (int)kv->value().animation_frames_durations.size(); frame++) {
|
for (int frame = 0; frame < (int)kv->value().animation_frames_durations.size(); frame++) {
|
||||||
@ -4568,6 +4569,8 @@ void RTileSetAtlasSource::_update_padded_texture() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image->unlock();
|
||||||
|
|
||||||
if (!padded_texture.is_valid()) {
|
if (!padded_texture.is_valid()) {
|
||||||
padded_texture.instance();
|
padded_texture.instance();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user