MCPcopy Create free account
hub / github.com/diasurgical/devilution / Dequeue

Method Dequeue

SourceX/storm/storm.cpp:478–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476 }
477
478 void Dequeue(Uint8 *out, int out_len)
479 {
480 SDL_memset(out, 0, sizeof(out[0]) * out_len);
481 AudioQueueItem *item;
482 while ((item = Next()) != NULL) {
483 if (static_cast<unsigned long>(out_len) <= item->len) {
484 SDL_MixAudio(out, item->pos, out_len, SDL_MIX_MAXVOLUME);
485 item->pos += out_len;
486 item->len -= out_len;
487 return;
488 }
489
490 SDL_MixAudio(out, item->pos, item->len, SDL_MIX_MAXVOLUME);
491 out += item->len;
492 out_len -= item->len;
493 Pop();
494 }
495 }
496
497 AudioQueueItem *Next()
498 {

Callers 1

CallbackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected