Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::engine Namespace Reference

Namespaces

namespace  gpuframe
 

Classes

class  MeshGPUCache
 
struct  MeshGPUDynamicVertexResource
 
struct  MeshGPUError
 
struct  MeshGPUModernTextureResource
 
struct  MeshGPUResource
 
struct  MeshGPUTextureResource
 
struct  MeshGPUUploadPlan
 
struct  MeshGPUVertex
 
class  ModernEnvironment
 
struct  ModernEnvironmentDefinition
 
struct  ModernPBRFragmentUniforms
 
struct  ModernPBRVertexUniforms
 
class  SequencePlayback
 
struct  SequenceWorld2DObject
 
class  SequenceWorld2DSlot
 
struct  SequenceWorld2DSyncStats
 
struct  SequenceWorld3DObject
 
class  SequenceWorld3DSlot
 
struct  SequenceWorld3DSlotError
 
struct  SequenceWorld3DSyncStats
 
struct  StudioEnvironmentData
 
struct  StudioEnvironmentError
 
class  StudioEnvironmentGPU
 
class  World2DRenderer
 
struct  World3DCamera
 
struct  World3DDirectionalLight
 
struct  World3DFragmentUniforms
 
struct  World3DGPUIndexedBatch
 
struct  World3DLighting
 
class  World3DPipeline
 
struct  World3DPipelineError
 
struct  World3DProjectionError
 
struct  World3DProjectionState
 
struct  World3DRect
 
class  World3DRenderer
 
struct  World3DRendererError
 
struct  World3DRenderStats
 
struct  World3DShaderError
 
class  World3DShaderSet
 
struct  World3DSpotLight
 
struct  World3DVertexUniforms
 

Enumerations

enum class  MeshGPUErrorCode {
  MissingDevice , MissingAsset , EmptyGeometry , SizeOverflow ,
  InvalidIndex , InvalidBatchRange , DynamicTopologyMismatch , MissingTexturePixels ,
  InvalidTexturePixels , VertexBufferCreationFailed , IndexBufferCreationFailed , TextureCreationFailed ,
  UnsupportedTextureFormat , SamplerCreationFailed , HostAllocationFailed , TransferBufferCreationFailed ,
  TransferMapFailed , CommandBufferCreationFailed , CopyPassCreationFailed , SubmitFailed
}
 
enum class  RenderSlot : std::uint8_t { Background2D = 0 , World3D = 1 , Overlay2D = 2 , Sound = 3 }
 
enum class  SequenceWorld3DSlotErrorCode { DuplicateNode }
 
enum class  StudioEnvironmentErrorCode {
  FileRead , InvalidAsset , UnsupportedFormat , GPUCreation ,
  GPUUpload
}
 
enum class  World3DPipelineErrorCode {
  MissingDevice , InvalidColorFormat , UnsupportedDepthFormat , ShaderLoadFailed ,
  PipelineCreateFailed
}
 
enum class  World3DProjectionErrorCode { InvalidViewport , InvalidPlanes , InvalidFieldOfView , InvalidCameraDirection }
 
enum class  World3DRendererErrorCode {
  MissingDevice , MissingCommandBuffer , MissingColorTarget , MissingView ,
  InvalidTargetSize , PipelineLoadFailed , SceneBuildFailed , SamplerCreationFailed ,
  FallbackTextureCreationFailed , FallbackTextureUploadFailed , DepthTargetCreationFailed , RenderPassCreationFailed
}
 
enum class  World3DShaderErrorCode {
  MissingDevice , UnsupportedFormat , MissingAsset , ReadFailed ,
  CreateFailed
}
 

Functions

void handleAudioPlaybackFailure (std::string_view context, const std::string &error) noexcept
 
void configureModernScene (data::ModernSceneOptions options) noexcept
 
bool modernTradePresentationEnabled () noexcept
 
SequencePlayback * sequencePlayback ()
 
void startOpeningMovies (bool startedByLobby)
 
bool consumeOpeningMovieInput (const uimsg::Message &message)
 
audio::Runtime * audioPlayback ()
 
bool startVoiceChat () noexcept
 
void stopVoiceChat () noexcept
 
fonts::Runtime * fontPlayback ()
 
udsound::Runtime * monopolySoundPlayback ()
 
void playWarningSound () noexcept
 
void playClickSound () noexcept
 
void playBuildSound () noexcept
 
void playUnbuildSound () noexcept
 
void playSaveFailureSound () noexcept
 
void playTokenVoice (std::uint8_t token, udsound::TokenVoiceLine line, udsound::TokenVoiceClipPolicy policy, bool watchAfterStart) noexcept
 
void playPennybagsVoice (udsound::PennybagsVoice line, udsound::TokenVoiceClipPolicy policy, bool watchAfterStart) noexcept
 
bool spokenPostLockSlotEmpty () noexcept
 
bool isUsaBoardEdition () noexcept
 
void playJailChoiceHostComment () noexcept
 
std::expected< void, std::string > syncSequenceAudio (SequencePlayback &session)
 
std::expected< void, std::string > syncMonopolyAudio (const rules::GameState &ruleState, const display::State &displayState)
 
statsui::AccountRuntime * statsAccounts () noexcept
 
bool initialize (SDL_Window *window, presentation::PresentMode presentMode)
 
bool runCyclicFunctions ()
 
void shutdown ()
 
std::expected< MeshGPUUploadPlan, MeshGPUError > makeMeshGPUUploadPlan (const data::MeshRenderData &renderData)
 
const std::array< ModernEnvironmentDefinition, ModernEnvironmentCount > & modernEnvironmentDefinitions () noexcept
 
data::MeshBounds presentationWorldBounds (const data::MeshBounds &local, const sequence::Matrix3D &world)
 
World3DCamera preserveModernTravelFraming (const World3DCamera &original, float groundY) noexcept
 
World3DCamera avoidModernPresentationBuildings (const World3DCamera &original, std::span< const data::MeshBounds > buildings, float groundY, float clearance, float influenceRadius) noexcept
 
float modernBoardControlReservation (const World3DRect &viewport, int pixelWidth, int pixelHeight, int controlsTop) noexcept
 
World3DCamera fitModernTopDownBoard (const data::MeshBounds &bounds, const World3DCamera &original, float aspect, float bottomReservedFraction=0) noexcept
 
World3DCamera modernBoardPresentationCamera (const data::MeshBounds &bounds, float aspect, float elevationDegrees=48.0F, float yawDegrees=8.0F, float bottomReservedFraction=0.0F)
 
World3DLighting modernBoardPresentationLighting ()
 
bool initializeRenderSlots ()
 
void shutdownRenderSlots ()
 
constexpr std::uint32_t renderSlotBit (RenderSlot slot)
 
World3DCamera world3DCameraFromSequence (const sequence::SequenceCamera3DView &camera) noexcept
 
std::optional< World3DCamera > resolveWorld3DCamera (const sequence::SetCameraCommand &command, const sequence::SequenceRuntime &runtime) noexcept
 
std::expected< StudioEnvironmentData, StudioEnvironmentError > parseStudioEnvironment (std::span< const std::uint8_t > bytes)
 
std::expected< StudioEnvironmentData, StudioEnvironmentError > readStudioEnvironment (const std::filesystem::path &path)
 
void pruneWorld3DGPUScene (const SequenceWorld3DSlot &slot, MeshGPUCache &cache)
 
std::expected< std::vector< World3DGPUIndexedBatch >, MeshGPUError > buildWorld3DGPUScene (const SequenceWorld3DSlot &slot, MeshGPUCache &cache)
 
std::optional< SDL_GPUTextureFormat > chooseWorld3DDepthFormat (SDL_GPUDevice *device) noexcept
 
std::expected< World3DProjectionState, World3DProjectionError > makeWorld3DProjectionState (World3DRect viewport, World3DCamera camera)
 
std::optional< World3DRect > intersectWorld3DRect (World3DRect left, World3DRect right) noexcept
 
std::optional< World3DRect > world3DMeshScreenRect (const data::MeshBounds &bounds, const sequence::Matrix3D &worldTransform, const World3DProjectionState &projection) noexcept
 

Variables

constexpr std::size_t ModernEnvironmentCount = 3
 
constexpr std::size_t ModernCityCount = 17
 
constexpr std::uint16_t ModernEnvironmentLogicalGroup = 0xFFFB
 
constexpr sequence::SequenceNodeId ModernEnvironmentNodeBase = 0x8000FFFB00000000ULL
 
constexpr std::uint32_t DefaultSequenceRenderSlotSet
 
constexpr RenderSlot MouseWorldCoordinatesSlot
 
constexpr float MonopolyBoardNearPlane = 10.0F
 
constexpr float MonopolyBoardFarPlane = 1540.0F
 

Enumeration Type Documentation

◆ MeshGPUErrorCode

Enumerator
MissingDevice 
MissingAsset 
EmptyGeometry 
SizeOverflow 
InvalidIndex 
InvalidBatchRange 
DynamicTopologyMismatch 
MissingTexturePixels 
InvalidTexturePixels 
VertexBufferCreationFailed 
IndexBufferCreationFailed 
TextureCreationFailed 
UnsupportedTextureFormat 
SamplerCreationFailed 
HostAllocationFailed 
TransferBufferCreationFailed 
TransferMapFailed 
CommandBufferCreationFailed 
CopyPassCreationFailed 
SubmitFailed 

Definition at line 35 of file MeshGPUResources.hpp.

◆ RenderSlot

enum class monopoly::engine::RenderSlot : std::uint8_t
strong
Enumerator
Background2D 
World3D 
Overlay2D 
Sound 

Definition at line 7 of file RenderSlots.hpp.

◆ SequenceWorld3DSlotErrorCode

Enumerator
DuplicateNode 

Definition at line 18 of file SequenceWorld3DSlot.hpp.

◆ StudioEnvironmentErrorCode

Enumerator
FileRead 
InvalidAsset 
UnsupportedFormat 
GPUCreation 
GPUUpload 

Definition at line 13 of file StudioEnvironmentGPU.hpp.

◆ World3DPipelineErrorCode

Enumerator
MissingDevice 
InvalidColorFormat 
UnsupportedDepthFormat 
ShaderLoadFailed 
PipelineCreateFailed 

Definition at line 14 of file World3DPipeline.hpp.

◆ World3DProjectionErrorCode

Enumerator
InvalidViewport 
InvalidPlanes 
InvalidFieldOfView 
InvalidCameraDirection 

Definition at line 39 of file World3DProjection.hpp.

◆ World3DRendererErrorCode

Enumerator
MissingDevice 
MissingCommandBuffer 
MissingColorTarget 
MissingView 
InvalidTargetSize 
PipelineLoadFailed 
SceneBuildFailed 
SamplerCreationFailed 
FallbackTextureCreationFailed 
FallbackTextureUploadFailed 
DepthTargetCreationFailed 
RenderPassCreationFailed 

Definition at line 20 of file World3DRenderer.hpp.

◆ World3DShaderErrorCode

Enumerator
MissingDevice 
UnsupportedFormat 
MissingAsset 
ReadFailed 
CreateFailed 

Definition at line 11 of file World3DShaderAssets.hpp.

Function Documentation

◆ audioPlayback()

audio::Runtime * monopoly::engine::audioPlayback ( )

Definition at line 1679 of file Engine.cpp.

◆ avoidModernPresentationBuildings()

World3DCamera monopoly::engine::avoidModernPresentationBuildings ( const World3DCamera &  original,
std::span< const data::MeshBounds >  buildings,
float  groundY,
float  clearance,
float  influenceRadius 
)
inlinenoexcept

Definition at line 62 of file ModernScenePresentation.hpp.

◆ buildWorld3DGPUScene()

std::expected< std::vector< World3DGPUIndexedBatch >, MeshGPUError > monopoly::engine::buildWorld3DGPUScene ( const SequenceWorld3DSlot &  slot,
MeshGPUCache &  cache 
)

Definition at line 24 of file World3DGPUScene.cpp.

◆ chooseWorld3DDepthFormat()

std::optional< SDL_GPUTextureFormat > monopoly::engine::chooseWorld3DDepthFormat ( SDL_GPUDevice *  device)
noexcept

Definition at line 13 of file World3DPipeline.cpp.

◆ configureModernScene()

void monopoly::engine::configureModernScene ( data::ModernSceneOptions  options)
noexcept

Definition at line 1198 of file Engine.cpp.

◆ consumeOpeningMovieInput()

bool monopoly::engine::consumeOpeningMovieInput ( const uimsg::Message &  message)

Definition at line 1665 of file Engine.cpp.

◆ fitModernTopDownBoard()

World3DCamera monopoly::engine::fitModernTopDownBoard ( const data::MeshBounds &  bounds,
const World3DCamera &  original,
float  aspect,
float  bottomReservedFraction = 0 
)
inlinenoexcept

Definition at line 130 of file ModernScenePresentation.hpp.

◆ fontPlayback()

fonts::Runtime * monopoly::engine::fontPlayback ( )

Definition at line 1753 of file Engine.cpp.

◆ handleAudioPlaybackFailure()

void monopoly::engine::handleAudioPlaybackFailure ( std::string_view  context,
const std::string &  error 
)
noexcept

Definition at line 1854 of file Engine.cpp.

◆ initialize()

bool monopoly::engine::initialize ( SDL_Window *  window,
presentation::PresentMode  presentMode 
)

Definition at line 2096 of file Engine.cpp.

◆ initializeRenderSlots()

bool monopoly::engine::initializeRenderSlots ( )

Definition at line 10 of file RenderSlots.cpp.

◆ intersectWorld3DRect()

std::optional< World3DRect > monopoly::engine::intersectWorld3DRect ( World3DRect  left,
World3DRect  right 
)
noexcept

Definition at line 152 of file World3DProjection.cpp.

◆ isUsaBoardEdition()

bool monopoly::engine::isUsaBoardEdition ( )
noexcept

Definition at line 1951 of file Engine.cpp.

◆ makeMeshGPUUploadPlan()

std::expected< MeshGPUUploadPlan, MeshGPUError > monopoly::engine::makeMeshGPUUploadPlan ( const data::MeshRenderData &  renderData)

Definition at line 418 of file MeshGPUResources.cpp.

◆ makeWorld3DProjectionState()

std::expected< World3DProjectionState, World3DProjectionError > monopoly::engine::makeWorld3DProjectionState ( World3DRect  viewport,
World3DCamera  camera 
)

Definition at line 111 of file World3DProjection.cpp.

◆ modernBoardControlReservation()

float monopoly::engine::modernBoardControlReservation ( const World3DRect &  viewport,
int  pixelWidth,
int  pixelHeight,
int  controlsTop 
)
inlinenoexcept

Definition at line 116 of file ModernScenePresentation.hpp.

◆ modernBoardPresentationCamera()

World3DCamera monopoly::engine::modernBoardPresentationCamera ( const data::MeshBounds &  bounds,
float  aspect,
float  elevationDegrees = 48.0F,
float  yawDegrees = 8.0F,
float  bottomReservedFraction = 0.0F 
)
inline

Definition at line 189 of file ModernScenePresentation.hpp.

◆ modernBoardPresentationLighting()

World3DLighting monopoly::engine::modernBoardPresentationLighting ( )
inline

Definition at line 236 of file ModernScenePresentation.hpp.

◆ modernEnvironmentDefinitions()

const std::array< ModernEnvironmentDefinition, ModernEnvironmentCount > & monopoly::engine::modernEnvironmentDefinitions ( )
noexcept

Definition at line 94 of file ModernEnvironment.cpp.

◆ modernTradePresentationEnabled()

