diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-08 01:48:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-08 01:48:23 +0300 |
commit | 0d8416acc7fa39a8519043e6e57006a203622644 (patch) | |
tree | 174da7aca885c66731bc9418a45a923fd53c22ce /source/blender | |
parent | 16160f5fcc1689d8008603442fe31b4edb507fb2 (diff) |
minor edits, no functional changes.
- BGE was getting MCol array and not using it.
- use list lookup functions for getting constraint from pose bone.
- use const char * in more places.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 23 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_window.h | 1 |
14 files changed, 31 insertions, 41 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index f75e4020cb9..2337b95dcbc 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -62,7 +62,7 @@ struct Scene *add_scene(const char *name); struct Base *object_in_scene(struct Object *ob, struct Scene *sce); void set_scene_bg(struct Main *bmain, struct Scene *sce); -struct Scene *set_scene_name(struct Main *bmain, char *name); +struct Scene *set_scene_name(struct Main *bmain, const char *name); struct Scene *copy_scene(struct Scene *sce, int type); void unlink_scene(struct Main *bmain, struct Scene *sce, struct Scene *newsce); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index e653a6198ca..1e3ff7142a1 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -419,7 +419,7 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4 /* ------------ General Target Matrix Tools ---------- */ /* function that sets the given matrix based on given vertex group in mesh */ -static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, float mat[][4]) +static void contarget_get_mesh_mat (Scene *scene, Object *ob, const char *substring, float mat[][4]) { DerivedMesh *dm = NULL; Mesh *me= ob->data; @@ -524,7 +524,7 @@ static void contarget_get_mesh_mat (Scene *scene, Object *ob, char *substring, f } /* function that sets the given matrix based on given vertex group in lattice */ -static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][4]) +static void contarget_get_lattice_mat (Object *ob, const char *substring, float mat[][4]) { Lattice *lt= (Lattice *)ob->data; @@ -582,7 +582,7 @@ static void contarget_get_lattice_mat (Object *ob, char *substring, float mat[][ /* generic function to get the appropriate matrix for most target cases */ /* The cases where the target can be object data have not been implemented */ -static void constraint_target_to_mat4 (Scene *scene, Object *ob, char *substring, float mat[][4], short from, short to, float headtail) +static void constraint_target_to_mat4 (Scene *scene, Object *ob, const char *substring, float mat[][4], short from, short to, float headtail) { /* Case OBJECT */ if (!strlen(substring)) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 95f39db9d6f..b6768a746fb 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -581,7 +581,7 @@ void set_scene_bg(Main *bmain, Scene *scene) } /* called from creator.c */ -Scene *set_scene_name(Main *bmain, char *name) +Scene *set_scene_name(Main *bmain, const char *name) { Scene *sce= (Scene *)find_id("SC", name); if(sce) { diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 798892d452a..94983791289 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -200,7 +200,7 @@ int BLO_has_bfile_extension(char *str); int BLO_is_a_library(const char *path, char *dir, char *group); struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, char *dir); -void BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, char *name, int idcode, short flag); +void BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *name, int idcode, short flag); void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag); /* deprecated */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f53d59135c3..ab11f41baac 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12500,7 +12500,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene) } } -static void append_named_part(const bContext *C, Main *mainl, FileData *fd, char *name, int idcode, short flag) +static void append_named_part(const bContext *C, Main *mainl, FileData *fd, const char *name, int idcode, short flag) { Scene *scene= CTX_data_scene(C); Object *ob; @@ -12566,7 +12566,7 @@ static void append_named_part(const bContext *C, Main *mainl, FileData *fd, char } } -void BLO_library_append_named_part(const bContext *C, Main *mainl, BlendHandle** bh, char *name, int idcode, short flag) +void BLO_library_append_named_part(const bContext *C, Main *mainl, BlendHandle** bh, const char *name, int idcode, short flag) { FileData *fd= (FileData*)(*bh); append_named_part(C, mainl, fd, name, idcode, flag); @@ -12744,7 +12744,7 @@ void BLO_library_append_end(const bContext *C, struct Main *mainl, BlendHandle** /* tentatively removed, Python should be able to use the split functions too: */ /* BLO_library_append_begin, BLO_library_append_end, BLO_library_append_named_part */ #if 0 -void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, +void BLO_script_library_append(BlendHandle **bh, char *dir, const char *name, int idcode, short flag, Main *mainvar, Scene *scene, ReportList *reports) { FileData *fd= (FileData*)(*bh); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 386bbc0a236..0e483750e1a 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -194,7 +194,7 @@ int paintface_minmax(struct Object *ob, float *min, float *max); struct bDeformGroup *ED_vgroup_add(struct Object *ob); struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name); void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup); -void ED_vgroup_select_by_name(struct Object *ob, char *name); +void ED_vgroup_select_by_name(struct Object *ob, const char *name); void ED_vgroup_data_create(struct ID *id); int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot); int ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 7dde0a73d56..154a263cd7b 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -472,8 +472,8 @@ extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *s struct ThemeUI; void ui_widget_color_init(struct ThemeUI *tui); -void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state); -void ui_draw_preview_item(struct uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state); +void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state); +void ui_draw_preview_item(struct uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state); /* interface_style.c */ void uiStyleInit(void); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index b62108136be..a431fc300d0 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3080,7 +3080,7 @@ void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) /* helper call to draw a menu item without button */ /* state: UI_ACTIVE or 0 */ -void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state) +void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state) { uiWidgetType *wt= widget_type(UI_WTYPE_MENU_ITEM); rcti _rect= *rect; @@ -3126,7 +3126,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconid, } } -void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state) +void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int iconid, int state) { rcti trect = *rect; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index bd7983004eb..c673ea0fd2d 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -550,7 +550,7 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum) return get_vert_def_nr(ob, def_nr, vertnum); } -void ED_vgroup_select_by_name(Object *ob, char *name) +void ED_vgroup_select_by_name(Object *ob, const char *name) { /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */ ob->actdef= defgroup_name_index(ob, name) + 1; } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 96999aacad8..9eae26ef8bb 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -47,6 +47,7 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BKE_action.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_library.h" @@ -1079,25 +1080,15 @@ static void draw_default_sensor_header(bSensor *sens, "Invert the level (output) of this sensor"); } -static void get_armature_bone_constraint(Object *ob, char *posechannel, char *constraint_name, bConstraint **constraint) +static void get_armature_bone_constraint(Object *ob, const char *posechannel, const char *constraint_name, bConstraint **constraint) { /* check that bone exist in the active object */ if (ob->type == OB_ARMATURE && ob->pose) { - bPoseChannel *pchan; - bPose *pose = ob->pose; - for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { - if (!strcmp(pchan->name, posechannel)) { - /* found it, now look for constraint channel */ - bConstraint *con; - for (con=pchan->constraints.first; con; con=con->next) { - if (!strcmp(con->name, constraint_name)) { - /* found it, all ok */ - *constraint = con; - return; - } - } - /* didn't find constraint, make empty */ - return; + bPoseChannel *pchan= get_pose_channel(ob->pose, posechannel); + if(pchan) { + bConstraint *con= BLI_findstring(&pchan->constraints, constraint_name, offsetof(bConstraint, name)); + if(con) { + *constraint= con; } } } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index b29664a09a5..3007cfc4cb4 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1244,7 +1244,7 @@ void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index) } } -static int outliner_filter_has_name(TreeElement *te, char *name, int flags) +static int outliner_filter_has_name(TreeElement *te, const char *name, int flags) { #if 0 int found= 0; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index eb69374b5b7..6f9ad138bac 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -89,7 +89,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c) return st->cwidth; } -int text_font_width(SpaceText *UNUSED(st), char *str) +int text_font_width(SpaceText *UNUSED(st), const char *str) { return BLF_width(mono, str); } @@ -124,7 +124,7 @@ static void flatten_string_append(FlattenString *fs, char c, int accum) fs->pos++; } -int flatten_string(SpaceText *st, FlattenString *fs, char *in) +int flatten_string(SpaceText *st, FlattenString *fs, const char *in) { int r = 0, i = 0; @@ -645,7 +645,7 @@ void wrap_offset_in_line(SpaceText *st, ARegion *ar, TextLine *linein, int cursi } } -int text_get_char_pos(SpaceText *st, char *line, int cur) +int text_get_char_pos(SpaceText *st, const char *line, int cur) { int a=0, i; @@ -961,7 +961,7 @@ int text_get_visible_lines_no(SpaceText *st, int lineno) return drawcache->line_height[lineno]; } -int text_get_visible_lines(SpaceText *st, ARegion *ar, char *str) +int text_get_visible_lines(SpaceText *st, ARegion *ar, const char *str) { int i, j, start, end, max, lines, chars; char ch; diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index cc957141ed2..5f6b2e05ba7 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -45,7 +45,7 @@ struct wmWindowManager; void draw_text_main(struct SpaceText *st, struct ARegion *ar); int text_font_width_character(struct SpaceText *st); -int text_font_width(struct SpaceText *st, char *str); +int text_font_width(struct SpaceText *st, const char *str); void text_update_line_edited(struct TextLine *line); void text_update_edited(struct Text *text); @@ -79,13 +79,13 @@ typedef struct FlattenString { int pos, len; } FlattenString; -int flatten_string(struct SpaceText *st, FlattenString *fs, char *in); +int flatten_string(struct SpaceText *st, FlattenString *fs, const char *in); void flatten_string_free(FlattenString *fs); int wrap_width(struct SpaceText *st, struct ARegion *ar); void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc); void wrap_offset_in_line(struct SpaceText *st, struct ARegion *ar, struct TextLine *linep, int cursin, int *offl, int *offc); -int text_get_char_pos(struct SpaceText *st, char *line, int cur); +int text_get_char_pos(struct SpaceText *st, const char *line, int cur); void text_drawcache_tag_update(struct SpaceText *st, int full); void text_free_caches(struct SpaceText *st); @@ -95,7 +95,7 @@ int text_file_modified(struct Text *text); int text_do_suggest_select(struct SpaceText *st, struct ARegion *ar); void text_pop_suggest_list(void); -int text_get_visible_lines(struct SpaceText *st, struct ARegion *ar, char *str); +int text_get_visible_lines(struct SpaceText *st, struct ARegion *ar, const char *str); int text_get_span_wrap(struct SpaceText *st, struct ARegion *ar, struct TextLine *from, struct TextLine *to); int text_get_total_lines(struct SpaceText *st, struct ARegion *ar); diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index b0aec50e228..9c82f276acf 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -55,7 +55,6 @@ void wm_window_set_size (wmWindow *win, int width, int height); void wm_window_get_size (wmWindow *win, int *width_r, int *height_r); void wm_window_get_size_ghost (wmWindow *win, int *width_r, int *height_r); void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r); -void wm_window_set_title (wmWindow *win, char *title); void wm_window_swap_buffers (wmWindow *win); void wm_get_cursor_position (wmWindow *win, int *x, int *y); |