@@ -68,8 +68,8 @@ void ALEInterface::disableBufferedIO() {
6868 std::cout.sync_with_stdio ();
6969}
7070
71- void ALEInterface::createOSystem (std::unique_ptr <OSystem> & theOSystem,
72- std::unique_ptr <Settings> & theSettings) {
71+ void ALEInterface::createOSystem (scoped_ptr <OSystem>& theOSystem,
72+ scoped_ptr <Settings>& theSettings) {
7373#if (defined(_WIN32) || defined(__MINGW32__))
7474 theOSystem.reset (new OSystemWin32 ());
7575 theSettings.reset (new SettingsWin32 (theOSystem.get ()));
@@ -81,8 +81,8 @@ void ALEInterface::createOSystem(std::unique_ptr<OSystem> &theOSystem,
8181 theOSystem->settings ().loadConfig ();
8282}
8383
84- void ALEInterface::checkForUnsupportedRom (std::unique_ptr< OSystem> & theOSystem) {
85- const Properties properties = theOSystem-> console ().properties ();
84+ void ALEInterface::checkForUnsupportedRom (OSystem& theOSystem) {
85+ const Properties properties = theOSystem. console ().properties ();
8686 const std::string md5 = properties.get (Cartridge_MD5);
8787 bool found = false ;
8888 std::ifstream ss (" md5.txt" );
@@ -105,27 +105,27 @@ void ALEInterface::checkForUnsupportedRom(std::unique_ptr<OSystem>& theOSystem)
105105}
106106
107107void ALEInterface::loadSettings (const std::string& rom, const std::string& name,
108- std::unique_ptr< OSystem> & theOSystem) {
108+ OSystem& theOSystem) {
109109 // Load the configuration from a config file (passed on the command
110110 // line), if provided
111- std::string configFile = theOSystem-> settings ().getString (" config" , false );
111+ std::string configFile = theOSystem. settings ().getString (" config" , false );
112112
113113 if (!configFile.empty ()) {
114- theOSystem-> settings ().loadConfig (configFile.c_str ());
114+ theOSystem. settings ().loadConfig (configFile.c_str ());
115115 }
116116
117- theOSystem-> settings ().validate ();
118- theOSystem-> create ();
117+ theOSystem. settings ().validate ();
118+ theOSystem. create ();
119119
120120 // Attempt to load the ROM
121121 if (rom.empty ()) {
122122 Logger::Error << " Empty ROM File specified"
123123 << std::endl;
124124 exit (1 );
125- } else if (theOSystem-> createConsole (rom, name)) {
125+ } else if (theOSystem. createConsole (rom, name)) {
126126 checkForUnsupportedRom (theOSystem);
127127 Logger::Info << " Running ROM " << name << " ..." << std::endl;
128- theOSystem-> settings ().setString (" rom_name" , name);
128+ theOSystem. settings ().setString (" rom_name" , name);
129129 } else {
130130 Logger::Error << " Unable to create console for " << name << std::endl;
131131 exit (1 );
@@ -134,11 +134,11 @@ void ALEInterface::loadSettings(const std::string& rom, const std::string& name,
134134// Must force the resetting of the OSystem's random seed, which is set before we change
135135// choose our random seed.
136136 Logger::Info << " Random seed is "
137- << theOSystem-> settings ().getInt (" random_seed" ) << std::endl;
138- theOSystem-> resetRNGSeed ();
137+ << theOSystem. settings ().getInt (" random_seed" ) << std::endl;
138+ theOSystem. resetRNGSeed ();
139139
140- std::string currentDisplayFormat = theOSystem-> console ().getFormat ();
141- theOSystem-> colourPalette ().setPalette (" standard" , currentDisplayFormat);
140+ std::string currentDisplayFormat = theOSystem. console ().getFormat ();
141+ theOSystem. colourPalette ().setPalette (" standard" , currentDisplayFormat);
142142}
143143
144144ALEInterface::ALEInterface () {
@@ -163,7 +163,7 @@ ALEInterface::~ALEInterface() {
163163// load.
164164bool ALEInterface::loadROM (std::string rom_file, std::string name) {
165165 assert (theOSystem.get ());
166- loadSettings (rom_file, name, theOSystem);
166+ loadSettings (rom_file, name, * theOSystem);
167167 romSettings.reset (buildRomRLWrapper (name));
168168 if (romSettings.get () == NULL ) return false ;
169169 environment.reset (new StellaEnvironment (theOSystem.get (), romSettings.get ()));
0 commit comments