bool monopoly::engine::modernTradePresentationEnabled ( )
noexcept

Definition at line 1203 of file Engine.cpp.

◆ monopolySoundPlayback()

udsound::Runtime * monopoly::engine::monopolySoundPlayback ( )

Definition at line 1849 of file Engine.cpp.

◆ parseStudioEnvironment()

std::expected< StudioEnvironmentData, StudioEnvironmentError > monopoly::engine::parseStudioEnvironment ( std::span< const std::uint8_t >  bytes)

Definition at line 52 of file StudioEnvironmentGPU.cpp.

◆ playBuildSound()

void monopoly::engine::playBuildSound ( )
noexcept

Definition at line 1907 of file Engine.cpp.

◆ playClickSound()

void monopoly::engine::playClickSound ( )
noexcept

Definition at line 1898 of file Engine.cpp.

◆ playJailChoiceHostComment()

void monopoly::engine::playJailChoiceHostComment ( )
noexcept

Definition at line 1957 of file Engine.cpp.

◆ playPennybagsVoice()

void monopoly::engine::playPennybagsVoice ( udsound::PennybagsVoice  line,
udsound::TokenVoiceClipPolicy  policy,
bool  watchAfterStart 
)
noexcept

Definition at line 1940 of file Engine.cpp.

◆ playSaveFailureSound()

void monopoly::engine::playSaveFailureSound ( )
noexcept

Definition at line 1925 of file Engine.cpp.

◆ playTokenVoice()

void monopoly::engine::playTokenVoice ( std::uint8_t  token,
udsound::TokenVoiceLine  line,
udsound::TokenVoiceClipPolicy  policy,
bool  watchAfterStart 
)
noexcept

Definition at line 1934 of file Engine.cpp.

◆ playUnbuildSound()

void monopoly::engine::playUnbuildSound ( )
noexcept

Definition at line 1916 of file Engine.cpp.

◆ playWarningSound()

void monopoly::engine::playWarningSound ( )
noexcept

Definition at line 1889 of file Engine.cpp.

◆ presentationWorldBounds()

data::MeshBounds monopoly::engine::presentationWorldBounds ( const data::MeshBounds &  local,
const sequence::Matrix3D &  world 
)
inline

Definition at line 12 of file ModernScenePresentation.hpp.

◆ preserveModernTravelFraming()

World3DCamera monopoly::engine::preserveModernTravelFraming ( const World3DCamera &  original,
float  groundY 
)
inlinenoexcept

Definition at line 34 of file ModernScenePresentation.hpp.

◆ pruneWorld3DGPUScene()

void monopoly::engine::pruneWorld3DGPUScene ( const SequenceWorld3DSlot &  slot,
MeshGPUCache &  cache 
)

Definition at line 9 of file World3DGPUScene.cpp.

◆ readStudioEnvironment()

std::expected< StudioEnvironmentData, StudioEnvironmentError > monopoly::engine::readStudioEnvironment ( const std::filesystem::path &  path)

Definition at line 80 of file StudioEnvironmentGPU.cpp.

◆ renderSlotBit()

constexpr std::uint32_t monopoly::engine::renderSlotBit ( RenderSlot  slot)
constexpr

Definition at line 15 of file RenderSlots.hpp.

◆ resolveWorld3DCamera()

std::optional< World3DCamera > monopoly::engine::resolveWorld3DCamera ( const sequence::SetCameraCommand &  command,
const sequence::SequenceRuntime &  runtime 
)
noexcept

Definition at line 46 of file SequenceWorld3DSlot.cpp.

◆ runCyclicFunctions()

bool monopoly::engine::runCyclicFunctions ( )

Definition at line 2227 of file Engine.cpp.

◆ sequencePlayback()

SequencePlayback * monopoly::engine::sequencePlayback ( )

Definition at line 1213 of file Engine.cpp.

◆ shutdown()

void monopoly::engine::shutdown ( )

Definition at line 3294 of file Engine.cpp.

◆ shutdownRenderSlots()

