feat: updated engine
This commit is contained in:
parent
cbe99774ff
commit
f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions
|
|
@ -30,7 +30,9 @@
|
|||
|
||||
#include "audio_stream_interactive.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/object/class_db.h"
|
||||
|
||||
AudioStreamInteractive::AudioStreamInteractive() {
|
||||
}
|
||||
|
|
@ -42,10 +44,6 @@ Ref<AudioStreamPlayback> AudioStreamInteractive::instantiate_playback() {
|
|||
return playback_transitioner;
|
||||
}
|
||||
|
||||
String AudioStreamInteractive::get_stream_name() const {
|
||||
return "Transitioner";
|
||||
}
|
||||
|
||||
void AudioStreamInteractive::set_clip_count(int p_count) {
|
||||
ERR_FAIL_COND(p_count < 0 || p_count > MAX_CLIPS);
|
||||
|
||||
|
|
@ -437,7 +435,7 @@ void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const
|
|||
r_property.usage = PROPERTY_USAGE_INTERNAL;
|
||||
} else if (prop == "clip_" + itos(clip) + "/next_clip") {
|
||||
if (clips[clip].auto_advance != AUTO_ADVANCE_ENABLED) {
|
||||
r_property.usage = 0;
|
||||
r_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (Engine::get_singleton()->is_editor_hint()) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
r_property.hint_string = _get_streams_hint();
|
||||
|
|
@ -485,7 +483,7 @@ void AudioStreamInteractive::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "clip_count", PROPERTY_HINT_RANGE, "1," + itos(MAX_CLIPS), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_ARRAY, "Clips,clip_,page_size=999,unfoldable,numbered,swap_method=_inspector_array_swap_clip,add_button_text=" + String(TTRC("Add Clip"))), "set_clip_count", "get_clip_count");
|
||||
for (int i = 0; i < MAX_CLIPS; i++) {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::STRING_NAME, "clip_" + itos(i) + "/name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_clip_name", "get_clip_name", i);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "clip_" + itos(i) + "/stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_clip_stream", "get_clip_stream", i);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "clip_" + itos(i) + "/stream", PROPERTY_HINT_RESOURCE_TYPE, AudioStream::get_class_static(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_clip_stream", "get_clip_stream", i);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::INT, "clip_" + itos(i) + "/auto_advance", PROPERTY_HINT_ENUM, "Disabled,Enabled,ReturnToHold", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_clip_auto_advance", "get_clip_auto_advance", i);
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::INT, "clip_" + itos(i) + "/next_clip", PROPERTY_HINT_ENUM, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "set_clip_auto_advance_next_clip", "get_clip_auto_advance_next_clip", i);
|
||||
}
|
||||
|
|
@ -520,6 +518,7 @@ void AudioStreamInteractive::_bind_methods() {
|
|||
|
||||
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_SAME_POSITION);
|
||||
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_START);
|
||||
BIND_ENUM_CONSTANT(TRANSITION_TO_TIME_PREVIOUS_POSITION);
|
||||
|
||||
BIND_ENUM_CONSTANT(FADE_DISABLED);
|
||||
BIND_ENUM_CONSTANT(FADE_IN);
|
||||
|
|
@ -885,12 +884,19 @@ void AudioStreamPlaybackInteractive::_mix_internal(int p_frames) {
|
|||
mix_buffer[i] = AudioFrame(0, 0);
|
||||
}
|
||||
|
||||
bool any_active = false;
|
||||
for (int i = 0; i < stream->clip_count; i++) {
|
||||
if (!states[i].active) {
|
||||
continue;
|
||||
}
|
||||
|
||||
_mix_internal_state(i, p_frames);
|
||||
|
||||
any_active = states[i].active || any_active;
|
||||
}
|
||||
if (!any_active) {
|
||||
active = false;
|
||||
playback_current = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue