string Dictionary::GetDefinition(int wordIndex, char const *prepend, char const *appendText) { string definition; if(wordIndex >= 0 && wordIndex < (int)mNumWords) { char const *def = mDefinition[wordIndex]; uint16 mask = GetU16(def); for(int i=0; i<kNumWordTypes; ++i) { if((mask & (1 << i)) != 0) { definition += prepend; definition += "("; definition += sDefinitionNames[i]; definition += ") "; uint8 type = *def++; if(type == kNone) { definition += def; def += strlen(def) + 1; } else { uint32 word = GetU24(def); definition += sReferenceText[type]; definition += " of @"; definition += mWord + word * 8; definition += "@"; } definition += appendText; } } } return definition; }
static inline uint32 GetU24(uint8 const * &d) { return GetU24((char const * &)d); }
uint32_t utils::GetU24c(char *str,int &pos){ uint32_t r = GetU24(str,pos); pos += 3; return r; }