Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 1458670daaa55da5595069ebbc31996743b8035e 1 parent f51a89a
ben authored
View
21 source/ps/Game.cpp
@@ -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())
View
6 source/ps/GameSetup/GameSetup.cpp
@@ -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();
View
8 source/renderer/Renderer.cpp
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.