CommonLibSSE NG
Loading...
Searching...
No Matches
GFxStateBag.h
Go to the documentation of this file.
1#pragma once
2
4#include "RE/G/GFxState.h"
5#include "RE/G/GPtr.h"
6
7namespace RE
8{
9 // StateBag collects accessor methods for properties that can be inherited from Loader to MovieDef and from MovieDef to Movie. These properties can be overwritten in any one of above mentioned instances.
11 {
12 protected:
13 // add
14 [[nodiscard]] virtual GFxStateBag* GetStateBagImpl() const; // 00
15
16 public:
17 virtual ~GFxStateBag(); // 01
18
19 virtual void SetState(GFxState::StateType a_stateType, GFxState* a_state); // 02 - SetState sets an interface to State. The state type is passed to SetState so that we can know which state is being cleared when null is passed
20 [[nodiscard]] virtual GFxState* GetStateAddRef(GFxState::StateType a_stateType) const; // 03 - GetStateAddRef obtains one or more State pointers based on the specified state type
21 virtual void GetStatesAddRef(GFxState** a_stateList, const GFxState::StateType* a_stateTypes, std::uint32_t a_count) const; // 04 - GetStatesAddRef fills in a set of states with one call. Initial array a_stateList must contain null pointers
22
23 template <class T>
25 {
26 return static_cast<T*>(GetStateAddRef(a_state));
27 }
28
29 [[nodiscard]] GPtr<GFxState> GetState(GFxState::StateType a_stateType) const;
30
31 template <class T>
33 {
34 GPtr<T> ptr(GetStateAddRef<T>(a_stateType));
35 ptr->Release();
36 return ptr;
37 }
38 };
39 static_assert(sizeof(GFxStateBag) == 0x8);
40}
Definition GFxFileConstants.h:6
Definition GFxStateBag.h:11
GPtr< GFxState > GetState(GFxState::StateType a_stateType) const
virtual GFxState * GetStateAddRef(GFxState::StateType a_stateType) const
T * GetStateAddRef(GFxState::StateType a_state) const
Definition GFxStateBag.h:24
virtual void SetState(GFxState::StateType a_stateType, GFxState *a_state)
virtual void GetStatesAddRef(GFxState **a_stateList, const GFxState::StateType *a_stateTypes, std::uint32_t a_count) const
GPtr< T > GetState(GFxState::StateType a_stateType) const
Definition GFxStateBag.h:32
virtual ~GFxStateBag()
virtual GFxStateBag * GetStateBagImpl() const
Definition GFxState.h:9
StateType
Definition GFxState.h:15
Definition GPtr.h:7
Definition AbsorbEffect.h:6