Show the default mouse cursor during replays.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-03-09 19:54:28 -04:00
parent f6412f06e8
commit fa6132808e
4 changed files with 51 additions and 21 deletions

View File

@@ -34,7 +34,6 @@ import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -46,8 +45,6 @@ import java.util.Scanner;
import javax.imageio.ImageIO;
import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Cursor;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Animation;
@@ -131,6 +128,8 @@ public class Utils {
public static void init(GameContainer container, StateBasedGame game)
throws SlickException {
input = container.getInput();
int width = container.getWidth();
int height = container.getHeight();
// game settings
container.setTargetFrameRate(Options.getTargetFPS());
@@ -141,20 +140,6 @@ public class Utils {
container.setAlwaysRender(true);
container.setUpdateOnlyWhenVisible(false);
int width = container.getWidth();
int height = container.getHeight();
// set the cursor
try {
// hide the native cursor
int min = Cursor.getMinCursorSize();
IntBuffer tmp = BufferUtils.createIntBuffer(min * min);
Cursor emptyCursor = new Cursor(min, min, min/2, min/2, 1, tmp, null);
container.setMouseCursor(emptyCursor, 0, 0);
} catch (LWJGLException e) {
ErrorHandler.error("Failed to set the cursor.", e, true);
}
// create fonts
float fontBase;
if (height <= 600)