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

Method OnDraw

Sources/Jazz2/UI/Menu/InGameMenu.cpp:129–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 }
128
129 bool InGameMenu::MenuBackgroundCanvas::OnDraw(RenderQueue& renderQueue)
130 {
131 Canvas::OnDraw(renderQueue);
132
133 ViewSize = _owner->_root->_upscalePass.GetViewSize();
134
135 _owner->_activeCanvas = ActiveCanvas::Background;
136
137 Vector2i center = ViewSize / 2;
138
139 std::int32_t charOffset = 0;
140 std::int32_t charOffsetShadow = 0;
141
142 float titleY = _owner->_contentBounds.Y - (ViewSize.Y >= 300 ? 30.0f : 12.0f);
143 float logoBaseScale = (ViewSize.Y >= 300 ? 1.0f : 0.85f);
144 float logoScale = logoBaseScale;
145 float logoTextScale = logoBaseScale;
146 float logoTranslateX = logoBaseScale;
147 float logoTranslateY = 0.0f;
148 float logoTextTranslate = 0.0f;
149
150 // Show blurred viewports behind
151 auto& viewports = _owner->_root->_assignedViewports;
152 for (std::size_t i = 0; i < viewports.size(); i++) {
153 auto& viewport = viewports[i];
154 Rectf scopedView = viewport->GetBounds();
155 Texture* blurTexture = viewport->_blurPass4.GetTarget();
156 if DEATH_LIKELY(blurTexture != nullptr) {
157 DrawTexture(*blurTexture, scopedView.GetLocation(), 500, scopedView.GetSize(), Vector4f(1.0f, 0.0f, 1.0f, 0.0f), Colorf(0.5f, 0.5f, 0.5f, std::min(AnimTime * 8.0f, 1.0f)));
158 } else {
159 DrawSolid(scopedView.GetLocation(), 500, scopedView.GetSize(), Colorf(0.0f, 0.0f, 0.0f, std::min(AnimTime * 8.0f, 0.7f)));
160 }
161
162 Vector4f ambientColor = viewport->_ambientLight;
163 if (ambientColor.W < 1.0f) {

Callers 1

InGameMenu.cppFile · 0.45

Calls 12

DEATH_LIKELYFunction · 0.50
ColorfClass · 0.50
GetViewSizeMethod · 0.45
sizeMethod · 0.45
GetBoundsMethod · 0.45
GetTargetMethod · 0.45
GetLocationMethod · 0.45
GetSizeMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
OnDrawClippedMethod · 0.45
OnDrawOverlayMethod · 0.45

Tested by

no test coverage detected