Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::save::anonymous_namespace{replay_file.cpp} Namespace Reference

Classes

struct  Header

Functions

constexpr uint64_t AlignUp (uint64_t value)
std::expected< uint64_t, std::string > ExpectedBytes (const Header &header)
std::expected< void, std::string > CheckOrder (const ReplayFile &replay)
std::string PathText (const fs::path &path)
void Append (std::vector< std::byte > &bytes, std::span< const std::byte > source)
template<typename T>
void CopyOut (std::span< const std::byte > bytes, uint64_t offset, std::span< T > values)

Variables

constexpr std::array< char, 4 > MAGIC = {'B', 'C', 'R', 'P'}
constexpr uint64_t HEADER_BYTES = 64
constexpr uint64_t HASH_BYTES = 16
constexpr uint64_t ALIGNMENT = 8
constexpr uint64_t MAX_FILE_BYTES = uint64_t{1} << 30

Function Documentation

◆ AlignUp()

uint64_t bicameral::save::anonymous_namespace{replay_file.cpp}::AlignUp ( uint64_t value)
constexpr

Definition at line 47 of file replay_file.cpp.

References ALIGNMENT, and AlignUp().

Referenced by AlignUp(), and ExpectedBytes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Append()

void bicameral::save::anonymous_namespace{replay_file.cpp}::Append ( std::vector< std::byte > & bytes,
std::span< const std::byte > source )

Definition at line 88 of file replay_file.cpp.

References Append().

Referenced by Append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckOrder()

std::expected< void, std::string > bicameral::save::anonymous_namespace{replay_file.cpp}::CheckOrder ( const ReplayFile & replay)

Definition at line 63 of file replay_file.cpp.

References CheckOrder(), bicameral::sim::CommandPrecedes(), bicameral::save::ReplayFile::commands, bicameral::save::ReplayFile::startTick, bicameral::sim::Command::targetTick, and bicameral::save::ReplayFile::tickHashes.

Referenced by CheckOrder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CopyOut()

template<typename T>
void bicameral::save::anonymous_namespace{replay_file.cpp}::CopyOut ( std::span< const std::byte > bytes,
uint64_t offset,
std::span< T > values )

Definition at line 94 of file replay_file.cpp.

References CopyOut().

Referenced by CopyOut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExpectedBytes()

std::expected< uint64_t, std::string > bicameral::save::anonymous_namespace{replay_file.cpp}::ExpectedBytes ( const Header & header)

Definition at line 52 of file replay_file.cpp.

References AlignUp(), bicameral::sim::COMMAND_BYTES, bicameral::save::anonymous_namespace{replay_file.cpp}::Header::commandCount, bicameral::save::anonymous_namespace{replay_file.cpp}::Header::deltaBytes, ExpectedBytes(), HASH_BYTES, bicameral::save::anonymous_namespace{replay_file.cpp}::Header::hashCount, HEADER_BYTES, and MAX_FILE_BYTES.

Referenced by ExpectedBytes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PathText()

std::string bicameral::save::anonymous_namespace{replay_file.cpp}::PathText ( const fs::path & path)

Definition at line 84 of file replay_file.cpp.

References PathText(), and bicameral::ToUtf8().

Referenced by PathText().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ALIGNMENT

uint64_t bicameral::save::anonymous_namespace{replay_file.cpp}::ALIGNMENT = 8
constexpr

Definition at line 21 of file replay_file.cpp.

Referenced by AlignUp().

◆ HASH_BYTES

uint64_t bicameral::save::anonymous_namespace{replay_file.cpp}::HASH_BYTES = 16
constexpr

Definition at line 20 of file replay_file.cpp.

Referenced by ExpectedBytes().

◆ HEADER_BYTES

uint64_t bicameral::save::anonymous_namespace{replay_file.cpp}::HEADER_BYTES = 64
constexpr

Definition at line 19 of file replay_file.cpp.

Referenced by ExpectedBytes().

◆ MAGIC

std::array<char, 4> bicameral::save::anonymous_namespace{replay_file.cpp}::MAGIC = {'B', 'C', 'R', 'P'}
constexpr

Definition at line 18 of file replay_file.cpp.

◆ MAX_FILE_BYTES

uint64_t bicameral::save::anonymous_namespace{replay_file.cpp}::MAX_FILE_BYTES = uint64_t{1} << 30
constexpr

Definition at line 23 of file replay_file.cpp.

Referenced by ExpectedBytes().