Transition::Transition(Myst3Engine *vm, TransitionType type) : _vm(vm), _type(type), _sourceScreenshot(nullptr) { // Capture a screenshot of the source node if (type != kTransitionNone && computeDuration() != 0) { _sourceScreenshot = _vm->_gfx->getScreenshot(); } }
static inline void addBatchTransToData(CatTransData *pData, int count, int error, unsigned long long sum) { ATOMICLONG_ADD(&pData->m_count, (long) count); ATOMICLONG_ADD(&pData->m_error, (long) error); ATOMICLONG_ADD(&pData->m_durationMsSum, (long) sum); if (count == 1) { long duration = computeDuration((long) (sum)); char tmpBuf[32]; sds key = catsdsnewEmpty(128); key = catsdscat(key, catItoA(duration, tmpBuf, 10)); ATOMICLONG *count = (ATOMICLONG *) findCCHashMapCreateByFun(pData->m_durations, key, createDurationFun, NULL); ATOMICLONG_INC(count); catsdsfree(key); } }
static inline void addTransToData(CatTransData *pData, CatTransaction *pTrans) { ATOMICLONG_INC(&pData->m_count); if (!checkCatMessageSuccess((CatMessage *) pTrans)) { ATOMICLONG_INC(&pData->m_error); } long rawDuration = (long) (getCatTransactionDurationUs(pTrans) / 1000); ATOMICLONG_ADD(&pData->m_durationMsSum, rawDuration); long duration = computeDuration(rawDuration); char tmpBuf[32]; sds key = catsdsnewEmpty(128); key = catsdscat(key, catItoA(duration, tmpBuf, 10)); ATOMICLONG *count = (ATOMICLONG *) findCCHashMapCreateByFun(pData->m_durations, key, createDurationFun, NULL); ATOMICLONG_INC(count); catsdsfree(key); }