![]() |
DDNet documentation
|
Classes | |
| struct | SSectionKeyHash |
| struct | SSectionKeyEquals |
| struct | SSection |
Public Member Functions | |
| void | Clear (size_t TextureDimension) |
| void | IncreaseDimension (size_t NewTextureDimension) |
| bool | Add (size_t Width, size_t Height, int &PosX, int &PosY) |
Private Member Functions | |
| void | AddSection (size_t X, size_t Y, size_t W, size_t H) |
| void | UseSection (const SSection &Section, size_t Width, size_t Height, int &PosX, int &PosY) |
Private Attributes | |
| size_t | m_TextureDimension |
| std::vector< SSection > | m_vSections |
| std::unordered_map< std::tuple< size_t, size_t >, std::vector< SSection >, SSectionKeyHash, SSectionKeyEquals > | m_SectionsMap |
Static Private Attributes | |
| static constexpr size_t | MIN_SECTION_DIMENSION = 6 |
| static constexpr size_t | MAX_SECTION_DIMENSION_MAPPED = 8 * MIN_SECTION_DIMENSION |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inlineprivate |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
Sections with larger width or height will be stored in m_vSections. Sections with width and height equal or smaller will be stored in m_SectionsMap. This achieves a good balance between the size of the vector storing all large sections and the map storing vectors of all sections with specific small sizes. Lowering this value will result in the size of m_vSections becoming the bottleneck. Increasing this value will result in the map becoming the bottleneck.
|
staticconstexprprivate |
Sections with a smaller width or height will not be created when cutting larger sections, to prevent collecting many small, mostly unusable sections.