Permalink
Browse files

Render initial game view during loading screen, to begin loading asse…

…ts and eliminate ugly terrain blending artifacts. Refs #1663

git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@13181 3db68df2-c116-0410-a063-a993310a9797
  • Loading branch information...
1 parent f51a89a commit 1458670daaa55da5595069ebbc31996743b8035e ben committed Feb 22, 2013
Showing with 20 additions and 15 deletions.
  1. +13 −8 source/ps/Game.cpp
  2. +0 −6 source/ps/GameSetup/GameSetup.cpp
  3. +7 −1 source/renderer/Renderer.cpp
View
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 Wildfire Games.
+/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -199,6 +199,18 @@ PSRETURN CGame::ReallyStartGame()
m_Simulation2->InitGame(settings);
}
+ // We need to do an initial Interpolate call to set up all the models etc,
+ // because Update might never interpolate (e.g. if the game starts paused)
+ // and we could end up rendering before having set up any models (so they'd
+ // all be invisible)
+ Interpolate(0, 0);
+
+ m_GameStarted=true;
+
+ // Render a frame to begin loading assets
+ if (CRenderer::IsInitialised())
+ Render();
+
// Call the reallyStartGame GUI function, but only if it exists
if (g_GUI && g_GUI->HasPages())
{
@@ -212,14 +224,7 @@ PSRETURN CGame::ReallyStartGame()
if (g_NetClient)
g_NetClient->LoadFinished();
- // We need to do an initial Interpolate call to set up all the models etc,
- // because Update might never interpolate (e.g. if the game starts paused)
- // and we could end up rendering before having set up any models (so they'd
- // all be invisible)
- Interpolate(0, 0);
-
debug_printf(L"GAME STARTED, ALL INIT COMPLETE\n");
- m_GameStarted=true;
// The call tree we've built for pregame probably isn't useful in-game.
if (CProfileManager::IsInitialised())
@@ -201,12 +201,6 @@ void Render()
ogl_WarnIfError();
- CStr skystring = "255 0 255";
- CFG_GET_VAL("skycolor", String, skystring);
- CColor skycol;
- GUI<CColor>::ParseString(skystring.FromUTF8(), skycol);
- g_Renderer.SetClearColor(skycol.AsSColor4ub());
-
// prepare before starting the renderer frame
if (g_Game && g_Game->IsGameStarted())
g_Game->GetView()->BeginFrame();
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 Wildfire Games.
+/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -451,6 +451,12 @@ CRenderer::CRenderer()
CFG_GET_VAL("smoothlos", Bool, m_Options.m_SmoothLOS);
CFG_GET_VAL("postproc", Bool, m_Options.m_Postproc);
+ CStr skystring = "0 0 0";
+ CColor skycolor;
+ CFG_GET_VAL("skycolor", String, skystring);
+ if (skycolor.ParseString(skystring, 255.f))
+ SetClearColor(skycolor.AsSColor4ub());
+
#if CONFIG2_GLES
// Override config option since GLES only supports GLSL
m_Options.m_PreferGLSL = true;

0 comments on commit 1458670

Please sign in to comment.