diff --git a/binaries/data/config/system.cfg b/binaries/data/config/system.cfg index 250d16f164..f8aa282377 100755 --- a/binaries/data/config/system.cfg +++ b/binaries/data/config/system.cfg @@ -66,6 +66,9 @@ font.console = console font.default = palatino12 font.misc = verdana16 +; Colour of the sky (in "r g b" format). (Will be removed once there's proper sky support). +;skycolor = "255 0 0" + ; GENERAL PREFERENCES: ; selection.outline.quality = 9; ( higher => very slightly slower, better quality) diff --git a/build/workspaces/update-workspaces.bat b/build/workspaces/update-workspaces.bat index c9dc383f96..fb36de0718 100755 --- a/build/workspaces/update-workspaces.bat +++ b/build/workspaces/update-workspaces.bat @@ -3,7 +3,7 @@ REM Create Visual Studio Workspaces on Windows mkdir vc6 mkdir vc7 -mkdir vc2003b +mkdir vc2003 REM Change to the lua project name, this must correspond to the base file name REM of the created project files @@ -27,7 +27,7 @@ move *.sln ..\..\workspaces\vc7 move *.vcproj ..\..\workspaces\vc7 ..\premake --target vs2003 -move *.sln ..\..\workspaces\vc2003b -move *.vcproj ..\..\workspaces\vc2003b +move *.sln ..\..\workspaces\vc2003 +move *.vcproj ..\..\workspaces\vc2003 cd ..\..\workspaces diff --git a/source/main.cpp b/source/main.cpp index 1fa912ec90..3c22a664bc 100755 --- a/source/main.cpp +++ b/source/main.cpp @@ -439,12 +439,17 @@ static void Render() oglCheck(); + CStr skystring = "61 193 255"; + CConfigValue* val; + if ((val=g_ConfigDB.GetValue(CFG_USER, "skycolor"))) + val->GetString(skystring); + CColor skycol; + GUI::ParseString(skystring, skycol); + g_Renderer.SetClearColor(skycol.Int()); + // start new frame g_Renderer.BeginFrame(); - // switch on wireframe for terrain if we want it - //g_Renderer.SetTerrainRenderMode( SOLID ); // (PT: If this is done here, the W key doesn't work) - oglCheck(); if (g_Game) @@ -967,7 +972,7 @@ static void Init(int argc, char* argv[]) MICROLOG(L"In init"); // If you ever want to catch a particular allocation: - //_CrtSetBreakAlloc(32894); + //_CrtSetBreakAlloc(14246); #ifdef _MSC_VER u64 TSC=rdtsc(); @@ -1238,9 +1243,8 @@ static void Frame() { MICROLOG(L"render"); Render(); - MICROLOG(L"swap buffers"); - SDL_GL_SwapBuffers(); MICROLOG(L"finished render"); + SDL_GL_SwapBuffers(); } // inactive; relinquish CPU for a little while // don't use SDL_WaitEvent: don't want the main loop to freeze until app focus is restored diff --git a/source/ps/Overlay.h b/source/ps/Overlay.h index b96bae057b..243d60e3de 100755 --- a/source/ps/Overlay.h +++ b/source/ps/Overlay.h @@ -35,6 +35,15 @@ struct CColor // For passing to glColor[34]fv: const float* FloatArray() const { return &r; } + // For passing to CRenderer: + const u32 Int() const + { + return (((int)(a*255.0) & 0xff) << 24) + + (((int)(b*255.0) & 0xff) << 16) + + (((int)(g*255.0) & 0xff) << 8) + + (((int)(r*255.0) & 0xff)); + } + float r, g, b, a; };