Skip to content

Commit

Permalink
Merge pull request #25 from bmabsout/patch-1
Browse files Browse the repository at this point in the history
Added defensive checks for resetting iTime
  • Loading branch information
oxters168 authored Feb 8, 2024
2 parents 66ea5c3 + aa3ca9b commit ace2988
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/com/OxGames/OxShell/Wallpaper/Shader.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@ protected void draw() {
float deltaTime = (currentTime - prevTime) / 1000f;
float fps = 1 / deltaTime;
prevTime = currentTime;
if (secondsElapsed > 60 * 60 * 24) {
if (secondsElapsed > 60 * 60 * 24 || Float.isNaN(fps) || Float.isNaN(deltaTime)) {
frame = 0;
startTime = System.currentTimeMillis();
prevTime = 0;
secondsElapsed = 0;
fps = 60f;
}
//if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
LocalDateTime localDateTime = LocalDateTime.now();
Expand Down

0 comments on commit ace2988

Please sign in to comment.