mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Replaced <hash_map><set> with <unordered_map><unordered_set>
This commit is contained in:
+4
-4
@@ -16,7 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <hash_map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#include "FalloutEngine.h"
|
||||
#include "SafeWrite.h"
|
||||
|
||||
typedef stdext::hash_map<TGameObj*, TGameObj*>::const_iterator iter;
|
||||
typedef std::tr1::unordered_map<TGameObj*, TGameObj*>::const_iterator iter;
|
||||
|
||||
static stdext::hash_map<TGameObj*, TGameObj*> targets;
|
||||
static stdext::hash_map<TGameObj*, TGameObj*> sources;
|
||||
static std::tr1::unordered_map<TGameObj*, TGameObj*> targets;
|
||||
static std::tr1::unordered_map<TGameObj*, TGameObj*> sources;
|
||||
|
||||
static void __declspec(naked) ai_try_attack_hook_FleeFix() {
|
||||
__asm {
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "Arrays.h"
|
||||
@@ -13,7 +13,7 @@ DWORD arraysBehavior = 1; // 0 - backward compatible with pre-3.4, 1 - permanent
|
||||
// arrays map: arrayId => arrayVar
|
||||
ArraysMap arrays;
|
||||
// temp arrays: set of arrayId
|
||||
std::set<DWORD> temporaryArrays;
|
||||
std::tr1::unordered_set<DWORD> temporaryArrays;
|
||||
// saved arrays: arrayKey => arrayId
|
||||
ArrayKeysMap savedArrays;
|
||||
|
||||
@@ -454,7 +454,7 @@ void _stdcall FreeArray(DWORD id) {
|
||||
|
||||
void DeleteAllTempArrays() {
|
||||
if (!temporaryArrays.empty()) {
|
||||
for (std::set<DWORD>::iterator it = temporaryArrays.begin(); it != temporaryArrays.end(); ++it) {
|
||||
for (std::tr1::unordered_set<DWORD>::iterator it = temporaryArrays.begin(); it != temporaryArrays.end(); ++it) {
|
||||
FreeArray(*it);
|
||||
}
|
||||
temporaryArrays.clear();
|
||||
|
||||
+11
-11
@@ -16,8 +16,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <hash_map>
|
||||
//#include <set>
|
||||
//#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "main.h"
|
||||
#include "FalloutEngine.h"
|
||||
@@ -471,8 +471,8 @@ struct sGlobalScript {
|
||||
};
|
||||
|
||||
struct sExportedVar {
|
||||
DWORD type; // in scripting engine terms, eg. VAR_TYPE_*
|
||||
DWORD val;
|
||||
int type; // in scripting engine terms, eg. VAR_TYPE_*
|
||||
int val;
|
||||
sExportedVar() : val(0), type(VAR_TYPE_INT) {}
|
||||
};
|
||||
|
||||
@@ -502,19 +502,19 @@ static std::vector<DWORD> checkedScripts;
|
||||
static std::vector<sGlobalScript> globalScripts;
|
||||
|
||||
// a map of all sfall programs (global and hook scripts) by thier scriptPtr
|
||||
typedef stdext::hash_map<DWORD, sScriptProgram> SfallProgsMap;
|
||||
typedef std::tr1::unordered_map<DWORD, sScriptProgram> SfallProgsMap;
|
||||
static SfallProgsMap sfallProgsMap;
|
||||
|
||||
// a map scriptPtr => self_obj to override self_obj for all script types using set_self
|
||||
stdext::hash_map<DWORD, SelfOverrideObj> selfOverrideMap;
|
||||
std::tr1::unordered_map<DWORD, SelfOverrideObj> selfOverrideMap;
|
||||
|
||||
typedef std::tr1::unordered_map<std::string, sExportedVar> ExportedVarsMap;
|
||||
static ExportedVarsMap globalExportedVars;
|
||||
DWORD isGlobalScriptLoading = 0;
|
||||
|
||||
stdext::hash_map<__int64, int> globalVars;
|
||||
typedef stdext::hash_map<__int64, int> :: iterator glob_itr;
|
||||
typedef stdext::hash_map<__int64, int> :: const_iterator glob_citr;
|
||||
std::tr1::unordered_map<__int64, int> globalVars;
|
||||
typedef std::tr1::unordered_map<__int64, int> :: iterator glob_itr;
|
||||
typedef std::tr1::unordered_map<__int64, int> :: const_iterator glob_citr;
|
||||
typedef std::pair<__int64, int> glob_pair;
|
||||
|
||||
static void* opcodes[0x300];
|
||||
@@ -800,7 +800,7 @@ static void __declspec(naked) InitHook() {
|
||||
}
|
||||
|
||||
static void __fastcall SetSelfObject(DWORD script, TGameObj* obj) {
|
||||
stdext::hash_map<DWORD, SelfOverrideObj>::iterator it = selfOverrideMap.find(script);
|
||||
std::tr1::unordered_map<DWORD, SelfOverrideObj>::iterator it = selfOverrideMap.find(script);
|
||||
bool isFind = (it != selfOverrideMap.end());
|
||||
if (obj) {
|
||||
if (isFind) {
|
||||
@@ -931,7 +931,7 @@ long __stdcall GetResetScriptReturnValue() {
|
||||
}
|
||||
|
||||
static DWORD __stdcall FindSid(DWORD script) {
|
||||
stdext::hash_map<DWORD, SelfOverrideObj>::iterator overrideIt = selfOverrideMap.find(script);
|
||||
std::tr1::unordered_map<DWORD, SelfOverrideObj>::iterator overrideIt = selfOverrideMap.find(script);
|
||||
if (overrideIt != selfOverrideMap.end()) {
|
||||
DWORD scriptId = overrideIt->second.object->scriptID; // script
|
||||
OverrideScriptStruct.script_id = scriptId;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <hash_map>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "main.h"
|
||||
#include "FalloutEngine.h"
|
||||
@@ -66,10 +66,10 @@ struct TextureData {
|
||||
: textures(tex), showHighlights(show), bakedBackground(baked), frames(frames) {}
|
||||
};
|
||||
|
||||
typedef stdext::hash_map<__int64, TextureData> :: iterator tex_itr;
|
||||
typedef stdext::hash_map<__int64, TextureData> :: const_iterator tex_citr;
|
||||
typedef std::tr1::unordered_map<__int64, TextureData> :: iterator tex_itr;
|
||||
typedef std::tr1::unordered_map<__int64, TextureData> :: const_iterator tex_citr;
|
||||
|
||||
static stdext::hash_map<__int64, TextureData> texMap;
|
||||
static std::tr1::unordered_map<__int64, TextureData> texMap;
|
||||
|
||||
static const char* headSuffix[] = { "gv", "gf", "gn", "ng", "nf", "nb", "bn", "bf", "bv", "gp", "np", "bp" };
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <hash_map>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
Reference in New Issue
Block a user