Back to index

kdeartwork  4.3.2
Public Member Functions | Public Attributes
ZKey Struct Reference

Utility type used to faciliate sorting of the Sprite list in order to implement the Painter's Algorithm when painting the back buffer. More...

Collaboration diagram for ZKey:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ZKey ()
 ZKey (Sprite *spr)
bool operator< (const ZKey &other) const

Public Attributes

int z
 Logical depth of sprite.
Spriteaddr

Detailed Description

Utility type used to faciliate sorting of the Sprite list in order to implement the Painter's Algorithm when painting the back buffer.

Definition at line 122 of file screen.cpp.


Constructor & Destructor Documentation

ZKey::ZKey ( ) [inline]

Definition at line 132 of file screen.cpp.

          : z(0), addr(0)
    {}
ZKey::ZKey ( Sprite spr) [inline]

Definition at line 135 of file screen.cpp.

                     : z(1000 - spr->depth()), addr(spr)
    {}

Member Function Documentation

bool ZKey::operator< ( const ZKey other) const [inline]

Definition at line 138 of file screen.cpp.

    {
        if (z < other.z) return true;
        if (z > other.z) return false;

        return addr < other.addr;
    }

Member Data Documentation

Definition at line 130 of file screen.cpp.

int ZKey::z

Logical depth of sprite.

Now 0 is farthest away from the eyes, unlike with Sprite::depth().

Definition at line 128 of file screen.cpp.


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