Skip to content

Commit

Permalink
Merge pull request #34 from Skrelpoid/develop
Browse files Browse the repository at this point in the history
getRawDeltaTime is no longer manipulated by SuperFastMode
  • Loading branch information
Skrelpoid authored Feb 2, 2019
2 parents dfd09e1 + ad1625d commit 4725210
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ Copy the SuperFastMode.jar file into the mods folder too. Then, start up ModTheS

Enjoy your new lightning fast experience!

## Compatibility with other mods
Because SuperFastMode speeds up the game by means of patching the engine, other mods get sped up too.
This is good if the other mod does not depend on an accurate time difference between frames.
However if the other mods need this, e.g. to calculate when 5 minutes are over, this will screw up the measurement
For this, the other mods should use `Gdx.graphics.getRawDeltaTime()` instead of `Gdx.graphics.getDeltaTime()`.
The implementation is exactly the same (it just returns the graphics object's `deltaTime` field, but this method won't be patched by SuperFastMode

## Building (only important for Modders)
This Mod uses Gradle for building. After making changes, you can double click buildMod.cmd
(or run ./gradlew build or gradlew build in a console) to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,4 @@ public void edit(FieldAccess f) throws CannotCompileException {
}
}

@SpirePatch(clz = com.badlogic.gdx.backends.lwjgl.LwjglGraphics.class, method = "getRawDeltaTime")
public static class RawDeltaPatch {
public static ExprEditor Instrument() {
return new ExprEditor() {
@Override
public void edit(FieldAccess f) throws CannotCompileException {
if (f.getFieldName().equals("deltaTime")) {
f.replace("{ $_ = skrelpoid.superfastmode.SuperFastMode.getMultDelta($0); }");
}
}
};
}
}
}

0 comments on commit 4725210

Please sign in to comment.