Commit Graph

13 Commits

Author SHA1 Message Date
Lioncash 4d2e0c7b48 UICommon/ResourcePack/Manager: Resolve use-after-move in Add()
The pack is already has its validity checked at the beginning of the
function, so we don't need to check this again after inserting it.

Also resolves a use-after-move case.
2019-05-28 17:40:28 -04:00
Lioncash f07cf9ebab UICommon/ResourcePack: Allow ReadCurrentFileUnlimited() to read into any contiguous container
This allows the same code to be used to read into a std::string, which
allows for eliminating the vector->string transfer when reading the
manifest file.

A ContiguousContainer is a concept that includes std::array,
std::string, and std::vector.
2019-05-27 13:29:40 -04:00
Lioncash 5c4d3f55da UICommon/Manager: Remove unused std::string variable in Remove() 2019-05-27 13:09:21 -04:00
Lioncash 41cda6fe6d UICommon/ResourcePack: Use ScopeGuards to manage closing files
Makes it way harder to introduce resource leaks, and plugs the existing
resource leaks in the constructor and Install() where the file wouldn't
be closed in some error cases.
2019-05-27 13:02:04 -04:00
Lioncash 157a305507 UICommon/ResourcePack: Deduplicate string construction
A few cases duplicate the string patch creation, which is kind of
wasteful. We can just construct the string once.
2019-05-27 12:45:23 -04:00
Lioncash a22cc615a9 UICommon/ResourcePack: Remove unnecessary resizes
We can simply construct the containers with the desired size in these
cases.
2019-05-27 12:37:46 -04:00
Lioncash 57701cd988 UICommon/ResourcePack: Make TEXTURE_PATH a regular array
Same behavior, only it doesn't unnecessarily store a pointer in the
executable. While we're at it, make it constexpr and move it into the
namespace.
2019-05-27 12:33:50 -04:00
Lioncash 6045b44203 UICommon/ResourcePack: Provide inequality operator to complement equality operator
Provides symmetrical behavior with the equality operator.
2019-03-13 15:55:20 -04:00
Lioncash 9d096a5e16 UICommon/ResourcePack: Mark ResourcePack's operator== as const 2019-03-13 15:53:30 -04:00
spycrab f86b34ceb9 ResourcePacks: Fix various bugs 2019-02-11 11:05:35 +01:00
spycrab b6863ff0a2 ResourcePacks: Support compression 2019-02-02 15:54:06 +01:00
spycrab c2c23677ed UICommon/ResourcePack: Fix resource packs without manifests being able to crash dolphin 2019-01-02 22:47:18 +01:00
spycrab 71d53c922f Implement resource packs 2018-12-19 11:03:09 +01:00