From 1601e9fc43c32459e7b4a3a53bf63799e03b867b Mon Sep 17 00:00:00 2001 From: korenkonder Date: Sat, 15 Jun 2024 10:53:28 +0300 Subject: [PATCH] Removed unused stuff --- src/CRE/render_texture.cpp | 35 +++++++++-------------------------- src/CRE/texture.cpp | 2 -- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/CRE/render_texture.cpp b/src/CRE/render_texture.cpp index 59fe16e3..cf5231a1 100644 --- a/src/CRE/render_texture.cpp +++ b/src/CRE/render_texture.cpp @@ -186,32 +186,15 @@ static int32_t render_texture_set_framebuffer_texture(RenderTexture* rt, gl_state_get_error(); if (!level) { - if (stencil) { - if (depth_texture) - glFramebufferTexture(GL_FRAMEBUFFER, - GL_DEPTH_STENCIL_ATTACHMENT, depth_texture, 0); - /*else if (rt->depth_rbo) { - glBindRenderbuffer(GL_RENDERBUFFER, rt->depth_rbo); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, - GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rt->depth_rbo); - }*/ - else - glFramebufferTexture(GL_FRAMEBUFFER, - GL_DEPTH_STENCIL_ATTACHMENT, 0, 0); - } - else { - if (depth_texture) - glFramebufferTexture(GL_FRAMEBUFFER, - GL_DEPTH_ATTACHMENT, depth_texture, 0); - /*else if (rt->depth_rbo) { - glBindRenderbuffer(GL_RENDERBUFFER, rt->depth_rbo); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, - GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth_rbo); - }*/ - else - glFramebufferTexture(GL_FRAMEBUFFER, - GL_DEPTH_ATTACHMENT, 0, 0); - } + GLenum attechment = stencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT; + if (depth_texture) + glFramebufferTexture(GL_FRAMEBUFFER, attechment, depth_texture, 0); + /*else if (rt->depth_rbo) { + glBindRenderbuffer(GL_RENDERBUFFER, rt->depth_rbo); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, attechment, GL_RENDERBUFFER, rt->depth_rbo); + }*/ + else + glFramebufferTexture(GL_FRAMEBUFFER, attechment, 0, 0); gl_state_get_error(); } diff --git a/src/CRE/texture.cpp b/src/CRE/texture.cpp index d0cda153..e0f7d355 100644 --- a/src/CRE/texture.cpp +++ b/src/CRE/texture.cpp @@ -4,8 +4,6 @@ */ #include "texture.hpp" -#include "../KKdLib/mat.hpp" -#include "../KKdLib/txp.hpp" #include "gl_state.hpp" #include "static_var.hpp"