Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Basic support (reads, is exposed, not set/write tested)
Browse files Browse the repository at this point in the history
  FNV::IDLMRecord, FNV::NOTERecord, FNV::COBJRecord, FNV::PROJRecord, FNV::LVLIRecord
  • Loading branch information
waruddar committed May 9, 2011
1 parent 811c420 commit c8dba6c
Show file tree
Hide file tree
Showing 28 changed files with 2,540 additions and 1,439 deletions.
Binary file modified CBash.suo
Binary file not shown.
94 changes: 94 additions & 0 deletions CBash/CBash.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\COBJRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\CONTRecord.cpp"
>
Expand Down Expand Up @@ -1639,6 +1643,10 @@
RelativePath=".\FalloutNewVegas\Records\HDPTRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\IDLMRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\INGRRecord.cpp"
>
Expand Down Expand Up @@ -1794,6 +1802,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\LVLIRecord.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="FullDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\LVLNRecord.cpp"
>
Expand Down Expand Up @@ -1868,6 +1907,10 @@
RelativePath=".\FalloutNewVegas\Records\MSTTRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\NOTERecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\NPC_Record.cpp"
>
Expand Down Expand Up @@ -1899,6 +1942,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\PROJRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\PWATRecord.cpp"
>
Expand Down Expand Up @@ -2330,6 +2377,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\COBJRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\CONTRecordAPI.cpp"
>
Expand Down Expand Up @@ -2675,6 +2726,10 @@
RelativePath=".\FalloutNewVegas\Records\API\HDPTRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\IDLMRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\INGRRecordAPI.cpp"
>
Expand Down Expand Up @@ -2830,6 +2885,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\LVLIRecordAPI.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="FullDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\LVLNRecordAPI.cpp"
>
Expand Down Expand Up @@ -2904,6 +2990,10 @@
RelativePath=".\FalloutNewVegas\Records\API\MSTTRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\NOTERecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\NPC_RecordAPI.cpp"
>
Expand Down Expand Up @@ -2935,6 +3025,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\PROJRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\PWATRecordAPI.cpp"
>
Expand Down
1 change: 1 addition & 0 deletions CBash/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ enum API_FieldTypes {
FORMID_OR_UINT32_FIELD,
FORMID_OR_FLOAT32_FIELD,
UINT8_OR_UINT32_FIELD,
FORMID_OR_STRING_FIELD,
UNKNOWN_OR_FORMID_OR_UINT32_FIELD,
UNKNOWN_OR_SINT32_FIELD,
MGEFCODE_OR_UINT32_FIELD,
Expand Down
130 changes: 65 additions & 65 deletions CBash/FalloutNewVegas/FNVFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,34 +470,34 @@ SINT32 FNVFile::Load(RecordOp &indexer, std::vector<FormIDResolver *> &Expanders
break;
case eIgIDLM:
case 'MLDI':
//reader.read(&IDLM.stamp, 4);
//reader.read(&IDLM.unknown, 4);
//IDLM.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&IDLM.stamp, 4);
reader.read(&IDLM.unknown, 4);
IDLM.Skim(reader, GRUPSize, processor, indexer);
break;
case eIgNOTE:
case 'ETON':
//reader.read(&NOTE.stamp, 4);
//reader.read(&NOTE.unknown, 4);
//NOTE.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&NOTE.stamp, 4);
reader.read(&NOTE.unknown, 4);
NOTE.Skim(reader, GRUPSize, processor, indexer);
break;
case eIgCOBJ:
case 'JBOC':
//reader.read(&COBJ.stamp, 4);
//reader.read(&COBJ.unknown, 4);
//COBJ.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&COBJ.stamp, 4);
reader.read(&COBJ.unknown, 4);
COBJ.Skim(reader, GRUPSize, processor, indexer);
break;
//case eIgPROJ: //Same as normal
case 'JORP':
//reader.read(&PROJ.stamp, 4);
//reader.read(&PROJ.unknown, 4);
//PROJ.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&PROJ.stamp, 4);
reader.read(&PROJ.unknown, 4);
PROJ.Skim(reader, GRUPSize, processor, indexer);
break;
//case eIgLVLI: //Same as normal
case 'ILVL':
//reader.read(&LVLI.stamp, 4);
//reader.read(&LVLI.unknown, 4);
//LVLI.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&LVLI.stamp, 4);
reader.read(&LVLI.unknown, 4);
LVLI.Skim(reader, GRUPSize, processor, indexer);
break;
//case eIgWTHR: //Same as normal
case 'RHTW':
//reader.read(&WTHR.stamp, 4);
Expand Down Expand Up @@ -939,15 +939,15 @@ UINT32 FNVFile::GetNumRecords(const UINT32 &RecordType)
case 'HCLA':
return (UINT32)ALCH.Records.size();
case 'MLDI':
//return (UINT32)IDLM.Records.size();
return (UINT32)IDLM.Records.size();
case 'ETON':
//return (UINT32)NOTE.Records.size();
return (UINT32)NOTE.Records.size();
case 'JBOC':
//return (UINT32)COBJ.Records.size();
return (UINT32)COBJ.Records.size();
case 'JORP':
//return (UINT32)PROJ.Records.size();
return (UINT32)PROJ.Records.size();
case 'ILVL':
//return (UINT32)LVLI.Records.size();
return (UINT32)LVLI.Records.size();
case 'RHTW':
//return (UINT32)WTHR.Records.size();
case 'TMLC':
Expand Down Expand Up @@ -1258,25 +1258,25 @@ Record * FNVFile::CreateRecord(const UINT32 &RecordType, STRING const &RecordEdi
newRecord = ALCH.Records.back();
break;
case 'MLDI':
//IDLM.Records.push_back(new FNV::IDLMRecord((FNV::IDLMRecord *)SourceRecord));
//newRecord = IDLM.Records.back();
//break;
IDLM.Records.push_back(new FNV::IDLMRecord((FNV::IDLMRecord *)SourceRecord));
newRecord = IDLM.Records.back();
break;
case 'ETON':
//NOTE.Records.push_back(new FNV::NOTERecord((FNV::NOTERecord *)SourceRecord));
//newRecord = NOTE.Records.back();
//break;
NOTE.Records.push_back(new FNV::NOTERecord((FNV::NOTERecord *)SourceRecord));
newRecord = NOTE.Records.back();
break;
case 'JBOC':
//COBJ.Records.push_back(new FNV::COBJRecord((FNV::COBJRecord *)SourceRecord));
//newRecord = COBJ.Records.back();
//break;
COBJ.Records.push_back(new FNV::COBJRecord((FNV::COBJRecord *)SourceRecord));
newRecord = COBJ.Records.back();
break;
case 'JORP':
//PROJ.Records.push_back(new FNV::PROJRecord((FNV::PROJRecord *)SourceRecord));
//newRecord = PROJ.Records.back();
//break;
PROJ.Records.push_back(new FNV::PROJRecord((FNV::PROJRecord *)SourceRecord));
newRecord = PROJ.Records.back();
break;
case 'ILVL':
//LVLI.Records.push_back(new FNV::LVLIRecord((FNV::LVLIRecord *)SourceRecord));
//newRecord = LVLI.Records.back();
//break;
LVLI.Records.push_back(new FNV::LVLIRecord((FNV::LVLIRecord *)SourceRecord));
newRecord = LVLI.Records.back();
break;
case 'RHTW':
//WTHR.Records.push_back(new FNV::WTHRRecord((FNV::WTHRRecord *)SourceRecord));
//newRecord = WTHR.Records.back();
Expand Down Expand Up @@ -1566,11 +1566,11 @@ SINT32 FNVFile::CleanMasters(std::vector<FormIDResolver *> &Expanders)
if(LVLN.VisitRecords(NULL, checker, false)) continue;
if(KEYM.VisitRecords(NULL, checker, false)) continue;
if(ALCH.VisitRecords(NULL, checker, false)) continue;
//if(IDLM.VisitRecords(NULL, checker, false)) continue;
//if(NOTE.VisitRecords(NULL, checker, false)) continue;
//if(COBJ.VisitRecords(NULL, checker, false)) continue;
//if(PROJ.VisitRecords(NULL, checker, false)) continue;
//if(LVLI.VisitRecords(NULL, checker, false)) continue;
if(IDLM.VisitRecords(NULL, checker, false)) continue;
if(NOTE.VisitRecords(NULL, checker, false)) continue;
if(COBJ.VisitRecords(NULL, checker, false)) continue;
if(PROJ.VisitRecords(NULL, checker, false)) continue;
if(LVLI.VisitRecords(NULL, checker, false)) continue;
//if(WTHR.VisitRecords(NULL, checker, false)) continue;
//if(CLMT.VisitRecords(NULL, checker, false)) continue;
//if(REGN.VisitRecords(NULL, checker, false)) continue;
Expand Down Expand Up @@ -1704,11 +1704,11 @@ SINT32 FNVFile::Save(STRING const &SaveName, std::vector<FormIDResolver *> &Expa
formCount += LVLN.WriteGRUP('NLVL', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += KEYM.WriteGRUP('MYEK', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += ALCH.WriteGRUP('HCLA', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += IDLM.WriteGRUP('MLDI', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += NOTE.WriteGRUP('ETON', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += COBJ.WriteGRUP('JBOC', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += PROJ.WriteGRUP('JORP', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += LVLI.WriteGRUP('ILVL', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += IDLM.WriteGRUP('MLDI', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += NOTE.WriteGRUP('ETON', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += COBJ.WriteGRUP('JBOC', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += PROJ.WriteGRUP('JORP', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += LVLI.WriteGRUP('ILVL', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += WTHR.WriteGRUP('RHTW', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += CLMT.WriteGRUP('TMLC', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += REGN.WriteGRUP('NGER', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
Expand Down Expand Up @@ -1827,11 +1827,11 @@ void FNVFile::VisitAllRecords(RecordOp &op)
LVLN.VisitRecords(NULL, op, true);
KEYM.VisitRecords(NULL, op, true);
ALCH.VisitRecords(NULL, op, true);
//IDLM.VisitRecords(NULL, op, true);
//NOTE.VisitRecords(NULL, op, true);
//COBJ.VisitRecords(NULL, op, true);
//PROJ.VisitRecords(NULL, op, true);
//LVLI.VisitRecords(NULL, op, true);
IDLM.VisitRecords(NULL, op, true);
NOTE.VisitRecords(NULL, op, true);
COBJ.VisitRecords(NULL, op, true);
PROJ.VisitRecords(NULL, op, true);
LVLI.VisitRecords(NULL, op, true);
//WTHR.VisitRecords(NULL, op, true);
//CLMT.VisitRecords(NULL, op, true);
//REGN.VisitRecords(NULL, op, true);
Expand Down Expand Up @@ -2034,20 +2034,20 @@ void FNVFile::VisitRecords(const UINT32 &TopRecordType, const UINT32 &RecordType
ALCH.VisitRecords(RecordType, op, DeepVisit);
break;
case 'MLDI':
//IDLM.VisitRecords(RecordType, op, DeepVisit);
//break;
IDLM.VisitRecords(RecordType, op, DeepVisit);
break;
case 'ETON':
//NOTE.VisitRecords(RecordType, op, DeepVisit);
//break;
NOTE.VisitRecords(RecordType, op, DeepVisit);
break;
case 'JBOC':
//COBJ.VisitRecords(RecordType, op, DeepVisit);
//break;
COBJ.VisitRecords(RecordType, op, DeepVisit);
break;
case 'JORP':
//PROJ.VisitRecords(RecordType, op, DeepVisit);
//break;
PROJ.VisitRecords(RecordType, op, DeepVisit);
break;
case 'ILVL':
//LVLI.VisitRecords(RecordType, op, DeepVisit);
//break;
LVLI.VisitRecords(RecordType, op, DeepVisit);
break;
case 'RHTW':
//WTHR.VisitRecords(RecordType, op, DeepVisit);
//break;
Expand Down
Loading

0 comments on commit c8dba6c

Please sign in to comment.