diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-22 15:45:37 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-22 15:45:37 +0300 |
commit | 0fe908181e7312ab7997a9d7fc12ff1504ff524f (patch) | |
tree | e7f9357815c8b22b05b685ed81cf82faf885e3a7 /source/blender/editors/animation/fmodifier_ui.c | |
parent | 220669d1fd5fe04f50b9fc6413d86015350130e8 (diff) |
Just a few compiler warnings...
Diffstat (limited to 'source/blender/editors/animation/fmodifier_ui.c')
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index d055667f264..35c578d3ea8 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -330,40 +330,44 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short /* draw settings for sound modifier */ static void draw_modifier__sound(const bContext *C, uiLayout *layout, ID *id, FModifier *fcm, short width) { + FMod_Sound *data= (FMod_Sound *)fcm->data; uiLayout *split, *col; PointerRNA ptr; - FMod_Sound *data= (FMod_Sound *)fcm->data; - + /* init the RNA-pointer */ RNA_pointer_create(id, &RNA_FModifierSound, fcm, &ptr); - + /* sound */ - uiTemplateID(layout, C, &ptr, "sound", NULL, "sound.open", NULL); - - if(data->sound) + uiTemplateID(layout, (bContext*)C, &ptr, "sound", NULL, "sound.open", NULL); + + if (data->sound) { - if(data->sound->cache) + /* only sounds that are cached can be used, so display error if not cached */ + if (data->sound->cache) { /* blending mode */ uiItemR(layout, NULL, 0, &ptr, "modification", 0); - + /* split into 2 columns */ split= uiLayoutSplit(layout, 0.5f); - + /* col 1 */ col= uiLayoutColumn(split, 0); uiItemR(col, NULL, 0, &ptr, "strength", 0); - + /* col 2 */ col= uiLayoutColumn(split, 0); uiItemR(col, NULL, 0, &ptr, "delay", 0); } else { - PointerRNA ptr2; - RNA_id_pointer_create(data->sound, &ptr2); + PointerRNA id_ptr; + + RNA_id_pointer_create((ID *)data->sound, &id_ptr); + + /* error message with a button underneath allowing users to rectify the issue */ uiItemL(layout, "Sound must be cached.", ICON_ERROR); - uiItemR(layout, NULL, 0, &ptr2, "caching", UI_ITEM_R_TOGGLE); + uiItemR(layout, NULL, 0, &id_ptr, "caching", UI_ITEM_R_TOGGLE); } } } |