diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-08 16:35:14 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-08 16:35:14 +0400 |
commit | ec33687d6cf74775e37fdc1a14e22dea08289cb1 (patch) | |
tree | a98875cf3deae05c46cdd70192858b8844ab1ea4 /source/blender/windowmanager | |
parent | 724746dba2deed8e336fc66b36bfc3b5b1858a8e (diff) | |
parent | 7b9adab594d1cc670d642b56ae8d76069ce91107 (diff) |
Merged changes in the trunk up to revision 52815.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 45 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 58 |
4 files changed, 35 insertions, 72 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 1b8bcd51564..c9f0bbffc63 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -183,7 +183,7 @@ void WM_init(bContext *C, int argc, const char **argv) GPU_extensions_init(); GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); GPU_set_anisotropic(U.anisotropic_filter); - GPU_set_gpu_mipmapping(); + GPU_set_gpu_mipmapping(U.use_gpu_mipmap); UI_init(); } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 4fe1e3b64ab..3739462ac2c 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -392,7 +392,7 @@ int WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi) } BLI_freelinkN(&keymap->items, kmi); - WM_keyconfig_update_tag(keymap, kmi); + WM_keyconfig_update_tag(keymap, NULL); return TRUE; } else { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 80ceb5700e5..c555f771a48 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1523,49 +1523,6 @@ static void WM_OT_splash(wmOperatorType *ot) /* ***************** Search menu ************************* */ -static void operator_call_cb(struct bContext *C, void *UNUSED(arg1), void *arg2) -{ - wmOperatorType *ot = arg2; - - if (ot) - WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); -} - -static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items) -{ - GHashIterator *iter = WM_operatortype_iter(); - - for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) { - wmOperatorType *ot = BLI_ghashIterator_getValue(iter); - - if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0) - continue; - - if (BLI_strcasestr(ot->name, str)) { - if (WM_operator_poll((bContext *)C, ot)) { - char name[256]; - int len = strlen(ot->name); - - /* display name for menu, can hold hotkey */ - BLI_strncpy(name, ot->name, sizeof(name)); - - /* check for hotkey */ - if (len < sizeof(name) - 6) { - if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, TRUE, - &name[len + 1], sizeof(name) - len - 1)) - { - name[len] = '|'; - } - } - - if (0 == uiSearchItemAdd(items, name, ot, 0)) - break; - } - } - } - BLI_ghashIterator_free(iter); -} - static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_op)) { static char search[256] = ""; @@ -1578,7 +1535,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_ uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU); but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); + uiOperatorSearch_But(but); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxHeight(), uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL); diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index d29d08a5431..8b387196da7 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -82,7 +82,7 @@ typedef struct PlayState { /* playback state */ short direction; - short next; + short next_frame; short once; short turbo; short pingpong; @@ -207,6 +207,21 @@ static int fromdisk = FALSE; static float zoomx = 1.0, zoomy = 1.0; static double ptottime = 0.0, swaptime = 0.04; +static PlayAnimPict *playanim_step(PlayAnimPict *playanim, int step) +{ + if (step > 0) { + while (step-- && playanim) { + playanim = playanim->next; + } + } + else if (step < 0) { + while (step++ && playanim) { + playanim = playanim->prev; + } + } + return playanim; +} + static int pupdate_time(void) { static double ltime; @@ -485,10 +500,10 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) ps->wait2 = FALSE; if (g_WS.qual & WS_QUAL_SHIFT) { ps->picture = picsbase.first; - ps->next = 0; + ps->next_frame = 0; } else { - ps->next = -1; + ps->next_frame = -1; } } break; @@ -496,10 +511,10 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) if (val) { ps->wait2 = FALSE; if (g_WS.qual & WS_QUAL_SHIFT) { - ps->next = ps->direction = -1; + ps->next_frame = ps->direction = -1; } else { - ps->next = -10; + ps->next_frame = -10; ps->sstep = TRUE; } } @@ -510,10 +525,10 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) ps->wait2 = FALSE; if (g_WS.qual & WS_QUAL_SHIFT) { ps->picture = picsbase.last; - ps->next = 0; + ps->next_frame = 0; } else { - ps->next = 1; + ps->next_frame = 1; } } break; @@ -521,10 +536,10 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) if (val) { ps->wait2 = FALSE; if (g_WS.qual & WS_QUAL_SHIFT) { - ps->next = ps->direction = 1; + ps->next_frame = ps->direction = 1; } else { - ps->next = 10; + ps->next_frame = 10; ps->sstep = TRUE; } } @@ -535,7 +550,8 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) if (val) { if (g_WS.qual & WS_QUAL_SHIFT) { if (ps->curframe_ibuf) - printf(" Name: %s | Speed: %.2f frames/s\n", ps->curframe_ibuf->name, ps->fstep / swaptime); + printf(" Name: %s | Speed: %.2f frames/s\n", + ps->curframe_ibuf->name, ps->fstep / swaptime); } else { swaptime = ps->fstep / 5.0; @@ -668,7 +684,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void) } ps->sstep = TRUE; ps->wait2 = FALSE; - ps->next = 0; + ps->next_frame = 0; } break; } @@ -780,7 +796,7 @@ void WM_main_playanim(int argc, const char **argv) /* ps.doubleb = TRUE;*/ /* UNUSED */ ps.go = TRUE; ps.direction = TRUE; - ps.next = 1; + ps.next_frame = 1; ps.once = FALSE; ps.turbo = FALSE; ps.pingpong = FALSE; @@ -1033,7 +1049,7 @@ void WM_main_playanim(int argc, const char **argv) } } - ps.next = ps.direction; + ps.next_frame = ps.direction; while ((hasevent = GHOST_ProcessEvents(g_WS.ghost_system, 0) || ps.wait2 != 0)) { @@ -1062,15 +1078,10 @@ void WM_main_playanim(int argc, const char **argv) pupdate_time(); - if (ps.picture && ps.next) { + if (ps.picture && ps.next_frame) { /* always at least set one step */ while (ps.picture) { - if (ps.next < 0) { - ps.picture = ps.picture->prev; - } - else { - ps.picture = ps.picture->next; - } + ps.picture = playanim_step(ps.picture, ps.next_frame); if (ps.once && ps.picture != NULL) { if (ps.picture->next == NULL) { @@ -1085,12 +1096,7 @@ void WM_main_playanim(int argc, const char **argv) ptottime -= swaptime; } if (ps.picture == NULL && ps.sstep) { - if (ps.next < 0) { - ps.picture = picsbase.last; - } - else if (ps.next > 0) { - ps.picture = picsbase.first; - } + ps.picture = playanim_step(ps.picture, ps.next_frame); } } if (ps.go == FALSE) { |