From f247218dc38087644145fa9e3716f3d4310bde53 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Sat, 16 Sep 2023 16:02:04 +0300 Subject: [PATCH] Renamed `render_texture` to `RenderTexture` --- src/CRE/post_process.cpp | 52 +++++++-------- src/CRE/post_process.hpp | 24 +++---- src/CRE/post_process/aa.cpp | 20 +++--- src/CRE/post_process/aa.hpp | 8 +-- src/CRE/post_process/blur.cpp | 82 +++++++++++------------ src/CRE/post_process/blur.hpp | 6 +- src/CRE/post_process/dof.cpp | 24 +++---- src/CRE/post_process/dof.hpp | 2 +- src/CRE/post_process/exposure.cpp | 12 ++-- src/CRE/post_process/exposure.hpp | 4 +- src/CRE/post_process/tone_map.cpp | 8 +-- src/CRE/post_process/tone_map.hpp | 4 +- src/CRE/render_context.cpp | 36 +++++------ src/CRE/render_context.hpp | 14 ++-- src/CRE/render_manager.cpp | 104 +++++++++++++++--------------- src/CRE/render_texture.cpp | 35 +++++----- src/CRE/render_texture.hpp | 24 +++---- src/CRE/task_effect.cpp | 30 ++++----- src/CRE/task_effect.hpp | 4 +- src/KKdLib/database/stage.cpp | 10 --- src/ReDIVA/render.cpp | 2 +- src/ReDIVA/x_pv_game.cpp | 2 +- 22 files changed, 248 insertions(+), 259 deletions(-) diff --git a/src/CRE/post_process.cpp b/src/CRE/post_process.cpp index 76e4b13e..b7c6ede4 100644 --- a/src/CRE/post_process.cpp +++ b/src/CRE/post_process.cpp @@ -187,7 +187,7 @@ void post_process::apply(camera* cam, texture* light_proj_tex, int32_t npr_param if (!render_textures_data[i]) continue; - render_textures[i].bind(); + render_textures[i].Bind(); texture* t = render_textures_data[i]; if (render_width > t->width * 2ULL || render_height > t->height * 2ULL) @@ -199,7 +199,7 @@ void post_process::apply(camera* cam, texture* light_proj_tex, int32_t npr_param gl_state_active_bind_texture_2d(0, rend_texture.color_texture->tex); gl_state_bind_sampler(0, samplers[0]); shaders_ft.set(SHADER_FT_REDUCE); - render_texture::draw_quad(&shaders_ft, render_width, render_height); + RenderTexture::DrawQuad(&shaders_ft, render_width, render_height); } get_frame_texture(rend_texture.color_texture->tex, POST_PROCESS_FRAME_TEXTURE_POST_PP); @@ -210,7 +210,7 @@ void post_process::apply(camera* cam, texture* light_proj_tex, int32_t npr_param 0, 0, render_width, render_height, 0, 0, render_width, render_height, GL_COLOR_BUFFER_BIT, GL_LINEAR); - screen_texture.bind(); + screen_texture.Bind(); glViewport(0, 0, sprite_width, sprite_height); if (ssaa) { gl_state_active_bind_texture_2d(0, rend_texture.color_texture->tex); @@ -218,7 +218,7 @@ void post_process::apply(camera* cam, texture* light_proj_tex, int32_t npr_param uniform_value[U_ALPHA_MASK] = ss_alpha_mask ? 1 : 0; uniform_value[U_REDUCE] = 0; shaders_ft.set(SHADER_FT_REDUCE); - render_texture::draw_quad(&shaders_ft, render_width, render_height); + RenderTexture::DrawQuad(&shaders_ft, render_width, render_height); uniform_value[U_ALPHA_MASK] = 0; } else { @@ -249,7 +249,7 @@ void post_process::apply(camera* cam, texture* light_proj_tex, int32_t npr_param } shaders_ft.set(SHADER_FT_MAGNIFY); - render_texture::draw_quad(&shaders_ft, render_width, render_height); + RenderTexture::DrawQuad(&shaders_ft, render_width, render_height); } shader::unbind(); @@ -516,7 +516,7 @@ static void make_ghost_quad(uint8_t flags, float_t opacity, mat4* mat, float_t*& data += 30; } -void post_process::draw_lens_ghost(render_texture* rt) { +void post_process::draw_lens_ghost(RenderTexture* rt) { static const float_t v13[16] = { -0.70f, -0.30f, 0.35f, 0.50f, -0.45f, -0.80f, 0.20f, 0.41f, @@ -598,7 +598,7 @@ void post_process::draw_lens_ghost(render_texture* rt) { } glViewport(0, 0, rt->color_texture->width, rt->color_texture->height); - rt->bind(); + rt->Bind(); gl_state_enable_blend(); gl_state_set_blend_func(GL_ONE, GL_ONE); @@ -626,16 +626,16 @@ void post_process::init_fbo(int32_t render_width, int32_t render_height, dof->init_fbo(render_width, render_height); exposure->init_fbo(); tone_map->init_fbo(); - rend_texture.init(render_width, render_height, 0, GL_RGBA16F, GL_DEPTH_COMPONENT32F); - buf_texture.init(render_width, render_height, 0, GL_RGBA16F, 0); - sss_contour_texture.init(render_width, render_height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); + rend_texture.Init(render_width, render_height, 0, GL_RGBA16F, GL_DEPTH_COMPONENT32F); + buf_texture.Init(render_width, render_height, 0, GL_RGBA16F, 0); + sss_contour_texture.Init(render_width, render_height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); if (aet_back_tex) texture_free(aet_back_tex); aet_back_tex = texture_load_tex_2d(texture_id(0x25, texture_counter++), GL_RGBA8, render_width, render_height, 0, 0, false); - aet_back_texture.set_color_depth_textures(aet_back_tex->tex, 0, rend_texture.depth_texture->tex); - pre_texture.init(render_width, render_height, 0, GL_RGBA16F, 0); - post_texture.init(render_width, render_height, 0, GL_RGBA16F, 0); - transparency_texture.init(render_width, render_height, 0, GL_RGBA16F, GL_DEPTH_COMPONENT32F); + aet_back_texture.SetColorDepthTextures(aet_back_tex->tex, 0, rend_texture.depth_texture->tex); + pre_texture.Init(render_width, render_height, 0, GL_RGBA16F, 0); + post_texture.Init(render_width, render_height, 0, GL_RGBA16F, 0); + transparency_texture.Init(render_width, render_height, 0, GL_RGBA16F, GL_DEPTH_COMPONENT32F); gl_state_bind_texture_2d(rend_texture.depth_texture->tex); GLint swizzle[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle); @@ -647,7 +647,7 @@ void post_process::init_fbo(int32_t render_width, int32_t render_height, } if (this->sprite_width != sprite_width || this->sprite_height != sprite_height) { - screen_texture.init(sprite_width, sprite_height, 0, GL_RGBA16F, 0); // Was GL_R11F_G11F_B10F + screen_texture.Init(sprite_width, sprite_height, 0, GL_RGBA16F, 0); // Was GL_R11F_G11F_B10F this->sprite_width = sprite_width; this->sprite_height = sprite_height; } @@ -668,7 +668,7 @@ void post_process::frame_texture_free() { for (post_process_frame_texture& i : frame_texture) { for (post_process_frame_texture_render_texture& j : i.render_textures) { j.texture = 0; - j.render_texture.free(); + j.render_texture.Free(); j.type = POST_PROCESS_FRAME_TEXTURE_MAX; } @@ -682,7 +682,7 @@ int32_t post_process::frame_texture_load(int32_t slot, post_process_frame_textur for (post_process_frame_texture_render_texture& i : frame_texture[slot].render_textures) if (!i.texture) { - i.render_texture.set_color_depth_textures(tex->tex, 0, 0); + i.render_texture.SetColorDepthTextures(tex->tex); i.texture = tex; i.type = type; return (int32_t)(&i - frame_texture[slot].render_textures); @@ -721,7 +721,7 @@ bool post_process::frame_texture_unload(int32_t slot, texture* tex) { for (post_process_frame_texture_render_texture& i : frame_texture[slot].render_textures) if (i.texture == tex) { - i.render_texture.free(); + i.render_texture.Free(); i.texture = 0; i.type = POST_PROCESS_FRAME_TEXTURE_MAX; return true; @@ -739,7 +739,7 @@ int32_t post_process::movie_texture_set(texture* movie_texture) { return -1; movie_textures_data[index] = movie_texture; - movie_textures[index].set_color_depth_textures(movie_texture->tex, 0, 0); + movie_textures[index].SetColorDepthTextures(movie_texture->tex); return index; } @@ -749,7 +749,7 @@ void post_process::get_frame_texture(GLuint tex, post_process_frame_texture_type continue; for (auto& j : i.render_textures) { - if (!j.texture || j.type != type || j.render_texture.bind() < 0) + if (!j.texture || j.type != type || j.render_texture.Bind() < 0) continue; texture* dst_tex = j.texture; @@ -760,7 +760,7 @@ void post_process::get_frame_texture(GLuint tex, post_process_frame_texture_type glViewport(0, 0, dst_tex->width, dst_tex->height); uniform_value[U_REDUCE] = 0; shaders_ft.set(SHADER_FT_REDUCE); - render_texture::draw_quad(&shaders_ft, dst_tex->width, dst_tex->height); + RenderTexture::DrawQuad(&shaders_ft, dst_tex->width, dst_tex->height); gl_state_bind_framebuffer(0); } } @@ -776,7 +776,7 @@ void post_process::movie_texture_free(texture* movie_texture) { return; movie_textures_data[index] = 0; - movie_textures[index].free(); + movie_textures[index].Free(); } int32_t post_process::render_texture_set(texture* render_texture, bool task_photo) { @@ -792,7 +792,7 @@ int32_t post_process::render_texture_set(texture* render_texture, bool task_phot return -1; render_textures_data[index] = render_texture; - render_textures[index].set_color_depth_textures(render_texture->tex, 0, 0); + render_textures[index].SetColorDepthTextures(render_texture->tex); return index; } @@ -809,7 +809,7 @@ void post_process::render_texture_free(texture* render_texture, bool task_photo) return; render_textures_data[index] = 0; - render_textures[index].free(); + render_textures[index].Free(); } void post_process::reset() { @@ -824,10 +824,10 @@ void post_process::reset() { void post_process::set_render_texture(bool aet_back) { if (aet_back) { - aet_back_texture.bind(); + aet_back_texture.Bind(); this->aet_back = 1; } else - rend_texture.bind(); + rend_texture.Bind(); glViewport(0, 0, render_width, render_height); } diff --git a/src/CRE/post_process.hpp b/src/CRE/post_process.hpp index db153771..7d6bff8b 100644 --- a/src/CRE/post_process.hpp +++ b/src/CRE/post_process.hpp @@ -39,7 +39,7 @@ struct sun_quad_shader_data { struct post_process_frame_texture_render_texture { texture* texture; - render_texture render_texture; + RenderTexture render_texture; post_process_frame_texture_type type; post_process_frame_texture_render_texture(); @@ -59,19 +59,19 @@ struct post_process { bool ssaa; bool mlaa; int32_t ss_alpha_mask; - render_texture rend_texture; - render_texture buf_texture; - render_texture sss_contour_texture; + RenderTexture rend_texture; + RenderTexture buf_texture; + RenderTexture sss_contour_texture; texture* aet_back_tex; - render_texture aet_back_texture; - render_texture pre_texture; - render_texture post_texture; - render_texture transparency_texture; - render_texture screen_texture; + RenderTexture aet_back_texture; + RenderTexture pre_texture; + RenderTexture post_texture; + RenderTexture transparency_texture; + RenderTexture screen_texture; texture* render_textures_data[16]; - render_texture render_textures[16]; + RenderTexture render_textures[16]; texture* movie_textures_data[1]; - render_texture movie_textures[1]; + RenderTexture movie_textures[1]; int32_t aet_back; post_process_aa* aa; post_process_blur* blur; @@ -123,7 +123,7 @@ struct post_process { void apply(camera* cam, texture* light_proj_tex, int32_t npr_param); void ctrl(camera* cam); void draw_lens_flare(camera* cam); - void draw_lens_ghost(render_texture* rt); + void draw_lens_ghost(RenderTexture* rt); void init_fbo(int32_t render_width, int32_t render_height, int32_t sprite_width, int32_t sprite_height, int32_t screen_width, int32_t screen_height); bool frame_texture_cont_capture_set(bool value); diff --git a/src/CRE/post_process/aa.cpp b/src/CRE/post_process/aa.cpp index 6fa109d7..830c7548 100644 --- a/src/CRE/post_process/aa.cpp +++ b/src/CRE/post_process/aa.cpp @@ -33,17 +33,17 @@ post_process_aa::~post_process_aa() { } } -void post_process_aa::apply_mlaa(render_texture* rt, - render_texture* buf_rt, GLuint* samplers, int32_t ss_alpha_mask) { +void post_process_aa::apply_mlaa(RenderTexture* rt, + RenderTexture* buf_rt, GLuint* samplers, int32_t ss_alpha_mask) { gl_state_begin_event("PostProcess::mlaa"); - mlaa_buffer.bind(); + mlaa_buffer.Bind(); gl_state_active_bind_texture_2d(0, rt->color_texture->tex); gl_state_bind_sampler(0, samplers[1]); uniform_value[U_MLAA] = 0; shaders_ft.set(SHADER_FT_MLAA); - render_texture::draw_quad(&shaders_ft, width, height); + RenderTexture::DrawQuad(&shaders_ft, width, height); - temp_buffer.bind(); + temp_buffer.Bind(); gl_state_active_bind_texture_2d(0, mlaa_buffer.color_texture->tex); gl_state_active_bind_texture_2d(1, mlaa_area_texture); gl_state_bind_sampler(0, samplers[0]); @@ -51,16 +51,16 @@ void post_process_aa::apply_mlaa(render_texture* rt, uniform_value[U_MLAA] = 1; uniform_value[U_MLAA_SEARCH] = 2; shaders_ft.set(SHADER_FT_MLAA); - render_texture::draw_quad(&shaders_ft, width, height); + RenderTexture::DrawQuad(&shaders_ft, width, height); - buf_rt->bind(); + buf_rt->Bind(); gl_state_active_bind_texture_2d(0, rt->color_texture->tex); gl_state_active_bind_texture_2d(1, temp_buffer.color_texture->tex); gl_state_bind_sampler(0, samplers[1]); uniform_value[U_MLAA] = 2; uniform_value[U_ALPHA_MASK] = ss_alpha_mask ? 1 : 0; shaders_ft.set(SHADER_FT_MLAA); - render_texture::draw_quad(&shaders_ft, width, height); + RenderTexture::DrawQuad(&shaders_ft, width, height); uniform_value[U_ALPHA_MASK] = 0; gl_state_active_bind_texture_2d(0, 0); gl_state_active_bind_texture_2d(1, 0); @@ -78,8 +78,8 @@ void post_process_aa::init_fbo(int32_t width, int32_t height) { this->width = max_def(width, 1); this->height = max_def(height, 1); - mlaa_buffer.init(this->width, this->height, 0, GL_RGBA8, 0); - temp_buffer.init(this->width, this->height, 0, GL_RGBA8, 0); + mlaa_buffer.Init(this->width, this->height, 0, GL_RGBA8, 0); + temp_buffer.Init(this->width, this->height, 0, GL_RGBA8, 0); } static void post_process_aa_generate_area_texture(post_process_aa* aa) { diff --git a/src/CRE/post_process/aa.hpp b/src/CRE/post_process/aa.hpp index 20f3969b..e2398c3b 100644 --- a/src/CRE/post_process/aa.hpp +++ b/src/CRE/post_process/aa.hpp @@ -13,14 +13,14 @@ struct post_process_aa { int32_t width; int32_t height; - render_texture mlaa_buffer; - render_texture temp_buffer; + RenderTexture mlaa_buffer; + RenderTexture temp_buffer; GLuint mlaa_area_texture; post_process_aa(); ~post_process_aa(); - void apply_mlaa(render_texture* rt, - render_texture* buf_rt, GLuint* samplers, int32_t ss_alpha_mask); + void apply_mlaa(RenderTexture* rt, + RenderTexture* buf_rt, GLuint* samplers, int32_t ss_alpha_mask); void init_fbo(int32_t width, int32_t height); }; diff --git a/src/CRE/post_process/blur.cpp b/src/CRE/post_process/blur.cpp index 13170c49..bf2eebf5 100644 --- a/src/CRE/post_process/blur.cpp +++ b/src/CRE/post_process/blur.cpp @@ -20,12 +20,12 @@ static void post_process_blur_radius_calculate_gaussian_kernel(float_t* gaussian post_process_blur::post_process_blur() : data(), width(), height(), width_down(), height_down(), tex_down(), count_down() { - tex[0].init(256, 144, 0, GL_RGBA16F, 0); - tex[1].init(128, 72, 0, GL_RGBA16F, 0); - tex[2].init(64, 36, 0, GL_RGBA16F, 0); - tex[3].init(32, 18, 0, GL_RGBA16F, 0); - tex[4].init(8, 8, 0, GL_RGBA16F, 0); - tex[5].init(256, 144, 0, GL_RGBA16F, 0); + tex[0].Init(256, 144, 0, GL_RGBA16F, 0); + tex[1].Init(128, 72, 0, GL_RGBA16F, 0); + tex[2].Init(64, 36, 0, GL_RGBA16F, 0); + tex[3].Init(32, 18, 0, GL_RGBA16F, 0); + tex[4].Init(8, 8, 0, GL_RGBA16F, 0); + tex[5].Init(256, 144, 0, GL_RGBA16F, 0); gaussian_coef_ubo.Create(sizeof(gaussian_coef_shader_data)); } @@ -35,13 +35,13 @@ post_process_blur:: ~post_process_blur() { gaussian_coef_ubo.Destroy(); for (int32_t i = 0; i < count_down; i++) - tex_down[i].free(); + tex_down[i].Free(); free_def(tex_down); free_def(height_down); free_def(width_down); } -void post_process_blur::get_blur(render_texture* rt) { +void post_process_blur::get_blur(RenderTexture* rt) { uniform_value[U_ALPHA_MASK] = 0; vec3 intensity = data.intensity; @@ -61,11 +61,11 @@ void post_process_blur::get_blur(render_texture* rt) { shaders_ft.set(SHADER_FT_REDUCE); for (; i < count_down; i++) { glViewport(0, 0, width_down[i], height_down[i]); - tex_down[i].bind(); + tex_down[i].Bind(); gl_state_active_bind_texture_2d(0, i ? tex_down[i - 1].color_texture->tex : rt->color_texture->tex); - render_texture::draw_quad(&shaders_ft, width_down[i], height_down[i]); + RenderTexture::DrawQuad(&shaders_ft, width_down[i], height_down[i]); } i--; } @@ -74,101 +74,101 @@ void post_process_blur::get_blur(render_texture* rt) { shaders_ft.set(SHADER_FT_REDUCE); glViewport(0, 0, 256, 144); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, count_down > 0 ? tex_down[i].color_texture->tex : rt->color_texture->tex); - render_texture::draw_quad(&shaders_ft, width, height, 1.0f, 1.1f, 1.1f, 1.1f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, width, height, 1.0f, 1.1f, 1.1f, 1.1f, 0.0f); uniform_value[U_GAUSS] = 1; shaders_ft.set(SHADER_FT_GAUSS); glViewport(0, 0, 256, 144); - tex[5].bind(); + tex[5].Bind(); gl_state_active_bind_texture_2d(0, tex[0].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 256, 144, 1.0f, + RenderTexture::DrawQuad(&shaders_ft, 256, 144, 1.0f, data.intensity.x * 0.5f, data.intensity.y * 0.5f, data.intensity.z * 0.5f, 1.0f); uniform_value[U_REDUCE] = 1; shaders_ft.set(SHADER_FT_REDUCE); glViewport(0, 0, 128, 72); - tex[1].bind(); + tex[1].Bind(); gl_state_active_bind_texture_2d(0, tex[0].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 256, 144); + RenderTexture::DrawQuad(&shaders_ft, 256, 144); uniform_value[U_REDUCE] = 1; shaders_ft.set(SHADER_FT_REDUCE); glViewport(0, 0, 64, 36); - tex[2].bind(); + tex[2].Bind(); gl_state_active_bind_texture_2d(0, tex[1].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 128, 72); + RenderTexture::DrawQuad(&shaders_ft, 128, 72); uniform_value[U_REDUCE] = 1; shaders_ft.set(SHADER_FT_REDUCE); glViewport(0, 0, 32, 18); - tex[3].bind(); + tex[3].Bind(); gl_state_active_bind_texture_2d(0, tex[2].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 64, 36); + RenderTexture::DrawQuad(&shaders_ft, 64, 36); uniform_value[U_EXPOSURE] = 0; shaders_ft.set(SHADER_FT_EXPOSURE); glViewport(0, 0, 8, 8); - tex[4].bind(); + tex[4].Bind(); gl_state_active_bind_texture_2d(0, tex[3].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 32, 18); + RenderTexture::DrawQuad(&shaders_ft, 32, 18); uniform_value[U_GAUSS] = 0; shaders_ft.set(SHADER_FT_GAUSS); gaussian_coef_ubo.Bind(1); glViewport(0, 0, 128, 72); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[1].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 128, 72, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, 128, 72, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f); fbo::blit(tex[0].fbos[0], tex[1].fbos[0], 0, 0, 128, 72, 0, 0, 128, 72, GL_COLOR_BUFFER_BIT, GL_LINEAR); glViewport(0, 0, 64, 36); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[2].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 64, 36, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, 64, 36, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f); fbo::blit(tex[0].fbos[0], tex[2].fbos[0], 0, 0, 64, 36, 0, 0, 64, 36, GL_COLOR_BUFFER_BIT, GL_LINEAR); glViewport(0, 0, 32, 18); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[3].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 32, 18); + RenderTexture::DrawQuad(&shaders_ft, 32, 18); fbo::blit(tex[0].fbos[0], tex[3].fbos[0], 0, 0, 32, 18, 0, 0, 32, 18, GL_COLOR_BUFFER_BIT, GL_LINEAR); glViewport(0, 0, 128, 72); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[1].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 128, 72, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + RenderTexture::DrawQuad(&shaders_ft, 128, 72, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); fbo::blit(tex[0].fbos[0], tex[1].fbos[0], 0, 0, 128, 72, 0, 0, 128, 72, GL_COLOR_BUFFER_BIT, GL_LINEAR); glViewport(0, 0, 64, 36); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[2].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 64, 36, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + RenderTexture::DrawQuad(&shaders_ft, 64, 36, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); fbo::blit(tex[0].fbos[0], tex[2].fbos[0], 0, 0, 64, 36, 0, 0, 64, 36, GL_COLOR_BUFFER_BIT, GL_LINEAR); glViewport(0, 0, 32, 18); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[3].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 32, 18, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + RenderTexture::DrawQuad(&shaders_ft, 32, 18, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); fbo::blit(tex[0].fbos[0], tex[3].fbos[0], 0, 0, 32, 18, 0, 0, 32, 18, GL_COLOR_BUFFER_BIT, GL_LINEAR); @@ -177,12 +177,12 @@ void post_process_blur::get_blur(render_texture* rt) { shaders_ft.set(SHADER_FT_REDUCE); glViewport(0, 0, 256, 144); - tex[0].bind(); + tex[0].Bind(); gl_state_active_bind_texture_2d(0, tex[5].color_texture->tex); gl_state_active_bind_texture_2d(1, tex[1].color_texture->tex); gl_state_active_bind_texture_2d(2, tex[2].color_texture->tex); gl_state_active_bind_texture_2d(3, tex[3].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 32, 18, 0.25f, 0.15f, 0.25f, 0.25f, 0.25f); + RenderTexture::DrawQuad(&shaders_ft, 32, 18, 0.25f, 0.15f, 0.25f, 0.25f, 0.25f); } void post_process_blur::init_fbo(int32_t width, int32_t height) { @@ -201,15 +201,15 @@ void post_process_blur::init_fbo(int32_t width, int32_t height) { i++; } - render_texture* tex_down = this->tex_down; + RenderTexture* tex_down = this->tex_down; int32_t* width_down = this->width_down; int32_t* height_down = this->height_down; if (!tex_down) - tex_down = force_malloc_s(render_texture, i); + tex_down = force_malloc_s(RenderTexture, i); else if (count_down < i) { - render_texture* temp = force_malloc_s(render_texture, i); - memcpy(temp, tex_down, sizeof(render_texture) * count_down); + RenderTexture* temp = force_malloc_s(RenderTexture, i); + memcpy(temp, tex_down, sizeof(RenderTexture) * count_down); free_def(tex_down); tex_down = temp; } @@ -244,7 +244,7 @@ void post_process_blur::init_fbo(int32_t width, int32_t height) { } for (i = 0; i < count_down; i++) - tex_down[i].init(width_down[i], height_down[i], 0, GL_RGBA16F, 0); + tex_down[i].Init(width_down[i], height_down[i], 0, GL_RGBA16F, 0); gl_state_bind_framebuffer(0); diff --git a/src/CRE/post_process/blur.hpp b/src/CRE/post_process/blur.hpp index 0408e3cc..da58c858 100644 --- a/src/CRE/post_process/blur.hpp +++ b/src/CRE/post_process/blur.hpp @@ -23,17 +23,17 @@ struct post_process_blur { post_process_blur_data data; int32_t width; int32_t height; - render_texture tex[6]; + RenderTexture tex[6]; int32_t* width_down; int32_t* height_down; - render_texture* tex_down; + RenderTexture* tex_down; int32_t count_down; GL::UniformBuffer gaussian_coef_ubo; post_process_blur(); ~post_process_blur(); - void get_blur(render_texture* rt); + void get_blur(RenderTexture* rt); void init_fbo(int32_t width, int32_t height); void initialize_data(const vec3& radius, const vec3& intensity); diff --git a/src/CRE/post_process/dof.cpp b/src/CRE/post_process/dof.cpp index 99f2e3fa..bb840e51 100644 --- a/src/CRE/post_process/dof.cpp +++ b/src/CRE/post_process/dof.cpp @@ -42,12 +42,12 @@ static const dof_pv dof_pv_default = { namespace renderer { struct DOF3 { - static void apply_f2(post_process_dof* dof, render_texture* rt, - render_texture* buf, GLuint* samplers, GLuint color_texture, + static void apply_f2(post_process_dof* dof, RenderTexture* rt, + RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, float_t min_distance, float_t max_distance, float_t fov, float_t focus, float_t focus_range, float_t fuzzing_range, float_t ratio); - static void apply_physical(post_process_dof* dof, render_texture* rt, - render_texture* buf, GLuint* samplers, GLuint color_texture, + static void apply_physical(post_process_dof* dof, RenderTexture* rt, + RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, float_t min_distance, float_t max_distance, float_t focus, float_t focal_length, float_t fov, float_t f_number); @@ -56,7 +56,7 @@ namespace renderer { static void downsample(post_process_dof* dof, GLuint* samplers, GLuint color_texture, GLuint depth_texture, bool f2); static void main_filter(post_process_dof* dof, GLuint* samplers, bool f2); - static void upsample(post_process_dof* dof, render_texture* rt, render_texture* buf, + static void upsample(post_process_dof* dof, RenderTexture* rt, RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, bool f2); static void update_data(post_process_dof* dof, float_t min_dist, @@ -80,7 +80,7 @@ post_process_dof::~post_process_dof() { post_process_dof_free_fbo(this); } -void post_process_dof::apply(render_texture* rt, render_texture* buf, GLuint* samplers, camera* cam) { +void post_process_dof::apply(RenderTexture* rt, RenderTexture* buf, GLuint* samplers, camera* cam) { if (!this) return; @@ -267,8 +267,8 @@ static void post_process_dof_free_fbo(post_process_dof* dof) { } namespace renderer { - void DOF3::apply_f2(post_process_dof* dof, render_texture* rt, - render_texture* buf, GLuint* samplers, GLuint color_texture, + void DOF3::apply_f2(post_process_dof* dof, RenderTexture* rt, + RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, float_t min_distance, float_t max_distance, float_t fov, float_t focus, float_t focus_range, float_t fuzzing_range, float_t ratio) { gl_state_begin_event("renderer::DOF3::apply_f2"); @@ -295,8 +295,8 @@ namespace renderer { gl_state_end_event(); } - void DOF3::apply_physical(post_process_dof* dof, render_texture* rt, - render_texture* buf, GLuint* samplers, GLuint color_texture, + void DOF3::apply_physical(post_process_dof* dof, RenderTexture* rt, + RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, float_t min_distance, float_t max_distance, float_t focus, float_t focal_length, float_t fov, float_t f_number) { gl_state_begin_event("renderer::DOF3::apply_physical"); @@ -382,10 +382,10 @@ namespace renderer { gl_state_end_event(); } - void DOF3::upsample(post_process_dof* dof, render_texture* rt, render_texture* buf, + void DOF3::upsample(post_process_dof* dof, RenderTexture* rt, RenderTexture* buf, GLuint* samplers, GLuint color_texture, GLuint depth_texture, bool f2) { gl_state_begin_event("renderer::DOF3::upsample"); - buf->bind(); + buf->Bind(); glViewport(0, 0, dof->width, dof->height); uniform_value[U_DOF_STAGE] = 4; shaders_ft.set(SHADER_FT_DOF); diff --git a/src/CRE/post_process/dof.hpp b/src/CRE/post_process/dof.hpp index e6fd05b2..7cc697c7 100644 --- a/src/CRE/post_process/dof.hpp +++ b/src/CRE/post_process/dof.hpp @@ -58,7 +58,7 @@ struct post_process_dof { post_process_dof(); ~post_process_dof(); - void apply(render_texture* rt, render_texture* buf, GLuint* samplers, camera* cam); + void apply(RenderTexture* rt, RenderTexture* buf, GLuint* samplers, camera* cam); void init_fbo(int32_t width, int32_t height); void initialize_data(dof_debug* debug, dof_pv* pv); diff --git a/src/CRE/post_process/exposure.cpp b/src/CRE/post_process/exposure.cpp index a860f3ce..8e36e7fc 100644 --- a/src/CRE/post_process/exposure.cpp +++ b/src/CRE/post_process/exposure.cpp @@ -169,24 +169,24 @@ void post_process_exposure::get_exposure(camera* cam, int32_t render_width, glViewport(0, 0, 32, 1); else glViewport(exposure_history_counter, 0, 1, 1); - exposure_history.bind(); + exposure_history.Bind(); uniform_value[U_EXPOSURE] = 1; shaders_ft.set(SHADER_FT_EXPOSURE); exposure_measure_ubo.Bind(1); gl_state_active_bind_texture_2d(0, in_tex_0); gl_state_active_bind_texture_2d(1, in_tex_1); - render_texture::draw_quad(&shaders_ft, reset_exposure ? 32 : 1, 1); + RenderTexture::DrawQuad(&shaders_ft, reset_exposure ? 32 : 1, 1); exposure_history_counter++; exposure_history_counter %= 32; } glViewport(0, 0, 1, 1); - exposure.bind(); + exposure.Bind(); uniform_value[U_EXPOSURE] = 2; shaders_ft.set(SHADER_FT_EXPOSURE); gl_state_active_bind_texture_2d(0, exposure_history.color_texture->tex); - render_texture::draw_quad(&shaders_ft, 1, 1); + RenderTexture::DrawQuad(&shaders_ft, 1, 1); } void post_process_exposure::get_exposure_chara_data(void* pp_data, camera* cam) { @@ -261,9 +261,9 @@ void post_process_exposure::init_fbo() { exposure_history_counter = 0; if (!exposure_history.color_texture) - exposure_history.init(32, 1, 0, GL_R32F, 0); + exposure_history.Init(32, 1, 0, GL_R32F, 0); if (!exposure.color_texture) - exposure.init(2, 2, 0, GL_R32F, 0); + exposure.Init(2, 2, 0, GL_R32F, 0); for (int32_t i = 0; i < ROB_CHARA_COUNT; i++) if (!chara_data[i].query[0]) diff --git a/src/CRE/post_process/exposure.hpp b/src/CRE/post_process/exposure.hpp index e3b531f4..99b8a37b 100644 --- a/src/CRE/post_process/exposure.hpp +++ b/src/CRE/post_process/exposure.hpp @@ -22,8 +22,8 @@ struct post_process_exposure_chara_data { }; struct post_process_exposure { - render_texture exposure_history; - render_texture exposure; + RenderTexture exposure_history; + RenderTexture exposure; int32_t exposure_history_counter; post_process_exposure_chara_data* chara_data; int32_t query_index; diff --git a/src/CRE/post_process/tone_map.cpp b/src/CRE/post_process/tone_map.cpp index 58168428..c5db19d9 100644 --- a/src/CRE/post_process/tone_map.cpp +++ b/src/CRE/post_process/tone_map.cpp @@ -33,8 +33,8 @@ post_process_tone_map::~post_process_tone_map() { glDeleteTextures(1, &tone_map_tex); } -void post_process_tone_map::apply(render_texture* in_tex, texture* light_proj_tex, texture* back_2d_tex, - render_texture* rt, render_texture* buf_rt,/* render_texture* contour_rt,*/ +void post_process_tone_map::apply(RenderTexture* in_tex, texture* light_proj_tex, texture* back_2d_tex, + RenderTexture* rt, RenderTexture* buf_rt,/* RenderTexture* contour_rt,*/ GLuint in_tex_0, GLuint in_tex_1, int32_t npr_param, void* pp_data) { if (!this) return; @@ -163,10 +163,10 @@ void post_process_tone_map::apply(render_texture* in_tex, texture* light_proj_te tone_map_ubo.WriteMapMemory(shader_data); glViewport(0, 0, rt->color_texture->width, rt->color_texture->height); - buf_rt->bind(); + buf_rt->Bind(); shaders_ft.set(SHADER_FT_TONEMAP); tone_map_ubo.Bind(1); - render_texture::draw(&shaders_ft); + RenderTexture::Draw(&shaders_ft); gl_state_active_bind_texture_2d(2, 0); fbo::blit(buf_rt->fbos[0], rt->fbos[0], diff --git a/src/CRE/post_process/tone_map.hpp b/src/CRE/post_process/tone_map.hpp index 8c9ec3a3..80f2e4fb 100644 --- a/src/CRE/post_process/tone_map.hpp +++ b/src/CRE/post_process/tone_map.hpp @@ -56,8 +56,8 @@ struct post_process_tone_map { post_process_tone_map(); ~post_process_tone_map(); - void apply(render_texture* in_tex, texture* light_proj_tex, texture* back_2d_tex, - render_texture* rt, render_texture* buf_rt,/* render_texture* contour_rt,*/ + void apply(RenderTexture* in_tex, texture* light_proj_tex, texture* back_2d_tex, + RenderTexture* rt, RenderTexture* buf_rt,/* RenderTexture* contour_rt,*/ GLuint in_tex_0, GLuint in_tex_1, int32_t npr_param, void* pp); void init_fbo(); void initialize_data(float_t exposure, bool auto_exposure, diff --git a/src/CRE/render_context.cpp b/src/CRE/render_context.cpp index 8c85978b..47e396d4 100644 --- a/src/CRE/render_context.cpp +++ b/src/CRE/render_context.cpp @@ -102,10 +102,10 @@ sss_data::sss_data() : init(), enable(), npr_contour(), param() { npr_contour = true; param = { 0.0f, 0.0f, 0.0f, 1.0f }; - textures[0].init(640, 360, 0, GL_RGBA16F, GL_ZERO /*GL_DEPTH_COMPONENT32F*/); - textures[1].init(320, 180, 0, GL_RGBA16F, GL_ZERO); - textures[2].init(320, 180, 0, GL_RGBA16F, GL_ZERO); - textures[3].init(320, 180, 0, GL_RGBA16F, GL_ZERO); + textures[0].Init(640, 360, 0, GL_RGBA16F, GL_ZERO /*GL_DEPTH_COMPONENT32F*/); + textures[1].Init(320, 180, 0, GL_RGBA16F, GL_ZERO); + textures[2].Init(320, 180, 0, GL_RGBA16F, GL_ZERO); + textures[3].Init(320, 180, 0, GL_RGBA16F, GL_ZERO); } sss_data::~sss_data() { @@ -342,9 +342,9 @@ namespace mdl { } light_proj::light_proj(int32_t width, int32_t height) : enable(), texture_id() { - shadow_texture[0].init(2048, 512, 0, GL_R32F, GL_DEPTH_COMPONENT32F); - shadow_texture[1].init(2048, 512, 0, GL_R32F, GL_ZERO); - draw_texture.init(width, height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); + shadow_texture[0].Init(2048, 512, 0, GL_R32F, GL_DEPTH_COMPONENT32F); + shadow_texture[1].Init(2048, 512, 0, GL_R32F, GL_ZERO); + draw_texture.Init(width, height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); } light_proj::~light_proj() { @@ -355,7 +355,7 @@ void light_proj::resize(int32_t width, int32_t height) { if (!this) return; - draw_texture.init(width, height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); + draw_texture.Init(width, height, 0, GL_RGBA8, GL_DEPTH_COMPONENT32F); } bool light_proj::set(render_context* rctx) { @@ -365,7 +365,7 @@ bool light_proj::set(render_context* rctx) { static const vec4 color_clear = 1.0f; static const GLfloat depth_clear = 1.0f; - shadow_texture[0].bind(); + shadow_texture[0].Bind(); glViewport(0, 0, 2048, 512); gl_state_enable_depth_test(); gl_state_set_depth_mask(GL_TRUE); @@ -378,7 +378,7 @@ bool light_proj::set(render_context* rctx) { return true; } else { - draw_texture.bind(); + draw_texture.Bind(); glViewport(0, 0, draw_texture.color_texture->width, draw_texture.color_texture->height); gl_state_enable_depth_test(); @@ -3101,9 +3101,9 @@ namespace rndr { if (v2->type != GL_TEXTURE_2D) continue; - render_texture& rt = render_textures[i]; - rt.init(v2->width, v2->height, v2->max_level, v2->color_format, v2->depth_format); - rt.bind(); + RenderTexture& rt = render_textures[i]; + rt.Init(v2->width, v2->height, v2->max_level, v2->color_format, v2->depth_format); + rt.Bind(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } @@ -3204,7 +3204,7 @@ namespace rndr { } } - render_texture& RenderManager::get_render_texture(int32_t index) { + RenderTexture& RenderManager::get_render_texture(int32_t index) { return render_textures[stru_140A244E0[index][tex_index[index]]]; } @@ -4056,7 +4056,7 @@ int32_t Shadow::InitData() { shadow_texture_init_params* v3 = init_params; for (int32_t i = 0; i < 8; i++, v3++) - if (render_textures[i].init(v3->width, v3->height, + if (render_textures[i].Init(v3->width, v3->height, v3->max_level, v3->color_format, v3->depth_format) < 0) return -1; @@ -4073,8 +4073,8 @@ int32_t Shadow::InitData() { } void Shadow::Reset() { - for (render_texture& i : render_textures) - i.free(); + for (RenderTexture& i : render_textures) + i.Free(); ResetData(); } @@ -4090,7 +4090,7 @@ void Shadow::ResetData() { field_200[i] = i; } - for (render_texture*& i : curr_render_textures) + for (RenderTexture*& i : curr_render_textures) i = 0; view_mat[0] = mat4_identity; diff --git a/src/CRE/render_context.hpp b/src/CRE/render_context.hpp index 32407025..dff4ad0b 100644 --- a/src/CRE/render_context.hpp +++ b/src/CRE/render_context.hpp @@ -190,7 +190,7 @@ struct sss_data { bool init; bool enable; bool npr_contour; - render_texture textures[4]; + RenderTexture textures[4]; vec4 param; sss_data(); @@ -443,8 +443,8 @@ namespace mdl { struct light_proj { bool enable; - render_texture shadow_texture[2]; - render_texture draw_texture; + RenderTexture shadow_texture[2]; + RenderTexture draw_texture; uint32_t texture_id; light_proj(int32_t width, int32_t height); @@ -640,7 +640,7 @@ namespace rndr { bool draw_pass_3d[DRAW_PASS_3D_MAX]; stage_data_reflect_type reflect_type; int32_t tex_index[12]; // Extra for buf - render_texture render_textures[9]; // Extra for buf + RenderTexture render_textures[9]; // Extra for buf GLuint multisample_framebuffer; GLuint multisample_renderbuffer; bool multisample; @@ -666,7 +666,7 @@ namespace rndr { void add_user_func(int32_t type, void(*func)(void*), void* data); void clear_user_func(int32_t type); - render_texture& get_render_texture(int32_t index); + RenderTexture& get_render_texture(int32_t index); void resize(int32_t width, int32_t height); void set_effect_texture(texture* value); void set_multisample(bool value); @@ -928,8 +928,8 @@ struct render_context { }; struct Shadow { - render_texture render_textures[8]; // Extra for buf - render_texture* curr_render_textures[4]; // Extra for buf + RenderTexture render_textures[8]; // Extra for buf + RenderTexture* curr_render_textures[4]; // Extra for buf float_t view_region; float_t range; vec3 view_point[2]; diff --git a/src/CRE/render_manager.cpp b/src/CRE/render_manager.cpp index 35f73c7b..c677dd9f 100644 --- a/src/CRE/render_manager.cpp +++ b/src/CRE/render_manager.cpp @@ -25,10 +25,10 @@ static void draw_pass_shadow_begin_make_shadowmap(render_context* rctx, Shadow* shad, int32_t index, int32_t a3); static void draw_pass_shadow_end_make_shadowmap(render_context* rctx, Shadow* shad, int32_t index, int32_t a3); -static void draw_pass_shadow_filter(render_context* rctx, render_texture* a1, render_texture* a2, - render_texture* a3, float_t sigma, float_t far_texel_offset, bool enable_lit_proj); +static void draw_pass_shadow_filter(render_context* rctx, RenderTexture* a1, RenderTexture* a2, + RenderTexture* a3, float_t sigma, float_t far_texel_offset, bool enable_lit_proj); static void draw_pass_shadow_esm_filter(render_context* rctx, - render_texture* dst, render_texture* buf, render_texture* src); + RenderTexture* dst, RenderTexture* buf, RenderTexture* src); static bool draw_pass_shadow_litproj(render_context* rctx, light_proj* litproj); static void draw_pass_sss_contour(render_context* rctx, post_process* pp); static void draw_pass_sss_filter(render_context* rctx, sss_data* sss); @@ -227,7 +227,7 @@ namespace rndr { for (int32_t i = 1; i < 3; i++) for (int32_t j = 0; j < 4; j++) { - shad->curr_render_textures[i]->bind(j); + shad->curr_render_textures[i]->Bind(j); glClearColor(1.0f, 1.0f, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); } @@ -248,11 +248,11 @@ namespace rndr { // sss->npr_contour = false; //if (sss->npr_contour) { - pp->rend_texture.bind(); + pp->rend_texture.Bind(); glViewport(0, 0, pp->render_width, pp->render_height); //} //else { - // sss->textures[0].bind(); + // sss->textures[0].Bind(); // glViewport(0, 0, 640, 360); //} @@ -288,7 +288,7 @@ namespace rndr { else if (npr) { rctx->obj_scene_ubo.WriteMapMemory(rctx->obj_scene); - pp->rend_texture.bind(); + pp->rend_texture.Bind(); glViewport(0, 0, pp->render_width, pp->render_height); glClear(GL_DEPTH_BUFFER_BIT); rctx->draw_state.shader_index = SHADER_FT_SSS_SKIN; @@ -304,7 +304,7 @@ namespace rndr { } if (!sss->npr_contour) { - sss->textures[0].bind(); + sss->textures[0].Bind(); glViewport(0, 0, 640, 360); filter_scene_shader_data filter_scene = {}; @@ -323,7 +323,7 @@ namespace rndr { rctx->filter_scene_ubo.Bind(0); rctx->imgfilter_batch_ubo.Bind(1); gl_state_active_bind_texture_2d(0, pp->rend_texture.color_texture->tex); - render_texture::draw_custom(); + RenderTexture::DrawCustom(); } draw_pass_sss_filter(rctx, sss); @@ -333,9 +333,9 @@ namespace rndr { void RenderManager::pass_reflect(render_context* rctx) { gl_state_begin_event("pass_reflect"); - render_texture& refl_tex = rctx->render_manager.get_render_texture(0); - render_texture& refl_buf_tex = rctx->render_manager.get_render_texture(11); - refl_tex.bind(); + RenderTexture& refl_tex = rctx->render_manager.get_render_texture(0); + RenderTexture& refl_buf_tex = rctx->render_manager.get_render_texture(11); + refl_tex.Bind(); if (rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFLECT_OPAQUE) || rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFLECT_TRANSPARENT) || rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFLECT_TRANSLUCENT) @@ -387,12 +387,12 @@ namespace rndr { for (int32_t i = reflect_blur_num, j = 0; i > 0; i--, j++) if (j % 2) { - refl_tex.bind(); + refl_tex.Bind(); blur_filter_apply(rctx, refl_tex.color_texture->tex, refl_buf_tex.color_texture->tex, reflect_blur_filter, 1.0f, 1.0f, 0.0f); } else { - refl_buf_tex.bind(); + refl_buf_tex.Bind(); blur_filter_apply(rctx, refl_buf_tex.color_texture->tex, refl_tex.color_texture->tex, reflect_blur_filter, 1.0f, 1.0f, 0.0f); } @@ -416,8 +416,8 @@ namespace rndr { void RenderManager::pass_refract(render_context* rctx) { gl_state_begin_event("pass_refract"); - render_texture& refract_texture = rctx->render_manager.get_render_texture(1); - refract_texture.bind(); + RenderTexture& refract_texture = rctx->render_manager.get_render_texture(1); + refract_texture.Bind(); if (rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFRACT_OPAQUE) || rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFRACT_TRANSPARENT) || rctx->disp_manager.get_obj_count(mdl::OBJ_TYPE_REFRACT_TRANSLUCENT)) { @@ -564,7 +564,7 @@ namespace rndr { rctx->obj_scene_ubo.WriteMapMemory(rctx->obj_scene); if (pass_sw[RND_PASSID_REFLECT] && reflect) { - render_texture& refl_tex = get_render_texture(0); + RenderTexture& refl_tex = get_render_texture(0); gl_state_active_bind_texture_2d(15, refl_tex.color_texture->tex); uniform_value[U_WATER_REFLECT] = 1; } @@ -801,7 +801,7 @@ namespace rndr { glClear(GL_COLOR_BUFFER_BIT); } else - rctx->post_process.screen_texture.bind(); + rctx->post_process.screen_texture.Bind(); gl_state_disable_depth_test(); gl_state_enable_blend(); @@ -826,8 +826,8 @@ namespace rndr { } void RenderManager::pass_3d_contour(render_context* rctx) { - render_texture* rt = &rctx->post_process.rend_texture; - render_texture* contour_rt = &rctx->post_process.sss_contour_texture; + RenderTexture* rt = &rctx->post_process.rend_texture; + RenderTexture* contour_rt = &rctx->post_process.sss_contour_texture; gl_state_enable_blend(); gl_state_set_blend_func(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -854,7 +854,7 @@ namespace rndr { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); rctx->quad_ubo.Bind(0); rctx->contour_params_ubo.Bind(2); - render_texture::draw(&shaders_ft); + RenderTexture::Draw(&shaders_ft); if (effect_texture) gl_state_active_bind_texture_2d(14, effect_texture->tex); @@ -904,7 +904,7 @@ void image_filter_scale(render_context* rctx, GLuint dst, GLuint src, const vec4 rctx->filter_scene_ubo.Bind(0); rctx->imgfilter_batch_ubo.Bind(1); gl_state_active_bind_texture_2d(0, src); - render_texture::draw_custom(); + RenderTexture::DrawCustom(); texture_params_restore(&tex_params[0], &tex_params[1]); } @@ -928,7 +928,7 @@ void draw_pass_set_camera(render_context* rctx) { static void draw_pass_shadow_begin_make_shadowmap(render_context* rctx, Shadow* shad, int32_t index, int32_t a3) { texture* tex = shad->curr_render_textures[0]->color_texture; - shad->curr_render_textures[0]->bind(); + shad->curr_render_textures[0]->Bind(); glViewport(0, 0, tex->width, tex->height); glScissor(0, 0, tex->width, tex->height); gl_state_enable_depth_test(); @@ -983,22 +983,22 @@ static void draw_pass_shadow_end_make_shadowmap(render_context* rctx, &shad->render_textures[6], &shad->render_textures[3]); } - render_texture* rend_tex = shad->curr_render_textures[1 + index]; - render_texture* rend_buf_tex = shad->curr_render_textures[3]; - rend_tex->bind(); + RenderTexture* rend_tex = shad->curr_render_textures[1 + index]; + RenderTexture* rend_buf_tex = shad->curr_render_textures[3]; + rend_tex->Bind(); - render_texture* src = shad->curr_render_textures[0]; + RenderTexture* src = shad->curr_render_textures[0]; image_filter_scale(rctx, rend_tex->color_texture->tex, src->color_texture->tex, 1.0f); if (shad->blur_filter_enable[index]) { for (int32_t i = shad->near_blur, j = 0; i > 0; i--, j++) if (j % 2) { - rend_tex->bind(); + rend_tex->Bind(); blur_filter_apply(rctx, rend_tex->color_texture->tex, rend_buf_tex->color_texture->tex, shad->blur_filter, 1.0f, 1.0f, 0.0f); } else { - rend_buf_tex->bind(); + rend_buf_tex->Bind(); blur_filter_apply(rctx, rend_buf_tex->color_texture->tex, rend_tex->color_texture->tex, shad->blur_filter, 1.0f, 1.0f, 0.0f); } @@ -1010,7 +1010,7 @@ static void draw_pass_shadow_end_make_shadowmap(render_context* rctx, GL_COLOR_BUFFER_BIT, GL_LINEAR); } else { - rend_tex->bind(); + rend_tex->Bind(); glClearColor(1.0f, 1.0f, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); } @@ -1021,8 +1021,8 @@ static void draw_pass_shadow_end_make_shadowmap(render_context* rctx, gl_state_bind_texture_2d(0); } -static void draw_pass_shadow_filter(render_context* rctx, render_texture* a1, render_texture* a2, - render_texture* a3, float_t sigma, float_t far_texel_offset, bool enable_lit_proj) { +static void draw_pass_shadow_filter(render_context* rctx, RenderTexture* a1, RenderTexture* a2, + RenderTexture* a3, float_t sigma, float_t far_texel_offset, bool enable_lit_proj) { GLuint v7 = a1->color_texture->tex; GLuint v9 = a2->color_texture->tex; GLuint v11 = v7; @@ -1055,7 +1055,7 @@ static void draw_pass_shadow_filter(render_context* rctx, render_texture* a1, re rctx->filter_scene_ubo.Bind(0); rctx->esm_filter_batch_ubo.Bind(1); - a2->bind(); + a2->Bind(); esm_filter_batch.g_params = { 1.0f / (float_t)tex_params[0].width, 0.0f, far_texel_offset, far_texel_offset }; rctx->esm_filter_batch_ubo.WriteMapMemory(esm_filter_batch); @@ -1068,22 +1068,22 @@ static void draw_pass_shadow_filter(render_context* rctx, render_texture* a1, re GLint swizzle[] = { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle); } - render_texture::draw_custom(); + RenderTexture::DrawCustom(); - a1->bind(); + a1->Bind(); esm_filter_batch.g_params = { 0.0f, 1.0f / (float_t)tex_params[0].height, far_texel_offset, far_texel_offset }; rctx->esm_filter_batch_ubo.WriteMapMemory(esm_filter_batch); gl_state_active_bind_texture_2d(0, v9); - render_texture::draw_custom(); + RenderTexture::DrawCustom(); shader::unbind(); texture_params_restore(&tex_params[0], &tex_params[1]); } static void draw_pass_shadow_esm_filter(render_context* rctx, - render_texture* dst, render_texture* buf, render_texture* src) { + RenderTexture* dst, RenderTexture* buf, RenderTexture* src) { GLuint dst_tex = dst->color_texture->tex; GLuint buf_tex = buf->color_texture->tex; GLuint src_tex = src->color_texture->tex; @@ -1105,7 +1105,7 @@ static void draw_pass_shadow_esm_filter(render_context* rctx, texture_param tex_params[3]; texture_params_get(dst_tex, &tex_params[0], src_tex, &tex_params[1], buf_tex, &tex_params[2]); - buf->bind(); + buf->Bind(); esm_filter_batch.g_params = { 1.0f / (float_t)tex_params[1].width, 1.0f / (float_t)tex_params[1].height, 0.0f, 0.0f }; rctx->esm_filter_batch_ubo.WriteMapMemory(esm_filter_batch); @@ -1113,9 +1113,9 @@ static void draw_pass_shadow_esm_filter(render_context* rctx, uniform_value[U_ESM_FILTER] = 0; shaders_ft.set(SHADER_FT_ESMFILT); gl_state_active_bind_texture_2d(0, src_tex); - render_texture::draw(&shaders_ft); + RenderTexture::Draw(&shaders_ft); - dst->bind(); + dst->Bind(); esm_filter_batch.g_params = { 0.75f / (float_t)tex_params[2].width, 0.75f / (float_t)tex_params[2].height, 0.0f, 0.0f }; rctx->esm_filter_batch_ubo.WriteMapMemory(esm_filter_batch); @@ -1123,7 +1123,7 @@ static void draw_pass_shadow_esm_filter(render_context* rctx, uniform_value[U_ESM_FILTER] = 1; shaders_ft.set(SHADER_FT_ESMFILT); gl_state_active_bind_texture_2d(0, buf_tex); - render_texture::draw(&shaders_ft); + RenderTexture::Draw(&shaders_ft); texture_params_restore(&tex_params[0], &tex_params[1], &tex_params[2]); } @@ -1136,7 +1136,7 @@ static bool draw_pass_shadow_litproj(render_context* rctx, light_proj* litproj) if (!tex) return false; - litproj->draw_texture.bind(); + litproj->draw_texture.Bind(); glViewport(0, 0, litproj->draw_texture.color_texture->width, litproj->draw_texture.color_texture->height); @@ -1165,7 +1165,7 @@ static bool draw_pass_shadow_litproj(render_context* rctx, light_proj* litproj) } static void draw_pass_sss_contour(render_context* rctx, post_process* pp) { - pp->sss_contour_texture.bind(); + pp->sss_contour_texture.Bind(); gl_state_enable_depth_test(); gl_state_set_depth_func(GL_ALWAYS); gl_state_set_depth_mask(GL_TRUE); @@ -1202,7 +1202,7 @@ static void draw_pass_sss_contour(render_context* rctx, post_process* pp) { shaders_ft.set(SHADER_FT_CONTOUR); rctx->contour_coef_ubo.Bind(2); - render_texture::draw_quad(&shaders_ft, pp->render_width, pp->render_height); + RenderTexture::DrawQuad(&shaders_ft, pp->render_width, pp->render_height); } static void draw_pass_sss_filter_calc_coef(double_t a1, size_t a2, double_t a3, size_t a4, @@ -1304,20 +1304,20 @@ static void draw_pass_sss_filter(render_context* rctx, sss_data* sss) { gl_state_active_texture(0); if (sss->npr_contour) { - sss->textures[0].bind(); + sss->textures[0].Bind(); glViewport(0, 0, 640, 360); post_process* pp = &rctx->post_process; uniform_value[U_REDUCE] = 0; shaders_ft.set(SHADER_FT_REDUCE); gl_state_bind_texture_2d(pp->rend_texture.color_texture->tex); - render_texture::draw_quad(&shaders_ft, 640, 360, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, 640, 360, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f); } - sss->textures[2].bind(); + sss->textures[2].Bind(); glViewport(0, 0, 320, 180); uniform_value[U_SSS_FILTER] = 0; shaders_ft.set(SHADER_FT_SSS_FILT); gl_state_bind_texture_2d(sss->textures[0].color_texture->tex); - render_texture::draw_quad(&shaders_ft, 640, 360, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, 640, 360, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f); sss_filter_gaussian_coef_shader_data shader_data = {}; shader_data.g_param = { (float_t)(sss_count - 1), 0.0f, 1.0f, 1.0f }; @@ -1329,13 +1329,13 @@ static void draw_pass_sss_filter(render_context* rctx, sss_data* sss) { draw_pass_sss_filter_calc_coef(1.0, sss_count, v34, 3, a5, a6, a7, a8, shader_data.g_coef); rctx->sss_filter_gaussian_coef_ubo.WriteMapMemory(shader_data); - sss->textures[1].bind(); + sss->textures[1].Bind(); glViewport(0, 0, 320, 180); uniform_value[U_SSS_FILTER] = 3; shaders_ft.set(SHADER_FT_SSS_FILT); gl_state_bind_texture_2d(sss->textures[2].color_texture->tex); rctx->sss_filter_gaussian_coef_ubo.Bind(1); - render_texture::draw_quad(&shaders_ft, 320, 180, 1.0f, 1.0f, 0.96f, 1.0f, 0.0f); + RenderTexture::DrawQuad(&shaders_ft, 320, 180, 1.0f, 1.0f, 0.96f, 1.0f, 0.0f); gl_state_bind_texture_2d(0); } @@ -1489,12 +1489,12 @@ static void draw_pass_3d_translucent(render_context* rctx, bool opaque_enable, shader_data.g_opacity = { (float_t)alpha * (float_t)(1.0 / 255.0), 0.0f, 0.0f, 0.0f }; rctx->transparency_batch_ubo.WriteMapMemory(shader_data); - pp->buf_texture.bind(); + pp->buf_texture.Bind(); shaders_ft.set(SHADER_FT_TRANSPARENCY); rctx->transparency_batch_ubo.Bind(0); gl_state_active_bind_texture_2d(0, pp->transparency_texture.color_texture->tex); gl_state_active_bind_texture_2d(1, pp->rend_texture.color_texture->tex); - render_texture::draw_custom(); + RenderTexture::DrawCustom(); fbo::blit(pp->buf_texture.fbos[0], pp->rend_texture.fbos[0], 0, 0, pp->render_width, pp->render_height, diff --git a/src/CRE/render_texture.cpp b/src/CRE/render_texture.cpp index c6361927..1becd72f 100644 --- a/src/CRE/render_texture.cpp +++ b/src/CRE/render_texture.cpp @@ -13,20 +13,20 @@ static GLuint render_texture_vao; static bool render_texture_data_initialized; static uint32_t render_texture_counter; -static int32_t render_texture_framebuffer_init(render_texture* rt, int32_t max_level); -static int32_t render_texture_framebuffer_set_texture(render_texture* rrt, +static int32_t render_texture_framebuffer_init(RenderTexture* rt, int32_t max_level); +static int32_t render_texture_framebuffer_set_texture(RenderTexture* rrt, GLuint color_texture, int32_t level, GLuint depth_texture, bool stencil); -render_texture::render_texture() : color_texture(), +RenderTexture::RenderTexture() : color_texture(), depth_texture(), binding(), max_level(), fbos(), rbo(), field_2C() { } -render_texture::~render_texture() { - free(); +RenderTexture::~RenderTexture() { + Free(); } -int32_t render_texture::bind(int32_t index) { +int32_t RenderTexture::Bind(int32_t index) { if (index < 0 || index > max_level) return -1; @@ -38,7 +38,7 @@ int32_t render_texture::bind(int32_t index) { return 0; } -void render_texture::draw(bool depth) { +void RenderTexture::Draw(bool depth) { gl_state_active_bind_texture_2d(0, color_texture->tex); if (depth && depth_texture->tex) gl_state_active_bind_texture_2d(1, depth_texture->tex); @@ -47,7 +47,7 @@ void render_texture::draw(bool depth) { gl_state_bind_vertex_array(0); } -void render_texture::free() { +void RenderTexture::Free() { if (depth_texture) { texture_free(depth_texture); depth_texture = 0; @@ -75,7 +75,7 @@ void render_texture::free() { max_level = 0; } -int32_t render_texture::init(int32_t width, int32_t height, +int32_t RenderTexture::Init(int32_t width, int32_t height, int32_t max_level, GLenum color_format, GLenum depth_format) { if (max_level < 0) return -1; @@ -83,7 +83,7 @@ int32_t render_texture::init(int32_t width, int32_t height, max_level = min_def(max_level, 15); if (max_level < 0) return 0; - free(); + Free(); GLuint color_texture; if (color_format) { @@ -127,15 +127,14 @@ int32_t render_texture::init(int32_t width, int32_t height, } this->max_level = max_level; - if (render_texture_framebuffer_init(this, max_level) >= 0) { + if (render_texture_framebuffer_init(this, max_level) >= 0) for (int32_t i = 0; i <= max_level; i++) if (render_texture_framebuffer_set_texture(this, color_texture, i, depth_texture, stencil) < 0) return -1; - } return 0; } -int32_t render_texture::set_color_depth_textures(GLuint color_texture, +int32_t RenderTexture::SetColorDepthTextures(GLuint color_texture, int32_t max_level, GLuint depth_texture, bool stencil) { int32_t error = 0; this->max_level = max_level; @@ -145,17 +144,17 @@ int32_t render_texture::set_color_depth_textures(GLuint color_texture, return error; } -void render_texture::draw(shader_set_data* set) { +void RenderTexture::Draw(shader_set_data* set) { gl_state_bind_vertex_array(render_texture_vao); set->draw_arrays(GL_TRIANGLE_STRIP, 0, 4); } -void render_texture::draw_custom() { +void RenderTexture::DrawCustom() { gl_state_bind_vertex_array(render_texture_vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } -void render_texture::draw_quad(shader_set_data* set, int32_t width, int32_t height, +void RenderTexture::DrawQuad(shader_set_data* set, int32_t width, int32_t height, float_t scale, float_t param_x, float_t param_y, float_t param_z, float_t param_w) { extern render_context* rctx_ptr; @@ -191,12 +190,12 @@ void render_texture_data_free() { render_texture_data_initialized = false; } -static int32_t render_texture_framebuffer_init(render_texture* rt, int32_t max_level) { +static int32_t render_texture_framebuffer_init(RenderTexture* rt, int32_t max_level) { glGenFramebuffers(max_level + 1, rt->fbos); return -(gl_state_get_error() != GL_ZERO); } -static int32_t render_texture_framebuffer_set_texture(render_texture* rt, +static int32_t render_texture_framebuffer_set_texture(RenderTexture* rt, GLuint color_texture, int32_t level, GLuint depth_texture, bool stencil) { if (level < 0 || level > rt->max_level) return -1; diff --git a/src/CRE/render_texture.hpp b/src/CRE/render_texture.hpp index d5506b81..89722ad7 100644 --- a/src/CRE/render_texture.hpp +++ b/src/CRE/render_texture.hpp @@ -9,7 +9,7 @@ #include "shader.hpp" #include "texture.hpp" -struct render_texture { +struct RenderTexture { texture* color_texture; texture* depth_texture; int32_t binding; @@ -18,20 +18,20 @@ struct render_texture { GLuint rbo; GLuint field_2C; - render_texture(); - ~render_texture(); + RenderTexture(); + ~RenderTexture(); - int32_t bind(int32_t index = 0); - void draw(bool depth = false); - void free(); - int32_t init(int32_t width, int32_t height, + int32_t Bind(int32_t index = 0); + void Draw(bool depth = false); + void Free(); + int32_t Init(int32_t width, int32_t height, int32_t max_level, GLenum color_format, GLenum depth_format); - int32_t set_color_depth_textures(GLuint color_texture, - int32_t max_level, GLuint depth_texture, bool stencil = false); + int32_t SetColorDepthTextures(GLuint color_texture, + int32_t max_level = 0, GLuint depth_texture = 0, bool stencil = false); - static void draw(shader_set_data* set); - static void draw_custom(); - static void draw_quad(shader_set_data* set, int32_t width, int32_t height, float_t scale = 1.0f, + static void Draw(shader_set_data* set); + static void DrawCustom(); + static void DrawQuad(shader_set_data* set, int32_t width, int32_t height, float_t scale = 1.0f, float_t param_x = 1.0f, float_t param_y = 1.0f, float_t param_z = 1.0f, float_t param_w = 1.0f); }; diff --git a/src/CRE/task_effect.cpp b/src/CRE/task_effect.cpp index 9b3d8690..edf7ca55 100644 --- a/src/CRE/task_effect.cpp +++ b/src/CRE/task_effect.cpp @@ -239,7 +239,7 @@ static particle_data* snow_particle_emit_fallen(); static vec3 snow_particle_get_random_velocity(); static void snow_particle_free(); -static void sub_1403B6ED0(render_texture* a1, render_texture* a2, render_texture* a3, ripple_emit_params& params); +static void sub_1403B6ED0(RenderTexture* a1, RenderTexture* a2, RenderTexture* a3, ripple_emit_params& params); static void sub_1403B6F60(GLuint a1, GLuint a2, GLuint a3, ripple_emit_params& params); static TaskEffectAuth3D* task_effect_auth_3d; @@ -280,8 +280,8 @@ static stage_param_litproj* stage_param_data_litproj_current; static bool stage_param_data_litproj_set; static bool light_proj_enable; -static render_texture litproj_shadow[2]; -static render_texture litproj_texture; +static RenderTexture litproj_shadow[2]; +static RenderTexture litproj_texture; static bool particle_enable; static float_t particle_delta_time; @@ -997,8 +997,8 @@ void TaskEffectFogRing::Data::Draw() { return; rctx->draw_state.set_fog_height(true); - render_texture& rt = rctx->render_manager.get_render_texture(8); - rt.bind(); + RenderTexture& rt = rctx->render_manager.get_render_texture(8); + rt.Bind(); glViewport(0, 0, rt.color_texture->get_width_align_mip_level(), rt.color_texture->get_height_align_mip_level()); @@ -1789,7 +1789,7 @@ void ripple_emit::clear_tex() { glGetFloatv(GL_COLOR_CLEAR_VALUE, (GLfloat*)&clear_color); for (int32_t i = 0, j = 5; i < 3; i++, j++) { - render_texture* rt; + RenderTexture* rt; float_t v5; if (use_float_ripplemap) { rt = &rctx_ptr->render_manager.get_render_texture(j - 3); @@ -1801,7 +1801,7 @@ void ripple_emit::clear_tex() { } glClearColor(0.0f, 0.0f, 0.0f, v5); - rt->bind(); + rt->Bind(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); gl_state_bind_framebuffer(0); } @@ -1847,7 +1847,7 @@ void ripple_emit::draw() { render_context* rctx = rctx_ptr; - render_texture* rt[3]; + RenderTexture* rt[3]; for (int32_t i = 0, j = 2; i < 3; i++, j++) rt[i] = &rctx->render_manager.get_render_texture( use_float_ripplemap ? j : (j + 3)); @@ -1857,7 +1857,7 @@ void ripple_emit::draw() { if (counter >= 3) counter = 0; - rt[(counter + 1) % 3]->bind(); + rt[(counter + 1) % 3]->Bind(); GLint v43[4]; glGetIntegerv(GL_VIEWPORT, v43); @@ -2010,7 +2010,7 @@ void ripple_emit::draw_static(void* data) { ((ripple_emit*)data)->draw(); } -void ripple_emit::sub_1403584A0(render_texture* rt) { +void ripple_emit::sub_1403584A0(RenderTexture* rt) { if (ripple_tex_id == -1) return; @@ -2018,8 +2018,8 @@ void ripple_emit::sub_1403584A0(render_texture* rt) { if (!ripple_tex) return; - field_BB8.set_color_depth_textures(ripple_tex->tex, 0, 0); - field_BB8.bind(0); + field_BB8.SetColorDepthTextures(ripple_tex->tex); + field_BB8.Bind(); image_filter_scale(rctx_ptr, ripple_tex->tex, rt->color_texture->tex, 1.0f); gl_state_bind_framebuffer(0); @@ -3503,7 +3503,7 @@ static void draw_ripple_emit(render_context* rctx, struc_101* data) { int32_t size = (int32_t)(data->size + 0.5f); - render_texture& rt = rctx->render_manager.get_render_texture( + RenderTexture& rt = rctx->render_manager.get_render_texture( ripple_emit_data->use_float_ripplemap ? 2 : 5); int32_t width = rt.color_texture->width; int32_t height = rt.color_texture->height; @@ -4516,8 +4516,8 @@ static void snow_particle_free() { snow_particle_batch_ubo.Destroy(); } -static void sub_1403B6ED0(render_texture* a1, render_texture* a2, render_texture* a3, ripple_emit_params& params) { - a1->bind(); +static void sub_1403B6ED0(RenderTexture* a1, RenderTexture* a2, RenderTexture* a3, ripple_emit_params& params) { + a1->Bind(); if (a1->color_texture->internal_format == GL_RGBA32F || a1->color_texture->internal_format == GL_RGBA16F) uniform_value[U_RIPPLE] = 1; diff --git a/src/CRE/task_effect.hpp b/src/CRE/task_effect.hpp index 92b87033..9f28339e 100644 --- a/src/CRE/task_effect.hpp +++ b/src/CRE/task_effect.hpp @@ -430,7 +430,7 @@ struct ripple_emit { int32_t field_4F0; struc_207 field_4F4[6]; int32_t field_BB4; - render_texture field_BB8; + RenderTexture field_BB8; int32_t counter; int8_t field_BEC; ripple_emit_params params; @@ -454,7 +454,7 @@ struct ripple_emit { static void draw_static(void* data); - void sub_1403584A0(render_texture* rt); + void sub_1403584A0(RenderTexture* rt); void sub_140358690(); void sub_1403587C0(const vec3 a2, const vec3 a3, float_t a4, struc_101& a5, struc_101& a6); void sub_14035AAE0(); diff --git a/src/KKdLib/database/stage.cpp b/src/KKdLib/database/stage.cpp index 7641264d..00d14728 100644 --- a/src/KKdLib/database/stage.cpp +++ b/src/KKdLib/database/stage.cpp @@ -371,16 +371,6 @@ void stage_database::add(stage_database_file* stage_data_file) { data->ring_rectangle_height = i.ring_rectangle_height; data->ring_height = i.ring_height; data->ring_out_height = i.ring_out_height; - data->render_texture = i.render_texture; - data->render_texture_flag = i.render_texture_flag; - data->movie_texture = i.movie_texture; - data->movie_texture_flag = i.movie_texture_flag; - data->ring_rectangle_x = i.ring_rectangle_x; - data->ring_rectangle_y = i.ring_rectangle_y; - data->ring_rectangle_width = i.ring_rectangle_width; - data->ring_rectangle_height = i.ring_rectangle_height; - data->ring_height = i.ring_height; - data->ring_out_height = i.ring_out_height; data->field_13 = i.field_13; data->effects = i.effects; data->effects_init = i.effects_init; diff --git a/src/ReDIVA/render.cpp b/src/ReDIVA/render.cpp index 3355dd12..0926312c 100644 --- a/src/ReDIVA/render.cpp +++ b/src/ReDIVA/render.cpp @@ -1136,7 +1136,7 @@ static void render_context_disp(render_context* rctx) { glViewport(0, 0, internal_3d_res.x, internal_3d_res.y); - rctx->post_process.rend_texture.bind(); + rctx->post_process.rend_texture.Bind(); gl_state_set_depth_mask(GL_TRUE); glClearBufferfv(GL_COLOR, 0, color_clear); glClearBufferfv(GL_DEPTH, 0, &depth_clear); diff --git a/src/ReDIVA/x_pv_game.cpp b/src/ReDIVA/x_pv_game.cpp index fc1353e2..0e675393 100644 --- a/src/ReDIVA/x_pv_game.cpp +++ b/src/ReDIVA/x_pv_game.cpp @@ -4079,7 +4079,7 @@ bool x_pv_game::Ctrl() { glViewport(0, 0, width, height); shaders_dev.set(SHADER_DEV_CLAMP_COLORS); glBeginQuery(GL_SAMPLES_PASSED, d3d_query[next_idx]); - render_texture::draw(&shaders_dev); + RenderTexture::Draw(&shaders_dev); glEndQuery(GL_SAMPLES_PASSED); gl_state_bind_texture_2d(0); gl_state_bind_framebuffer(0);