[Scummvm-git-logs] scummvm master -> 04477c375f77f77eb3e0b924c42d8f666572b029

grisenti noreply at scummvm.org
Tue Jun 20 13:55:53 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
04477c375f HPL1: Remove Hpl1::Std::multimap


Commit: 04477c375f77f77eb3e0b924c42d8f666572b029
    https://github.com/scummvm/scummvm/commit/04477c375f77f77eb3e0b924c42d8f666572b029
Author: grisenti (emanuele at grisenti.net)
Date: 2023-06-20T15:55:17+02:00

Commit Message:
HPL1: Remove Hpl1::Std::multimap

Changed paths:
  R engines/hpl1/std/multimap.h
    engines/hpl1/engine/game/SaveGame.h
    engines/hpl1/engine/graphics/Mesh.h
    engines/hpl1/engine/gui/Gui.cpp
    engines/hpl1/engine/input/Input.h
    engines/hpl1/engine/resources/FileSearcher.h
    engines/hpl1/engine/scene/SubMeshEntity.h
    engines/hpl1/penumbra-overture/GameTypes.h
    engines/hpl1/penumbra-overture/Inventory.h
    engines/hpl1/penumbra-overture/MapHandler.h
    engines/hpl1/penumbra-overture/TriggerHandler.h


diff --git a/engines/hpl1/engine/game/SaveGame.h b/engines/hpl1/engine/game/SaveGame.h
index dc161dd384f..2e5b78a7703 100644
--- a/engines/hpl1/engine/game/SaveGame.h
+++ b/engines/hpl1/engine/game/SaveGame.h
@@ -31,7 +31,7 @@
 #include "hpl1/engine/system/SerializeClass.h"
 #include "hpl1/engine/system/SystemTypes.h"
 #include "hpl1/std/map.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 class TiXmlElement;
 
@@ -172,7 +172,7 @@ private:
 
 //---------------------------------------------------------
 
-typedef Hpl1::Std::multimap<int, iSaveObject *> tSaveObjectMap;
+typedef Common::MultiMap<int, iSaveObject *> tSaveObjectMap;
 typedef tSaveObjectMap::iterator tSaveObjectMapIt;
 
 typedef cSTLMapIterator<iSaveObject *, tSaveObjectMap, tSaveObjectMapIt> cSaveObjectIterator;
@@ -203,7 +203,7 @@ private:
 
 //---------------------------------------------------------
 
-typedef Hpl1::Std::multimap<int, iSaveData *> tSaveDataMap;
+typedef Common::MultiMap<int, iSaveData *> tSaveDataMap;
 typedef tSaveDataMap::iterator tSaveDataMapIt;
 
 typedef cSTLMapIterator<iSaveData *, tSaveDataMap, tSaveDataMapIt> cSaveDataIterator;
diff --git a/engines/hpl1/engine/graphics/Mesh.h b/engines/hpl1/engine/graphics/Mesh.h
index 9126cdf4eb1..bfff11d4634 100644
--- a/engines/hpl1/engine/graphics/Mesh.h
+++ b/engines/hpl1/engine/graphics/Mesh.h
@@ -39,7 +39,7 @@
 #include "common/array.h"
 #include "hpl1/engine/scene/Light3D.h"
 #include "hpl1/std/map.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 namespace hpl {
 
@@ -71,7 +71,7 @@ typedef tAnimationIndexMap::iterator tAnimationIndexMapIt;
 typedef Common::Array<cSubMesh *> tSubMeshVec;
 typedef Common::Array<cSubMesh *>::iterator tSubMeshVecIt;
 
-typedef Hpl1::Std::multimap<tString, cSubMesh *> tSubMeshMap;
+typedef Common::MultiMap<tString, cSubMesh *> tSubMeshMap;
 typedef tSubMeshMap::iterator tSubMeshMapIt;
 
 typedef Common::Array<cNode3D *> tNode3DVec;
