Crossfire Server, Trunk
CREPixmap.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CREPIXMAP_H
14 #define CREPIXMAP_H
15 
16 #include <QtWidgets>
17 extern "C" {
18 #include "global.h"
19 #include "image.h"
20 }
21 
22 class CREPixmap
23 {
24  public:
25  static void init();
26 
27  static face_sets *faceset;
28  static void setFaceset(const QString& prefix);
29  static void setUseFacesetFallback(bool use);
30  static void clearFaceCache();
31 
32  static QIcon getIcon(uint16_t faceNumber);
33  static QIcon getIcon(const Face *face);
34 
35  static QIcon getTreasureIcon();
36  static QIcon getTreasureOneIcon();
37  static QIcon getTreasureYesIcon();
38  static QIcon getTreasureNoIcon();
39 
40  protected:
41  static QIcon getIcon(const face_sets* faceset, uint16_t faceNumber);
42 
43  static QHash<uint16_t, QIcon> allFaces;
44  static QIcon* myTreasureIcon;
45  static QIcon* myTreasureOneIcon;
46  static QIcon* myTreasureYesIcon;
47  static QIcon* myTreasureNoIcon;
48  static bool myUseFaceFallback;
49 };
50 
51 #endif // CREPIXMAP_H
CREPixmap::setFaceset
static void setFaceset(const QString &prefix)
Definition: CREPixmap.cpp:46
Face
Definition: face.h:14
CREPixmap::allFaces
static QHash< uint16_t, QIcon > allFaces
Definition: CREPixmap.h:43
global.h
castle_read.prefix
string prefix
Definition: castle_read.py:31
CREPixmap::setUseFacesetFallback
static void setUseFacesetFallback(bool use)
Definition: CREPixmap.cpp:54
CREPixmap::getTreasureIcon
static QIcon getTreasureIcon()
Definition: CREPixmap.cpp:104
CREPixmap::getIcon
static QIcon getIcon(uint16_t faceNumber)
Definition: CREPixmap.cpp:67
CREPixmap::myTreasureYesIcon
static QIcon * myTreasureYesIcon
Definition: CREPixmap.h:46
CREPixmap::myTreasureOneIcon
static QIcon * myTreasureOneIcon
Definition: CREPixmap.h:45
CREPixmap::myTreasureNoIcon
static QIcon * myTreasureNoIcon
Definition: CREPixmap.h:47
CREPixmap::faceset
static face_sets * faceset
Definition: CREPixmap.h:27
CREPixmap::getTreasureYesIcon
static QIcon getTreasureYesIcon()
Definition: CREPixmap.cpp:116
image.h
CREPixmap
Definition: CREPixmap.h:22
CREPixmap::getTreasureOneIcon
static QIcon getTreasureOneIcon()
Definition: CREPixmap.cpp:110
CREPixmap::myUseFaceFallback
static bool myUseFaceFallback
Definition: CREPixmap.h:48
CREPixmap::init
static void init()
Definition: CREPixmap.cpp:34
CREPixmap::clearFaceCache
static void clearFaceCache()
Definition: CREPixmap.cpp:62
face_sets
Definition: image.h:17
CREPixmap::getTreasureNoIcon
static QIcon getTreasureNoIcon()
Definition: CREPixmap.cpp:122
CREPixmap::myTreasureIcon
static QIcon * myTreasureIcon
Definition: CREPixmap.h:44