Commit 0a19616
committed
Correct inconsistency in anim_load() regarding memory-mapped files.
In commit 735f5e1 randomtiger changed how anim_load() worked in seemingly-bizarre ways, for reasons unclear to me. In brief, a condition's logic was reversed, a three-value enum was created of which only one value was used, and as a result loose files passed to anim_load() (and only loose files) would be opened as "memory-mapped", one consequence of which is that they'd keep a cfile block open until the corresponding call to anim_free() (which means that, if a mission had enough different loose animations, the cfile block limit could be reached). Since files in packfiles behaved the same way they always had (namely, being loaded into memory and then closed, thereby not taking up a cfile block), apparently nobody noticed the difference, and this inconsistent code has stayed for the past 13-and-a-half years.
This commit changes the condition after the one changed in the older commit so that they both match, then changes the enum so that the seemingly-meaningless third value is removed, and the other two values are swapped (and the default value of the file_mapped parameter to anim_load() changed) so that the original Volition behavior is restored.1 parent 6da72bb commit 0a19616
2 files changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
768 | | - | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
0 commit comments