void ClientMap::update (uint32_t deltaTime) { if (isPause()) return; if (_screenRumble) { _screenRumbleOffsetX = _screenRumbleOffsetY = 0; _screenRumbleOffsetX = rand() % std::max(2, static_cast<int>(_screenRumbleStrength * 10.0f)); _screenRumbleOffsetY = rand() % std::max(2, static_cast<int>(_screenRumbleStrength * 10.0f)); } _timeManager.update(deltaTime); _particleSystem.update(deltaTime); _time += deltaTime; if (_player) { _camera.update(_player->getPos(), _player->getMoveDirection(), _zoom); SoundControl.setListenerPosition(_player->getPos()); } const ExecutionTime updateTime("ClientMap", 2000L); const bool lerp = wantLerp(); for (ClientEntityMapIter i = _entities.begin(); i != _entities.end();) { const bool val = i->second->update(deltaTime, lerp); if (!val) { _entities.erase(i++); } else { ++i; } } }
void scanMusic(voice_index voice_, short *left_over) { struct LOC_scanMusic V; Char buf[256], enote[256], xnote[256]; boolean has_next = false, done = false; Char dur1, lastdur; music_word nscan; Char STR1[256]; V.voice = voice_; strcpy(terminators, "d.x"); resetInfo(V.voice, buf); *left_over = 0; V.store_macro = false; V.bar = full_bar; V.bar_length = 0; V.ngrace = 0; V.nmulti = 0; if (meternum == 0) V.bar = 32000; dur1 = duration(V.voice); lastdur = dur1; do { getNextMusWord(buf, V.note, &nscan); if (*V.note == '\0') break; V.count = 0; /* if isNoteOrRest(note) and not (isPause(note) or isMultibarRest(note)) then note:=toStandard(note); */ V.doublex = (pos1('D', V.note) > 0); if (nscan == mword) { if (*V.note == '\0') error3(V.voice, "You may not end a line with a meter change"); if (V.bar_length > 0) error3(V.voice, "Meter change only allowed at start of bar"); else V.bar = barLength(V.note); } else if (nscan == rword) { if (!(isPause(V.note) || isMultiBarRest(V.note))) { processNote(V.note, xnote, dur1, &lastdur, &V.count); checkSticky(V.note, rest_attrib[V.voice-1]); } } if (*V.note != '\0') appendNote(V.voice, nscan); strcpy(enote, V.note); if (nscan == macro || nscan == endmacro) examineMacro(&V); if (nscan == abcdefg) { if (!multi_bar_rest && V.ngrace + V.nmulti == 0) { processNote(enote, xnote, dur1, &lastdur, &V.count); if (*xnote != '\0') { checkSticky(enote, note_attrib[V.voice-1]); appendToLine(V.voice, enote); appendNote(V.voice, nscan); strcpy(enote, xnote); } checkSticky(enote, note_attrib[V.voice-1]); } } appendToLine(V.voice, enote); if (*V.note == '\0') /* !!! else word_bound[here]:=length(line); */ done = true; sprintf(STR1, "%c", barsym); if (!strcmp(V.note, STR1)) { if (meternum == 0) error3(V.voice, "You may not use bar lines in barless music"); else if (V.bar_length == 0) markBar(V.voice); else if (numberOfBars(V.voice) == 0 && V.bar_length < V.bar) { if (has_next) has_next = false; /*Should check whether pickups are equal*/ else if (*left_over > 0) error3(V.voice, "Bar is too short"); *left_over = V.bar_length; V.bar_length = 0; } } if (nscan == nextvoice) { if (V.bar_length > 0) error3(V.voice, "Next voice before bar is full"); else barForward(V.voice, -1); has_next = true; } else if (isPause(V.note)) V.bar_length += V.bar; else if (!multi_bar_rest) { /*do nothing*/ if (!done && isNoteOrRest(V.note)) countIt(&V); else maybeGroup(&V); } dur1 = lastdur; if (V.bar_length >= V.bar && V.ngrace + V.nmulti == 0 && !V.store_macro) { if (debugMode()) printf("%d %d\n", V.voice, V.bar_length); barForward(V.voice, V.bar_length / V.bar); V.bar_length %= V.bar; /* p2c: mtx.pas, line 268: * Note: Using % for possibly-negative arguments [317] */ } } while (!done); setExtraLength(V.voice, V.bar_length); resetDuration(V.voice, dur1); regroup(V.voice); }
Static void processLine(voice_index voice_, short bar_no) { struct LOC_processLine V; paragraph_index par_line; Char STR1[256]; V.voice = voice_; *V.pretex = '\0'; V.no_chords = false; V.no_uptext = false; par_line = musicLineNo(V.voice); V.nmulti = 0; V.ngrace = 0; line_no = orig_line_no[par_line-1]; do { getMusicWord(V.note, V.voice); if (*V.note == '\0') return; /* if debugMode then writeln(voice,' ',note); */ switch (thisNote(V.voice)) { case rword: if (*multi_bar_rest != '\0') { if (uptextOnRests()) addUptext(V.voice, &V.no_uptext, V.pretex); } else { V.l = pos1(multi_group, V.note); if (V.l > 0) scan1(V.note, V.l + 1, &V.nmulti); if (V.nmulti > 0) { V.in_group = true; V.nmulti--; } if (uptextOnRests()) addUptext(V.voice, &V.no_uptext, V.pretex); if (!(isPause(V.note) || V.in_group)) /*0.63: allow rests in xtuples*/ resetDuration(V.voice, durationCode(V.note)); } break; case abcdefg: processUsual(&V); break; case barword: if (V.voice == nvoices) { if (endOfBar(V.voice, bar_no)) strcpy(repeat_sign, V.note); else writeRepeat(V.note); } sprintf(STR1, "%c", barsym); if (strcmp(V.note, STR1)) *V.note = '\0'; V.no_chords = false; break; case FirstOnly: if (V.voice != nvoices) *V.note = '\0'; else strcpy(V.note, processOther(STR1, V.note, &V)); break; default: strcpy(V.note, processOther(STR1, V.note, &V)); break; } output(V.note, &V); } while (!endOfBar(V.voice, bar_no)); if (!V.no_chords) skipChordBar(V.voice); }
bool FFVideo::isPlaying() const { return !isPause(); }