ManaPlus
Public Member Functions | Data Fields
AtlasItem Struct Reference

#include <atlasitem.h>

Inheritance diagram for AtlasItem:
MemoryCounter

Public Member Functions

 AtlasItem (Image *const image0)
 
int calcMemoryLocal () const
 
std::string getCounterName () const
 
- Public Member Functions inherited from MemoryCounter
 MemoryCounter ()
 
virtual ~MemoryCounter ()
 
int calcMemory (const int level) const
 
virtual int calcMemoryChilds (const int level) const
 

Data Fields

Imageimage
 
std::string name
 
int x
 
int y
 
int width
 
int height
 

Detailed Description

Definition at line 29 of file atlasitem.h.

Constructor & Destructor Documentation

◆ AtlasItem()

AtlasItem::AtlasItem ( Image *const  image0)
inlineexplicit

Definition at line 31 of file atlasitem.h.

31  :
32  MemoryCounter(),
33  image(image0),
34  name(),
35  x(0),
36  y(0),
37  width(image0 != nullptr ? image0->mBounds.w : 0),
38  height(image0 != nullptr ? image0->mBounds.h : 0)
39  {
40  }
int height
Definition: atlasitem.h:59
Image * image
Definition: atlasitem.h:54
int width
Definition: atlasitem.h:58
std::string name
Definition: atlasitem.h:55

Referenced by calcMemoryLocal().

Member Function Documentation

◆ calcMemoryLocal()

int AtlasItem::calcMemoryLocal ( ) const
inlinevirtual

Reimplemented from MemoryCounter.

Definition at line 44 of file atlasitem.h.

45  {
46  return static_cast<int>(sizeof(AtlasItem) +
47  name.capacity());
48  // +++ here need print, but not add to sum size of image
49  }
AtlasItem(Image *const image0)
Definition: atlasitem.h:31

References AtlasItem(), and name.

◆ getCounterName()

std::string AtlasItem::getCounterName ( ) const
inlinevirtual

Reimplemented from MemoryCounter.

Definition at line 51 of file atlasitem.h.

52  { return name; }

References name.

Field Documentation

◆ height

int AtlasItem::height

Definition at line 59 of file atlasitem.h.

Referenced by AtlasManager::convertAtlas(), and AtlasManager::convertEmptyAtlas().

◆ image

Image* AtlasItem::image

◆ name

std::string AtlasItem::name

◆ width

int AtlasItem::width

Definition at line 58 of file atlasitem.h.

Referenced by AtlasManager::convertAtlas(), and AtlasManager::convertEmptyAtlas().

◆ x

int AtlasItem::x

◆ y

int AtlasItem::y

The documentation for this struct was generated from the following file: