MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / RenderTitleImage

Method RenderTitleImage

TombEngine/Renderer/RendererDrawMenu.cpp:1152–1186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1150 }
1151
1152 void Renderer::RenderTitleImage()
1153 {
1154 auto texture = Texture2D{};
1155 SetTextureOrDefault(texture, TEN::Utils::ToWString(g_GameFlow->GetGameDir() + g_GameFlow->IntroImagePath.c_str()));
1156
1157 if (!texture.Texture)
1158 return;
1159
1160 int timeout = 20;
1161 float currentFade = FADE_FACTOR;
1162
1163 while (timeout || currentFade > 0.0f)
1164 {
1165 if (timeout)
1166 {
1167 if (currentFade < 1.0f)
1168 {
1169 currentFade = std::clamp(currentFade += FADE_FACTOR, 0.0f, 1.0f);
1170 }
1171 else
1172 {
1173 timeout--;
1174 }
1175 }
1176 else
1177 {
1178 currentFade = std::clamp(currentFade -= FADE_FACTOR, 0.0f, 1.0f);
1179 }
1180
1181 DrawFullScreenImage(texture.ShaderResourceView.Get(), Smoothstep(currentFade), _backBuffer.RenderTargetView.Get(), _backBuffer.DepthStencilView.Get());
1182 Synchronize();
1183 _swapChain->Present(1, 0);
1184 _context->ClearDepthStencilView(_backBuffer.DepthStencilView.Get(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);
1185 }
1186 }
1187
1188 void Renderer::DrawDisplayItems()
1189 {

Callers 1

GameMainFunction · 0.80

Calls 5

ToWStringFunction · 0.85
SmoothstepFunction · 0.85
GetGameDirMethod · 0.80
c_strMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected