FreeOrion

Forums for the FreeOrion project
It is currently Thu May 23, 2013 1:31 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Patch for starfields
PostPosted: Sun Dec 14, 2008 3:13 pm 
Offline
Space Dragon
User avatar

Joined: Thu Oct 02, 2008 11:00 pm
Posts: 339
Location: Slovakia
I created patch for optionable starfields from programming work. Because I haven't svn write access yet, I post patch here.
Code:
### Eclipse Workspace Patch 1.0
#P FreeOrion
Index: default/eng_stringtable.txt
===================================================================
--- default/eng_stringtable.txt   (revision 2702)
+++ default/eng_stringtable.txt   (working copy)
@@ -153,6 +153,9 @@
OPTIONS_DB_GALAXY_MAP_GAS
Render gassy substance around systems to give galaxy shape.  May slow rendering on older systems.

+OPTIONS_DB_GALAXY_MAP_STARFIELDS
+Render starsfields around systems. May slow rendering on older systems.
+
OPTIONS_DB_OPTIMIZED_SYSTEM_RENDERING
Use fancy optimized OpenGL 1.5 rendering for systems on galaxy map.  May crash on older graphics hardware.

@@ -872,6 +875,9 @@
OPTIONS_GALAXY_MAP_GAS
Galaxy map gas rendering

+OPTIONS_GALAXY_MAP_STARFIELDS
+Galaxy map starfields rendering
+
OPTIONS_OPTIMIZED_SYSTEM_RENDERING
Optimized system rendering

Index: UI/MapWnd.cpp
===================================================================
--- UI/MapWnd.cpp   (revision 2702)
+++ UI/MapWnd.cpp   (working copy)
@@ -80,6 +80,7 @@
         db.Add("UI.chat-hide-interval",             "OPTIONS_DB_UI_CHAT_HIDE_INTERVAL",         10,     RangedValidator<int>(0, 3600));
         db.Add("UI.chat-edit-history",              "OPTIONS_DB_UI_CHAT_EDIT_HISTORY",          50,     RangedValidator<int>(0, 1000));
         db.Add("UI.galaxy-gas-background",          "OPTIONS_DB_GALAXY_MAP_GAS",                true,   Validator<bool>());
+        db.Add("UI.galaxy-starfields",            "OPTIONS_DB_GALAXY_MAP_STARFIELDS",         true,   Validator<bool>());
         db.Add("UI.optimized-system-rendering",     "OPTIONS_DB_OPTIMIZED_SYSTEM_RENDERING",    true,   Validator<bool>());
         db.Add("UI.starlane-thickness",             "OPTIONS_DB_STARLANE_THICKNESS",            2.5,    RangedValidator<double>(0.1, 15.0));
         db.Add("UI.resource-starlane-colouring",    "OPTIONS_DB_RESOURCE_STARLANE_COLOURING",   true,   Validator<bool>());
@@ -1760,6 +1761,9 @@

void MapWnd::RenderStarfields()
{
+   if (!GetOptionsDB().Get<bool>("UI.galaxy-starfields"))
+         return;
+   
     glColor3d(1.0, 1.0, 1.0);

     GG::Pt origin_offset =
Index: UI/OptionsWnd.cpp
===================================================================
--- UI/OptionsWnd.cpp   (revision 2702)
+++ UI/OptionsWnd.cpp   (working copy)
@@ -731,6 +731,7 @@
     EndSection();
     BeginSection(UserString("OPTIONS_GALAXY_MAP"));
     BoolOption("UI.galaxy-gas-background",          UserString("OPTIONS_GALAXY_MAP_GAS"));
+    BoolOption("UI.galaxy-starfields",            UserString("OPTIONS_GALAXY_MAP_STARFIELDS"));
     BoolOption("UI.optimized-system-rendering",     UserString("OPTIONS_OPTIMIZED_SYSTEM_RENDERING"));
     DoubleOption("UI.starlane-thickness",           UserString("OPTIONS_STARLANE_THICKNESS"));
     BoolOption("UI.resource-starlane-colouring",    UserString("OPTIONS_RESOURCE_STARLANE_COLOURING"));



Top
 Profile  
 
 Post subject: Re: Patch for starfields
PostPosted: Sun Dec 14, 2008 5:36 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7891
Location: Vancouver, BC
Comitted. Send me your real name if you'd like it added it to your credit for programming.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group