moving stuff around
This commit is contained in:
@@ -24,18 +24,13 @@ import org.lwjgl.openal.AL;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.DisplayMode;
|
||||
import org.newdawn.slick.Graphics;
|
||||
import org.newdawn.slick.opengl.ImageIOImageData;
|
||||
import org.newdawn.slick.opengl.InternalTextureLoader;
|
||||
import org.newdawn.slick.opengl.LoadableImageData;
|
||||
import org.newdawn.slick.opengl.TGAImageData;
|
||||
import org.newdawn.slick.opengl.renderer.Renderer;
|
||||
import org.newdawn.slick.opengl.renderer.SGL;
|
||||
import org.newdawn.slick.util.Log;
|
||||
import org.newdawn.slick.util.ResourceLoader;
|
||||
import yugecin.opsudance.states.EmptyRedState;
|
||||
import yugecin.opsudance.utils.GLHelper;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -97,6 +92,7 @@ public class DisplayContainer {
|
||||
// temp displaymode to not flash the screen with a 1ms black window
|
||||
Display.setDisplayMode(new DisplayMode(100, 100));
|
||||
Display.create();
|
||||
GLHelper.setIcons(new String[] { "icon16.png", "icon32.png" });
|
||||
setDisplayMode(640, 480, false);
|
||||
} catch (LWJGLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -181,29 +177,4 @@ public class DisplayContainer {
|
||||
return (Sys.getTime() * 1000) / Sys.getTimerResolution();
|
||||
}
|
||||
|
||||
public void setIcons(String[] refs) {
|
||||
ByteBuffer[] bufs = new ByteBuffer[refs.length];
|
||||
|
||||
for (int i = 0; i < refs.length; i++) {
|
||||
LoadableImageData data;
|
||||
boolean flip = true;
|
||||
|
||||
if (refs[i].endsWith(".tga")) {
|
||||
data = new TGAImageData();
|
||||
} else {
|
||||
flip = false;
|
||||
data = new ImageIOImageData();
|
||||
}
|
||||
|
||||
try {
|
||||
bufs[i] = data.loadImage(ResourceLoader.getResourceAsStream(refs[i]), flip, false, null);
|
||||
} catch (Exception e) {
|
||||
Log.error("failed to set the icon", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Display.setIcon(bufs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user