예제 #1
0
파일: LANDRecord.cpp 프로젝트: Dienes/CBash
bool LANDRecord::deep_equals(Record *master, RecordOp &read_self, RecordOp &read_master, boost::unordered_set<Record *> &identical_records)
    {
    //Precondition: equals has been run for these records and returned true
    CELLRecord *parent_cell = (CELLRecord *)GetParentRecord(), *master_cell = (CELLRecord *)master->GetParentRecord();
    Record *parent_wrld = parent_cell->GetParentRecord(), *master_wrld = master_cell->GetParentRecord();
    //Check to make sure the parent cell is attached at the same spot
    if(parent_cell->formID != master_cell->formID)
        return false;
    if(parent_wrld != NULL)
        {
        if(master_wrld != NULL)
            {
            if(parent_wrld->formID != master_wrld->formID)
                return false;
            }
        else
            return false;
        }
    else if(master_wrld != NULL)
        return false;
    if(parent_wrld)
        {
        read_self.Accept((Record *&)parent_cell);
        read_master.Accept((Record *&)master_cell);
        parent_cell->XCLC.Load();
        master_cell->XCLC.Load();
        if(parent_cell->XCLC->posX != master_cell->XCLC->posX)
            return false;
        if(parent_cell->XCLC->posY != master_cell->XCLC->posY)
            return false;
        }
    return true;
    }
예제 #2
0
void * ACHRRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //flags2
            return &flagsUnk;
        case 4: //eid
            return EDID.value;
        case 5: //base
            return &NAME.value;
        case 6: //unknownXPCIFormID
            return (XPCI.IsLoaded() && XPCI->XPCI.IsLoaded()) ? &XPCI->XPCI.value : NULL;
        case 7: //unknownXPCIString
            return XPCI.IsLoaded() ? XPCI->FULL.value : NULL;
        case 8: //lod1
            return XLOD.IsLoaded() ? &XLOD->lod1 : NULL;
        case 9: //lod2
            return XLOD.IsLoaded() ? &XLOD->lod2 : NULL;
        case 10: //lod3
            return XLOD.IsLoaded() ? &XLOD->lod3 : NULL;
        case 11: //parent
            return XESP.IsLoaded() ? &XESP->parent : NULL;
        case 12: //parentFlags
            return XESP.IsLoaded() ? &XESP->flags : NULL;
        case 13: //unused1
            *FieldValues = XESP.IsLoaded() ? &XESP->unused1[0] : NULL;
            return NULL;
        case 14: //merchantContainer
            return XMRC.IsLoaded() ? &XMRC.value : NULL;
        case 15: //horse
            return XHRS.IsLoaded() ? &XHRS.value : NULL;
        case 16: //xrgd_p
            *FieldValues = XRGD.value;
            return NULL;
        case 17: //scale
            return XSCL.IsLoaded() ? &XSCL.value : NULL;
        case 18: //posX
            return &DATA.value.posX;
        case 19: //posY
            return &DATA.value.posY;
        case 20: //posZ
            return &DATA.value.posZ;
        case 21: //rotX
            return &DATA.value.rotX;
        case 22: //rotY
            return &DATA.value.rotY;
        case 23: //rotZ
            return &DATA.value.rotZ;
        case 24: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #3
0
파일: ROADRecord.cpp 프로젝트: Dienes/CBash
bool ROADRecord::deep_equals(Record *master, RecordOp &read_self, RecordOp &read_master, boost::unordered_set<Record *> &identical_records)
    {
    //Precondition: equals has been run for these records and returned true
    //Check to make sure the parent world is attached at the same spot
    if(GetParentRecord()->formID != master->GetParentRecord()->formID)
        return false;
    return true;
    }
예제 #4
0
void * ACRERecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //flags2
            return &flagsUnk;
        case 4: //eid
            return EDID.value;
        case 5: //base
            return &NAME.value;
        case 6: //owner
            return Ownership.IsLoaded() ? &Ownership->XOWN.value : NULL;
        case 7: //rank
            return Ownership.IsLoaded() ? Ownership->XRNK.value : NULL;
        case 8: //globalVariable
            return (Ownership.IsLoaded() && Ownership->XGLB.IsLoaded()) ? &Ownership->XGLB.value : NULL;
        case 9: //lod1
            return XLOD.IsLoaded() ? &XLOD->lod1 : NULL;
        case 10: //lod2
            return XLOD.IsLoaded() ? &XLOD->lod2 : NULL;
        case 11: //lod3
            return XLOD.IsLoaded() ? &XLOD->lod3 : NULL;
        case 12: //parent
            return XESP.IsLoaded() ? &XESP->parent : NULL;
        case 13: //parentFlags
            return XESP.IsLoaded() ? &XESP->flags : NULL;
        case 14: //unused1
            *FieldValues = XESP.IsLoaded() ? &XESP->unused1[0] : NULL;
            return NULL;
        case 15: //xrgd_p
            *FieldValues = XRGD.value;
            return NULL;
        case 16: //scale
            return XSCL.IsLoaded() ? &XSCL.value : NULL;
        case 17: //posX
            return &DATA.value.posX;
        case 18: //posY
            return &DATA.value.posY;
        case 19: //posZ
            return &DATA.value.posZ;
        case 20: //rotX
            return &DATA.value.rotX;
        case 21: //rotY
            return &DATA.value.rotY;
        case 22: //rotZ
            return &DATA.value.rotZ;
        case 23: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #5
0
void * ROADRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //flags2
            return &flagsUnk;
        case 5: //pgrp
            if(ListIndex >= PGRP.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //x
                    return &PGRP.value[ListIndex].x;
                case 2: //y
                    return &PGRP.value[ListIndex].y;
                case 3: //z
                    return &PGRP.value[ListIndex].z;
                case 4: //connections
                    return &PGRP.value[ListIndex].connections;
                case 5: //unused1
                    *FieldValues = &PGRP.value[ListIndex].unused1[0];
                    return NULL;
                default:
                    return NULL;
                }
            return NULL;
        case 6: //pgrr
            if(ListIndex >= PGRR.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //x
                    return &PGRR.value[ListIndex].x;
                case 2: //y
                    return &PGRR.value[ListIndex].y;
                case 3: //z
                    return &PGRR.value[ListIndex].z;
                default:
                    return NULL;
                }
            return NULL;
        case 7: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #6
