#pragma once #include #include using namespace Framework; class ColorMode { private: int ref; public: ColorMode(); virtual Bild *colorImage( Bild *zImg, int color ); ColorMode *getThis(); ColorMode *release(); }; class AlphaColorMode : public ColorMode { private: unsigned char alpha; public: AlphaColorMode( unsigned char alpha ); Bild *colorImage( Bild *zImg, int color ) override; }; class MaskColorMode : public ColorMode { private: int colorToReplace; public: MaskColorMode( int colorToReplace ); Bild *colorImage( Bild *zImg, int color ) override; }; enum ResourceIds { R_BARIERE, R_BASE, R_PFEIL_GESCHOSS, R_PFEIL, R_LEBEN, R_SCHILD, R_SCHUH, R_GEIST, R_ROLLE, R_ROLLE_OBEN, R_ROLLE_LINKS, R_ROLLE_RECHTS, R_ROLLE_UNTEN, R_STURM, R_STURM_OBEN, R_STURM_LINKS, R_STURM_RECHTS, R_STURM_UNTEN, R_DRACHENAUGE, R_DRACHENAUGE_GESCHOSS, R_FEUERBALL, R_FEUERBALL_GESCHOSS, R_FEUERBALL_TREFFER, R_ENTERHAKEN_SEIL, R_ENTERHAKEN_SPITZE, R_ENTERHAKEN_ITEM, R_MINE, R_MINE_GESCHOSS, R_RWEISHEIT, R_RBOSHEIT, R_RLEBEN, R_RTEMPO, R_RSTRENGTH, R_SCHALTER, R_SCHIENE, R_SPIELER_STIRBT, R_SPIELER, R_SPIELER_RECHTS, R_SPIELER_LINKS, R_BRAND, R_EXPLOSION, R_HEILUNG, R_SCHADEN, R_TUNNEL, R_UMLENKUNG, R_RWEISHEIT_EFFECT, R_RBOSHEIT_EFFECT, R_RLEBEN_EFFECT, R_RTEMPO_EFFECT, R_RSTRENGTH_EFFECT, R_KUGEL_GESCHOSS, R_KUGEL, R_GUI_SPIELER, R_GUI_ERF_RAND, R_GUI_ERF, R_GUI_INVENTAR_AUSWAHL, R_GUI_INVENTAR_HINTERGRUND, R_GUI_INVENTAR_HINTERGRUND_BENUTZT, R_GUI_LEBEN_RAND, R_GUI_LEVEL_RAND }; class ResourceRegistry; class Resource { private: ResourceIds id; int color; int ref; RCArray< Bild > images; public: Resource( ResourceIds id, int color ); virtual Resource *createColoredResource( int color, ColorMode *mode ) const; Iterator< Bild * > getImages() const; ResourceIds getId() const; int getColor() const; Bild *zImage( int id ) const; Bild *getImage( int id ) const; int getImageCount() const; Resource *getThis(); Resource *release(); friend ResourceRegistry; }; class ResourceRegistry { private: RCArray< Resource > resources; Text spielPfad; Text mapPfad; Schrift *schrift; int ref; public: ResourceRegistry( Text spielPfad, Text mapPfad ); ~ResourceRegistry(); void setSchrift( Schrift *schrift ); Schrift *zSchrift() const; Schrift *getSchrift() const; Resource *getResource( ResourceIds id, int color, ColorMode *mode = 0, Text path = "" ); Resource *zResource( ResourceIds id, int color, ColorMode *mode = 0, Text path = "" ); ResourceRegistry *getThis(); ResourceRegistry *release(); };