Original Post
I'm having a problem with my std::vector function that is supposed to clear certain information: My defines are: A possible value for something in the std::vector dataType might consist of (UIENT_BUTTON | UIENT_RECT). For some reason unknown to me, some parts of the vector that have UIENT_BUTTON in them (like (UIENT_BUTTON | UIENT_RECT)) don't get erased. That is to say, some of them do and some don't.
int UserInterface::ClearButton() {
std::vector<void*>::iterator i=data.begin();
std::vector<int>::iterator i2=dataType.begin();
for(;i != data.end();i++,i2++) {
if(*i2 & UIENT_BUTTON) {
data.erase(i);
dataType.erase(i2);
}
}
return 1;
}
#define UIENT_BLANK 0x00010000
#define UIENT_SPRITE 0x00020000
#define UIENT_BUTTON 0x00040000
#define UIENT_TEXTA 0x00080000
#define UIENT_MOUSE 0x00110000
#define UIENT_LIST 0x00120000
#define UIENT_TEXTURE 0x00000001
#define UIENT_POSITION 0x00000002
#define UIENT_TEXTB 0x00000004
#define UIENT_TEXTB1 0x00000010
#define UIENT_TITLE UIENT_TEXTB1
#define UIENT_TEXTB2 0x00004444
#define UIENT_ENTRY 0x00001110
#define UIENT_RECT 0x00000008
#define UIENT_ACTION 0x00000011
#define UIENT_TYPE 0x00000012
#define UIENT_COLOR 0x00000014
#define UIENT_WIDTH 0x00000102