Make utterance_id 64-bit.

This commit is contained in:
Pāvels Nadtočajevs 2025-11-03 23:25:29 +02:00
parent cb3af5afff
commit 281c74550a
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
34 changed files with 69 additions and 63 deletions

View file

@ -428,7 +428,7 @@ TypedArray<Dictionary> DisplayServerWeb::tts_get_voices() const {
return voices;
}
void DisplayServerWeb::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int p_utterance_id, bool p_interrupt) {
void DisplayServerWeb::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int64_t p_utterance_id, bool p_interrupt) {
if (p_interrupt) {
tts_stop();
}
@ -453,14 +453,14 @@ void DisplayServerWeb::tts_resume() {
}
void DisplayServerWeb::tts_stop() {
for (const KeyValue<int, CharString> &E : utterance_ids) {
for (const KeyValue<int64_t, CharString> &E : utterance_ids) {
tts_post_utterance_event(DisplayServer::TTS_UTTERANCE_CANCELED, E.key);
}
utterance_ids.clear();
godot_js_tts_stop();
}
void DisplayServerWeb::js_utterance_callback(int p_event, int p_id, int p_pos) {
void DisplayServerWeb::js_utterance_callback(int p_event, int64_t p_id, int p_pos) {
#ifdef PROXY_TO_PTHREAD_ENABLED
if (!Thread::is_main_thread()) {
callable_mp_static(DisplayServerWeb::_js_utterance_callback).call_deferred(p_event, p_id, p_pos);
@ -471,7 +471,7 @@ void DisplayServerWeb::js_utterance_callback(int p_event, int p_id, int p_pos) {
_js_utterance_callback(p_event, p_id, p_pos);
}
void DisplayServerWeb::_js_utterance_callback(int p_event, int p_id, int p_pos) {
void DisplayServerWeb::_js_utterance_callback(int p_event, int64_t p_id, int p_pos) {
DisplayServerWeb *ds = (DisplayServerWeb *)DisplayServer::get_singleton();
if (ds->utterance_ids.has(p_id)) {
int pos = 0;