- 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.
XChangeProperty(m_display, m_window,
name, utf8str, 8, PropModeReplace,
(const unsigned char*) title.ReadPtr(),
- strlen(title.ReadPtr()));
+ title.Length());
// This should convert to valid x11 string
// and getTitle would need matching change
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);
/* ------------ 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;
}
/* 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;
/* 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)) {
}
/* 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) {
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 */
}
}
-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;
}
}
-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);
/* 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);
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);
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);
/* 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;
}
}
-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;
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;
}
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_library.h"
"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;
}
}
}
}
}
-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;
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);
}
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;
}
}
-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;
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;
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);
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);
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);
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);
memcpy(gattribs, ¤t_gpu_attribs, sizeof(GPUVertexAttribs));
return 1;
}
+
+/*
static int CheckTexfaceDM(void *mcol, int index)
{
}
return 0;
}
+*/
static int CheckTexDM(MTFace *tface, MCol *mcol, int matnr)
{
current_ms = &ms;
current_mesh = ms.m_mesh;
current_wireframe = wireframe;
- MCol *mcol = (MCol*)ms.m_pDerivedMesh->getFaceDataArray(ms.m_pDerivedMesh, CD_MCOL);
+ // MCol *mcol = (MCol*)ms.m_pDerivedMesh->getFaceDataArray(ms.m_pDerivedMesh, CD_MCOL); /* UNUSED */
// handle two-side
if (current_polymat->GetDrawingMode() & RAS_IRasterizer::KX_TWOSIDE)