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::WTHRRecord, FNV::CLMTRecord, FNV::REGNRecord
  • Loading branch information
waruddar committed May 9, 2011
1 parent c8dba6c commit 0976d15
Show file tree
Hide file tree
Showing 19 changed files with 7,030 additions and 1,806 deletions.
Binary file modified CBash.suo
Binary file not shown.
186 changes: 186 additions & 0 deletions CBash/CBash.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\CLMTRecord.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\COBJRecord.cpp"
>
Expand Down Expand Up @@ -1981,6 +2012,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\REGNRecord.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\SCOLRecord.cpp"
>
Expand Down Expand Up @@ -2183,6 +2245,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\WTHRRecord.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>
</Filter>
<Filter
Name="API"
Expand Down Expand Up @@ -2377,6 +2470,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\CLMTRecordAPI.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\COBJRecordAPI.cpp"
>
Expand Down Expand Up @@ -3064,6 +3188,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\REGNRecordAPI.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\SCOLRecordAPI.cpp"
>
Expand Down Expand Up @@ -3266,6 +3421,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\WTHRRecordAPI.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>
</Filter>
</Filter>
</Filter>
Expand Down
7 changes: 7 additions & 0 deletions CBash/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,13 @@ struct UnorderedPackedArray
if(value.size())
writer.record_write_subrecord(_Type, &value[0], (UINT32)value.size() * sizeof(T));
}
void ReqWrite(UINT32 _Type, FileWriter &writer)
{
if(value.size())
writer.record_write_subrecord(_Type, &value[0], (UINT32)value.size() * sizeof(T));
else
writer.record_write_subheader(_Type, 0);
}

UnorderedPackedArray<T>& operator = (const UnorderedPackedArray<T> &rhs)
{
Expand Down
78 changes: 39 additions & 39 deletions CBash/FalloutNewVegas/FNVFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,22 +500,22 @@ SINT32 FNVFile::Load(RecordOp &indexer, std::vector<FormIDResolver *> &Expanders
break;
//case eIgWTHR: //Same as normal
case 'RHTW':
//reader.read(&WTHR.stamp, 4);
//reader.read(&WTHR.unknown, 4);
//WTHR.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&WTHR.stamp, 4);
reader.read(&WTHR.unknown, 4);
WTHR.Skim(reader, GRUPSize, processor, indexer);
break;
case eIgCLMT:
case 'TMLC':
//reader.read(&CLMT.stamp, 4);
//reader.read(&CLMT.unknown, 4);
//CLMT.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&CLMT.stamp, 4);
reader.read(&CLMT.unknown, 4);
CLMT.Skim(reader, GRUPSize, processor, indexer);
break;
case eIgREGN:
case 'NGER':
//reader.read(&REGN.stamp, 4);
//reader.read(&REGN.unknown, 4);
//REGN.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&REGN.stamp, 4);
reader.read(&REGN.unknown, 4);
REGN.Skim(reader, GRUPSize, processor, indexer);
break;
case eIgNAVI:
case 'IVAN':
//reader.read(&NAVI.stamp, 4);
Expand Down Expand Up @@ -949,11 +949,11 @@ UINT32 FNVFile::GetNumRecords(const UINT32 &RecordType)
case 'ILVL':
return (UINT32)LVLI.Records.size();
case 'RHTW':
//return (UINT32)WTHR.Records.size();
return (UINT32)WTHR.Records.size();
case 'TMLC':
//return (UINT32)CLMT.Records.size();
return (UINT32)CLMT.Records.size();
case 'NGER':
//return (UINT32)REGN.Records.size();
return (UINT32)REGN.Records.size();
case 'IVAN':
//return (UINT32)NAVI.Records.size();
case 'LLEC':
Expand Down Expand Up @@ -1278,17 +1278,17 @@ Record * FNVFile::CreateRecord(const UINT32 &RecordType, STRING const &RecordEdi
newRecord = LVLI.Records.back();
break;
case 'RHTW':
//WTHR.Records.push_back(new FNV::WTHRRecord((FNV::WTHRRecord *)SourceRecord));
//newRecord = WTHR.Records.back();
//break;
WTHR.Records.push_back(new FNV::WTHRRecord((FNV::WTHRRecord *)SourceRecord));
newRecord = WTHR.Records.back();
break;
case 'TMLC':
//CLMT.Records.push_back(new FNV::CLMTRecord((FNV::CLMTRecord *)SourceRecord));
//newRecord = CLMT.Records.back();
//break;
CLMT.Records.push_back(new FNV::CLMTRecord((FNV::CLMTRecord *)SourceRecord));
newRecord = CLMT.Records.back();
break;
case 'NGER':
//REGN.Records.push_back(new FNV::REGNRecord((FNV::REGNRecord *)SourceRecord));
//newRecord = REGN.Records.back();
//break;
REGN.Records.push_back(new FNV::REGNRecord((FNV::REGNRecord *)SourceRecord));
newRecord = REGN.Records.back();
break;
case 'IVAN':
//NAVI.Records.push_back(new FNV::NAVIRecord((FNV::NAVIRecord *)SourceRecord));
//newRecord = NAVI.Records.back();
Expand Down Expand Up @@ -1571,9 +1571,9 @@ SINT32 FNVFile::CleanMasters(std::vector<FormIDResolver *> &Expanders)
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;
if(WTHR.VisitRecords(NULL, checker, false)) continue;
if(CLMT.VisitRecords(NULL, checker, false)) continue;
if(REGN.VisitRecords(NULL, checker, false)) continue;
//if(NAVI.VisitRecords(NULL, checker, false)) continue;
//if(CELL.VisitRecords(NULL, checker, false)) continue;
//if(WRLD.VisitRecords(NULL, checker, false)) continue;
Expand Down Expand Up @@ -1709,9 +1709,9 @@ SINT32 FNVFile::Save(STRING const &SaveName, std::vector<FormIDResolver *> &Expa
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);
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);
//formCount += NAVI.WriteGRUP('IVAN', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += CELL.WriteGRUP('LLEC', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += WRLD.WriteGRUP('DLRW', writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
Expand Down Expand Up @@ -1832,9 +1832,9 @@ void FNVFile::VisitAllRecords(RecordOp &op)
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);
WTHR.VisitRecords(NULL, op, true);
CLMT.VisitRecords(NULL, op, true);
REGN.VisitRecords(NULL, op, true);
//NAVI.VisitRecords(NULL, op, true);
//CELL.VisitRecords(NULL, op, true);
//WRLD.VisitRecords(NULL, op, true);
Expand Down Expand Up @@ -2049,14 +2049,14 @@ void FNVFile::VisitRecords(const UINT32 &TopRecordType, const UINT32 &RecordType
LVLI.VisitRecords(RecordType, op, DeepVisit);
break;
case 'RHTW':
//WTHR.VisitRecords(RecordType, op, DeepVisit);
//break;
WTHR.VisitRecords(RecordType, op, DeepVisit);
break;
case 'TMLC':
//CLMT.VisitRecords(RecordType, op, DeepVisit);
//break;
CLMT.VisitRecords(RecordType, op, DeepVisit);
break;
case 'NGER':
//REGN.VisitRecords(RecordType, op, DeepVisit);
//break;
REGN.VisitRecords(RecordType, op, DeepVisit);
break;
case 'IVAN':
//NAVI.VisitRecords(RecordType, op, DeepVisit);
//break;
Expand Down
Loading

0 comments on commit 0976d15

Please sign in to comment.