/[usata]/usata2/src/usata.cpp
ViewVC logotype

Diff of /usata2/src/usata.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by skunix, Sun Dec 26 10:05:05 2004 UTC revision 1.11 by Descender, Sun Dec 26 18:36:42 2004 UTC
# Line 11  Line 11 
11  // http://www.fsf.org/licenses/gpl.html.  // http://www.fsf.org/licenses/gpl.html.
12  //  //
13  // $Id$  // $Id$
 // $Log$  
 // Revision 1.10  2004/12/26 10:05:05  skunix  
 // removed texture loading  
 //  
 // Revision 1.9  2004/12/26 09:35:23  skunix  
 // use logging functionality  
 //  
 // Revision 1.8  2004/12/26 08:58:16  skunix  
 // removed all std::cout  
 //  
 // Revision 1.7  2004/12/26 08:03:34  skunix  
 // changed lambda::bind's to boost::binds  
 //  
 // Revision 1.6  2004/12/22 23:35:19  Descender  
 //  
 // Fix license headers  
 //  
14    
15  #include "usata.hpp"  #include "usata.hpp"
16  #include "config.hpp"  #include "config.hpp"
# Line 96  void Line 79  void
79  Usata::setup_video()  Usata::setup_video()
80  {  {
81          ConfigSection conf("video");          ConfigSection conf("video");
82          log::Stream2 logstream(log::Level::INFO);          log::BufferedStream logstream(log::Level::INFO);
83    
84          std::string mode_string = conf.get("mode", std::string(DEFAULT_VIDEO_MODE));          std::string mode_string = conf.get("mode", std::string(DEFAULT_VIDEO_MODE));
85          parsed_video_mode mode(parse_video_mode(mode_string));            parsed_video_mode mode(parse_video_mode(mode_string));  
# Line 105  Usata::setup_video() Line 88  Usata::setup_video()
88                  throw std::runtime_error("yay!");                  throw std::runtime_error("yay!");
89                    
90          logstream << boost::format("requested video mode %1%x%2%") % mode.get<1>()          logstream << boost::format("requested video mode %1%x%2%") % mode.get<1>()
91                                  % mode.get<2>() << log::Commit;                                  % mode.get<2>() << log::commit;
92    
93          system::VideoMode vm(mode.get<1>(), mode.get<2>(), false);          system::VideoMode vm(mode.get<1>(), mode.get<2>(), false);
94                    
95          system::VideoMode vm2 = scan_modes(vm);          system::VideoMode vm2 = scan_modes(vm);
96          if (vm2 == vm)          if (vm2 == vm)
97                  logstream << "mode checks out." << log::Commit;                  logstream << "mode checks out." << log::commit;
98          else          else
99          {          {
100                  logstream << "scan_modes() suggests " << vm2.width << "x" << vm2.height << log::Commit;                  logstream << "scan_modes() suggests " << vm2.width << "x" << vm2.height << log::commit;
101          }                }      
102          set_mode(vm2);          set_mode(vm2);
103                    
104  }  }
105    
106  int  int
107  Usata::run()  Usata::run()
108  {  {
109          log::Stream2 logstream;          log::BufferedStream logstream;
110          boost::format vstring("(version %1%)");          boost::format vstring("(version %1%)");
111                    
112          logstream << "Usata initializing " << vstring%PROGRAM_VERSION << log::Commit;          logstream << "Usata initializing " << vstring%PROGRAM_VERSION << log::commit;
113          setup_video();          setup_video();
114          boost::filesystem::path datapath = find_data();          boost::filesystem::path datapath = find_data();
115          // FIXME: catch exceptions          // FIXME: catch exceptions
# Line 136  Usata::run() Line 120  Usata::run()
120          return 0;          return 0;
121  }  }
122    
123  }  } // namespace usata

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26