MCPcopy Create free account
hub / github.com/ZDoom/Raze / Draw

Method Draw

source/common/menu/menu.cpp:222–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222bool MenuTransition::Draw()
223{
224 double now = I_GetTimeNS() * (120. / 1'000'000'000);
225 if (now < start + length)
226 {
227 double factor = screen->GetWidth()/2;
228 double phase = (now - start) / double(length) * M_PI + M_PI / 2;
229 DVector2 origin;
230
231 origin.Y = 0;
232 origin.X = factor * dir * (sin(phase) - 1.);
233 twod->SetOffset(origin);
234 previous->CallDrawer();
235 origin.X = factor * dir * (sin(phase) + 1.);
236 twod->SetOffset(origin);
237 current->CallDrawer();
238 origin = { 0,0 };
239 twod->SetOffset(origin);
240 return true;
241 }
242 if (destroyprev && previous) previous->Destroy();
243 previous = nullptr;
244 current = nullptr;
245 return false;
246}
247
248
249//============================================================================

Callers 1

M_DrawerFunction · 0.45

Calls 5

I_GetTimeNSFunction · 0.85
CallDrawerMethod · 0.80
GetWidthMethod · 0.45
SetOffsetMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected