소스 검색

fix old bam loading

David Rose 14 년 전
부모
커밋
00a012ef13
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      panda/src/gobj/texture.cxx

+ 8 - 0
panda/src/gobj/texture.cxx

@@ -7202,6 +7202,14 @@ make_this_from_bam(const FactoryParams &params) {
   int alpha_file_channel = scan.get_uint8();
   bool has_rawdata = scan.get_bool();
   TextureType texture_type = (TextureType)scan.get_uint8();
+  if (manager->get_file_minor_ver() < 25) {
+    // Between Panda3D releases 1.7.2 and 1.8.0 (bam versions 6.24 and
+    // 6.25), we added TT_2d_texture_array, shifting the definition
+    // for TT_cube_map.
+    if (texture_type == TT_2d_texture_array) {
+      texture_type = TT_cube_map;
+    }
+  }
 
   Texture *me = NULL;
   if (has_rawdata) {