summaryrefslogtreecommitdiff
path: root/servers/movie_writer
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-11-30 16:40:50 +0100
committerkobewi <kobewi4e@gmail.com>2022-11-30 18:36:57 +0100
commit9a3960daa59a728f2620f64ad182aa332059489c (patch)
tree3234e83a17d4a7f66e9b8b96265aa876652119d5 /servers/movie_writer
parentcd491c6e47bb41ccf596189676c0c5d4a72226cc (diff)
Simplify GDVIRTUAL_REQUIRED_CALL calls
Diffstat (limited to 'servers/movie_writer')
-rw-r--r--servers/movie_writer/movie_writer.cpp43
1 files changed, 16 insertions, 27 deletions
diff --git a/servers/movie_writer/movie_writer.cpp b/servers/movie_writer/movie_writer.cpp
index 0edce4ced6..419943f2d2 100644
--- a/servers/movie_writer/movie_writer.cpp
+++ b/servers/movie_writer/movie_writer.cpp
@@ -52,34 +52,26 @@ MovieWriter *MovieWriter::find_writer_for_file(const String &p_file) {
}
uint32_t MovieWriter::get_audio_mix_rate() const {
- uint32_t ret = 0;
- if (GDVIRTUAL_REQUIRED_CALL(_get_audio_mix_rate, ret)) {
- return ret;
- }
- return 48000;
+ uint32_t ret = 48000;
+ GDVIRTUAL_REQUIRED_CALL(_get_audio_mix_rate, ret);
+ return ret;
}
AudioServer::SpeakerMode MovieWriter::get_audio_speaker_mode() const {
AudioServer::SpeakerMode ret = AudioServer::SPEAKER_MODE_STEREO;
- if (GDVIRTUAL_REQUIRED_CALL(_get_audio_speaker_mode, ret)) {
- return ret;
- }
- return AudioServer::SPEAKER_MODE_STEREO;
+ GDVIRTUAL_REQUIRED_CALL(_get_audio_speaker_mode, ret);
+ return ret;
}
Error MovieWriter::write_begin(const Size2i &p_movie_size, uint32_t p_fps, const String &p_base_path) {
- Error ret = OK;
- if (GDVIRTUAL_REQUIRED_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret)) {
- return ret;
- }
- return ERR_UNCONFIGURED;
+ Error ret = ERR_UNCONFIGURED;
+ GDVIRTUAL_REQUIRED_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret);
+ return ret;
}
Error MovieWriter::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) {
- Error ret = OK;
- if (GDVIRTUAL_REQUIRED_CALL(_write_frame, p_image, p_audio_data, ret)) {
- return ret;
- }
- return ERR_UNCONFIGURED;
+ Error ret = ERR_UNCONFIGURED;
+ GDVIRTUAL_REQUIRED_CALL(_write_frame, p_image, p_audio_data, ret);
+ return ret;
}
void MovieWriter::write_end() {
@@ -88,18 +80,15 @@ void MovieWriter::write_end() {
bool MovieWriter::handles_file(const String &p_path) const {
bool ret = false;
- if (GDVIRTUAL_REQUIRED_CALL(_handles_file, p_path, ret)) {
- return ret;
- }
- return false;
+ GDVIRTUAL_REQUIRED_CALL(_handles_file, p_path, ret);
+ return ret;
}
void MovieWriter::get_supported_extensions(List<String> *r_extensions) const {
Vector<String> exts;
- if (GDVIRTUAL_REQUIRED_CALL(_get_supported_extensions, exts)) {
- for (int i = 0; i < exts.size(); i++) {
- r_extensions->push_back(exts[i]);
- }
+ GDVIRTUAL_REQUIRED_CALL(_get_supported_extensions, exts);
+ for (int i = 0; i < exts.size(); i++) {
+ r_extensions->push_back(exts[i]);
}
}