android: frontend: Further simplify show FPS overlay text.
This commit is contained in:
parent
c58623d289
commit
f0e3e13761
@ -18,8 +18,6 @@ import android.widget.Button;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
|
|
||||||
import org.citra.citra_android.NativeLibrary;
|
import org.citra.citra_android.NativeLibrary;
|
||||||
import org.citra.citra_android.R;
|
import org.citra.citra_android.R;
|
||||||
import org.citra.citra_android.activities.EmulationActivity;
|
import org.citra.citra_android.activities.EmulationActivity;
|
||||||
@ -190,12 +188,13 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||||||
|
|
||||||
perfStatsUpdater = () ->
|
perfStatsUpdater = () ->
|
||||||
{
|
{
|
||||||
final DecimalFormat df = new DecimalFormat("#.#");
|
final double[] perfStats = NativeLibrary.GetPerfStats();
|
||||||
double[] perfStats = NativeLibrary.GetPerfStats();
|
if (perfStats[FPS] > 0) {
|
||||||
mPerfStats.setText(String.format("FPS: %s Speed: %s%%", df.format(perfStats[FPS]),
|
mPerfStats.setText(String.format("FPS: %d Speed: %d%%", (int)(perfStats[FPS] + 0.5),
|
||||||
df.format(perfStats[SPEED] * 100.0)));
|
(int)(perfStats[SPEED] * 100.0 + 0.5)));
|
||||||
|
}
|
||||||
|
|
||||||
perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 2000 /* 1s */);
|
perfStatsUpdateHandler.postDelayed(perfStatsUpdater, 3000);
|
||||||
};
|
};
|
||||||
perfStatsUpdateHandler.post(perfStatsUpdater);
|
perfStatsUpdateHandler.post(perfStatsUpdater);
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
android:linksClickable="false"
|
android:linksClickable="false"
|
||||||
android:longClickable="false"
|
android:longClickable="false"
|
||||||
android:shadowColor="@android:color/black"
|
android:shadowColor="@android:color/black"
|
||||||
android:text="TextView"
|
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user