diff --git a/engines/hpl1/engine/gui/Gui.cpp b/engines/hpl1/engine/gui/Gui.cpp
index 539bdc048ed..07c54376d57 100644
--- a/engines/hpl1/engine/gui/Gui.cpp
+++ b/engines/hpl1/engine/gui/Gui.cpp
@@ -42,7 +42,7 @@
 #include "hpl1/engine/resources/TextureManager.h"
 
 #include "hpl1/engine/gui/GuiMaterialBasicTypes.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 namespace hpl {
 
@@ -164,7 +164,7 @@ void cGui::OnPostSceneDraw() {
 //-----------------------------------------------------------------------
 
 void cGui::OnPostGUIDraw() {
-	typedef Hpl1::Std::multimap<int, cGuiSet *> tPrioMap;
+	typedef Common::MultiMap<int, cGuiSet *> tPrioMap;
 	tPrioMap mapSortedSets;
 
 	tGuiSetMapIt it = m_mapSets.begin();
diff --git a/engines/hpl1/engine/input/Input.h b/engines/hpl1/engine/input/Input.h
index 648cf2f0afb..a42b8f60566 100644
--- a/engines/hpl1/engine/input/Input.h
+++ b/engines/hpl1/engine/input/Input.h
@@ -33,7 +33,7 @@
 #include "hpl1/engine/input/InputTypes.h"
 #include "hpl1/engine/system/SystemTypes.h"
 #include "hpl1/std/map.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 namespace hpl {
 
@@ -46,7 +46,7 @@ class iAction;
 typedef Hpl1::Std::map<tString, iAction *> tActionMap;
 typedef tActionMap::iterator tActionMapIt;
 
-typedef Hpl1::Std::multimap<tString, iAction *> tActionMultiMap;
+typedef Common::MultiMap<tString, iAction *> tActionMultiMap;
 typedef tActionMultiMap::iterator tActionMultiMapIt;
 
 typedef Common::List<iInputDevice *> tInputDeviceList;
diff --git a/engines/hpl1/engine/resources/FileSearcher.h b/engines/hpl1/engine/resources/FileSearcher.h
index e52cae584be..981dbe67831 100644
--- a/engines/hpl1/engine/resources/FileSearcher.h
+++ b/engines/hpl1/engine/resources/FileSearcher.h
@@ -31,13 +31,13 @@
 #include "hpl1/engine/resources/ResourcesTypes.h"
 #include "hpl1/engine/system/SystemTypes.h"
 #include "hpl1/std/map.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 namespace hpl {
 
 class LowLevelResources;
 
-typedef Hpl1::Std::multimap<tString, tString> tFilePathMap;
+typedef Common::MultiMap<tString, tString> tFilePathMap;
 typedef tFilePathMap::iterator tFilePathMapIt;
 
 class cFileSearcher {
diff --git a/engines/hpl1/engine/scene/SubMeshEntity.h b/engines/hpl1/engine/scene/SubMeshEntity.h
index 3f91e6a718c..6edd05bb023 100644
--- a/engines/hpl1/engine/scene/SubMeshEntity.h
+++ b/engines/hpl1/engine/scene/SubMeshEntity.h
@@ -37,7 +37,7 @@
 #include "hpl1/engine/scene/SectorVisibility.h"
 #include "hpl1/engine/system/SystemTypes.h"
 #include "hpl1/std/map.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 namespace hpl {
 
@@ -177,7 +177,7 @@ private:
 typedef Common::Array<cSubMeshEntity *> tSubMeshEntityVec;
 typedef Common::Array<cSubMeshEntity *>::iterator tSubMeshEntityVecIt;
 
-typedef Hpl1::Std::multimap<tString, cSubMeshEntity *> tSubMeshEntityMap;
+typedef Common::MultiMap<tString, cSubMeshEntity *> tSubMeshEntityMap;
 typedef tSubMeshEntityMap::iterator tSubMeshEntityMapIt;
 
 } // namespace hpl
diff --git a/engines/hpl1/penumbra-overture/GameTypes.h b/engines/hpl1/penumbra-overture/GameTypes.h
index 0e2acbe2470..ce8e352d825 100644
--- a/engines/hpl1/penumbra-overture/GameTypes.h
+++ b/engines/hpl1/penumbra-overture/GameTypes.h
@@ -34,7 +34,7 @@
 #define kCopyFromVar(aVar, aVal) (aVal = aVar->aVal)
 
 #include "hpl1/engine/engine.h"
-#include "hpl1/std/multimap.h"
+#include "common/multimap.h"
 
 using namespace hpl;
 
@@ -243,7 +243,7 @@ class cInventoryUseCallback : public iSerializable {
 	tString msFunction;
 };
 
-typedef Hpl1::Std::multimap<tString, cInventoryUseCallback *> tInventoryUseCallbackMap;
+typedef Common::MultiMap<tString, cInventoryUseCallback *> tInventoryUseCallbackMap;
 typedef tInventoryUseCallbackMap::iterator tInventoryUseCallbackMapIt;
 
 //-----------------------------------------
@@ -253,7 +253,7 @@ class cInventoryPickupCallback : public iSerializable {
 	tString msFunction;
 };
 
-typedef Hpl1::Std::multimap<tString, cInventoryPickupCallback *> tInventoryPickupCallbackMap;
+typedef Common::MultiMap<tString, cInventoryPickupCallback *> tInventoryPickupCallbackMap;
 typedef tInventoryPickupCallbackMap::iterator tInventoryPickupCallbackMapIt;
 
 //-----------------------------------------
diff --git a/engines/hpl1/penumbra-overture/Inventory.h b/engines/hpl1/penumbra-overture/Inventory.h
index 1bfb9fb8e70..bf1c739f9f5 100644
--- a/engines/hpl1/penumbra-overture/Inventory.h
+++ b/engines/hpl1/penumbra-overture/Inventory.h
@@ -184,7 +184,7 @@ private:
 	int mlCount;
 };
 
-typedef Hpl1::Std::multimap<tString, cInventoryItem *> tInventoryItemMap;
+typedef Common::MultiMap<tString, cInventoryItem *> tInventoryItemMap;
 typedef tInventoryItemMap::iterator tInventoryItemMapIt;
 
 //-----------------------------------------
diff --git a/engines/hpl1/penumbra-overture/MapHandler.h b/engines/hpl1/penumbra-overture/MapHandler.h
index e5f8810498d..eadabf34b63 100644
--- a/engines/hpl1/penumbra-overture/MapHandler.h
+++ b/engines/hpl1/penumbra-overture/MapHandler.h
@@ -44,7 +44,7 @@ class cSavedWorld;
 class cGameTimer;
 class cGameItem;
 
-typedef Hpl1::Std::multimap<tString, iGameEntity *> tGameEntityMap;
+typedef Common::MultiMap<tString, iGameEntity *> tGameEntityMap;
 typedef tGameEntityMap::iterator tGameEntityMapIt;
 
 typedef Common::Array<iGameEntity *> tGameEntityVec;
diff --git a/engines/hpl1/penumbra-overture/TriggerHandler.h b/engines/hpl1/penumbra-overture/TriggerHandler.h
index c7120f80f42..91c9ea847c9 100644
--- a/engines/hpl1/penumbra-overture/TriggerHandler.h
+++ b/engines/hpl1/penumbra-overture/TriggerHandler.h
@@ -66,7 +66,7 @@ private:
 	float mfRadius;
 };
 
