| 114 | } |
| 115 | |
| 116 | void 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); |
no test coverage detected