Skip to content

Commit

Permalink
Merge branch 'rj/show_backfaces'
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Jones committed Oct 16, 2010
2 parents 2626a28 + 7072fad commit 7477501
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/wings_proxy.erl
Expand Up @@ -241,7 +241,7 @@ draw_1(#dlo{proxy_data=#sp{src_we=We}} = D, Dl, Wire,
gl:blendColor(0, 0, 0, Opacity)
end
end,
case wings_we:is_open(We) of
case wings_we:is_open(We) andalso wings_pref:get_value(show_backfaces) of
true -> gl:disable(?GL_CULL_FACE);
false -> ignore
end,
Expand Down
4 changes: 2 additions & 2 deletions src/wings_render.erl
Expand Up @@ -186,7 +186,7 @@ render_plain(#dlo{work=Faces,edges=Edges,open=Open,
polygonOffset(2),
gl:shadeModel(?GL_SMOOTH),
enable_lighting(SceneLights),
case Open of
case Open andalso wings_pref:get_value(show_backfaces) of
false ->
wings_dl:call(Faces);
true ->
Expand Down Expand Up @@ -291,7 +291,7 @@ render_smooth(#dlo{work=Work,edges=Edges,smooth=Smooth0,transparent=Trans0,
gl:depthMask(?GL_TRUE)
end,

case Open of
case Open andalso wings_pref:get_value(show_backfaces) of
false -> ok;
true -> gl:disable(?GL_CULL_FACE)
end,
Expand Down
9 changes: 8 additions & 1 deletion src/wings_view.erl
Expand Up @@ -60,6 +60,8 @@ menu(#st{views={CurrentView,Views}}=St) ->
{?__(11,"Toggle Wireframe"),toggle_wireframe,
?__(12,"Toggle display mode for selected objects (same for all objects if nothing is selected)"),wireframe_crossmark(St)},
{?__(19,"Show Edges"),show_edges,?__(20,"Show edges in workmode"),crossmark(show_edges)},
{?__(72,"Show Backfaces"),show_backfaces,
?__(73,"Show backfaces when there is a hole or hiddwn faces in an object"),crossmark(show_backfaces)},
{?__(21,"Show Wireframe Backfaces"),show_wire_backfaces,
?__(22,"Show wireframe backfaces"),crossmark(show_wire_backfaces)},
separator,
Expand Down Expand Up @@ -334,6 +336,10 @@ command(show_edges, St) ->
wings_dl:map(fun(D, _) -> D#dlo{hard=none} end, []),
St
end;
command(show_backfaces, St) ->
Bool = wings_pref:get_value(show_backfaces),
wings_pref:set_value(show_backfaces, not Bool),
St;
command({highlight_aim,{Type,{Selmode,Sel,MM}}}, St) ->
highlight_aim(Type, Selmode, Sel, MM, St),
St;
Expand All @@ -349,7 +355,7 @@ command(frame, St) ->
command(frame_mode, St) ->
Bool = wings_pref:get_value(frame_disregards_mirror),
wings_pref:set_value(frame_disregards_mirror, not Bool),
St;
St;
command({views,Views}, St) ->
views(Views, St);
command({along,Axis}, St) ->
Expand Down Expand Up @@ -842,6 +848,7 @@ set_current(View) ->

init() ->
wings_pref:set_default(show_edges, true),
wings_pref:set_default(show_backfaces, true),
wings_pref:set_default(number_of_lights, 1),
wings_pref:set_default(number_of_shaders, 1),
wings_pref:set_default(show_normals, false),
Expand Down

0 comments on commit 7477501

Please sign in to comment.