mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-05-07 11:13:58 +03:00
Added some fun cracking
This commit is contained in:
parent
5f1a34d9c9
commit
94bc6486eb
14 changed files with 181 additions and 221 deletions
|
@ -66,7 +66,7 @@ GameEngine::GameEngine() {
|
|||
}
|
||||
}
|
||||
|
||||
this->context = Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 32000, 1024, 2480 });
|
||||
this->context = Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 44100, 1024, 2480 });
|
||||
|
||||
auto loader = context->GetResourceManager()->GetResourceLoader();
|
||||
loader->RegisterResourceFactory(std::make_shared<SF64::ResourceFactoryBinaryAnimV0>(), RESOURCE_FORMAT_BINARY, "Animation", static_cast<uint32_t>(SF64::ResourceType::AnimData), 0);
|
||||
|
@ -139,9 +139,9 @@ void GameEngine::HandleAudioThread(){
|
|||
u32 num_audio_samples = samples_left < AudioPlayerGetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW;
|
||||
s16 audio_buffer[SAMPLES_PER_FRAME];
|
||||
for (int i = 0; i < NUM_AUDIO_CHANNELS; i++) {
|
||||
AudioThread_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples * 2);
|
||||
AudioThread_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples);
|
||||
}
|
||||
AudioPlayerPlayFrame((u8 *) audio_buffer, 2 * num_audio_samples * 4);
|
||||
AudioPlayerPlayFrame((u8 *) audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE));
|
||||
audio.processing = false;
|
||||
audio.cv_from_thread.notify_one();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue