27 #ifndef ICB_ICON_LIST_H_INCLUDED 28 #define ICB_ICON_LIST_H_INCLUDED 31 #include "engines/icb/common/px_string.h" 32 #include "engines/icb/common/px_clu_api.h" 33 #include "engines/icb/p4.h" 34 #include "engines/icb/debug.h" 35 #include "engines/icb/string_vest.h" 39 extern const char *global_deleted_list;
42 #define ICON_LIST_DELETED_PLACEHOLDER global_deleted_list 45 enum IconListScope { CURRENT_LOGIC = 0, SESSION_WIDE, MISSION_WIDE, GAME_WIDE };
48 #define ICON_LIST_MAX_ICONS 16 // This defines an array size, so must be a multiple of 4! 51 #define ICON_LIST_MAX_DISPLAYED 10 54 #define ICON_MAX_DUPLICATE_COUNT 99 57 #define ICON_LIST_NO_SELECTION (-1) 61 extern const char *iconListEmptyIcon;
62 #define ICON_LIST_EMPTY_ICON iconListEmptyIcon 82 const char *GetListName()
const {
return (m_pcListName); }
83 void SetListName(
const char *pcListName) { m_pcListName = pcListName; }
85 uint8 GetIconCount()
const {
return (m_nItemCount); }
87 IconListScope GetScope()
const {
return (m_eScope); }
88 void SetScope(IconListScope eScope) { m_eScope = eScope; }
90 inline const char *GetIcon(uint32 nIndex)
const;
91 inline uint32 GetIconHash(uint32 nIndex)
const;
92 uint8 GetDuplicateCount(
const char *pcIconName)
const;
93 uint8 GetDuplicateCount(uint32 nIndex)
const;
95 void SetAbsoluteIconCount(
const char *pcIconName, uint32 nCount);
98 int32 GetIconPosition(
const char *pcIconName)
const;
101 void AddIcon(
const char *pcIconName,
const uint32 nIconNameHash);
102 void RemoveIcon(
const char *pcIconName, bool8 bForceRemove);
105 const char *m_pcListName;
106 IconListScope m_eScope;
107 uint32 m_pnIconListHash[ICON_LIST_MAX_ICONS];
108 uint8 m_pnDuplicateCount[ICON_LIST_MAX_ICONS];
109 char m_ppcIconList[ICON_LIST_MAX_ICONS][MAXLEN_ICON_NAME];
111 bool8 m_bAllowDuplicates;
119 inline _icon_list::_icon_list(
const _icon_list &oX) { Clone(oX); }
127 inline void _icon_list::Reset() {
128 memset((uint8 *)m_pnIconListHash, 0, ICON_LIST_MAX_ICONS *
sizeof(uint32));
129 memset((uint8 *)m_pnDuplicateCount, 0, ICON_LIST_MAX_ICONS *
sizeof(uint8));
130 memset((uint8 *)m_ppcIconList, 0, ICON_LIST_MAX_ICONS * MAXLEN_ICON_NAME *
sizeof(
char));
134 inline const char *_icon_list::GetIcon(uint32 nIndex)
const {
return (m_ppcIconList[nIndex]); }
136 inline uint32 _icon_list::GetIconHash(uint32 nIndex)
const {
137 if (nIndex >= m_nItemCount) {
138 Fatal_error(
"_icon_list::GetIconHash( %d ) called - list has %d items", nIndex, m_nItemCount);
141 return (m_pnIconListHash[nIndex]);
146 #endif // #if !defined( ICON_LIST_H_INCLUDED )
Definition: icon_list.h:65