____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"00001 // ____ _ __ 00002 // / __ )____ _____ | | / /___ ___________ 00003 // / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ 00004 // / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) 00005 // /_____/\____/____/ |__/|__/\__,_/_/ /____/ 00006 // 00007 // A futuristic real-time strategy game. 00008 // This file is part of Bos Wars. 00009 // 00011 // 00012 // (c) Copyright 1998-2007 by Lutz Sammer 00013 // 00014 // This program is free software; you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation; only version 2 of the License. 00017 // 00018 // This program is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU General Public License for more details. 00022 // 00023 // You should have received a copy of the GNU General Public License 00024 // along with this program; if not, write to the Free Software 00025 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00026 // 02111-1307, USA. 00027 00028 #ifndef __ICONS_H__ 00029 #define __ICONS_H__ 00030 00032 00033 #include <string> 00034 #include <map> 00035 00036 /*---------------------------------------------------------------------------- 00037 -- Documentation 00038 ----------------------------------------------------------------------------*/ 00039 00085 /*---------------------------------------------------------------------------- 00086 -- Defines 00087 ----------------------------------------------------------------------------*/ 00088 00089 #define IconActive 1 00090 #define IconClicked 2 00091 #define IconSelected 4 00092 #define IconDisabled 8 00093 #define IconAutoCast 16 00094 00095 /*---------------------------------------------------------------------------- 00096 -- Declarations 00097 ----------------------------------------------------------------------------*/ 00098 00099 class CGraphic; 00100 class CPlayer; 00101 class ButtonStyle; 00102 00104 class CIcon { 00105 public: 00106 CIcon(const std::string &ident); 00107 ~CIcon(); 00108 00109 static CIcon *New(const std::string &ident); 00110 static CIcon *Get(const std::string &ident); 00111 00113 void DrawIcon(const CPlayer *player, int x, int y) const; 00115 void DrawUnitIcon(const CPlayer *player, ButtonStyle *style, 00116 unsigned flags, int x, int y, const std::string &text) const; 00117 00118 inline const std::string &GetIdent() { return this->Ident; } 00119 00120 CGraphic *G; 00121 int Frame; 00122 private: 00123 std::string Ident; 00124 }; 00125 00127 class IconConfig { 00128 public: 00129 IconConfig() : Icon(NULL) {} 00130 00131 void Load(); 00132 00133 std::string Name; 00134 CIcon *Icon; 00135 }; 00136 00137 extern std::map<std::string, CIcon *> Icons; 00138 00139 /*---------------------------------------------------------------------------- 00140 -- Functions 00141 ----------------------------------------------------------------------------*/ 00142 00143 extern void InitIcons(void); 00144 extern void LoadIcons(void); 00145 extern void CleanIcons(void); 00146 00148 extern void IconCclRegister(void); 00149 00151 00152 #endif // !__ICONS_H__
1.5.6