-typedef Hpl1::Std::multimap<int, cGameTrigger *, Common::Greater<int> > tGameTriggerMap;
+typedef Common::MultiMap<int, cGameTrigger *, Common::Greater<int> > tGameTriggerMap;
 typedef tGameTriggerMap::iterator tGameTriggerMapIt;
 
 //----------------------------------------
diff --git a/engines/hpl1/std/multimap.h b/engines/hpl1/std/multimap.h
deleted file mode 100644
index bc115324b99..00000000000
--- a/engines/hpl1/std/multimap.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef HPL1_STD_MULTIMAP_H
-#define HPL1_STD_MULTIMAP_H
-
-#include "hpl1/std/pair.h"
-#include "hpl1/std/tree.h"
-
-namespace Hpl1 {
-
-namespace Std {
-
-template<class Key, class Val, class CompFunc = Common::Less<Key> >
-class multimap {
-	using TreeT = Tree<pair<Key, Val>, Key, PairKey<Key, Val>, CompFunc>;
-
-public:
-	using value_type = pair<Key, Val>;
-	using iterator = typename TreeT::BasicIterator;
-	using const_iterator = typename TreeT::ConstIterator;
-
-	/**
-	 * Clears the map
-	 */
-	void clear() {
-		_items.clear();
-	}
-
-	/**
-	 * Gets the iterator start
-	 */
-	iterator begin() {
-		return _items.begin();
-	}
-
-	/**
-	 * Get the iterator end
-	 */
-	iterator end() {
-		return _items.end();
-	}
-
-	/**
-	 * Get the const iterator start
-	 */
-	const_iterator begin() const {
-		return _items.begin();
-	}
-
-	/**
-	 * Get the const iterator end
-	 */
-	const_iterator end() const {
-		return _items.end();
-	}
-
-	/**
-	 * Returns an iterator for the first element of the map that is
-	 * not less than the given key
-	 */
-	const_iterator lower_bound(const Key &key) const {
-		return _items.lowerBound(key);
-	}
-
-	iterator lower_bound(const Key &key) {
-		return _items.lowerBound(key);
-	}
-
-	iterator upper_bound(const Key &key) {
-		return _items.upperBound(key);
-	}
-
-	/**
-	 * Find the entry with the given key
-	 */
-	iterator find(const Key &theKey) {
-		iterator it = _items.lowerBound(theKey);
-		if (it != this->end() && compareEqual(it->first, theKey))
-			return it;
-		return this->end();
-	}
-
-	const_iterator find(const Key &theKey) const {
-		const_iterator it = _items.lowerBound(theKey);
-		if (it != this->end() && compareEqual(it->first, theKey))
-			return it;
-		return this->end();
-	}
-
-	/**
-	 * Erases an entry in the map
-	 */
-	iterator erase(iterator it) {
-		return _items.erase(it);
-	}
-
-	iterator erase(iterator first, iterator last) {
-		return _items.erase(first, last);
-	}
-
-	iterator erase(const Key &theKey) {
-		const iterator first = find(theKey);
-		iterator last = first;
-		while (last != this->end() && compareEqual(last->first, theKey))
-			++last;
-		return _items.erase(first, last);
-	}
-
-	iterator insert(const value_type &val) {
-		return _items.insert(val);
-	}
-
-	/**
-	 * Returns the size of the map
-	 */
-	size_t size() const {
-		return _items.size();
-	}
-
-	bool empty() const {
-		return _items.isEmpty();
-	}
-
-	/**
-	 * Returns the number of elements with a matching key
-	 */
-	size_t count(const Key &theKey) {
-		int count_ = 0;
-		for (iterator it = this->begin(); it != this->end(); ++it) {
-			if (compareEqual(it->first, theKey))
-				++count_;
-		}
-		return count_;
-	}
-
-private:
-	bool compareEqual(const Key &a, const Key &b) {
-		return !_comp(a, b) && !_comp(b, a);
-	}
-
-	TreeT _items;
-	CompFunc _comp;
-};
-
-} // namespace Std
-} // namespace Hpl1
-
-#endif




More information about the Scummvm-git-logs mailing list