0
void * PMISRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //versionControl1
            *FieldValues = &flagsUnk;
            return NULL;
        case 4: //eid
            return EDID.value;
        case 5: //formVersion
            return &formVersion;
        case 6: //versionControl2
            *FieldValues = &versionControl2[0];
            return NULL;
        case 7: //base
            return &NAME.value;
        case 8: //encounterZone
            return &XEZN.value;
        case 9: //xrgd_p
            *FieldValues = XRGD.value;
            return NULL;
        case 10: //xrgb_p
            *FieldValues = XRGB.value;
            return NULL;
        case 11: //idleTime
            return Patrol.IsLoaded() ? &Patrol->XPRD.value : NULL;
        case 12: //idle
            return Patrol.IsLoaded() ? &Patrol->INAM.value : NULL;
        case 13: //unused1
            *FieldValues = Patrol.IsLoaded() ? &Patrol->SCHR.value.unused1[0] : NULL;
            return NULL;
        case 14: //numRefs
            return Patrol.IsLoaded() ? &Patrol->SCHR.value.numRefs : NULL;
        case 15: //compiledSize
            return Patrol.IsLoaded() ? &Patrol->SCHR.value.compiledSize : NULL;
        case 16: //lastIndex
            return Patrol.IsLoaded() ? &Patrol->SCHR.value.lastIndex : NULL;
        case 17: //scriptType
            return Patrol.IsLoaded() ? &Patrol->SCHR.value.scriptType : NULL;
        case 18: //scriptFlags
            return Patrol.IsLoaded() ? &Patrol->SCHR.value.flags : NULL;
        case 19: //compiled_p
            *FieldValues = Patrol.IsLoaded() ? Patrol->SCDA.value : NULL;
            return NULL;
        case 20: //scriptText
            return Patrol.IsLoaded() ? Patrol->SCTX.value : NULL;
        case 21: //vars
            if(!Patrol.IsLoaded())
                return NULL;

            if(ListIndex >= Patrol->VARS.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //index
                    return &Patrol->VARS.value[ListIndex]->SLSD.value.index;
                case 2: //unused1
                    *FieldValues = &Patrol->VARS.value[ListIndex]->SLSD.value.unused1[0];
                    return NULL;
                case 3: //flags
                    return &Patrol->VARS.value[ListIndex]->SLSD.value.flags;
                case 4: //unused2
                    *FieldValues = &Patrol->VARS.value[ListIndex]->SLSD.value.unused2[0];
                    return NULL;
                case 5: //name
                    return Patrol->VARS.value[ListIndex]->SCVR.value;
                default:
                    return NULL;
                }
            return NULL;
        case 22: //references
            if(!Patrol.IsLoaded())
                {
                *FieldValues = NULL;
                return NULL;
                }
            for(UINT32 x = 0; x < Patrol->SCR_.value.size(); ++x)
                ((FORMIDARRAY)FieldValues)[x] = Patrol->SCR_.value[x]->reference;
            return NULL;
        case 23: //topic
            return Patrol.IsLoaded() ? &Patrol->TNAM.value : NULL;
        case 24: //owner
            return Ownership.IsLoaded() ? &Ownership->XOWN.value : NULL;
        case 25: //rank
            return Ownership.IsLoaded() ? Ownership->XRNK.value : NULL;
        case 26: //count
            return &XCNT.value;
        case 27: //radius
            return &XRDS.value;
        case 28: //health
            return &XHLP.value;
        case 29: //decals
            if(ListIndex >= XDCR.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //reference
                    return &XDCR.value[ListIndex]->reference;
                case 2: //unknown1
                    *FieldValues = &XDCR.value[ListIndex]->unknown1[0];
                    return NULL;
                default:
                    return NULL;
                }
            return NULL;
        case 30: //linkedReference
            return &XLKR.value;
        case 31: //startRed
            return XCLP.IsLoaded() ? &XCLP->start.red : NULL;
        case 32: //startGreen
            return XCLP.IsLoaded() ? &XCLP->start.green : NULL;
        case 33: //startBlue
            return XCLP.IsLoaded() ? &XCLP->start.blue : NULL;
        case 34: //unused2
            *FieldValues = XCLP.IsLoaded() ? &XCLP->start.unused1 : NULL;
            return NULL;
        case 35: //endRed
            return XCLP.IsLoaded() ? &XCLP->end.red : NULL;
        case 36: //endGreen
            return XCLP.IsLoaded() ? &XCLP->end.green : NULL;
        case 37: //endBlue
            return XCLP.IsLoaded() ? &XCLP->end.blue : NULL;
        case 38: //unused3
            *FieldValues = XCLP.IsLoaded() ? &XCLP->end.unused1 : NULL;
            return NULL;
        case 39: //activateParentFlags
            return ActivateParents.IsLoaded() ? &ActivateParents->XAPD.value : NULL;
        case 40: //activateParentRefs
            if(!ActivateParents.IsLoaded())
                return NULL;

            if(ListIndex >= ActivateParents->XAPR.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //reference
                    return &ActivateParents->XAPR.value[ListIndex]->reference;
                case 2: //delay
                    return &ActivateParents->XAPR.value[ListIndex]->delay;
                default:
                    return NULL;
                }
            return NULL;
        case 41: //prompt
            return XATO.value;
        case 42: //parent
            return XESP.IsLoaded() ? &XESP->parent : NULL;
        case 43: //parentFlags
            return XESP.IsLoaded() ? &XESP->flags : NULL;
        case 44: //unused4
            *FieldValues = XESP.IsLoaded() ? &XESP->unused1[0] : NULL;
            return NULL;
        case 45: //emittance
            return &XEMI.value;
        case 46: //boundRef
            return &XMBR.value;
        case 47: //reflrefrs
            if(ListIndex >= XPWR.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //reference
                    return &XPWR.value[ListIndex]->reference;
                case 2: //type
                    return &XPWR.value[ListIndex]->type;
                default:
                    return NULL;
                }
            return NULL;
        case 48: //ignoredBySandbox
            return &XIBS.value;
        case 49: //scale
            return &XSCL.value;
        case 50: //posX
            return &DATA.value.posX;
        case 51: //posY
            return &DATA.value.posY;
        case 52: //posZ
            return &DATA.value.posZ;
        case 53: //rotX
            return &DATA.value.rotX;
        case 54: //rotY
            return &DATA.value.rotY;
        case 55: //rotZ
            return &DATA.value.rotZ;
        case 56: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #7
