ECode CCursorLoader::DeliverResult( /* [in] */ IInterface* data) { if (ICursor::Probe(data) == NULL) return E_ILLEGAL_ARGUMENT_EXCEPTION; Boolean isReset = FALSE; if ((IsReset(&isReset), isReset)) { // An async query came in while the loader is stopped if (NULL != data) { FAIL_RETURN(((ICursor*)data)->Close()); } return NOERROR; } AutoPtr<ICursor> oldCursor = mCursor; mCursor = (ICursor*)data; Boolean isStarted = FALSE; if ((IsStarted(&isStarted), isStarted)) { FAIL_RETURN(Loader::DeliverResult((ICursor*)data)); } Boolean isClosed = FALSE; if (NULL != oldCursor && !_CObject_Compare(oldCursor, data) && !(oldCursor->IsClosed(&isClosed), isClosed)) { FAIL_RETURN(oldCursor->Close()); } return NOERROR; }
void Engine::Run(void) { uint32 ms; uint32 diff; float diff_scaled; while(!s_quit) { if(IsReset()) _Reset(); ms = GetTicks(); diff = ms - s_lastFrameTimeReal; if(diff > 127) // 127 ms max. allowed diff time diff = 127; diff_scaled = diff * s_speed; s_fracTime = diff_scaled / 1000.0f; s_accuTime += diff_scaled; s_diffTime = uint32(s_accuTime); s_accuTime -= s_diffTime; // s_accuTime stores the remaining sub-milliseconds s_diffTimeReal = diff; // limiting this to 127 max is intentional (its not the real REAL diff then, but oh well) _ProcessEvents(); if(!_paused) { s_curFrameTime += s_diffTime; _Process(); if(_screen) _Render(); } _CalcFPS(); s_lastFrameTimeReal = ms; } }
void AABB::Augment(AABB const& bb) { if (!IsReset() && !bb.IsReset()) { Add( min + bb.min ); Add( max + bb.max ); } }
void AABB::Expand(Vector3F const& v) { if (!IsReset()) { min -= v; max += v; } }