mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-15 16:16:03 +02:00
Lock and unlock images in LayeredTileSetAtlasSource::_create_padded_image_texture.
This commit is contained in:
parent
068c83f71d
commit
87be638698
@ -5702,6 +5702,9 @@ Ref<ImageTexture> LayeredTileSetAtlasSource::_create_padded_image_texture(const
|
|||||||
image.instance();
|
image.instance();
|
||||||
image->create(size.x, size.y, false, src_image->get_format());
|
image->create(size.x, size.y, false, src_image->get_format());
|
||||||
|
|
||||||
|
src_image->lock();
|
||||||
|
image->lock();
|
||||||
|
|
||||||
for (HashMap<Vector2i, TileAlternativesData>::Element *kv = tiles.front(); kv; kv = kv->next) {
|
for (HashMap<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++) {
|
||||||
// Compute the source rects.
|
// Compute the source rects.
|
||||||
@ -5732,6 +5735,9 @@ Ref<ImageTexture> LayeredTileSetAtlasSource::_create_padded_image_texture(const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image->unlock();
|
||||||
|
src_image->unlock();
|
||||||
|
|
||||||
Ref<ImageTexture> tex;
|
Ref<ImageTexture> tex;
|
||||||
tex.instance();
|
tex.instance();
|
||||||
tex->create_from_image(image, p_source->get_flags());
|
tex->create_from_image(image, p_source->get_flags());
|
||||||
|
Loading…
Reference in New Issue
Block a user