android: frontend: Further simplify show FPS overlay text.

This commit is contained in:
bunnei 2019-09-01 03:51:31 -04:00
parent 803b999a57
commit a0c4c702ab
2 changed files with 6 additions and 8 deletions

View File

@ -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);

View File

@ -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" />