Minor code style changes from #102.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-06-28 02:38:50 -05:00
parent b6a99f8bdd
commit 52cb5d24f0
3 changed files with 13 additions and 19 deletions

View File

@ -81,8 +81,7 @@ public class CurveRenderState {
* {@link #draw(org.newdawn.slick.Color, org.newdawn.slick.Color, itdelatrisu.opsu.objects.curves.Vec2f[])} * {@link #draw(org.newdawn.slick.Color, org.newdawn.slick.Color, itdelatrisu.opsu.objects.curves.Vec2f[])}
* are undone. * are undone.
*/ */
public static void shutdown() public static void shutdown() {
{
staticState.shutdown(); staticState.shutdown();
FrameBufferCache.shutdown(); FrameBufferCache.shutdown();
} }
@ -149,7 +148,7 @@ public class CurveRenderState {
} }
/** /**
* Discard the cache mapping for this curve object * Discard the cache mapping for this curve object.
*/ */
public void discardCache() { public void discardCache() {
fbo = null; fbo = null;
@ -464,16 +463,13 @@ public class CurveRenderState {
/** /**
* Cleanup any OpenGL objects that may have been initialized. * Cleanup any OpenGL objects that may have been initialized.
*/ */
private void shutdown() private void shutdown() {
{ if (gradientTexture != 0) {
if(gradientTexture != 0)
{
GL11.glDeleteTextures(gradientTexture); GL11.glDeleteTextures(gradientTexture);
gradientTexture = 0; gradientTexture = 0;
} }
if(program != 0) if (program != 0) {
{
GL20.glDeleteProgram(program); GL20.glDeleteProgram(program);
program = 0; program = 0;
attribLoc = 0; attribLoc = 0;

View File

@ -124,15 +124,14 @@ public class FrameBufferCache {
/** /**
* Clear the cache pool of Framebuffers. * Clear the cache pool of Framebuffers.
* If there were any previous Framebuffers in the cache delete them * If there were any previous Framebuffers in the cache, delete them.
* this is necessary for cases when the game gets re-started with a * <p>
* different resolution without closing the process * This is necessary for cases when the game gets restarted with a
* different resolution without closing the process.
*/ */
public static void shutdown() public static void shutdown() {
{
FrameBufferCache fbcInstance = FrameBufferCache.getInstance(); FrameBufferCache fbcInstance = FrameBufferCache.getInstance();
for(Rendertarget target: fbcInstance.cache) for (Rendertarget target : fbcInstance.cache) {
{
target.destroyRTT(); target.destroyRTT();
} }
fbcInstance.cache.clear(); fbcInstance.cache.clear();

View File

@ -35,7 +35,7 @@ public class Rendertarget {
/** The FBO ID. */ /** The FBO ID. */
private final int fboID; private final int fboID;
/** The texture ID. for the color buffer this rendertarget renders into. */ /** The texture ID for the color buffer this rendertarget renders into. */
private final int textureID; private final int textureID;
/** The renderbuffer ID for the depth buffer that this rendertarget renders into. */ /** The renderbuffer ID for the depth buffer that this rendertarget renders into. */
@ -120,8 +120,7 @@ public class Rendertarget {
* Destroy the OpenGL objects associated with this Rendertarget. Do not try * Destroy the OpenGL objects associated with this Rendertarget. Do not try
* to use this rendertarget with OpenGL after calling this method. * to use this rendertarget with OpenGL after calling this method.
*/ */
public void destroyRTT() public void destroyRTT() {
{
GL30.glDeleteFramebuffers(fboID); GL30.glDeleteFramebuffers(fboID);
GL30.glDeleteRenderbuffers(depthBufferID); GL30.glDeleteRenderbuffers(depthBufferID);
GL11.glDeleteTextures(textureID); GL11.glDeleteTextures(textureID);