Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-08-27 06:02:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-27 06:05:12 +0300
commit61f9274d07087770e7b4dffc557d66b9bf3c34ec (patch)
tree65bc3243a04cc6963ea5a5fa302f24c0269c0d78 /source/blender/sequencer/intern/effects.c
parentefc129bc827558e55cf4619b8e2ca502342338f3 (diff)
Cleanup: use early return
Diffstat (limited to 'source/blender/sequencer/intern/effects.c')
-rw-r--r--source/blender/sequencer/intern/effects.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c
index 203dcccae02..9235da366f4 100644
--- a/source/blender/sequencer/intern/effects.c
+++ b/source/blender/sequencer/intern/effects.c
@@ -3755,34 +3755,39 @@ static void init_text_effect(Sequence *seq)
void SEQ_effect_text_font_unload(TextVars *data, const bool do_id_user)
{
- if (data) {
- /* Unlink the VFont */
- if (do_id_user && data->text_font != NULL) {
- id_us_min(&data->text_font->id);
- data->text_font = NULL;
- }
+ if (data == NULL) {
+ return;
+ }
- /* Unload the BLF font. */
- if (data->text_blf_id >= 0) {
- BLF_unload_id(data->text_blf_id);
- }
+ /* Unlink the VFont */
+ if (do_id_user && data->text_font != NULL) {
+ id_us_min(&data->text_font->id);
+ data->text_font = NULL;
+ }
+
+ /* Unload the BLF font. */
+ if (data->text_blf_id >= 0) {
+ BLF_unload_id(data->text_blf_id);
}
}
void SEQ_effect_text_font_load(TextVars *data, const bool do_id_user)
{
- if (data->text_font != NULL) {
- if (do_id_user) {
- id_us_plus(&data->text_font->id);
- }
-
- char path[FILE_MAX];
- STRNCPY(path, data->text_font->filepath);
- BLI_assert(BLI_thread_is_main());
- BLI_path_abs(path, ID_BLEND_PATH_FROM_GLOBAL(&data->text_font->id));
+ VFont *vfont = data->text_font;
+ if (vfont == NULL) {
+ return;
+ }
- data->text_blf_id = BLF_load(path);
+ if (do_id_user) {
+ id_us_plus(&vfont->id);
}
+
+ char path[FILE_MAX];
+ STRNCPY(path, vfont->filepath);
+ BLI_assert(BLI_thread_is_main());
+ BLI_path_abs(path, ID_BLEND_PATH_FROM_GLOBAL(&vfont->id));
+
+ data->text_blf_id = BLF_load(path);
}
static void free_text_effect(Sequence *seq, const bool do_id_user)