MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Draw

Method Draw

engine/Poseidon/Core/ProgressSystem.cpp:116–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void ProgressSystem::Draw()
117{
118 // Skip rendering for dedicated server (dummy engine doesn't support drawing)
119 if (IsDedicatedServer())
120 {
121 return;
122 }
123
124 if (!GEngine->IsAbleToDraw())
125 {
126 return;
127 }
128
129 static DWORD lastTime;
130 DWORD time = Poseidon::Foundation::GlobalTickCount();
131 int deltaMs = time - lastTime;
132 lastTime = time;
133
134 if (deltaMs > 300)
135 {
136 deltaMs = 300;
137 }
138 float deltaT = deltaMs * 0.001f;
139
140 if (ProgressScript)
141 {
142 /*
143 if (_progressTot>0)
144 {
145 float factor=_progressCur/_progressTot;
146 GlobalShowMessage(100,"factor %.3f",factor);
147 }
148 */
149
150 if (ProgressScript->Simulate(deltaT))
151 {
152 ProgressScript.Free();
153 }
154
155 // draw title and cut effects (if any)
156 TitleEffect* tit = GWorld ? GWorld->GetTitleEffect() : nullptr;
157 if (tit)
158 {
159 tit->Simulate(deltaT);
160 tit->Draw();
161 if (tit->IsTerminated())
162 {
163 GWorld->SetTitleEffect(nullptr);
164 }
165 }
166 TitleEffect* cut = GWorld->GetCutEffect();
167 if (cut)
168 {
169 cut->Simulate(deltaT);
170 cut->Draw();
171 if (cut->IsTerminated())
172 {
173 GWorld->SetCutEffect(nullptr);

Callers 1

ProgressDrawFunction · 0.45

Calls 15

IsDedicatedServerFunction · 0.85
GlobalTickCountFunction · 0.85
fastFmodFunction · 0.85
ColorClass · 0.85
GetTitleEffectMethod · 0.80
SetTitleEffectMethod · 0.80
GetCutEffectMethod · 0.80
SetCutEffectMethod · 0.80
NextAliveExpectedMethod · 0.80
Point2DFloatClass · 0.50
PackedColorClass · 0.50
IsAbleToDrawMethod · 0.45

Tested by

no test coverage detected