mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 07:56:37 +00:00 
			
		
		
		
	Fix the frame update not getting called on the first frame
This commit is contained in:
		
							parent
							
								
									e2620a1edf
								
							
						
					
					
						commit
						ac4fa1941d
					
				
					 3 changed files with 13 additions and 1 deletions
				
			
		|  | @ -428,6 +428,10 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings) | ||||||
|         MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, pos); |         MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, pos); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     Ogre::FrameEvent event; | ||||||
|  |     event.timeSinceLastEvent = 0; | ||||||
|  |     event.timeSinceLastFrame = 0; | ||||||
|  |     frameRenderingQueued(event); | ||||||
|     mOgre->getRoot()->addFrameListener (this); |     mOgre->getRoot()->addFrameListener (this); | ||||||
| 
 | 
 | ||||||
|     // scripts
 |     // scripts
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,8 @@ OcclusionQuery::OcclusionQuery(OEngine::Render::OgreRenderer* renderer, SceneNod | ||||||
|     mSunTotalAreaQuery(0), mSunVisibleAreaQuery(0), mActiveQuery(0), |     mSunTotalAreaQuery(0), mSunVisibleAreaQuery(0), mActiveQuery(0), | ||||||
|     mDoQuery(0), mSunVisibility(0), |     mDoQuery(0), mSunVisibility(0), | ||||||
|     mWasVisible(false), |     mWasVisible(false), | ||||||
|     mActive(false) |     mActive(false), | ||||||
|  |     mFirstFrame(true) | ||||||
| { | { | ||||||
|     mRendering = renderer; |     mRendering = renderer; | ||||||
|     mSunNode = sunNode; |     mSunNode = sunNode; | ||||||
|  | @ -147,6 +148,12 @@ void OcclusionQuery::renderQueueEnded(uint8 queueGroupId, const String& invocati | ||||||
| 
 | 
 | ||||||
| void OcclusionQuery::update(float duration) | void OcclusionQuery::update(float duration) | ||||||
| { | { | ||||||
|  |     if (mFirstFrame) | ||||||
|  |     { | ||||||
|  |         // GLHardwareOcclusionQuery::isStillOutstanding doesn't seem to like getting called when nothing has been rendered yet
 | ||||||
|  |         mFirstFrame = false; | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|     if (!mSupported) return; |     if (!mSupported) return; | ||||||
| 
 | 
 | ||||||
|     mWasVisible = false; |     mWasVisible = false; | ||||||
|  |  | ||||||
|  | @ -59,6 +59,7 @@ namespace MWRender | ||||||
|         bool mWasVisible; |         bool mWasVisible; | ||||||
| 
 | 
 | ||||||
|         bool mActive; |         bool mActive; | ||||||
|  |         bool mFirstFrame; | ||||||
| 
 | 
 | ||||||
|         bool mSupported; |         bool mSupported; | ||||||
|         bool mDoQuery; |         bool mDoQuery; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue