mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -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
|
// memory dumped when the texture is prepared for
|
||||||
// rendering.
|
// rendering.
|
||||||
//
|
//
|
||||||
// This will be true for most textures, which can reload
|
// This will be false for most textures, which can
|
||||||
// their images if needed by rereading the input file.
|
// reload their images if needed by rereading the input
|
||||||
// However, textures that were generated dynamically and
|
// file. However, textures that were generated
|
||||||
// cannot be easily reloaded will want to set this flag
|
// dynamically and cannot be easily reloaded will want
|
||||||
// to true, so that the texture will always keep its
|
// to set this flag to true, so that the texture will
|
||||||
// image copy around.
|
// always keep its image copy around.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void Texture::
|
INLINE void Texture::
|
||||||
set_keep_ram_image(bool keep_ram_image) {
|
set_keep_ram_image(bool keep_ram_image) {
|
||||||
|
@ -3874,6 +3874,15 @@ do_get_uncompressed_ram_image() {
|
|||||||
do_unlock_and_reload_ram_image(false);
|
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) {
|
if (_ram_images.empty() || _ram_image_compression != CM_off) {
|
||||||
return CPTA_uchar(get_class_type());
|
return CPTA_uchar(get_class_type());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user