mirror of
https://github.com/rwengine/openrw.git
synced 2024-10-06 09:07:19 +02:00
Convert AnimationSet to unordered_map and use reserve
This commit is contained in:
parent
8c7e94a600
commit
4063fabe52
@ -1,8 +1,8 @@
|
||||
#ifndef _LIBRW_RW_FORWARD_HPP_
|
||||
#define _LIBRW_RW_FORWARD_HPP_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
// Forward Declarations
|
||||
@ -23,6 +23,6 @@ using ClumpPtr = std::shared_ptr<Clump>;
|
||||
|
||||
// Collections
|
||||
using AtomicList = std::vector<AtomicPtr>;
|
||||
typedef std::map<std::string, AnimationPtr> AnimationSet;
|
||||
typedef std::unordered_map<std::string, AnimationPtr> AnimationSet;
|
||||
|
||||
#endif /* FORWARD_HPP */
|
||||
|
@ -63,6 +63,8 @@ bool LoaderIFP::loadFromMemory(char* data) {
|
||||
ANPK* fileRoot = read<ANPK>(data, dataI);
|
||||
std::string listname = readString(data, dataI);
|
||||
|
||||
animations.reserve(fileRoot->info.entries);
|
||||
|
||||
for (auto a = 0u; a < fileRoot->info.entries; ++a) {
|
||||
// something about a name?
|
||||
/*NAME* n =*/read<NAME>(data, dataI);
|
||||
|
Loading…
Reference in New Issue
Block a user