src/driver.cpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10991 d8811e327d12
equal deleted inserted replaced
10991:d8811e327d12 10994:cd9968b6f96b
    12 #include "video/video_driver.hpp"
    12 #include "video/video_driver.hpp"
    13 
    13 
    14 VideoDriver *_video_driver;
    14 VideoDriver *_video_driver;
    15 char _ini_videodriver[32];
    15 char _ini_videodriver[32];
    16 int _num_resolutions;
    16 int _num_resolutions;
    17 uint16 _resolutions[32][2];
    17 Dimension _resolutions[32];
    18 uint16 _cur_resolution[2];
    18 Dimension _cur_resolution;
    19 
    19 
    20 SoundDriver *_sound_driver;
    20 SoundDriver *_sound_driver;
    21 char _ini_sounddriver[32];
    21 char _ini_sounddriver[32];
    22 
    22 
    23 MusicDriver *_music_driver;
    23 MusicDriver *_music_driver;
   181 		p += snprintf(p, last - p, "\n");
   181 		p += snprintf(p, last - p, "\n");
   182 	}
   182 	}
   183 
   183 
   184 	return p;
   184 	return p;
   185 }
   185 }
       
   186 
       
   187 /** Frees memory used for this->name
       
   188  */
       
   189 DriverFactoryBase::~DriverFactoryBase() {
       
   190 	if (this->name == NULL) return;
       
   191 
       
   192 	/* Prefix the name with driver type to make it unique */
       
   193 	char buf[32];
       
   194 	strecpy(buf, GetDriverTypeName(type), lastof(buf));
       
   195 	strecpy(buf + 5, this->name, lastof(buf));
       
   196 
       
   197 	GetDrivers().erase(buf);
       
   198 	if (GetDrivers().empty()) delete &GetDrivers();
       
   199 	free(this->name);
       
   200 }