MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / SetFacingLeft

Method SetFacingLeft

Sources/Jazz2/Actors/ActorBase.cpp:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 void ActorBase::SetFacingLeft(bool value)
50 {
51 if (IsFacingLeft() == value) {
52 return;
53 }
54
55 SetState(ActorState::IsFacingLeft, value);
56 _renderer.setFlippedX(value);
57
58 // Recalculate hotspot
59 GraphicResource* res = (_currentTransition != nullptr ? _currentTransition : _currentAnimation);
60 if (res != nullptr) {
61 _renderer.Hotspot.X = static_cast<float>(IsFacingLeft() ? (res->Base->FrameDimensions.X - res->Base->Hotspot.X) : res->Base->Hotspot.X);
62 _renderer.setAbsAnchorPoint(_renderer.Hotspot.X, _renderer.Hotspot.Y);
63 }
64 }
65
66 void ActorBase::SetParent(SceneNode* parent)
67 {

Callers 2

OnUpdateMethod · 0.80
OnUpdateMethod · 0.80

Calls 2

setAbsAnchorPointMethod · 0.80
setFlippedXMethod · 0.45

Tested by

no test coverage detected