0
void * PGRDRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //flags2
            return &flagsUnk;
        case 5: //count
            return &DATA.value;
        case 6: //pgrp
            if(ListIndex >= PGRP.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //x
                    return &PGRP.value[ListIndex].x;
                case 2: //y
                    return &PGRP.value[ListIndex].y;
                case 3: //z
                    return &PGRP.value[ListIndex].z;
                case 4: //connections
                    return &PGRP.value[ListIndex].connections;
                case 5: //unused1
                    *FieldValues = &PGRP.value[ListIndex].unused1[0];
                    return NULL;
                default:
                    return NULL;
                }
            return NULL;
        case 7: //pgag_p
            *FieldValues = PGAG.value;
            return NULL;
        case 8: //pgrr_p
            *FieldValues = PGRR.value;
            return NULL;
        case 9: //pgri
            if(ListIndex >= PGRI.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //point
                    return &PGRI.value[ListIndex].point;
                case 2: //unused1
                    *FieldValues = &PGRI.value[ListIndex].unused1[0];
                    return NULL;
                case 3: //x
                    return &PGRI.value[ListIndex].x;
                case 4: //y
                    return &PGRI.value[ListIndex].y;
                case 5: //z
                    return &PGRI.value[ListIndex].z;
                default:
                    return NULL;
                }
            return NULL;
        case 10: //pgrl
            if(ListIndex >= PGRL.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //reference
                    return PGRL.value[ListIndex]->points.value.size() ? &PGRL.value[ListIndex]->points.value[0] : NULL;
                case 2: //points
                    *FieldValues = (PGRL.value[ListIndex]->points.value.size() > 1) ? &PGRL.value[ListIndex]->points.value[1] : NULL;
                    return NULL;
                default:
                    return NULL;
                }
            return NULL;
        case 11: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #8
0
void * CELLRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //versionControl1
            *FieldValues = &flagsUnk;
            return NULL;
        case 4: //eid
            return EDID.value;
        case 5: //formVersion
            return &formVersion;
        case 6: //versionControl2
            *FieldValues = &versionControl2[0];
            return NULL;
        case 7: //full
            return FULL.value;
        case 8: //flags
            return &DATA.value;
        case 9: //posX
            return (!IsInterior() & XCLC.IsLoaded()) ? &XCLC->posX : NULL;
        case 10: //posY
            return (!IsInterior() & XCLC.IsLoaded()) ? &XCLC->posY : NULL;
        case 11: //quadFlags
            return (!IsInterior() & XCLC.IsLoaded()) ? &XCLC->flags : NULL;
#if 0
        case 12: //ambientRed
            return XCLL.IsLoaded() ? &XCLL->ambient.red : NULL;
        case 13: //ambientGreen
            return XCLL.IsLoaded() ? &XCLL->ambient.green : NULL;
        case 14: //ambientBlue
            return XCLL.IsLoaded() ? &XCLL->ambient.blue : NULL;
        case 15: //unused1
            *FieldValues = XCLL.IsLoaded() ? &XCLL->ambient.unused1 : NULL;
            return NULL;
        case 16: //directionalRed
            return XCLL.IsLoaded() ? &XCLL->directional.red : NULL;
        case 17: //directionalGreen
            return XCLL.IsLoaded() ? &XCLL->directional.green : NULL;
        case 18: //directionalBlue
            return XCLL.IsLoaded() ? &XCLL->directional.blue : NULL;
        case 19: //unused2
            *FieldValues = XCLL.IsLoaded() ? &XCLL->directional.unused1 : NULL;
            return NULL;
        case 20: //fogRed
            return XCLL.IsLoaded() ? &XCLL->fog.red : NULL;
        case 21: //fogGreen
            return XCLL.IsLoaded() ? &XCLL->fog.green : NULL;
        case 22: //fogBlue
            return XCLL.IsLoaded() ? &XCLL->fog.blue : NULL;
        case 23: //unused3
            *FieldValues = XCLL.IsLoaded() ? &XCLL->fog.unused1 : NULL;
            return NULL;
        case 24: //fogNear
            return XCLL.IsLoaded() ? &XCLL->fogNear : NULL;
        case 25: //fogFar
            return XCLL.IsLoaded() ? &XCLL->fogFar : NULL;
        case 26: //directionalXY
            return XCLL.IsLoaded() ? &XCLL->directionalXY : NULL;
        case 27: //directionalZ
            return XCLL.IsLoaded() ? &XCLL->directionalZ : NULL;
        case 28: //directionalFade
            return XCLL.IsLoaded() ? &XCLL->directionalFade : NULL;
        case 29: //fogClip
            return XCLL.IsLoaded() ? &XCLL->fogClip : NULL;
        case 30: //fogPower
            return XCLL.IsLoaded() ? &XCLL->fogPower : NULL;
#endif
        case 31: //swappedImpacts
            if(ListIndex >= IMPS.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //material
                    return &IMPS.value[ListIndex]->material;
                case 2: //oldImpact
                    return &IMPS.value[ListIndex]->oldImpact;
                case 3: //newImpact
                    return &IMPS.value[ListIndex]->newImpact;
                default:
                    return NULL;
                }
            return NULL;
        case 32: //concSolid
            return IMPF.IsLoaded() ? &IMPF->concSolid[0] : NULL;
        case 33: //concBroken
            return IMPF.IsLoaded() ? &IMPF->concBroken[0] : NULL;
        case 34: //metalSolid
            return IMPF.IsLoaded() ? &IMPF->metalSolid[0] : NULL;
        case 35: //metalHollow
            return IMPF.IsLoaded() ? &IMPF->metalHollow[0] : NULL;
        case 36: //metalSheet
            return IMPF.IsLoaded() ? &IMPF->metalSheet[0] : NULL;
        case 37: //wood
            return IMPF.IsLoaded() ? &IMPF->wood[0] : NULL;
        case 38: //sand
            return IMPF.IsLoaded() ? &IMPF->sand[0] : NULL;
        case 39: //dirt
            return IMPF.IsLoaded() ? &IMPF->dirt[0] : NULL;
        case 40: //grass
            return IMPF.IsLoaded() ? &IMPF->grass[0] : NULL;
        case 41: //water
            return IMPF.IsLoaded() ? &IMPF->water[0] : NULL;
        case 42: //lightTemplate
            return &LTMP.value;
        case 43: //lightFlags
            return &LNAM.value;
        case 44: //waterHeight
            return &XCLW.value;
        case 45: //waterNoisePath
            return XNAM.value;
        case 46: //regions
            *FieldValues = XCLR.IsLoaded() ? &XCLR.value[0] : NULL;
            return NULL;
        case 47: //imageSpace
            return &XCIM.value;
        case 48: //xcet_p
            *FieldValues = XCET.value;
            return NULL;
        case 49: //encounterZone
            return &XEZN.value;
        case 50: //climate
            return &XCCM.value;
        case 51: //water
            return &XCWT.value;
#if 0
        case 52: //owner
            return Ownership.IsLoaded() ? &Ownership->XOWN.value : NULL;
        case 53: //rank
            return Ownership.IsLoaded() ? Ownership->XRNK.value : NULL;
#endif
        case 54: //acousticSpace
            return &XCAS.value;
        case 55: //xcmt_p
            *FieldValues = XCMT.value;
            return NULL;
        case 56: //music
            return &XCMO.value;
