mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-14 07:47:13 +00:00
The dashboard's copy of the terrain reader in dCommon is gone; main's in dZoneManager reads for everyone, and keeps what the copy had over it: colour and texture maps from before version 32 become RGBA, cut to the resolution the client keeps. The scene map (ZoneScenes) and the dCommon tests compile against that reader. A scene ID takes its layer as the zone file numbers it (0 General, 1 Audio) as well as the enum, so main's scene tools and tests build; /getscene prints the layer as a number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.8 KiB
C++
40 lines
1.8 KiB
C++
#ifndef LWOSCENEID_H
|
|
#define LWOSCENEID_H
|
|
|
|
#include <cstdint>
|
|
|
|
#include "eSceneType.h"
|
|
|
|
// A scene of a zone: its scene ID and layer
|
|
struct LWOSCENEID {
|
|
public:
|
|
constexpr LWOSCENEID() noexcept { m_sceneID = -1; m_layerID = eSceneType::General; }
|
|
constexpr LWOSCENEID(int32_t sceneID) noexcept { m_sceneID = sceneID; m_layerID = eSceneType::General; }
|
|
constexpr LWOSCENEID(int32_t sceneID, eSceneType layerID) noexcept { m_sceneID = sceneID; m_layerID = layerID; }
|
|
// The layer as the zone file and the terrain number it (0 General, 1 Audio)
|
|
constexpr LWOSCENEID(int32_t sceneID, uint32_t layerID) noexcept { m_sceneID = sceneID; m_layerID = static_cast<eSceneType>(layerID); }
|
|
|
|
constexpr LWOSCENEID& operator=(const LWOSCENEID& rhs) noexcept { m_sceneID = rhs.m_sceneID; m_layerID = rhs.m_layerID; return *this; }
|
|
constexpr LWOSCENEID& operator=(const int32_t rhs) noexcept { m_sceneID = rhs; m_layerID = eSceneType::General; return *this; }
|
|
|
|
constexpr bool operator<(const LWOSCENEID& rhs) const noexcept { return (m_sceneID < rhs.m_sceneID || (m_sceneID == rhs.m_sceneID && m_layerID < rhs.m_layerID)); }
|
|
constexpr bool operator<(const int32_t rhs) const noexcept { return m_sceneID < rhs; }
|
|
|
|
constexpr bool operator==(const LWOSCENEID& rhs) const noexcept { return (m_sceneID == rhs.m_sceneID && m_layerID == rhs.m_layerID); }
|
|
constexpr bool operator==(const int32_t rhs) const noexcept { return m_sceneID == rhs; }
|
|
|
|
constexpr int32_t GetSceneID() const noexcept { return m_sceneID; }
|
|
constexpr eSceneType GetLayerID() const noexcept { return m_layerID; }
|
|
|
|
constexpr void SetSceneID(const int32_t sceneID) noexcept { m_sceneID = sceneID; }
|
|
constexpr void SetLayerID(const eSceneType layerID) noexcept { m_layerID = layerID; }
|
|
|
|
private:
|
|
int32_t m_sceneID;
|
|
eSceneType m_layerID;
|
|
};
|
|
|
|
constexpr LWOSCENEID LWOSCENEID_INVALID = -1;
|
|
|
|
#endif //!LWOSCENEID_H
|