void monopoly::engine::shutdownRenderSlots ( )

Definition at line 26 of file RenderSlots.cpp.

◆ spokenPostLockSlotEmpty()

bool monopoly::engine::spokenPostLockSlotEmpty ( )
noexcept

Definition at line 1946 of file Engine.cpp.

◆ startOpeningMovies()

void monopoly::engine::startOpeningMovies ( bool  startedByLobby)

Definition at line 1647 of file Engine.cpp.

◆ startVoiceChat()

bool monopoly::engine::startVoiceChat ( )
noexcept

Definition at line 1704 of file Engine.cpp.

◆ statsAccounts()

statsui::AccountRuntime * monopoly::engine::statsAccounts ( )
noexcept

Definition at line 2093 of file Engine.cpp.

◆ stopVoiceChat()

void monopoly::engine::stopVoiceChat ( )
noexcept

Definition at line 1746 of file Engine.cpp.

◆ syncMonopolyAudio()

std::expected< void, std::string > monopoly::engine::syncMonopolyAudio ( const rules::GameState &  ruleState,
const display::State &  displayState 
)

Definition at line 2064 of file Engine.cpp.

◆ syncSequenceAudio()

std::expected< void, std::string > monopoly::engine::syncSequenceAudio ( SequencePlayback &  session)

Definition at line 1976 of file Engine.cpp.

◆ world3DCameraFromSequence()

World3DCamera monopoly::engine::world3DCameraFromSequence ( const sequence::SequenceCamera3DView &  camera)
noexcept

Definition at line 34 of file SequenceWorld3DSlot.cpp.

◆ world3DMeshScreenRect()

std::optional< World3DRect > monopoly::engine::world3DMeshScreenRect ( const data::MeshBounds &  bounds,
const sequence::Matrix3D &  worldTransform,
const World3DProjectionState &  projection 
)
noexcept

Definition at line 163 of file World3DProjection.cpp.

Variable Documentation

◆ DefaultSequenceRenderSlotSet

constexpr std::uint32_t monopoly::engine::DefaultSequenceRenderSlotSet
inlineconstexpr
Initial value:
=
renderSlotBit(RenderSlot::Overlay2D) |
renderSlotBit(RenderSlot::World3D) |
renderSlotBit(RenderSlot::Sound)
constexpr std::uint32_t renderSlotBit(RenderSlot slot)

Definition at line 24 of file RenderSlots.hpp.

◆ ModernCityCount

constexpr std::size_t monopoly::engine::ModernCityCount = 17
inlineconstexpr

Definition at line 16 of file ModernEnvironment.hpp.

◆ ModernEnvironmentCount

constexpr std::size_t monopoly::engine::ModernEnvironmentCount = 3
inlineconstexpr

Definition at line 15 of file ModernEnvironment.hpp.

◆ ModernEnvironmentLogicalGroup

constexpr std::uint16_t monopoly::engine::ModernEnvironmentLogicalGroup = 0xFFFB
inlineconstexpr

Definition at line 19 of file ModernEnvironment.hpp.

◆ ModernEnvironmentNodeBase

constexpr sequence::SequenceNodeId monopoly::engine::ModernEnvironmentNodeBase = 0x8000FFFB00000000ULL
inlineconstexpr

Definition at line 20 of file ModernEnvironment.hpp.

◆ MonopolyBoardFarPlane

constexpr float monopoly::engine::MonopolyBoardFarPlane = 1540.0F
inlineconstexpr

Definition at line 37 of file World3DProjection.hpp.

◆ MonopolyBoardNearPlane

constexpr float monopoly::engine::MonopolyBoardNearPlane = 10.0F
inlineconstexpr

Definition at line 36 of file World3DProjection.hpp.

◆ MouseWorldCoordinatesSlot

constexpr RenderSlot monopoly::engine::MouseWorldCoordinatesSlot
inlineconstexpr
Initial value:
=
RenderSlot::Overlay2D

Definition at line 31 of file RenderSlots.hpp.