mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
Sky colour, plus skycolor config value
This was SVN commit r1583.
This commit is contained in:
@@ -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,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
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user