这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@IriaSomobu
Copy link

This will remove compile errors on modern javac.

Note: android.util.FloatMath class was deprecated and all its methods was removed in API version 23 and above.

Also adding (Object) cast before bundle.getCollection() call will supress Incompatible types error in Android Studio.

Comment on lines 89 to 94
float a = i * 3.1415926f * 2 / nRays;
v[0] = FloatMath.cos( a ) * radius;
v[1] = FloatMath.sin( a ) * radius;
v[0] = (float)Math.cos( a ) * radius;
v[1] = (float)Math.sin( a ) * radius;
vertices.put( v );

a += 3.1415926f * 2 / nRays / 2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our static analysis engine detects that your pull request includes a change that uses the rough value of Math.PI. According to the best practice, it's recommended to use the predefined library constant for code clarity and better precision.

@LingASDJ
Copy link

Good,But The Pixel Dungeon Not Update.

@IriaSomobu
Copy link
Author

@LingASDJ yep, but maybe this code will help someone else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants