33 This source file is part of OGRE
44 (Object-oriented Graphics Rendering Engine)
55 For the latest info, see http://www.ogre3d.org/
6-
6+
77 Copyright (c) 2000-2014 Torus Knot Software Ltd
8-
8+
99 Permission is hereby granted, free of charge, to any person obtaining a copy
1010 of this software and associated documentation files (the "Software"), to deal
1111 in the Software without restriction, including without limitation the rights
1212 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1313 copies of the Software, and to permit persons to whom the Software is
1414 furnished to do so, subject to the following conditions:
15-
15+
1616 The above copyright notice and this permission notice shall be included in
1717 all copies or substantial portions of the Software.
18-
18+
1919 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2121 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -80,24 +80,21 @@ namespace OgreBites
8080 if (s)
8181 {
8282 // retrieve sample's required plugins and currently installed plugins
83- Ogre::Root::PluginInstanceList ip = mRoot ->getInstalledPlugins ();
84- Ogre::StringVector rp = s->getRequiredPlugins ();
85-
86- for (Ogre::StringVector::iterator j = rp.begin (); j != rp.end (); j++)
83+ for (const auto & p : s->getRequiredPlugins ())
8784 {
8885 bool found = false ;
8986 // try to find the required plugin in the current installed plugins
90- for (Ogre::Root::PluginInstanceList::iterator k = ip. begin (); k != ip. end (); k++ )
87+ for (const auto *i : mRoot -> getInstalledPlugins () )
9188 {
92- if ((*k) ->getName () == *j )
89+ if (i ->getName () == p )
9390 {
9491 found = true ;
9592 break ;
9693 }
9794 }
9895 if (!found) // throw an exception if a plugin is not found
9996 {
100- OGRE_EXCEPT (Ogre::Exception::ERR_NOT_IMPLEMENTED, " Sample requires plugin: " + *j );
97+ OGRE_EXCEPT (Ogre::Exception::ERR_NOT_IMPLEMENTED, " Sample requires plugin: " + p );
10198 }
10299 }
103100
@@ -139,7 +136,7 @@ namespace OgreBites
139136#endif
140137
141138 loadStartUpSample ();
142-
139+
143140 if (mRoot ->getRenderSystem () != NULL )
144141 {
145142 mRoot ->startRendering (); // start the render loop
@@ -176,7 +173,7 @@ namespace OgreBites
176173 mCurrentSample ->unpaused ();
177174 }
178175 }
179-
176+
180177 /* -----------------------------------------------------------------------------
181178 | Processes frame started events.
182179 -----------------------------------------------------------------------------*/
@@ -187,7 +184,7 @@ namespace OgreBites
187184 // manually call sample callback to ensure correct order
188185 return !isCurrentSamplePaused () ? mCurrentSample ->frameStarted (evt) : true ;
189186 }
190-
187+
191188 /* -----------------------------------------------------------------------------
192189 | Processes rendering queued events.
193190 -----------------------------------------------------------------------------*/
@@ -196,7 +193,7 @@ namespace OgreBites
196193 // manually call sample callback to ensure correct order
197194 return !isCurrentSamplePaused () ? mCurrentSample ->frameRenderingQueued (evt) : true ;
198195 }
199-
196+
200197 /* -----------------------------------------------------------------------------
201198 | Processes frame ended events.
202199 -----------------------------------------------------------------------------*/
@@ -262,7 +259,7 @@ namespace OgreBites
262259
263260 ApplicationContext::shutdown ();
264261 }
265-
262+
266263 Sample* mCurrentSample ; // The active sample (0 if none is active)
267264 bool mSamplePaused ; // whether current sample is paused
268265 bool mLastRun ; // whether or not this is the final run
0 commit comments