Permalink
Browse files

Update proxy when preferences have changed

  • Loading branch information...
1 parent bb582a4 commit 1b293b7b41c738845f308de7c71fe274b06cb960 @dgud dgud committed Mar 16, 2011
Showing with 13 additions and 2 deletions.
  1. +9 −0 src/wings_pref_dlg.erl
  2. +4 −2 src/wings_proxy.erl
View
@@ -636,6 +636,8 @@ smart_set_value_1(Key, Val, St) ->
wings_file:init_autosave();
proxy_shaded_edge_style ->
clear_proxy_edges(St);
+ proxy_opencl_level ->
+ clear_proxy(St);
new_system_font ->
delayed_set_value(Key, OldVal, Val),
wings_u:message(?__(1,"The change to the system font will take\neffect the next time Wings 3D is started."));
@@ -701,6 +703,13 @@ clear_vertex_dlist() ->
clear_vertex_dlist(D, _) -> D#dlo{vs=none}.
+clear_proxy(St) ->
+ wings_dl:map(fun(D, _) -> clear_proxy(D, St) end, []).
+
+clear_proxy(#dlo{proxy_data=Data}=D, St) ->
+ PD = wings_proxy:invalidate(Data, all),
+ wings_proxy:update(D#dlo{proxy_data=PD}, St).
+
clear_proxy_edges(St) ->
wings_dl:map(fun(D, _) -> clear_proxy_edges(D, St) end, []).
View
@@ -52,7 +52,7 @@ quick_preview(_St) ->
wings_wm:set_prop(workmode, true)
end.
--spec invalidate('none'|#sp{}, 'vab'|'dl'|'edges'|'maybe') ->
+-spec invalidate('none'|#sp{}, 'vab'|'dl'|'edges'|'maybe'|'all') ->
'none'|#sp{}.
invalidate(none, _) -> none;
@@ -70,7 +70,9 @@ invalidate(#sp{faces=none}=Pd, maybe) ->
invalidate(#sp{faces=FL}=Pd, maybe) ->
Pd#sp{faces=[FL]};
invalidate(#sp{}=Pd, edges) ->
- Pd#sp{proxy_edges=none}.
+ Pd#sp{proxy_edges=none};
+invalidate(#sp{}, all) ->
+ none.
smooth_dl(#sp{smooth=Smooth}) when Smooth =/= none -> Smooth;
smooth_dl(#sp{smooth=none, faces=FL}) when FL =/= none -> {[FL,[]], false};

0 comments on commit 1b293b7

Please sign in to comment.