feat: add camera culling masks

This commit is contained in:
2026-04-01 01:42:06 +08:00
parent 51736253e3
commit 0fe02fd1b4
9 changed files with 81 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ void CameraComponent::Serialize(std::ostream& os) const {
os << "depth=" << m_depth << ";";
os << "primary=" << (m_primary ? 1 : 0) << ";";
os << "clearMode=" << static_cast<int>(m_clearMode) << ";";
os << "cullingMask=" << m_cullingMask << ";";
os << "clearColor=" << m_clearColor.r << "," << m_clearColor.g << "," << m_clearColor.b << "," << m_clearColor.a << ";";
}
@@ -68,6 +69,8 @@ void CameraComponent::Deserialize(std::istream& is) {
m_primary = (std::stoi(value) != 0);
} else if (key == "clearMode") {
m_clearMode = static_cast<CameraClearMode>(std::stoi(value));
} else if (key == "cullingMask") {
m_cullingMask = static_cast<uint32_t>(std::stoul(value));
} else if (key == "clearColor") {
std::replace(value.begin(), value.end(), ',', ' ');
std::istringstream ss(value);