Skip to content

Commit

Permalink
Floated the doubles and NaNed the Nan
Browse files Browse the repository at this point in the history
  • Loading branch information
bmabsout authored Feb 8, 2024
1 parent 3381240 commit aa3ca9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/main/java/com/OxGames/OxShell/Wallpaper/Shader.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,16 @@ protected void draw() {

frame++;
long currentTime = System.currentTimeMillis() - startTime;
float secondsElapsed = (currentTime) / 1000.0; // will be input into shader as iTime
float deltaTime = (currentTime - prevTime) / 1000.0;
float secondsElapsed = (currentTime) / 1000f; // will be input into shader as iTime
float deltaTime = (currentTime - prevTime) / 1000f;
float fps = 1 / deltaTime;
prevTime = currentTime;
if (secondsElapsed > 60 * 60 * 24 || Double.isNaN(fps) || Double.isNan(deltaTime)) {
if (secondsElapsed > 60 * 60 * 24 || Float.isNaN(fps) || Float.isNaN(deltaTime)) {
frame = 0;
startTime = System.currentTimeMillis();
prevTime = 0;
secondsElapsed = 0;
fps = 60.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 aa3ca9b

Please sign in to comment.