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::DIALRecord, FNV::INFORecord
  • Loading branch information
waruddar committed May 17, 2011
1 parent eb33d9a commit 14abf9d
Show file tree
Hide file tree
Showing 24 changed files with 3,502 additions and 1,148 deletions.
Binary file modified CBash.suo
Binary file not shown.
70 changes: 70 additions & 0 deletions CBash/CBash.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,14 @@
RelativePath=".\FalloutNewVegas\Records\CELLRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\DIALRecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\INFORecord.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\LANDRecord.cpp"
>
Expand Down Expand Up @@ -2720,6 +2728,37 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\DIALRecordAPI.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\DOORRecordAPI.cpp"
>
Expand Down Expand Up @@ -3007,6 +3046,37 @@
RelativePath=".\FalloutNewVegas\Records\API\IDLMRecordAPI.cpp"
>
</File>
<File
RelativePath=".\FalloutNewVegas\Records\API\INFORecordAPI.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\INGRRecordAPI.cpp"
>
Expand Down
42 changes: 21 additions & 21 deletions CBash/FalloutNewVegas/FNVFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ SINT32 FNVFile::Load(RecordOp &indexer, std::vector<FormIDResolver *> &Expanders
break;
case eIgDIAL:
case REV32(DIAL):
//reader.read(&DIAL.stamp, 4);
//reader.read(&DIAL.unknown, 4);
//DIAL.Skim(reader, GRUPSize, processor, indexer);
//break;
reader.read(&DIAL.stamp, 4);
reader.read(&DIAL.unknown, 4);
DIAL.Skim(reader, GRUPSize, processor, indexer);
break;
//case eIgQUST: //Same as normal
case REV32(QUST):
//reader.read(&QUST.stamp, 4);
Expand Down Expand Up @@ -984,7 +984,7 @@ UINT32 FNVFile::GetNumRecords(const UINT32 &RecordType)
case REV32(WRLD):
return (UINT32)WRLD.Records.size();
case REV32(DIAL):
//return (UINT32)DIAL.Records.size();
return (UINT32)DIAL.Records.size();
case REV32(QUST):
//return (UINT32)QUST.Records.size();
case REV32(IDLE):
Expand Down Expand Up @@ -1365,19 +1365,19 @@ Record * FNVFile::CreateRecord(const UINT32 &RecordType, STRING const &RecordEdi
newRecord = WRLD.Records.back();
break;
case REV32(DIAL):
//DIAL.Records.push_back(new FNV::DIALRecord((FNV::DIALRecord *)SourceRecord));
//newRecord = DIAL.Records.back();
//break;
DIAL.Records.push_back(new FNV::DIALRecord((FNV::DIALRecord *)SourceRecord));
newRecord = DIAL.Records.back();
break;
case REV32(INFO):
//if(ParentRecord == NULL || ParentRecord->GetType() != REV32(DIAL))
// {
// printf("FNVFile::CreateRecord: Error - Unable to create INFO record in mod \"%s\". Parent record type (%s) is invalid, only DIAL records can be INFO parents.\n", reader.getModName(), ParentRecord->GetStrType());
// return NULL;
// }
if(ParentRecord == NULL || ParentRecord->GetType() != REV32(DIAL))
{
printf("FNVFile::CreateRecord: Error - Unable to create INFO record in mod \"%s\". Parent record type (%s) is invalid, only DIAL records can be INFO parents.\n", reader.getModName(), ParentRecord->GetStrType());
return NULL;
}

//((DIALRecord *)ParentRecord)->INFO.push_back(new INFORecord((INFORecord *)SourceRecord));
//newRecord = ((DIALRecord *)ParentRecord)->INFO.back();
//break;
((FNV::DIALRecord *)ParentRecord)->INFO.push_back(new FNV::INFORecord((FNV::INFORecord *)SourceRecord));
newRecord = ((FNV::DIALRecord *)ParentRecord)->INFO.back();
break;
case REV32(ACHR):
if(ParentRecord == NULL || ParentRecord->GetType() != REV32(CELL))
{
Expand Down Expand Up @@ -1757,7 +1757,7 @@ SINT32 FNVFile::CleanMasters(std::vector<FormIDResolver *> &Expanders)
if(NAVI.VisitRecords(NULL, checker, false)) continue;
if(CELL.VisitRecords(NULL, checker, true)) continue;
if(WRLD.VisitRecords(NULL, checker, true)) continue;
//if(DIAL.VisitRecords(NULL, checker, true)) continue;
if(DIAL.VisitRecords(NULL, checker, true)) continue;
//if(QUST.VisitRecords(NULL, checker, false)) continue;
//if(IDLE.VisitRecords(NULL, checker, false)) continue;
//if(PACK.VisitRecords(NULL, checker, false)) continue;
Expand Down Expand Up @@ -1895,7 +1895,7 @@ SINT32 FNVFile::Save(STRING const &SaveName, std::vector<FormIDResolver *> &Expa
formCount += NAVI.WriteGRUP(REV32(NAVI), writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += CELL.WriteGRUP(writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += WRLD.WriteGRUP(writer, FormIDHandler, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += DIAL.WriteGRUP(REV32(DIAL), writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
formCount += DIAL.WriteGRUP(writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += QUST.WriteGRUP(REV32(QUST), writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += IDLE.WriteGRUP(REV32(IDLE), writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
//formCount += PACK.WriteGRUP(REV32(PACK), writer, Expanders, expander, collapser, bMastersChanged, CloseMod);
Expand Down Expand Up @@ -2018,7 +2018,7 @@ void FNVFile::VisitAllRecords(RecordOp &op)
NAVI.VisitRecords(NULL, op, true);
CELL.VisitRecords(NULL, op, true);
WRLD.VisitRecords(NULL, op, true);
//DIAL.VisitRecords(NULL, op, true);
DIAL.VisitRecords(NULL, op, true);
//QUST.VisitRecords(NULL, op, true);
//IDLE.VisitRecords(NULL, op, true);
//PACK.VisitRecords(NULL, op, true);
Expand Down Expand Up @@ -2247,8 +2247,8 @@ void FNVFile::VisitRecords(const UINT32 &TopRecordType, const UINT32 &RecordType
WRLD.VisitRecords(RecordType, op, DeepVisit);
break;
case REV32(DIAL):
//DIAL.VisitRecords(RecordType, op, DeepVisit);
//break;
DIAL.VisitRecords(RecordType, op, DeepVisit);
break;
case REV32(QUST):
//QUST.VisitRecords(RecordType, op, DeepVisit);
//break;
Expand Down
4 changes: 2 additions & 2 deletions CBash/FalloutNewVegas/FNVFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ GPL License and Copyright Notice ============================================
#include "Records/NAVIRecord.h"
#include "Records/CELLRecord.h"
#include "Records/WRLDRecord.h"
//#include "Records/DIALRecord.h"
#include "Records/DIALRecord.h"
//#include "Records/QUSTRecord.h"
//#include "Records/IDLERecord.h"
//#include "Records/PACKRecord.h"
Expand Down Expand Up @@ -183,7 +183,7 @@ class FNVFile : public ModFile
FNVGRUPRecords<FNV::NAVIRecord> NAVI;
FNVGRUPRecords<FNV::CELLRecord> CELL;
FNVGRUPRecords<FNV::WRLDRecord> WRLD;
//FNVGRUPRecords<FNV::DIALRecord> DIAL;
FNVGRUPRecords<FNV::DIALRecord> DIAL;
//FNVGRUPRecords<FNV::QUSTRecord> QUST;
//FNVGRUPRecords<FNV::IDLERecord> IDLE;
//FNVGRUPRecords<FNV::PACKRecord> PACK;
Expand Down
Loading

0 comments on commit 14abf9d

Please sign in to comment.