-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "WRLD.h" | ||
|
||
#include <ESLoader.h> | ||
|
||
void WRLD::ParseChunks(WRLD& aSourceRecord, Map<uint8_t, uint32_t>& aParentToFormIdPrefix) noexcept | ||
{ | ||
aSourceRecord.IterateChunks([&](ChunkId aChunkId, Buffer::Reader& aReader) { | ||
switch (aChunkId) | ||
{ | ||
case ChunkId::EDID_ID: | ||
m_editorId = ESLoader::ReadZString(aReader); | ||
break; | ||
case ChunkId::WCTR_ID: | ||
m_centerCell = Chunks::WCTR(aReader); | ||
break; | ||
case ChunkId::CNAM_ID: | ||
aReader.ReadBytes(reinterpret_cast<uint8_t*>(&m_climateId), sizeof(m_climateId)); | ||
break; | ||
case ChunkId::DNAM_ID: | ||
m_landData = Chunks::DNAM(aReader); | ||
break; | ||
case ChunkId::WNAM_ID: { | ||
uint32_t id = 0; | ||
aReader.ReadBytes(reinterpret_cast<uint8_t*>(&id), sizeof(id)); | ||
m_parentId = id; | ||
} | ||
break; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
case ChunkId::ZNAM_ID: | ||
aReader.ReadBytes(reinterpret_cast<uint8_t*>(&m_musicId), sizeof(m_musicId)); | ||
break; | ||
case ChunkId::NAMA_ID: | ||
aReader.ReadBytes(reinterpret_cast<uint8_t*>(&m_lodMultiplier), sizeof(m_lodMultiplier)); | ||
break; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include "Record.h" | ||
#include "Chunks.h" | ||
|
||
// https://en.uesp.net/wiki/Skyrim_Mod:Mod_File_Format/WRLD | ||
class WRLD : public Record | ||
{ | ||
public: | ||
static constexpr FormEnum kType = FormEnum::WRLD; | ||
|
||
String m_editorId = ""; | ||
std::optional<Chunks::WCTR> m_centerCell; | ||
std::optional<uint32_t> m_climateId; | ||
std::optional<Chunks::DNAM> m_landData; | ||
std::optional<uint32_t> m_parentId; | ||
uint32_t m_musicId; | ||
float m_lodMultiplier; | ||
|
||
void ParseChunks(WRLD& aSourceRecord, Map<uint8_t, uint32_t>& aParentToFormIdPrefix) noexcept; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is this "break;" supposed to be outside the brackets?