diff --git a/saco/net/labelpool.cpp b/saco/net/labelpool.cpp index de697a5..cd2c87b 100644 --- a/saco/net/labelpool.cpp +++ b/saco/net/labelpool.cpp @@ -3,9 +3,22 @@ CLabelPool::CLabelPool() { - for(WORD wLabel = 0; wLabel < MAX_LABELS; wLabel++) + for(WORD wLabelID = 0; wLabelID < MAX_LABELS; wLabelID++) { - memset(&field_0[wLabel], 0, sizeof(struc_92)); - field_E800[wLabel] = 0; + memset(&m_Labels[wLabelID], 0, sizeof(LABEL)); + m_bLabelSlotState[wLabelID] = FALSE; } } + +BOOL CLabelPool::Delete(WORD wLabelID) +{ + if(wLabelID >= MAX_LABELS) return FALSE; + if(!m_bLabelSlotState[wLabelID]) return FALSE; + + if(m_Labels[wLabelID].szText) + free(m_Labels[wLabelID].szText); + memset(&m_Labels[wLabelID], 0, sizeof(LABEL)); + m_bLabelSlotState[wLabelID] = FALSE; + + return TRUE; +} diff --git a/saco/net/labelpool.h b/saco/net/labelpool.h index 6c5ce7e..933c9bf 100644 --- a/saco/net/labelpool.h +++ b/saco/net/labelpool.h @@ -1,17 +1,20 @@ #pragma once -struct struc_92 +typedef struct _LABEL { - char _gap[29]; -}; + char *szText; + char _gap4[25]; +} LABEL; class CLabelPool { private: - struc_92 field_0[MAX_LABELS]; - int field_E800[MAX_LABELS]; + LABEL m_Labels[MAX_LABELS]; + BOOL m_bLabelSlotState[MAX_LABELS]; public: CLabelPool(); + BOOL Delete(WORD wLabelID); + };