32 friend class GxToolRealTimeDemo;
40 enum class RESOURCE_LOAD_STATE
62 GX_ENUM_TABLE_MAX(INTERPOLATE_TYPE)
75 enum SKIP_NOTIFICATION
77 SKIP_NOTIFICATION_NONE = 0,
78 SKIP_NOTIFICATION_EFFECT = 1 << 0,
79 SKIP_NOTIFICATION_RESERVED = 1 << 1,
80 SKIP_NOTIFICATION_ALL = 0xFFFFFFFF
84 struct GxSkipNotification
86 SKIP_NOTIFICATION _type;
105 enum class PLAY_REQUEST
115 enum class SETUP_STATE
123 static const f32 INVALID_FRAME;
146 void cleanup(
void)
override;
155 void asyncUpdate(
void)
override;
157 void sequentialUpdate(
void)
override;
159 void forceAsyncUpdate(
void)
override;
164 void iconRender(
void)
override;
169 void play(f32 targetFrame = INVALID_FRAME);
171 void playLoop(f32 targetFrame = INVALID_FRAME, s32 count = -1);
179 void updateKeyFrame(
void);
183 void clearReplaceUnit(
void);
187 GX_FORCE_INLINE
virtual b32 requestEffectSkipCall(GxSkipNotification notification) {
return true; }
202 s32 getNextKeyFrame(
void);
204 GX_FORCE_INLINE
void requestSkip(
void) {
if (isPlaying() && _frameSkipState == SKIP::NONE) { _frameSkipState = SKIP::REQUEST; _skipTargetFrame = _targetFrame; } }
210 void skipRTDSub(u32 targetFrame);
229 b32 isPlayable(
void)
const;
231 b32 isPlaying(
void)
const;
233 b32 _isPlaying(
void)
const;
235 GX_FORCE_INLINE
b32 isPausing(
void)
const {
return _isPausing() || (_playRequest == PLAY_REQUEST::PAUSE); }
237 GX_FORCE_INLINE
b32 _isPausing(
void)
const {
return _playState == PLAY_STATE::PAUSE; }
239 f32 getNowFrame(
void)
const;
241 f32 getStartFrame(
void)
const;
243 f32 getEndFrame(
void)
const;
249 void setPrecreateUnit(
b32 enable);
251 GxUnitBase* getUnit(u32 resourceIndex, u32 unitNodeId );
253 GxUnitBase* getUnitFromDiscrimID(u32 resourceIndex, s32 discrimId);
257 b32 getPropertyValueAsString(
GxString& value,
GxRtti*& pRtti, u32 resourceIndex, u32 unitNodeId, u32 propertyNodeId);
259 b32 getPropertyValuePointer(
GxTypedObject*& pValue, u32 resourceIndex, u32 unitNodeId, u32 targetPropertyNodeId);
264 void updatePlayState(
void);
319 constexpr u32 getNowFrameU32(
void)
const {
return static_cast<u32
>(_nowFrame); }
321 virtual void getInterpolateTypeEnum(
GX_ENUM** ppEnum, u32* pCount);
323 constexpr u32 getSkipFrame(
void)
const {
return static_cast<u32
>(_midFramePosition); }
325 constexpr u32 getRequestSkipNotification(
void)
const {
return _requestSkipNotification; }
327 void setRequestSkipNotification(u32 skipRequest);
332 virtual f32 getDeltaFrame(
void);
341 virtual void pauseMotion(
void);
343 virtual void resumeMotion(
void);
347 constexpr void getPropertyStartFrame(
void*
const pValue){ *
static_cast<u32*
>(pValue) = (
nullptr != _pResource[0]) ? _pResource[0]->getStartFrame() : 0; }
349 constexpr void setPropertyStartFrame(
const void*
const){}
351 constexpr void getPropertyEndFrame(
void*
const pValue){ *
static_cast<u32*
>(pValue) = (
nullptr != _pResource[0]) ? _pResource[0]->getEndFrame() : 0; }
353 constexpr void setPropertyEndFrame(
const void*
const){}
355 GX_FORCE_INLINE
void getPropertyPlay(
void*
const pValue){ *
static_cast<b32*
>(pValue) = (PLAY_STATE::PLAY == _playState) || (PLAY_STATE::PLAY == _reservedPlayState); }
357 void setPropertyPlay(
const void*
const pValue);
359 GX_FORCE_INLINE
void getPropertyPlayLoop(
void*
const pValue){ *
static_cast<b32*
>(pValue) = (PLAY_STATE::PLAY_LOOP == _playState) || (PLAY_STATE::PLAY_LOOP == _reservedPlayState); }
361 void setPropertyPlayLoop(
const void*
const pValue);
363 constexpr void getPropertyResource(
void*
const pValue, u32 index){ *
static_cast<GxResRealTimeDemo**
>(pValue) = _pResource[index]; }
365 GX_FORCE_INLINE
void setPropertyResource(
const void*
const pValue, u32 index){ setRTDResource(*
static_cast<GxResRealTimeDemo**
>(
const_cast<void*
>(pValue)), index,
false); }
369 constexpr void setPropertyResourceCount(u32){}
371 constexpr void getPropertyPreCreateUnit(
void*
const pValue){ *
static_cast<b32*
>(pValue) = _preCreateUnit; }
373 GX_FORCE_INLINE
void setPropertyPreCreateUnit(
const void*
const pValue){ setPrecreateUnit(*
static_cast<b32*
>(
const_cast<void*
>(pValue))); }
381 void _play(
b32 loop);
383 void _stop(
b32 resetFrame);
385 void updateRtdPlay(
void);
387 void updatePlayStateAfter(
void);
390 void setSetupState(SETUP_STATE state);
392 void updateSetupAsync(
void);
394 void updateSetupSeq(
void);
400 void releaseKeyResource(u32 resourceIndex);
402 void releaseKeyResourceAll(
void);
404 b32 isLoadFinishedKeyResource(u32 resourceIndex);
407 void setUpdateRenderUnit(
b32 on);
409 void createUnit(
void);
411 void updatePointerUnit(
void);
413 void disposeUnit(u32 resourceIndex);
415 void disposeUnitAll(
void);
417 b32 isCreatedUnit(
void);
432 void updatePointerReplaceUnit(
void);
438 void registRenderUnit(
void);
451 PLAY_REQUEST _playRequest;
452 PLAY_STATE _playState;
453 PLAY_STATE _reservedPlayState;
454 PLAY_STATE _lastPlayState;
460 b32 _continuePlayRequest;
461 f32 _continuePlayWaitFrame;
464 SETUP_STATE _setupState;
466 RESOURCE_LOAD_STATE _resourceLoadState[RESOURCE_MAX];
474 END_FRAME_MODE _endFrameMode;
476 static GxRtti* _pRttiCreateCharacter;
477 static GxRtti* _pRttiCreateCamera;
481 b32 _isForceSkipPlayMode;
484 b32 _isEnableDisposeUnitAll;
485 b32 _isEnableFrameSkip;
487 f32 _previousDeltaTimeFactor;
488 f32 _skipTargetFrame;
489 b32 _isEnableMidFrameStart;
490 f32 _midFramePosition;
491 u32 _requestSkipNotification;