| 190 | } |
| 191 | |
| 192 | void Renderer::DrawAllStrings() |
| 193 | { |
| 194 | if (_stringsToDraw.empty()) |
| 195 | return; |
| 196 | |
| 197 | SetBlendMode(BlendMode::AlphaBlend); |
| 198 | |
| 199 | float shadowOffset = 1.5f / (REFERENCE_FONT_SIZE / _gameFont->GetLineSpacing()); |
| 200 | auto shadowColor = (Vector4)g_GameFlow->GetSettings()->UI.ShadowTextColor; |
| 201 | |
| 202 | _spriteBatch->Begin(); |
| 203 | |
| 204 | for (const auto& rString : _stringsToDraw) |
| 205 | { |
| 206 | auto drawPos = Vector2::Lerp(rString.PrevPosition, rString.Position, GetInterpolationFactor()); |
| 207 | |
| 208 | // Draw shadow. |
| 209 | if (rString.Flags & (int)PrintStringFlags::Outline) |
| 210 | { |
| 211 | _gameFont->DrawString( |
| 212 | _spriteBatch.get(), rString.String.c_str(), |
| 213 | Vector2(drawPos.x + shadowOffset * rString.Scale, drawPos.y + shadowOffset * rString.Scale), |
| 214 | (shadowColor * rString.Color.w * shadowColor.w) * ScreenFadeCurrent, |
| 215 | 0.0f, Vector4::Zero, rString.Scale); |
| 216 | } |
| 217 | |
| 218 | // Draw string. |
| 219 | _gameFont->DrawString( |
| 220 | _spriteBatch.get(), rString.String.c_str(), |
| 221 | Vector2(drawPos.x, drawPos.y), |
| 222 | (rString.Color * rString.Color.w) * ScreenFadeCurrent, |
| 223 | 0.0f, Vector4::Zero, rString.Scale); |
| 224 | } |
| 225 | |
| 226 | _spriteBatch->End(); |
| 227 | } |
| 228 | } |