Sky colour, plus skycolor config value

This was SVN commit r1583.
This commit is contained in:
Ykkrosh
2004-12-28 11:16:05 +00:00
parent 7c390625c9
commit f4fe8c8543
4 changed files with 25 additions and 9 deletions
+3
View File
@@ -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)
+3 -3
View File
@@ -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
+10 -6
View File
@@ -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<CColor>::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
+9
View File
@@ -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;
};