Advertisement
MageKing17

bmpman.cpp.patch

Apr 2nd, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.63 KB | None | 0 0
  1. Index: code/bmpman/bmpman.cpp
  2. ===================================================================
  3. --- code/bmpman/bmpman.cpp  (revision 11296)
  4. +++ code/bmpman/bmpman.cpp  (working copy)
  5. @@ -65,7 +65,7 @@
  6.  
  7.  // locals
  8.  static unsigned int Bm_next_signature = 0x1234;
  9. -static int bm_next_handle = 1;
  10. +static size_t bm_next_handle = 1;
  11.  int Bm_low_mem = 0;
  12.  // Bm_max_ram - How much RAM bmpman can use for textures.
  13.  // Set to <1 to make it use all it wants.
  14. @@ -462,10 +462,11 @@
  15.  
  16.         bool animated = ((bm_bitmaps[i].type == BM_TYPE_EFF) || (bm_bitmaps[i].type == BM_TYPE_ANI));
  17.  
  18. -       if ( animated_type && !animated )
  19. +       if ( animated_type != animated ) {
  20. +           if (bm_bitmaps[i].info.ani.num_frames > 1)
  21. +               i += bm_bitmaps[i].info.ani.num_frames - 1;
  22.             continue;
  23. -       else if ( !animated_type && animated )
  24. -           continue;
  25. +       }
  26.  
  27.         if ( !strextcmp(real_filename, bm_bitmaps[i].filename) ) {
  28.             nprintf(("BmpFastLoad", "Found bitmap %s -- number %d\n", bm_bitmaps[i].filename, i));
  29. @@ -472,7 +473,8 @@
  30.             bm_bitmaps[i].load_count++;
  31.             *handle = bm_bitmaps[i].handle;
  32.             return 1;
  33. -       }
  34. +       } else if (bm_bitmaps[i].info.ani.num_frames > 1)
  35. +           i += bm_bitmaps[i].info.ani.num_frames - 1;
  36.     }
  37.  
  38.     // not found to be loaded already
  39. @@ -555,6 +557,8 @@
  40.         if (bm_bitmaps[i].type == BM_TYPE_NONE) {
  41.             free_slot = i;
  42.             break;
  43. +       } else if (bm_bitmaps[i].info.ani.num_frames > 1) {
  44. +           i += bm_bitmaps[i].info.ani.num_frames - 1;
  45.         }
  46.     }
  47.  
  48. @@ -736,6 +740,8 @@
  49.             cnt++;
  50.         } else {
  51.             cnt = 0;
  52. +           if (bm_bitmaps[i].info.ani.num_frames > 1)
  53. +               i += bm_bitmaps[i].info.ani.num_frames - 1;
  54.         }
  55.  
  56.         if (cnt == n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement