-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slightly optimize loading same-sprite monsters
For monsters with the same sprite, load the sprite from the file system only once. Example: ``` VERBOSE: Loaded monster graphics: falspear\phall 452 KiB x1 VERBOSE: Loaded monster graphics: skelbow\sklbw 618 KiB x1 VERBOSE: Loaded monster graphics: skelsd\sklsr 610 KiB x1 VERBOSE: Loaded monster graphics: goatbow\goatb 832 KiB x1 VERBOSE: Loaded monster graphics: bat\bat 282 KiB x2 <-- here we only load the sprite once VERBOSE: Loaded monster graphics: rhino\rhino 1306 KiB x1 VERBOSE: Loaded monster graphics: golem\golem 298 KiB x1 VERBOSE: Total monster graphics: 4401 KiB 4684 KiB ``` Here, the bat sprite will be loaded from the MPQ only once. For the second sprite, we simply clone the first sprite before applying TRNs. This also reduces the size of `MonsterData` from 88 bytes to 80. When we migrate monster data to a TSV, the sprite IDs can be generated automatically at load time.
- Loading branch information
Showing
7 changed files
with
423 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.