diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-10 16:57:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-08-10 16:57:59 +0300 |
commit | 4a4c6da0f8aaf94dff8d219770404c46760cce15 (patch) | |
tree | ca7213d9957a1ce0ee4811e0deadfde2e42e18e9 /source/blender | |
parent | 6e2f17ea02be5caa9eee8a68ccd558474030b29a (diff) | |
parent | aa1b35bb60d1d559f00095ed895a0c1884193a39 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 35 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_format_pov.c | 912 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_format_pov_ini.c | 129 | ||||
-rw-r--r-- | source/blender/imbuf/intern/colormanagement.c | 8 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/png.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 13 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 11 |
13 files changed, 640 insertions, 509 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 49b08af97d6..6e29db9529d 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -335,7 +335,8 @@ bool BKE_sequence_base_shuffle( bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, struct Scene *evil_scene); bool BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase); void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, bool for_render); -struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag); +struct Sequence *BKE_sequence_dupli_recursive( + const struct Scene *scene_src, struct Scene *scene_dst, struct Sequence *seq, int dupe_flag); int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str); bool BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur); @@ -352,7 +353,7 @@ void BKE_sequencer_refresh_sound_length(struct Scene *scene); void BKE_sequence_base_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq); void BKE_sequence_base_dupli_recursive( - const struct Scene *scene, struct Scene *scene_to, struct ListBase *nseqbase, const struct ListBase *seqbase, + const struct Scene *scene_src, struct Scene *scene_dst, struct ListBase *nseqbase, const struct ListBase *seqbase, int dupe_flag, const int flag); bool BKE_sequence_is_valid_check(struct Sequence *seq); diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 23bd2a7bb16..8dad3a2036e 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -248,7 +248,7 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id return IDWALK_RET_NOP; } -/* Some reamapping unfortunately require extra and/or specific handling, tackle those here. */ +/* Some remapping unfortunately require extra and/or specific handling, tackle those here. */ static void libblock_remap_data_preprocess_scene_base_unlink( IDRemap *r_id_remap_data, Scene *sce, BaseLegacy *base, const bool skip_indirect, const bool is_indirect) { @@ -352,7 +352,7 @@ static void libblock_remap_data_preprocess(IDRemap *r_id_remap_data) } } -static void libblock_remap_data_postprocess_object_fromgroup_update(Main *bmain, Object *old_ob, Object *new_ob) +static void libblock_remap_data_postprocess_object_update(Main *bmain, Object *old_ob, Object *new_ob) { if (old_ob->flag & OB_FROMGROUP) { /* Note that for Scene's BaseObject->flag, either we: @@ -371,6 +371,13 @@ static void libblock_remap_data_postprocess_object_fromgroup_update(Main *bmain, new_ob->flag |= OB_FROMGROUP; } } + if (old_ob->type == OB_MBALL) { + for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + if (ob->type == OB_MBALL && BKE_mball_is_basis_for(ob, old_ob)) { + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + } + } + } } static void libblock_remap_data_postprocess_group_scene_unlink(Main *UNUSED(bmain), Scene *sce, ID *old_id) @@ -575,7 +582,7 @@ void BKE_libblock_remap_locked( */ switch (GS(old_id->name)) { case ID_OB: - libblock_remap_data_postprocess_object_fromgroup_update(bmain, (Object *)old_id, (Object *)new_id); + libblock_remap_data_postprocess_object_update(bmain, (Object *)old_id, (Object *)new_id); break; case ID_GR: if (!new_id) { /* Only affects us in case group was unlinked. */ @@ -685,8 +692,7 @@ void BKE_libblock_relink_ex( switch (GS(old_id->name)) { case ID_OB: { - libblock_remap_data_postprocess_object_fromgroup_update( - bmain, (Object *)old_id, (Object *)new_id); + libblock_remap_data_postprocess_object_update(bmain, (Object *)old_id, (Object *)new_id); break; } case ID_GR: @@ -701,7 +707,7 @@ void BKE_libblock_relink_ex( else { /* No choice but to check whole objects/groups. */ for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { - libblock_remap_data_postprocess_object_fromgroup_update(bmain, ob, NULL); + libblock_remap_data_postprocess_object_update(bmain, ob, NULL); } for (Group *grp = bmain->group.first; grp; grp = grp->id.next) { libblock_remap_data_postprocess_group_scene_unlink(bmain, sce, NULL); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 8a4f09763f5..7f7c29a8191 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -5373,9 +5373,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad return seq; } -static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dupe_flag, const int flag) +static Sequence *seq_dupli(const Scene *scene_src, Scene *scene_dst, Sequence *seq, int dupe_flag, const int flag) { - Scene *sce_audio = scene_to ? scene_to : scene; Sequence *seqn = MEM_dupallocN(seq); seq->tmp = seqn; @@ -5418,7 +5417,7 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup else if (seq->type == SEQ_TYPE_SCENE) { seqn->strip->stripdata = NULL; if (seq->scene_sound) - seqn->scene_sound = BKE_sound_scene_add_scene_sound_defaults(sce_audio, seqn); + seqn->scene_sound = BKE_sound_scene_add_scene_sound_defaults(scene_dst, seqn); } else if (seq->type == SEQ_TYPE_MOVIECLIP) { /* avoid assert */ @@ -5435,7 +5434,7 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); if (seq->scene_sound) - seqn->scene_sound = BKE_sound_add_scene_sound_defaults(sce_audio, seqn); + seqn->scene_sound = BKE_sound_add_scene_sound_defaults(scene_dst, seqn); if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) { id_us_plus((ID *)seqn->sound); @@ -5459,11 +5458,15 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup BLI_assert(0); } - if (dupe_flag & SEQ_DUPE_UNIQUE_NAME) - BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seqn); + if (scene_src == scene_dst) { + if (dupe_flag & SEQ_DUPE_UNIQUE_NAME) { + BKE_sequence_base_unique_name_recursive(&scene_dst->ed->seqbase, seqn); + } - if (dupe_flag & SEQ_DUPE_ANIM) - BKE_sequencer_dupe_animdata(scene, seq->name + 2, seqn->name + 2); + if (dupe_flag & SEQ_DUPE_ANIM) { + BKE_sequencer_dupe_animdata(scene_dst, seq->name + 2, seqn->name + 2); + } + } return seqn; } @@ -5490,16 +5493,16 @@ static void seq_new_fix_links_recursive(Sequence *seq) } } -Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence *seq, int dupe_flag) +Sequence *BKE_sequence_dupli_recursive(const Scene *scene_src, Scene *scene_dst, Sequence *seq, int dupe_flag) { Sequence *seqn; seq->tmp = NULL; - seqn = seq_dupli(scene, scene_to, seq, dupe_flag, 0); + seqn = seq_dupli(scene_src, scene_dst, seq, dupe_flag, 0); if (seq->type == SEQ_TYPE_META) { Sequence *s; for (s = seq->seqbase.first; s; s = s->next) { - Sequence *n = BKE_sequence_dupli_recursive(scene, scene_to, s, dupe_flag); + Sequence *n = BKE_sequence_dupli_recursive(scene_src, scene_dst, s, dupe_flag); if (n) { BLI_addtail(&seqn->seqbase, n); } @@ -5512,19 +5515,19 @@ Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence * } void BKE_sequence_base_dupli_recursive( - const Scene *scene, Scene *scene_to, ListBase *nseqbase, const ListBase *seqbase, + const Scene *scene_src, Scene *scene_dst, ListBase *nseqbase, const ListBase *seqbase, int dupe_flag, const int flag) { Sequence *seq; Sequence *seqn = NULL; - Sequence *last_seq = BKE_sequencer_active_get((Scene *)scene); + Sequence *last_seq = BKE_sequencer_active_get((Scene *)scene_src); /* always include meta's strips */ int dupe_flag_recursive = dupe_flag | SEQ_DUPE_ALL; for (seq = seqbase->first; seq; seq = seq->next) { seq->tmp = NULL; if ((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) { - seqn = seq_dupli((Scene *)scene, scene_to, seq, dupe_flag, flag); + seqn = seq_dupli(scene_src, scene_dst, seq, dupe_flag, flag); if (seqn) { /*should never fail */ if (dupe_flag & SEQ_DUPE_CONTEXT) { seq->flag &= ~SEQ_ALLSEL; @@ -5534,13 +5537,13 @@ void BKE_sequence_base_dupli_recursive( BLI_addtail(nseqbase, seqn); if (seq->type == SEQ_TYPE_META) { BKE_sequence_base_dupli_recursive( - scene, scene_to, &seqn->seqbase, &seq->seqbase, + scene_src, scene_dst, &seqn->seqbase, &seq->seqbase, dupe_flag_recursive, flag); } if (dupe_flag & SEQ_DUPE_CONTEXT) { if (seq == last_seq) { - BKE_sequencer_active_set(scene_to, seqn); + BKE_sequencer_active_set(scene_dst, seqn); } } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 631c31251ec..407f4306fec 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -727,7 +727,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe) if (!skip_dup) { /* Duplicate AFTER the first change */ - seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); + seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } if (seqn) { @@ -820,7 +820,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe) if (!skip_dup) { /* Duplicate AFTER the first change */ - seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); + seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM); } if (seqn) { @@ -2139,7 +2139,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) if (ed == NULL) return OPERATOR_CANCELLED; - BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT, 0); + BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT, 0); if (nseqbase.first) { Sequence *seq = nseqbase.first; @@ -3177,7 +3177,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME, 0); + BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME, 0); /* To make sure the copied strips have unique names between each other add * them temporarily to the end of the original seqbase. (bug 25932) @@ -3244,7 +3244,7 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) ED_sequencer_deselect_all(scene); ofs = scene->r.cfra - seqbase_clipboard_frame; - BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME, 0); + BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME, 0); /* transform pasted strips before adding */ if (ofs) { diff --git a/source/blender/editors/space_text/text_format_pov.c b/source/blender/editors/space_text/text_format_pov.c index 0d19c503798..1ef3322711c 100644 --- a/source/blender/editors/space_text/text_format_pov.c +++ b/source/blender/editors/space_text/text_format_pov.c @@ -49,36 +49,38 @@ static int txtfmt_pov_find_keyword(const char *string) { int i, len; /* Language Directives */ - if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "persistent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "declare", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "default", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "include", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "elseif", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "else", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "error", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fopen", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ifdef", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "include", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "patch", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "local", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "macro", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "range", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "read", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "render", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "switch", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "undef", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "while", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "write", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len; else i = 0; /* If next source char is an identifier (eg. 'i' in "definate") no match */ @@ -92,221 +94,275 @@ static int txtfmt_pov_find_reserved_keywords(const char *string) * list is from... * http://www.povray.org/documentation/view/3.7.0/212/ */ + + /* Float Functions */ + if (STR_LITERAL_STARTSWITH(string, "conserve_energy", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_intersections", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "dimension_size", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bitwise_and", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bitwise_or", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bitwise_xor", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "file_exists", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "precompute", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "dimensions", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clipped_by", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "shadowless", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "turb_depth", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "reciprocal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "quaternion", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "phong_size", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tesselate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "save_file", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "load_file", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_trace", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "transform", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "translate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "direction", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "roughness", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "metallic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gts_load", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gts_save", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "location", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "altitude", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "function", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "evaluate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inverse", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "collect", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "target", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "albedo", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rotate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "matrix", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "look_at", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "jitter", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "angle", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "right", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "scale", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "child", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "crand", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "blink", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "defined", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "degrees", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inside", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "radians", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vlength", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "select", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "floor", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "strcmp", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "strlen", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tessel", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sturm", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "abs", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "acosh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "prod", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "with", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "acos", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "asc", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "asinh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "asin", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "atan2", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "atand", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "atanh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "atan", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ceil", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "warp", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cosh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "log", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "min", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mod", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pow", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rand", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "seed", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "form", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sinh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sqrt", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tanh", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vdot", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sin", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sqr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sum", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pwr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tan", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "val", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cos", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "div", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "exp", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "int", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sky", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "up", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ln", len)) i = len; + /* Color Identifiers */ + else if (STR_LITERAL_STARTSWITH(string, "transmit", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "filter", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "srgbft", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "srgbf", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "srgbt", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rgbft", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gamma", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "green", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "blue", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gray", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "srgb", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sRGB", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "SRGB", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rgbf", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rgbt", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rgb", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "red", len)) i = len; + /* Color Spaces */ + else if (STR_LITERAL_STARTSWITH(string, "pov", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hsl", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hsv", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "xyl", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "xyv", len)) i = len; + /* Vector Functions */ + else if (STR_LITERAL_STARTSWITH(string, "vaxis_rotate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vturbulence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "min_extent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vnormalize", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_extent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vrotate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vcross", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "trace", len)) i = len; + /* String Functions */ + else if (STR_LITERAL_STARTSWITH(string, "file_time", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "datetime", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "concat", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "strlwr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "strupr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "substr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vstr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "chr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "str", len)) i = len; + else i = 0; + + /* If next source char is an identifier (eg. 'i' in "definate") no match */ + return (i == 0 || text_check_identifier(string[i])) ? -1 : i; +} + + +static int txtfmt_pov_find_reserved_builtins(const char *string) +{ + int i, len; + + /* POV-Ray Built-in Variables + * list is from... + * http://www.povray.org/documentation/view/3.7.0/212/ + */ /* Language Keywords */ - if (STR_LITERAL_STARTSWITH(string, "aa_level", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "reflection_exponent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "area_illumination", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "all_intersections", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cutaway_textures", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "smooth_triangle", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "lommel_seeliger", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "falloff_angle", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "aa_threshold", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hypercomplex", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "major_radius", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_distance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_iteration", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "colour_space", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "color_space", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "iridescence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "subsurface", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "scattering", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "absorption", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "accuracy", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "adc_bailout", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "albedo", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "all_intersections", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "translucency", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "all", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "alpha", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "altitude", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "always_sample", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ambient_light", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ambient", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "angle", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "aperture", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "water_level", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "reflection", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_extent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "oren_nayar", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "refraction", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hierarchy", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "radiosity", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tolerance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "interior", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "toroidal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "emission", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "material", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "internal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "photons", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "arc_angle", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "area_light", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "area_illumination", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "minnaert", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "texture", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "array", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "assumed_gamma", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "autostop", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "black_hole", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "blur_samples", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "brightness", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "brilliance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "caustics", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "charset", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "collect", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "component", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "composite", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "confidence", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "conserve_energy", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "contained_by", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "coords", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "count", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "crand", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "cube", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cutaway_textures", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "diffuse", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "direction", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "dispersion_samples", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "dispersion", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "dist_exp", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "distance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "eccentricity", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "emission", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "error_bound", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "evaluate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "expand_thresholds", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "exponent", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "exterior", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "extinction", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "face_indices", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "falloff_angle", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "falloff", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "file_gamma", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "flatness", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "planet", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "screw", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "keep", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "flip", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "focal_point", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fog_alt", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fog_offset", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fog_type", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "form", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fresnel", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "function", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "gamma", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "gather", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "global_settings", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "gray_threshold", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "hf_gray_16", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "hierarchy", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "hypercomplex", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "importance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "inside_vector", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "internal", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "intervals", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ior", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "irid_wavelength", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "irid", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "load_file", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "location", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "move", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "roll", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "look_at", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "looks_like", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "low_error_factor", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "major_radius", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_distance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_extent", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_gradient", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_intersections", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_iteration", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_sample", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_trace_level", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max_trace", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "maximum_reuse", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "metallic", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "method", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "metric", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "minimum_reuse", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "nearest_count", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "normal_indices", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "normal_vectors", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "now", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "number_of_waves", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "offset", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "open", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "orientation", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pass_through", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "pattern", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "phong_size", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "phong", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "point_at", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pot", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "precision", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "precompute", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pretrace_end", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pretrace_start", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "prod", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pwr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "quaternion", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "radiosity", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "radius", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ratio", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "reciprocal", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "recursion_limit", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "reflection_exponent", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "reflection", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "refraction", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "width", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "repeat", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "right", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "roughness", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "samples", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "save_file", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "scattering", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bend", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "size", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sky", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "alpha", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "slice", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "smooth", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "solid", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "spacing", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "specular", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "split_union", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "spotlight", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "strength", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sturm", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sum", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "target", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "texture_list", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "thickness", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "threshold", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tightness", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tolerance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "toroidal", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ttf", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "turb_depth", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "all", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "now", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pot", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "type", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "u_steps", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "up", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "use_alpha", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "uv_indices", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "uv_vectors", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "v_steps", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "variance", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vertex_vectors", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "water_level", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "width", len)) i = len; - - else i = 0; - - /* If next source char is an identifier (eg. 'i' in "definate") no match */ - return (i == 0 || text_check_identifier(string[i])) ? -1 : i; -} - - -static int txtfmt_pov_find_reserved_builtins(const char *string) -{ - int i, len; - - /* POV-Ray Built-in Variables - * list is from... - * http://www.povray.org/documentation/view/3.7.0/212/ - */ - if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "final_clock", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "final_frame", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len; + /* Animation Options */ + else if (STR_LITERAL_STARTSWITH(string, "global_settings", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "initial_clock", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "initial_frame", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "image_height", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "image_width", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len; - /* Color Identifiers */ - else if (STR_LITERAL_STARTSWITH(string, "blue", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "filter", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "gray", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "green", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "red", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rgbft", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rgbf", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rgbt", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rgb", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "srgb", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sRGB", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "SRGB", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "srgbft", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "srgbf", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "srgbt", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "transmit", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "final_clock", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "final_frame", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len; + /* Spline Identifiers */ + else if (STR_LITERAL_STARTSWITH(string, "extended_x_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "general_x_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "quadratic_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "basic_x_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "natural_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "linear_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bezier_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "akima_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cubic_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sor_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tcb_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "linear_sweep", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "conic_sweep", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "b_spline", len)) i = len; /* Patterns */ - else if (STR_LITERAL_STARTSWITH(string, "agate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "aoi", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pigment_pattern", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "image_pattern", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "density_file", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cylindrical", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "proportion", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "triangular", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "image_map", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "proximity", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "spherical", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bump_map", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "wrinkles", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "average", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "voronoi", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "masonry", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "binary", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "boxed", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "bozo", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "brick", len)) i = len; @@ -315,14 +371,11 @@ static int txtfmt_pov_find_reserved_builtins(const char *string) else if (STR_LITERAL_STARTSWITH(string, "checker", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "crackle", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "cubic", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cylindrical", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "density_file", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "dents", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "facets", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "gradient", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "granite", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "hexagon", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "image_pattern", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "julia", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "leopard", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "magnet", len)) i = len; @@ -330,13 +383,11 @@ static int txtfmt_pov_find_reserved_builtins(const char *string) else if (STR_LITERAL_STARTSWITH(string, "marble", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "onion", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "pavement", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pigment_pattern", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "planar", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "quilted", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "radial", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ripples", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "slope", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "spherical", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "spiral1", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "spiral2", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "spotted", len)) i = len; @@ -344,97 +395,68 @@ static int txtfmt_pov_find_reserved_builtins(const char *string) else if (STR_LITERAL_STARTSWITH(string, "tile2", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "tiling", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "tiles", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "triangular", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "waves", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "wood", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "wrinkles", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "agate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "aoi", len)) i = len; /* Objects */ - else if (STR_LITERAL_STARTSWITH(string, "background", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "superellipsoid", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "bicubic_patch", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "blob", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "box", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "camera", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cone", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cubic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "julia_fractal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "height_field", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cubic_spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sphere_sweep", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "light_group", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "light_source", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "intersection", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "isosurface", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "background", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sky_sphere", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "cylinder", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "difference", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "brilliance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "parametric", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "interunion", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "intermerge", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "polynomial", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "displace", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "specular", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ambient", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "diffuse", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "polygon", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "quadric", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "quartic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "rainbow", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sphere", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "spline", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "prism", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "galley", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cubic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "phong", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cone", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "blob", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "box", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "disc", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fog", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "height_field", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "intersection", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "isosurface", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "julia_fractal", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "lathe", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "light_group", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "light_source", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "merge", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "mesh2", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "mesh", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "object", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ovus", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "lemon", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "parametric", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "plane", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "poly", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "polygon", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "polynomial", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "prism", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "quadric", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "quartic", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rainbow", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sky_sphere", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "smooth_triangle", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cubic_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sphere_sweep", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sphere", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "superellipsoid", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "irid", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "sor", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "text", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "torus", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "triangle", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "union", len)) i = len; - /* Filetypes */ - else if (STR_LITERAL_STARTSWITH(string, "df3", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "exr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "gif", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "hdr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "iff", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "jpeg", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pgm", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "png", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ppm", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sys", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tga", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tiff", len)) i = len; - /* Spline Identifiers */ - else if (STR_LITERAL_STARTSWITH(string, "b_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bezier_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "conic_sweep", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cubic_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "linear_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "linear_sweep", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "natural_spline", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "quadratic_spline", len)) i = len; - /* Encodings */ - else if (STR_LITERAL_STARTSWITH(string, "ascii", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "utf8", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "uint8", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "uint16be", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "uint16le", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sint8", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sint16be", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sint16le", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sint32be", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sint32le", len)) i = len; - /* Camera Types */ - else if (STR_LITERAL_STARTSWITH(string, "fisheye", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "mesh_camera", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "omnimax", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "orthographic", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "panoramic", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "perspective", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ultra_wide_angle", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "colour", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "color", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "media", len)) i = len; /* Built-in Vectors */ else if (STR_LITERAL_STARTSWITH(string, "t", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "u", len)) i = len; @@ -442,7 +464,6 @@ static int txtfmt_pov_find_reserved_builtins(const char *string) else if (STR_LITERAL_STARTSWITH(string, "x", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "y", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "z", len)) i = len; - else i = 0; /* If next source char is an identifier (eg. 'i' in "definate") no match */ @@ -465,156 +486,201 @@ static int txtfmt_pov_find_specialvar(const char *string) { int i, len; /* Modifiers */ - if (STR_LITERAL_STARTSWITH(string, "interior_texture", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "dispersion_samples", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "projected_through", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "double_illuminate", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "expand_thresholds", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "media_interaction", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "media_attenuation", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "projected_through", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "low_error_factor", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "recursion_limit", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "interior_texture", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_trace_level", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gray_threshold", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pretrace_start", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "normal_indices", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "normal_vectors", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "vertex_vectors", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "noise_generator", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "irid_wavelength", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "number_of_waves", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ambient_light", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inside_vector", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "face_indices", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "texture_list", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_gradient", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "uv_indices", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "uv_vectors", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fade_distance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "global_lights", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_bump_scale", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pretrace_end", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_radiosity", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_reflection", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "assumed_gamma", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "scallop_wave", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "triangle_wave", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "nearest_count", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "maximum_reuse", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "minimum_reuse", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "always_sample", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "translucency", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "eccentricity", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "contained_by", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inside_point", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "adc_bailout", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "density_map", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "split_union", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mm_per_unit", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "agate_turb", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "bounded_by", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "brick_size", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bump_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bump_size", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "circular", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clipped_by", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cubic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hf_gray_16", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "dispersion", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "extinction", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "thickness", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "color_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "color", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "colour_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "colour", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "control0", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "control1", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "cubic_wave", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "density_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "density", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fade_color", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fade_colour", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fade_distance", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fade_power", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "frequency", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "global_lights", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "hollow", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "image_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "adaptive", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "interior", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "interpolate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "inverse", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "jitter", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "lambda", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "map_type", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "material_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "material", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "matrix", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "media", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "mm_per_unit", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "mortar", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no_bump_scale", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no_image", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no_radiosity", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no_reflection", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no_shadow", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fade_color", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "normal_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "normal", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "octaves", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "omega", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "once", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "orient", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "parallel", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "phase", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "photons", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "pigment_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pigment", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "finish", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "poly_wave", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "quick_color", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "quick_colour", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ramp_wave", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rotate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "scale", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "scallop_wave", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "shadowless", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sine_wave", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "slope_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "subsurface", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "material_map", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pass_through", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "interpolate", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "texture_map", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "texture", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "transform", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "translate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "triangle_wave", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "turbulence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "error_bound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "brightness", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "use_color", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "use_alpha", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "use_colour", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "use_index", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "uv_mapping", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "warp", len)) i = len; - - /* Vector Functions */ - else if (STR_LITERAL_STARTSWITH(string, "max_extent", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "min_extent", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "trace", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vaxis_rotate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vcross", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vnormalize", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vrotate", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vturbulence", len)) i = len; - /* String Functions */ - else if (STR_LITERAL_STARTSWITH(string, "chr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "concat", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "datetime", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "str", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "strlwr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "strupr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "substr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vstr", len)) i = len; - /* Float Functions */ - else if (STR_LITERAL_STARTSWITH(string, "abs", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "acosh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "acos", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "asc", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "asinh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "asin", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "atan2", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "atand", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "atanh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "atan", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bitwise_and", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bitwise_or", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "bitwise_xor", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ceil", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cosh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "cos", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "defined", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "degrees", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "dimension_size", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "dimensions", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "div", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "exp", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "file_exists", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "floor", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "inside", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "int", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ln", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "log", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "max", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "min", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "mod", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pow", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "radians", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "rand", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "seed", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "select", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sinh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sin", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sqrt", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "sqr", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "strcmp", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "strlen", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tanh", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tan", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "val", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vdot", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "vlength", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "importance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "max_sample", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "intervals", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sine_wave", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "slope_map", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "poly_wave", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_shadow", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ramp_wave", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "precision", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "original", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "accuracy", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "map_type", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_image", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "distance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "autostop", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "caustics", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "octaves", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "aa_level", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "frequency", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fog_offset", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "modulation", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "outbound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no_cache", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pigment", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "charset", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inbound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "outside", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "inner", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "turbulence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "threshold", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "accuracy", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "polarity", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bump_size", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "circular", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "control0", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "control1", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "maximal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "minimal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fog_type", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fog_alt", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "samples", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "origin", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "amount", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "adaptive", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "exponent", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "strength", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "density", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fresnel", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "albinos", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "finish", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "method", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "omega", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fixed", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "spacing", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "u_steps", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "v_steps", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "offset", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hollow", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gather", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "lambda", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mortar", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "cubic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "count", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "once", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "orient", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "normal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "phase", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ratio", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "open", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ior", len)) i = len; + /* Light Types and options*/ + else if (STR_LITERAL_STARTSWITH(string, "area_light", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "looks_like", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fade_power", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tightness", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "spotlight", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "parallel", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "point_at", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "falloff", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "radius", len)) i = len; + /* Camera Types and options*/ + else if (STR_LITERAL_STARTSWITH(string, "omni_directional_stereo", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "lambert_cylindrical", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "miller_cylindrical", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "lambert_azimuthal", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ultra_wide_angle", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera_direction", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera_location ", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "van_der_grinten", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "aitoff_hammer", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "smyth_craster", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "orthographic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera_right", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "blur_samples", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "plate_carree", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera_type", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "perspective", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mesh_camera", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "focal_point", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "balthasart", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "confidence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "parallaxe", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hobo_dyer", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "camera_up", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "panoramic", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "eckert_vi", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "eckert_iv", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mollweide", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "aperture", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "behrmann", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "variance", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "stereo", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "icosa", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tetra", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "octa", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "mercator", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "omnimax", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fisheye", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "edwards", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "peters", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gall", len)) i = len; else i = 0; /* If next source char is an identifier (eg. 'i' in "definate") no match */ @@ -625,15 +691,43 @@ static int txtfmt_pov_find_bool(const char *string) { int i, len; /*Built-in Constants*/ - if (STR_LITERAL_STARTSWITH(string, "false", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "no", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "off", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "true", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "yes", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "on", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "pi", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "tau", len)) i = len; - else i = 0; + if (STR_LITERAL_STARTSWITH(string, "unofficial", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "false", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "no", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "off", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "true", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "yes", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "on", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pi", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tau", len)) i = len; + /* Encodings */ + else if (STR_LITERAL_STARTSWITH(string, "sint16be", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sint16le", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sint32be", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sint32le", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "uint16be", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "uint16le", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bt2020", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "bt709", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sint8", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "uint8", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ascii", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "utf8", len)) i = len; + /* Filetypes */ + else if (STR_LITERAL_STARTSWITH(string, "tiff", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "df3", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "exr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "gif", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "hdr", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "iff", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "jpeg", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "pgm", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "png", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ppm", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "sys", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "tga", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ttf", len)) i = len; + else i = 0; /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */ return (i == 0 || text_check_identifier(string[i])) ? -1 : i; @@ -645,7 +739,7 @@ static char txtfmt_pov_format_identifier(const char *str) if ((txtfmt_pov_find_specialvar(str)) != -1) fmt = FMT_TYPE_SPECIAL; else if ((txtfmt_pov_find_keyword(str)) != -1) fmt = FMT_TYPE_KEYWORD; else if ((txtfmt_pov_find_reserved_keywords(str)) != -1) fmt = FMT_TYPE_RESERVED; - else if ((txtfmt_pov_find_reserved_builtins(str)) != -1) fmt = FMT_TYPE_RESERVED; + else if ((txtfmt_pov_find_reserved_builtins(str)) != -1) fmt = FMT_TYPE_DIRECTIVE; else fmt = FMT_TYPE_DEFAULT; return fmt; } @@ -770,7 +864,7 @@ static void txtfmt_pov_format_line(SpaceText *st, TextLine *line, const bool do_ if ((i = txtfmt_pov_find_specialvar(str)) != -1) prev = FMT_TYPE_SPECIAL; else if ((i = txtfmt_pov_find_keyword(str)) != -1) prev = FMT_TYPE_KEYWORD; else if ((i = txtfmt_pov_find_reserved_keywords(str)) != -1) prev = FMT_TYPE_RESERVED; - else if ((i = txtfmt_pov_find_reserved_builtins(str)) != -1) prev = FMT_TYPE_RESERVED; + else if ((i = txtfmt_pov_find_reserved_builtins(str)) != -1) prev = FMT_TYPE_DIRECTIVE; if (i > 0) { text_format_fill_ascii(&str, &fmt, prev, i); diff --git a/source/blender/editors/space_text/text_format_pov_ini.c b/source/blender/editors/space_text/text_format_pov_ini.c index 719f4e3c036..453dd1d748c 100644 --- a/source/blender/editors/space_text/text_format_pov_ini.c +++ b/source/blender/editors/space_text/text_format_pov_ini.c @@ -49,36 +49,36 @@ static int txtfmt_ini_find_keyword(const char *string) { int i, len; /* Language Directives */ - if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "declare", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "default", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "include", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "elseif", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "else", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "error", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "fopen", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ifdef", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "include", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "local", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "macro", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "range", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "read", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "render", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "switch", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "undef", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "while", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "write", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "else", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "read", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "I", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "S", len)) i = len; @@ -104,29 +104,54 @@ static int txtfmt_ini_find_reserved(const char *string) * list is from... * http://www.povray.org/documentation/view/3.7.0/212/ */ - if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", len)) i = len; + if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Antialias_Confidence", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Antialias_Gamma", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "final_clock", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "final_frame", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "initial_clock", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "initial_frame", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "image_height", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "image_width", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Subset_Start_Frame", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Subset_End_Frame", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Frame_Step", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Cyclic_Animation", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Field_Render", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Odd_Field", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "final_clock", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "final_frame", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "initial_clock", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "initial_frame", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "image_height", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "image_width", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Start_Column", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Start_Row", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "End_Column", len)) i = len; @@ -134,7 +159,7 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "Test_Abort_Count", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Test_Abort", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Continue_Trace", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Create_Ini", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Display_Gamma", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Display", len)) i = len; @@ -151,19 +176,6 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "Bits_Per_Color", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Compression", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Dither_Method", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Include_Header", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Library_Path", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Debug_Console", len)) i = len; @@ -187,7 +199,9 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "Remove_Bounds", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Split_Unions", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Antialias", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Glare_Desaturation", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Sampling_Method", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Stochastic_Seed", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Jitter_Amount", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Jitter", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len; @@ -221,25 +235,14 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "Band3Width", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Band4Width", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "ShowCmd", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Transparency", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Use8BitMode", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "MakeActive", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "KeepAboveMain", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "AutoClose", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "PreserveBitmap", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "FontSize", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "FontWeight", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "KeepMessages", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "AlertSound", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Completion", len)) i = len; @@ -250,14 +253,6 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "PreventSleep", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "NoShelloutWait", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "SystemNoActive", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "NoShellOuts", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "VideoSource", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "SceneFile", len)) i = len; @@ -269,6 +264,14 @@ static int txtfmt_ini_find_reserved(const char *string) else if (STR_LITERAL_STARTSWITH(string, "RenderwinClose", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Append_File", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "Warning Level", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len; + else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len; /* Filetypes */ else if (STR_LITERAL_STARTSWITH(string, "df3", len)) i = len; else if (STR_LITERAL_STARTSWITH(string, "exr", len)) i = len; diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 03f71b5878c..1f3be8d73bb 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -2565,6 +2565,14 @@ const char *IMB_colormanagement_colorspace_get_indexed_name(int index) void IMB_colormanagment_colorspace_from_ibuf_ftype(ColorManagedColorspaceSettings *colorspace_settings, ImBuf *ibuf) { + /* Don't modify non-color data space, it does not change with file type. */ + ColorSpace *colorspace = colormanage_colorspace_get_named(colorspace_settings->name); + + if (colorspace && colorspace->is_data) { + return; + } + + /* Get color space from file type. */ const ImFileType *type; for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 390f2502ee7..388c2734fe9 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -588,7 +588,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) img_fol_t img_fol; /* only needed for cinema presets */ memset(&img_fol, 0, sizeof(img_fol_t)); - if (ibuf->float_colorspace) { + if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) { /* float buffer was managed already, no need in color space conversion */ chanel_colormanage_cb = channel_colormanage_noop; } diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 503e63a3fb1..dded0f7aecf 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -152,7 +152,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) compression = (int)(((float)(ibuf->foptions.quality) / 11.1111f)); compression = compression < 0 ? 0 : (compression > 9 ? 9 : compression); - if (ibuf->float_colorspace) { + if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) { /* float buffer was managed already, no need in color space conversion */ chanel_colormanage_cb = channel_colormanage_noop; } diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 4368a428186..8e5cf80e013 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -822,7 +822,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags) /* convert from float source */ float rgb[4]; - if (ibuf->float_colorspace) { + if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) { /* float buffer was managed already, no need in color space conversion */ copy_v3_v3(rgb, &fromf[from_i]); } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 63b287382b4..ab3fe1b51b9 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -481,7 +481,7 @@ typedef struct UserDef { int scrollback; /* console scrollback limit */ int dpi; /* range 48-128? */ float ui_scale; /* interface scale */ - int pad1; + int ui_line_width; /* interface line width */ char node_margin; /* node insert offset (aka auto-offset) margin, but might be useful for later stuff as well */ char pad2; short transopts; /* eUserpref_Translation_Flags */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4183e23fc03..8e24646f3b2 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3338,6 +3338,13 @@ static void rna_def_userdef_view(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem line_width[] = { + {-1, "THIN", 0, "Thin", "Thinner lines than the default"}, + { 0, "AUTO", 0, "Auto", "Automatic line width based on UI scale"}, + { 1, "THICK", 0, "Thick", "Thicker lines than the default"}, + {0, NULL, 0, NULL, NULL} + }; + PropertyRNA *prop; StructRNA *srna; @@ -3355,6 +3362,12 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_float_default(prop, 1.0f); RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); + prop = RNA_def_property(srna, "ui_line_width", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, line_width); + RNA_def_property_ui_text(prop, "UI Line Width", + "Changes the thickness of lines and points in the interface"); + RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); + /* display */ prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 595ccc94584..efa0932ba92 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -416,12 +416,12 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) void WM_window_set_dpi(wmWindow *win) { - int auto_dpi = GHOST_GetDPIHint(win->ghostwin); + float auto_dpi = GHOST_GetDPIHint(win->ghostwin); /* Clamp auto DPI to 96, since our font/interface drawing does not work well * with lower sizes. The main case we are interested in supporting is higher * DPI. If a smaller UI is desired it is still possible to adjust UI scale. */ - auto_dpi = MAX2(auto_dpi, 96); + auto_dpi = max_ff(auto_dpi, 96.0f); /* Lazily init UI scale size, preserving backwards compatibility by * computing UI scale from ratio of previous DPI and auto DPI */ @@ -441,13 +441,16 @@ void WM_window_set_dpi(wmWindow *win) /* Blender's UI drawing assumes DPI 72 as a good default following macOS * while Windows and Linux use DPI 96. GHOST assumes a default 96 so we * remap the DPI to Blender's convention. */ + auto_dpi *= GHOST_GetNativePixelSize(win->ghostwin); int dpi = auto_dpi * U.ui_scale * (72.0 / 96.0f); /* Automatically set larger pixel size for high DPI. */ - int pixelsize = MAX2(1, dpi / 54); + int pixelsize = max_ii(1, (int)(dpi / 64)); + /* User adjustment for pixel size. */ + pixelsize = max_ii(1, pixelsize + U.ui_line_width); /* Set user preferences globals for drawing, and for forward compatibility. */ - U.pixelsize = GHOST_GetNativePixelSize(win->ghostwin) * pixelsize; + U.pixelsize = pixelsize; U.dpi = dpi / pixelsize; U.virtual_pixel = (pixelsize == 1) ? VIRTUAL_PIXEL_NATIVE : VIRTUAL_PIXEL_DOUBLE; U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72; |