/[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.7 by skunix, Sun Dec 26 08:03:34 2004 UTC revision 1.8 by skunix, Sun Dec 26 08:58:16 2004 UTC
# Line 12  Line 12 
12  //  //
13  // $Id$  // $Id$
14  // $Log$  // $Log$
15    // Revision 1.8  2004/12/26 08:58:16  skunix
16    // removed all std::cout
17    //
18  // Revision 1.7  2004/12/26 08:03:34  skunix  // Revision 1.7  2004/12/26 08:03:34  skunix
19  // changed lambda::bind's to boost::binds  // changed lambda::bind's to boost::binds
20  //  //
# Line 28  Line 31 
31  #include "log.hpp"  #include "log.hpp"
32  #include "texture.hpp"  #include "texture.hpp"
33  #include <stdexcept>  #include <stdexcept>
 #include <iostream>  
34  #include <boost/format.hpp>  #include <boost/format.hpp>
35  #include <boost/filesystem/operations.hpp>  #include <boost/filesystem/operations.hpp>
36  #include <memory>  #include <memory>
# Line 88  void Line 90  void
90  Usata::setup_video()  Usata::setup_video()
91  {  {
92          ConfigSection conf("video");          ConfigSection conf("video");
93            log::Stream2 logstream(log::Level::INFO);
94    
95          std::string mode_string = conf.get("mode", std::string(DEFAULT_VIDEO_MODE));          std::string mode_string = conf.get("mode", std::string(DEFAULT_VIDEO_MODE));
96          parsed_video_mode mode(parse_video_mode(mode_string));            parsed_video_mode mode(parse_video_mode(mode_string));  
97    
98          if (!mode.get<0>())          if (!mode.get<0>())
99                  throw std::runtime_error("yay!");                  throw std::runtime_error("yay!");
100            
101            logstream << boost::format("requested video mode %1%x%2%") % mode.get<1>()
102                                    % mode.get<2>() << log::Commit;
103    
         std::cout << boost::format("Height: %1%\nWidth: %2%") % mode.get<1>()  
                                 % mode.get<2>() <<std::endl;  
104          system::VideoMode vm(mode.get<1>(), mode.get<2>(), false);          system::VideoMode vm(mode.get<1>(), mode.get<2>(), false);
105          vm = scan_modes(vm);          
106          std::cout << "going with " << vm.width << "x" << vm.height <<std::endl;          system::VideoMode vm2 = scan_modes(vm);
107          set_mode(vm);          if (vm2 == vm)
108                    logstream << "mode checks out." << log::Commit;
109            else
110            {
111                    logstream << "scan_modes() suggests " << vm2.width << "x" << vm2.height << log::Commit;
112            }      
113            set_mode(vm2);
114                    
115  }  }
116  int  int
# Line 107  Usata::run() Line 118  Usata::run()
118  {  {
119          setup_video();          setup_video();
120          boost::filesystem::path datapath = find_data();          boost::filesystem::path datapath = find_data();
         std::cout << datapath.string() <<std::endl;  
121          // FIXME: catch exceptions          // FIXME: catch exceptions
122          texture_manager->load_path(datapath);          texture_manager->load_path(datapath);
123    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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