12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include "Array.h"
- #include "Critical.h"
- namespace Framework
- {
- class Textur; //! Textur.h
- //! Verwaltet alle geladenen Texturdaten, so dass mehrere Zeichnungen die selben Daten benutzen können
- class TexturList
- {
- private:
- static int id;
- static Critical cs;
- RCArray< Textur > *textures;
- RCArray< Text > *names;
- int ref;
- public:
- //! Konstruktor
- TexturList();
- //! Destruktor
- ~TexturList();
- //! Löscht alle Texturen
- DLLEXPORT void leeren();
- //! Fügt der Liste eine Textur hinzu
- //! \param t Die Textur
- //! \param name Der name, unter dem die Textur in der Liste gespeichert wird
- DLLEXPORT bool addTextur( Textur *t, const char *name );
- //! Entfernt eine Textur aus der Liste
- //! \param name Der Name der Textur
- DLLEXPORT void removeTextur( const char *name );
- //! Überprüft, ob unter einem bestimmten Namen eine Textur abgespeichert wurde
- //! \param name Der Name
- //! \return true, wenn eine Textur mit dem Namen existiert
- DLLEXPORT bool hatTextur( const char *name ) const;
- //! Gibt eine bestimmte Textur zurück
- //! \param name Der Name der Textur
- DLLEXPORT Textur *getTextur( const char *name ) const;
- //! Gibt eine bestimmte Textur zurück
- //! \param id Die Id der Textur
- DLLEXPORT Textur *getTextur( int id ) const;
- //! Gibt eine bestimmte Textur ohne erhöhten Reference Counter zurück
- //! \param name Der Name der Textur
- DLLEXPORT Textur *zTextur( const char *name ) const;
- //! Gibt eine bestimmte Textur ohne erhöhten Reference Counter zurück
- //! \param id Die Id der Textur
- DLLEXPORT Textur *zTextur( int id ) const;
- //! Erhöht den Reference Counting Zähler.
- //! \return this.
- DLLEXPORT TexturList *getThis();
- //! Verringert den Reference Counting Zähler. Wenn der Zähler 0 erreicht, wird das Zeichnung automatisch gelöscht.
- //! \return 0.
- DLLEXPORT TexturList *release();
- //! Initialisiert statische private member. Wird vom Framework automatisch aufgerufen.
- static void init();
- //! Löscht statische private member. Wird vom Framework automatisch aufgerufen.
- static void destroy();
- };
- }
|