From 756340d3e91fde315d70001d0633bac12010bd9a Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 27 Jul 2005 22:38:51 +0000 Subject: [PATCH] prevent crash when reloading textures --- panda/src/gobj/texture.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 388a565620..798f387092 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -597,6 +597,7 @@ load(const PNMImage &pnmimage, int z) { } else { if (_x_size != pnmimage.get_x_size() || _y_size != pnmimage.get_y_size() || + _num_components != num_components || _component_type != component_type) { gobj_cat.error() << "Texture properties have changed for texture " << get_name() @@ -922,9 +923,10 @@ get_ram_image() { make_ram_image(); if (has_alpha_fullpath()) { - read(get_fullpath(), get_alpha_fullpath()); + read(get_fullpath(), get_alpha_fullpath(), + 0, _primary_file_num_channels, _alpha_file_channel); } else { - read(get_fullpath()); + read(get_fullpath(), 0, _primary_file_num_channels); } }