#if 0
        case 57: //ACHR
            for(uint32_t p = 0;p < (uint32_t)ACHR.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = ACHR[p];
            return NULL;
        case 58: //ACRE
            for(uint32_t p = 0;p < (uint32_t)ACRE.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = ACRE[p];
            return NULL;
            //*FieldValues = ACRE.size() != 0 ? &ACRE[0] : NULL;
            //return NULL;
        case 59: //REFR
            for(uint32_t p = 0;p < (uint32_t)REFR.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = REFR[p];
            return NULL;
        case 60: //PGRE
            for(uint32_t p = 0;p < (uint32_t)PGRE.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = PGRE[p];
            return NULL;
        case 61: //PMIS
            for(uint32_t p = 0;p < (uint32_t)PMIS.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = PMIS[p];
            return NULL;
        case 62: //PBEA
            for(uint32_t p = 0;p < (uint32_t)PBEA.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = PBEA[p];
            return NULL;
        case 63: //PFLA
            for(uint32_t p = 0;p < (uint32_t)PFLA.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = PFLA[p];
            return NULL;
        case 64: //PCBE
            for(uint32_t p = 0;p < (uint32_t)PCBE.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = PCBE[p];
            return NULL;
        case 65: //NAVM
            for(uint32_t p = 0;p < (uint32_t)NAVM.size();++p)
                ((RECORDIDARRAY)FieldValues)[p] = NAVM[p];
            return NULL;
        case 66: //LAND
            return LAND;
#endif
        case 67: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #9
0
void * REFRRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
{
    switch(FieldID)
    {
    case 1: //flags1
        return &flags;
    case 2: //fid
        return &formID;
    case 3: //flags2
        return &flagsUnk;
    case 50: //Parent
        return GetParentRecord();
    default:
        break;
    }
    if(!Data.IsLoaded())
        return NULL;
    switch(FieldID)
    {
    case 4: //eid
        return Data->EDID.value;
    case 5: //base
        return &Data->NAME.value;
    case 6: //destination
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destinationFid : NULL;
    case 7: //destinationPosX
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.posX : NULL;
    case 8: //destinationPosY
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.posY : NULL;
    case 9: //destinationPosZ
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.posZ : NULL;
    case 10: //destinationRotX
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.rotX : NULL;
    case 11: //destinationRotY
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.rotY : NULL;
    case 12: //destinationRotZ
        return Data->XTEL.IsLoaded() ? &Data->XTEL->destination.rotZ : NULL;
    case 13: //lockLevel
        return Data->XLOC.IsLoaded() ? &Data->XLOC->level : NULL;
    case 14: //unused1
        *FieldValues = Data->XLOC.IsLoaded() ? &Data->XLOC->unused1[0] : NULL;
        return NULL;
    case 15: //lockKey
        return Data->XLOC.IsLoaded() ? &Data->XLOC->key : NULL;
    case 16: //unused2
        *FieldValues = Data->XLOC.IsLoaded() ? &Data->XLOC->unused2[0] : NULL;
        return NULL;
    case 17: //lockFlags
        return Data->XLOC.IsLoaded() ? &Data->XLOC->flags : NULL;
    case 18: //unused3
        *FieldValues = Data->XLOC.IsLoaded() ? &Data->XLOC->unused3[0] : NULL;
        return NULL;
    case 19: //owner
        return Data->Ownership.IsLoaded() ? &Data->Ownership->XOWN.value : NULL;
    case 20: //rank
        return Data->Ownership.IsLoaded() ? Data->Ownership->XRNK.value : NULL;
    case 21: //globalVariable
        return (Data->Ownership.IsLoaded() && Data->Ownership->XGLB.IsLoaded()) ? &Data->Ownership->XGLB.value : NULL;
    case 22: //parent
        return Data->XESP.IsLoaded() ? &Data->XESP->parent : NULL;
    case 23: //parentFlags
        return Data->XESP.IsLoaded() ? &Data->XESP->flags : NULL;
    case 24: //unused4
        *FieldValues = Data->XESP.IsLoaded() ? &Data->XESP->unused1[0] : NULL;
        return NULL;
    case 25: //target
        return Data->XTRG.IsLoaded() ? &Data->XTRG.value : NULL;
    case 26: //seed
        if(Data->XSED.IsLoaded())
        {
            if(Data->XSED->isOffset)
                return &Data->XSED->offset;
            return &Data->XSED->seed;
        }
        return NULL;
    case 27: //lod1
        return Data->XLOD.IsLoaded() ? &Data->XLOD->lod1 : NULL;
    case 28: //lod2
        return Data->XLOD.IsLoaded() ? &Data->XLOD->lod2 : NULL;
    case 29: //lod3
        return Data->XLOD.IsLoaded() ? &Data->XLOD->lod3 : NULL;
    case 30: //charge
        return Data->XCHG.IsLoaded() ? &Data->XCHG.value : NULL;
    case 31: //health
        return Data->XHLT.IsLoaded() ? &Data->XHLT.value : NULL;
    case 32: //unknownXPCIFormID
        return (Data->XPCI.IsLoaded() && Data->XPCI->XPCI.IsLoaded()) ? &Data->XPCI->XPCI.value : NULL;
    case 33: //unknownXPCIString
        return Data->XPCI.IsLoaded() ? Data->XPCI->FULL.value : NULL;
    case 34: //levelMod
        return Data->XLCM.IsLoaded() ? &Data->XLCM.value : NULL;
    case 35: //unknownXRTMFormID
        return Data->XRTM.IsLoaded() ? &Data->XRTM.value : NULL;
    case 36: //actionFlags
        return Data->XACT.IsLoaded() ? &Data->XACT.value : NULL;
    case 37: //count
        return Data->XCNT.IsLoaded() ? &Data->XCNT.value : NULL;
    case 38: //markerFlags
        return Data->Marker.IsLoaded() ? &Data->Marker->FNAM.value : NULL;
    case 39: //markerName
        return Data->Marker.IsLoaded() ? Data->Marker->FULL.value : NULL;
    case 40: //markerType
        return Data->Marker.IsLoaded() ? &Data->Marker->TNAM.value.markerType : NULL;
    case 41: //markerUnused
        *FieldValues = Data->Marker.IsLoaded() ? &Data->Marker->TNAM.value.unused1 : NULL;
        return NULL;
    case 42: //scale
        return Data->XSCL.IsLoaded() ? &Data->XSCL.value : NULL;
    case 43: //soulType
        return Data->XSOL.IsLoaded() ? &Data->XSOL.value : NULL;
    case 44: //posX
        return &Data->DATA.value.posX;
    case 45: //posY
        return &Data->DATA.value.posY;
    case 46: //posZ
        return &Data->DATA.value.posZ;
    case 47: //rotX
        return &Data->DATA.value.rotX;
    case 48: //rotY
        return &Data->DATA.value.rotY;
    case 49: //rotZ
        return &Data->DATA.value.rotZ;
    default:
        return NULL;
    }
    return NULL;
}
예제 #10
0
void * NAVMRecord::GetField(FIELD_IDENTIFIERS, void **FieldValues)
    {
    switch(FieldID)
        {
        case 1: //flags1
            return &flags;
        case 2: //fid
            return &formID;
        case 3: //versionControl1
            *FieldValues = &flagsUnk;
            return NULL;
        case 4: //eid
            return EDID.value;
        case 5: //formVersion
            return &formVersion;
        case 6: //versionControl2
            *FieldValues = &versionControl2[0];
            return NULL;
        case 7: //version
            return &NVER.value;
        case 8: //cell
            return &DATA.value.cell;
        case 9: //numVertices
            return &DATA.value.numVertices;
        case 10: //numTriangles
            return &DATA.value.numTriangles;
        case 11: //numConnections
            return &DATA.value.numConnections;
        case 12: //numUnknown
            return &DATA.value.numNVCA;
        case 13: //numDoors
            return &DATA.value.numDoors;
        case 14: //vertices
            if(ListIndex >= NVVX.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //x
                    return &NVVX.value[ListIndex].x;
                case 2: //y
                    return &NVVX.value[ListIndex].y;
                case 3: //z
                    return &NVVX.value[ListIndex].z;
                default:
                    return NULL;
                }
            return NULL;
        case 15: //triangles
            if(ListIndex >= NVTR.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //vertex1
                    return &NVTR.value[ListIndex].vertex1;
                case 2: //vertex2
                    return &NVTR.value[ListIndex].vertex2;
                case 3: //vertex3
                    return &NVTR.value[ListIndex].vertex3;
                case 4: //edge1
                    return &NVTR.value[ListIndex].edge1;
                case 5: //edge2
                    return &NVTR.value[ListIndex].edge2;
                case 6: //edge3
                    return &NVTR.value[ListIndex].edge3;
                case 7: //flags
                    return &NVTR.value[ListIndex].flags;
                default:
                    return NULL;
                }
            return NULL;
        case 16: //unknown1
            *FieldValues = NVCA.IsLoaded() ? &NVCA.value[0] : NULL;
            return NULL;
        case 17: //doors
            if(ListIndex >= NVDP.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //door
                    return &NVDP.value[ListIndex].door;
                case 2: //unknown1
                    return &NVDP.value[ListIndex].unknown1;
                case 3: //unused1
                    *FieldValues = &NVDP.value[ListIndex].unused1[0];
                    return NULL;
                default:
                    return NULL;
                }
            return NULL;
        case 18: //nvgd_p
            *FieldValues = NVGD.value;
            return NULL;
        case 19: //connections
            if(ListIndex >= NVEX.value.size())
                return NULL;

            switch(ListFieldID)
                {
                case 1: //unknown1
                    *FieldValues = &NVEX.value[ListIndex].unknown1[0];
                    return NULL;
                case 2: //mesh
                    return &NVEX.value[ListIndex].mesh;
                case 3: //triangle
                    return &NVEX.value[ListIndex].triangle;
                default:
                    return NULL;
                }
            return NULL;
        case 20: //Parent
            return GetParentRecord();
        default:
            return NULL;
        }
    return NULL;
    }
예제 #11
0
파일: CELLRecord.cpp 프로젝트: Dienes/CBash
bool CELLRecord::deep_equals(Record *master, RecordOp &read_self, RecordOp &read_master, boost::unordered_set<Record *> &identical_records)
    {
    //Precondition: equals has been run for these records and returned true
    //              all child records have been visited
    CELLRecord *master_cell = (CELLRecord *)master;
    Record *parent_wrld = GetParentRecord(), *master_wrld = master_cell->GetParentRecord();
    //Check to make sure the CELLs are attached at the same spot
    if(parent_wrld != NULL)
        {
        if(master_wrld != NULL)
            {
            if(parent_wrld->formID != master_wrld->formID)
                return false;
            }
        else
            return false;
        }
    else if(master_wrld != NULL)
        return false;

    if(ACHR.size() > master_cell->ACHR.size())
        return false;
    if(ACRE.size() > master_cell->ACRE.size())
        return false;
    if(REFR.size() > master_cell->REFR.size())
        return false;
    if(PGRE.size() > master_cell->PGRE.size())
        return false;
    if(PMIS.size() > master_cell->PMIS.size())
        return false;
    if(PBEA.size() > master_cell->PBEA.size())
        return false;
    if(PFLA.size() > master_cell->PFLA.size())
        return false;
    if(PCBE.size() > master_cell->PCBE.size())
        return false;
    if(NAVM.size() > master_cell->NAVM.size())
        return false;

    if(LAND != NULL)
        {
        if(master_cell->LAND != NULL)
            {
            if(identical_records.count(LAND) == 0)
                return false;
            }
        else
            return false;
        }

    for(uint32_t ListIndex = 0; ListIndex < ACHR.size(); ++ListIndex)
        if(identical_records.count(ACHR[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < ACRE.size(); ++ListIndex)
        if(identical_records.count(ACRE[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < REFR.size(); ++ListIndex)
        if(identical_records.count(REFR[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < PGRE.size(); ++ListIndex)
        if(identical_records.count(PGRE[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < PMIS.size(); ++ListIndex)
        if(identical_records.count(PMIS[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < PBEA.size(); ++ListIndex)
        if(identical_records.count(PBEA[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < PFLA.size(); ++ListIndex)
        if(identical_records.count(PFLA[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < PCBE.size(); ++ListIndex)
        if(identical_records.count(PCBE[ListIndex]) == 0)
            return false;

    for(uint32_t ListIndex = 0; ListIndex < NAVM.size(); ++ListIndex)
        if(identical_records.count(NAVM[ListIndex]) == 0)
            return false;
    return true;
    }