Make the pie menu smoother by using the same amount of steps for the washer as back in V1 times

Sat, 16 Apr 2016 00:47:45 +0200

author
Ansariel
date
Sat, 16 Apr 2016 00:47:45 +0200
changeset 48949
1cd8af2124d0
parent 48948
6811e15aeb67
child 48950
b08e631b4fb7

Make the pie menu smoother by using the same amount of steps for the washer as back in V1 times

indra/newview/piemenu.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/piemenu.cpp	Fri Apr 15 21:58:22 2016 +0200
     1.2 +++ b/indra/newview/piemenu.cpp	Sat Apr 16 00:47:45 2016 +0200
     1.3 @@ -293,6 +293,8 @@
     1.4  		borderColor %= 0.f;
     1.5  	}
     1.6  
     1.7 +	S32 steps = 100;
     1.8 +
     1.9  	// remember to take the UI scaling into account
    1.10  	LLVector2 scale = gViewerWindow->getDisplayScale();
    1.11  
    1.12 @@ -300,7 +302,7 @@
    1.13  	gGL.translatef(r.getWidth() / 2.f * scale.mV[VX], r.getHeight() / 2.f * scale.mV[VY], 0.f);
    1.14  
    1.15  	// draw the general pie background
    1.16 -	gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, 32, bgColor, borderColor);
    1.17 +	gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, steps, bgColor, borderColor);
    1.18  
    1.19  	// set up an item list iterator to point at the beginning of the item list
    1.20  	slice_list_t::iterator cur_item_iter;
    1.21 @@ -427,11 +429,11 @@
    1.22  				}
    1.23  
    1.24  				// draw the currently highlighted pie slice
    1.25 -				gl_washer_segment_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, segmentStart + 0.02f, segmentStart + F_PI / 4.f - 0.02f, 4, selectedColor, borderColor);
    1.26 +				gl_washer_segment_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, segmentStart + 0.02f, segmentStart + F_PI / 4.f - 0.02f, steps / 8, selectedColor, borderColor);
    1.27  			}
    1.28  		}
    1.29  		// draw the divider line for this slice
    1.30 -		gl_washer_segment_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, segmentStart - 0.02f, segmentStart + 0.02f, 4, lineColor, borderColor);
    1.31 +		gl_washer_segment_2d(PIE_OUTER_SIZE * factor, PIE_INNER_SIZE, segmentStart - 0.02f, segmentStart + 0.02f, steps / 8, lineColor, borderColor);
    1.32  
    1.33  		// draw the slice labels around the center
    1.34  		mFont->renderUTF8(label,
    1.35 @@ -451,9 +453,9 @@
    1.36  	// draw inner and outer circle, outer only if it was not the first click
    1.37  	if (!mFirstClick)
    1.38  	{
    1.39 -		gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_OUTER_SIZE * factor - 2.f, 32, lineColor, borderColor);
    1.40 +		gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_OUTER_SIZE * factor - 2.f, steps, lineColor, borderColor);
    1.41  	}
    1.42 -	gl_washer_2d(PIE_INNER_SIZE + 1, PIE_INNER_SIZE - 1, 16, borderColor, lineColor);
    1.43 +	gl_washer_2d(PIE_INNER_SIZE + 1, PIE_INNER_SIZE - 1, steps, borderColor, lineColor);
    1.44  
    1.45  	// restore OpenGL drawing matrix
    1.46  	gGL.popMatrix();

mercurial