mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
fix get_uncompressed_ram_image() with implicit reload
This commit is contained in:
parent
0dc844602f
commit
9b9528097e
@ -1201,12 +1201,12 @@ clear_ram_image() {
|
||||
// memory dumped when the texture is prepared for
|
||||
// rendering.
|
||||
//
|
||||
// This will be true for most textures, which can reload
|
||||
// their images if needed by rereading the input file.
|
||||
// However, textures that were generated dynamically and
|
||||
// cannot be easily reloaded will want to set this flag
|
||||
// to true, so that the texture will always keep its
|
||||
// image copy around.
|
||||
// This will be false for most textures, which can
|
||||
// reload their images if needed by rereading the input
|
||||
// file. However, textures that were generated
|
||||
// dynamically and cannot be easily reloaded will want
|
||||
// to set this flag to true, so that the texture will
|
||||
// always keep its image copy around.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void Texture::
|
||||
set_keep_ram_image(bool keep_ram_image) {
|
||||
|
@ -3874,6 +3874,15 @@ do_get_uncompressed_ram_image() {
|
||||
do_unlock_and_reload_ram_image(false);
|
||||
}
|
||||
|
||||
if (!_ram_images.empty() && _ram_image_compression != CM_off) {
|
||||
// Great, now we have an image.
|
||||
if (do_uncompress_ram_image()) {
|
||||
gobj_cat.info()
|
||||
<< "Uncompressed " << get_name() << "\n";
|
||||
return _ram_images[0]._image;
|
||||
}
|
||||
}
|
||||
|
||||
if (_ram_images.empty() || _ram_image_compression != CM_off) {
|
||||
return CPTA_uchar(get_class_type());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user