summaryrefslogtreecommitdiff
path: root/src/resources/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-04 02:38:36 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-04 02:38:36 +0300
commita698e2e44e3dfa157c2b184a184db204b44a6a30 (patch)
tree66876f11a3e80e5bfab69cfd4ce17ed2a59df896 /src/resources/map
parent44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0 (diff)
downloadplus-a698e2e44e3dfa157c2b184a184db204b44a6a30.tar.gz
plus-a698e2e44e3dfa157c2b184a184db204b44a6a30.tar.bz2
plus-a698e2e44e3dfa157c2b184a184db204b44a6a30.tar.xz
plus-a698e2e44e3dfa157c2b184a184db204b44a6a30.zip
Show current atlases count in debug window.
If use too many images, atlase can be split to more than one. And this is performance issue.
Diffstat (limited to 'src/resources/map')
-rw-r--r--src/resources/map/map.cpp9
-rw-r--r--src/resources/map/map.h7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 1e97597bf..c9636183e 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -42,6 +42,8 @@
#include "resources/ambientlayer.h"
+#include "resources/atlas/atlasresource.h"
+
#include "resources/image/subimage.h"
#include "resources/loaders/imageloader.h"
@@ -1791,3 +1793,10 @@ int Map::calcMemoryChilds(const int level) const
mHeights->calcMemory(level + 1);
return sz;
}
+
+int Map::getAtlasCount() const restrict2
+{
+ if (mAtlas == nullptr)
+ return 0;
+ return CAST_S32(mAtlas->atlases.size());
+}
diff --git a/src/resources/map/map.h b/src/resources/map/map.h
index fbb3e43da..a3397ad2e 100644
--- a/src/resources/map/map.h
+++ b/src/resources/map/map.h
@@ -42,6 +42,7 @@
#include "resources/map/properties.h"
class AmbientLayer;
+class AtlasResource;
class MapHeights;
class MapItem;
class MapLayer;
@@ -283,6 +284,8 @@ class Map final : public Properties,
int getActorsCount() const restrict2 A_WARN_UNUSED
{ return CAST_S32(mActors.size()); }
+ int getAtlasCount() const restrict2 A_WARN_UNUSED;
+
void setPvpMode(const int mode) restrict2;
int getPvpMode() const restrict2 noexcept2 A_WARN_UNUSED
@@ -327,7 +330,7 @@ class Map final : public Properties,
restrict2 noexcept2 A_WARN_UNUSED
{ return mTileAnimations; }
- void setAtlas(Resource *restrict const atlas) restrict2 noexcept2
+ void setAtlas(AtlasResource *restrict const atlas) restrict2 noexcept2
{ mAtlas = atlas; }
const MetaTile *getMetaTiles() const restrict2 noexcept2
@@ -483,7 +486,7 @@ class Map final : public Properties,
int mDrawScrollX;
int mDrawScrollY;
int mMask;
- Resource *mAtlas;
+ AtlasResource *mAtlas;
const MapHeights *mHeights;
bool mRedrawMap;
bool mBeingOpacity;