mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
fix: splash goes black when hq2x is enabled
This commit is contained in:
@@ -242,8 +242,6 @@ public class App implements ApplicationListener {
|
|||||||
public static Hq2x hq2x;
|
public static Hq2x hq2x;
|
||||||
|
|
||||||
public static Mesh fullscreenQuad;
|
public static Mesh fullscreenQuad;
|
||||||
public static Mesh fullscreenQuad2x;
|
|
||||||
public static Mesh fullscreenQuadHQnX;
|
|
||||||
private static OrthographicCamera camera;
|
private static OrthographicCamera camera;
|
||||||
private static FlippingSpriteBatch logoBatch;
|
private static FlippingSpriteBatch logoBatch;
|
||||||
public static TextureRegion logo;
|
public static TextureRegion logo;
|
||||||
@@ -484,21 +482,7 @@ public class App implements ApplicationListener {
|
|||||||
VertexAttribute.ColorUnpacked(),
|
VertexAttribute.ColorUnpacked(),
|
||||||
VertexAttribute.TexCoords(0)
|
VertexAttribute.TexCoords(0)
|
||||||
);
|
);
|
||||||
fullscreenQuad2x = new Mesh(
|
|
||||||
true, 4, 6,
|
|
||||||
VertexAttribute.Position(),
|
|
||||||
VertexAttribute.ColorUnpacked(),
|
|
||||||
VertexAttribute.TexCoords(0)
|
|
||||||
);
|
|
||||||
fullscreenQuadHQnX = new Mesh(
|
|
||||||
true, 4, 6,
|
|
||||||
VertexAttribute.Position(),
|
|
||||||
VertexAttribute.ColorUnpacked(),
|
|
||||||
VertexAttribute.TexCoords(0)
|
|
||||||
);
|
|
||||||
updateFullscreenQuad(fullscreenQuad, scr.getWidth(), scr.getHeight());
|
updateFullscreenQuad(fullscreenQuad, scr.getWidth(), scr.getHeight());
|
||||||
updateFullscreenQuad(fullscreenQuad2x, scr.getWidth() * 2, scr.getHeight() * 2);
|
|
||||||
updateFullscreenQuad(fullscreenQuadHQnX, Math.round(scr.getWf() * 1280f / 2028f), Math.round(scr.getHf() * 720f / 982f));
|
|
||||||
|
|
||||||
// set up renderer info variables
|
// set up renderer info variables
|
||||||
renderer = Gdx.graphics.getGLVersion().getRendererString();
|
renderer = Gdx.graphics.getGLVersion().getRendererString();
|
||||||
@@ -578,14 +562,18 @@ public class App implements ApplicationListener {
|
|||||||
|
|
||||||
if (getConfigString("screenmagnifyingfilter").equals("hq2x") ) {
|
if (getConfigString("screenmagnifyingfilter").equals("hq2x") ) {
|
||||||
FrameBufferManager.begin(postProcessorOutFBO2);
|
FrameBufferManager.begin(postProcessorOutFBO2);
|
||||||
hq2x.renderToScreen(postProcessorOutFBO.getColorBufferTexture());
|
shaderPassthruRGBA.bind();
|
||||||
|
shaderPassthruRGBA.setUniformMatrix("u_projTrans", camera.combined);
|
||||||
|
shaderPassthruRGBA.setUniformi("u_texture", 0);
|
||||||
|
hq2x.renderToScreen(postProcessorOutFBO.getColorBufferTexture());
|
||||||
FrameBufferManager.end();
|
FrameBufferManager.end();
|
||||||
|
|
||||||
shaderPassthruRGBA.bind();
|
shaderPassthruRGBA.bind();
|
||||||
|
shaderPassthruRGBA.setUniformMatrix("u_projTrans", camera.combined);
|
||||||
shaderPassthruRGBA.setUniformi("u_texture", 0);
|
shaderPassthruRGBA.setUniformi("u_texture", 0);
|
||||||
postProcessorOutFBO2.getColorBufferTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
|
postProcessorOutFBO2.getColorBufferTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
|
||||||
postProcessorOutFBO2.getColorBufferTexture().bind(0);
|
postProcessorOutFBO2.getColorBufferTexture().bind(0);
|
||||||
fullscreenQuadHQnX.render(shaderPassthruRGBA, GL20.GL_TRIANGLES);
|
fullscreenQuad.render(shaderPassthruRGBA, GL20.GL_TRIANGLES);
|
||||||
}
|
}
|
||||||
else if (getConfigDouble("screenmagnifying") < 1.01 || getConfigString("screenmagnifyingfilter").equals("none")) {
|
else if (getConfigDouble("screenmagnifying") < 1.01 || getConfigString("screenmagnifyingfilter").equals("none")) {
|
||||||
shaderPassthruRGBA.bind();
|
shaderPassthruRGBA.bind();
|
||||||
@@ -756,8 +744,6 @@ public class App implements ApplicationListener {
|
|||||||
if (currentScreen != null) currentScreen.resize(scr.getWidth(), scr.getHeight());
|
if (currentScreen != null) currentScreen.resize(scr.getWidth(), scr.getHeight());
|
||||||
TerrarumPostProcessor.INSTANCE.resize(scr.getWidth(), scr.getHeight());
|
TerrarumPostProcessor.INSTANCE.resize(scr.getWidth(), scr.getHeight());
|
||||||
updateFullscreenQuad(fullscreenQuad, scr.getWidth(), scr.getHeight());
|
updateFullscreenQuad(fullscreenQuad, scr.getWidth(), scr.getHeight());
|
||||||
updateFullscreenQuad(fullscreenQuad2x, scr.getWidth() * 2, scr.getHeight() * 2);
|
|
||||||
updateFullscreenQuad(fullscreenQuadHQnX, Math.round(scr.getWf() * 1280f / 2028f), Math.round(scr.getHf() * 720f / 982f));
|
|
||||||
|
|
||||||
|
|
||||||
if (renderFBO == null ||
|
if (renderFBO == null ||
|
||||||
@@ -830,8 +816,6 @@ public class App implements ApplicationListener {
|
|||||||
|
|
||||||
CommonResourcePool.INSTANCE.dispose();
|
CommonResourcePool.INSTANCE.dispose();
|
||||||
fullscreenQuad.dispose();
|
fullscreenQuad.dispose();
|
||||||
fullscreenQuad2x.dispose();
|
|
||||||
fullscreenQuadHQnX.dispose();
|
|
||||||
logoBatch.dispose();
|
logoBatch.dispose();
|
||||||
batch.dispose();
|
batch.dispose();
|
||||||
// shapeRender.dispose();
|
// shapeRender.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user