Exemplo n.º 1
0
bool FieldParser::ParseVector3Field(ESMStream& stream, uint16_t length, Vector3F& outVector) {
    if (length <= sizeof(float) * 3)
        return false;
    
    stream.ReadRaw(&outVector.X, sizeof(outVector.X));
    stream.ReadRaw(&outVector.Y, sizeof(outVector.Y));
    stream.ReadRaw(&outVector.Z, sizeof(outVector.Z));
    
    return true;
}
Exemplo n.º 2
0
bool FieldParser::ParseBinaryField(ESMStream& stream, uint16_t length, std::vector<uint8_t>& outVector) {
    outVector.resize(length);
    
    stream.ReadRaw(&outVector[0], length);
    
    return true;
}
Exemplo n.º 3
0
bool FieldParser::ParseOFSTField(ESMStream& stream, uint32_t length, std::vector<uint32_t>& outValue) {
    outValue.reserve(length / sizeof(uint32_t));
    
    stream.ReadRaw(&outValue[0], length);
    
    return true;
}
Exemplo n.º 4
0
bool FieldParser::ParseFormID(ESMStream& stream, uint16_t length, FormIdentifier& outValue) {
    if (length != sizeof(outValue))
        return false;
    
    stream.ReadRaw(&outValue, sizeof(outValue));
    
    return true;
}
Exemplo n.º 5
0
bool FieldParser::ParseByteValue(ESMStream& stream, uint16_t length, uint8_t& outValue) {
    if (length != sizeof(outValue))
        return false;
    
    stream.ReadRaw(&outValue, sizeof(outValue));
    
    return true;
}
Exemplo n.º 6
0
bool FieldParser::ParseHavokData(ESMStream& stream, uint16_t length, LandTextureHavokData& havokData) {
    if (length != sizeof(havokData))
        return false;
    
    stream.ReadRaw(&havokData, sizeof(havokData));
    
    return true;
}
Exemplo n.º 7
0
bool FieldParser::ParseSCHRField(ESMStream& stream, uint16_t length, SCHRField& outField) {
    if (length != sizeof(outField))
        return false;
    
    stream.ReadRaw(&outField, sizeof(outField));
    
    return true;
}
Exemplo n.º 8
0
bool FieldParser::ParseXCLCField(ESMStream& stream, uint16_t length, XCLCField& outField) {
    //FIXME: According to the documents this is a 12 byte field, however I'm encountering only 8 bytes.
    if (length != sizeof(outField))
    {
        if (length == sizeof(uint32_t) * 2) {
            stream.Read32((uint32_t &)outField.X);
            stream.Read32((uint32_t &)outField.Y);
            
            outField.LandHideFlags = LandHideFlag::None;
            return true;
        }
        
        return false;
    }
    
    stream.ReadRaw(&outField, sizeof(outField));
    
    return true;
}
Exemplo n.º 9
0
void ParseRecordHeader(ESMStream& stream, RecordHeader& header) {
    //FIXME: This is not portable.
    stream.ReadRaw(&header, sizeof(header));
}