From 32a16c3affbaf7a820367519b61334df083be498 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Fri, 10 May 2024 23:54:16 +0300 Subject: [PATCH] ... --- src/CRE/mdl/disp_manager.cpp | 12 ++++++------ src/CRE/object.cpp | 2 +- src/CRE/object.hpp | 2 +- src/CRE/render.cpp | 2 +- src/CRE/stage.cpp | 6 +++--- src/ReDIVA/data_test/auth_2d_test.cpp | 3 --- src/ReDIVA/data_test/auth_3d_test.cpp | 4 ---- src/ReDIVA/data_test/glitter_test.cpp | 2 -- src/ReDIVA/data_test/motion_test.cpp | 1 + src/ReDIVA/data_test/stage_test.cpp | 5 ----- 10 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/CRE/mdl/disp_manager.cpp b/src/CRE/mdl/disp_manager.cpp index 970e7ca4..2712ccc1 100644 --- a/src/CRE/mdl/disp_manager.cpp +++ b/src/CRE/mdl/disp_manager.cpp @@ -1717,7 +1717,7 @@ namespace mdl { size_t center_offset = gen_grid_vertices(vtx_data, grid.w, grid.h, grid.ws, grid.hs); etc_vertex_array->offset = 0; - etc_vertex_array->count = (GLsizei)(center_offset / 6); + etc_vertex_array->count = (GLsizei)center_offset; } break; case mdl::ETC_OBJ_CUBE: { EtcObjCube& cube = etc->data.cube; @@ -1746,7 +1746,7 @@ namespace mdl { gen_plane_vertices(vtx_data, plane.w, plane.h); - etc_vertex_array->count = (GLsizei)(vtx_data.size() / 6); + etc_vertex_array->count = (GLsizei)vtx_data.size(); } break; case mdl::ETC_OBJ_CONE: { EtcObjCone& cone = etc->data.cone; @@ -1758,14 +1758,14 @@ namespace mdl { gen_line_vertices(vtx_data, length); - etc_vertex_array->count = (GLsizei)(vtx_data.size() / 6); + etc_vertex_array->count = (GLsizei)vtx_data.size(); } break; case mdl::ETC_OBJ_CROSS: { EtcObjCross& cross = etc->data.cross; gen_cross_vertices(vtx_data, cross.size); - etc_vertex_array->count = (GLsizei)(vtx_data.size() / 6); + etc_vertex_array->count = (GLsizei)vtx_data.size(); } break; case mdl::ETC_OBJ_CAPSULE: { // Added EtcObjCapsule& capsule = etc->data.capsule; @@ -1820,10 +1820,10 @@ namespace mdl { gl_state_bind_vertex_array(etc_vertex_array->vertex_array); if (etc_vertex_array->vertex_buffer.IsNull()) - etc_vertex_array->vertex_buffer.Create(sizeof(float_t) * vtx_data.size()); + etc_vertex_array->vertex_buffer.Create(sizeof(vec3) * 2 * vtx_data.size()); etc_vertex_array->vertex_buffer.Bind(true); - glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float_t) + glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vec3) * 2 * vtx_data.size(), vtx_data.data()); if (indexed) { diff --git a/src/CRE/object.cpp b/src/CRE/object.cpp index 9687fa10..529b1ffb 100644 --- a/src/CRE/object.cpp +++ b/src/CRE/object.cpp @@ -1912,7 +1912,7 @@ inline obj_mesh_vertex_buffer* object_storage_get_obj_mesh_vertex_buffer(object_ return 0; } -GLuint obj_database_get_obj_set_texture(int32_t set, uint32_t tex_id) { +GLuint object_storage_get_obj_set_texture(uint32_t set, uint32_t tex_id) { std::vector* textures = object_storage_get_obj_set_textures(set); if (!textures) return 0; diff --git a/src/CRE/object.hpp b/src/CRE/object.hpp index 40355199..0f0cdbf5 100644 --- a/src/CRE/object.hpp +++ b/src/CRE/object.hpp @@ -138,7 +138,7 @@ extern obj_index_buffer* object_storage_get_obj_index_buffers(uint32_t set_id); extern obj_mesh_index_buffer* object_storage_get_obj_mesh_index_buffer(object_info obj_info); extern obj_vertex_buffer* object_storage_get_obj_vertex_buffers(uint32_t set_id); extern obj_mesh_vertex_buffer* object_storage_get_obj_mesh_vertex_buffer(object_info obj_info); -extern GLuint obj_database_get_obj_set_texture(int32_t set, uint32_t tex_id); +extern GLuint object_storage_get_obj_set_texture(uint32_t set, uint32_t tex_id); extern std::vector* object_storage_get_obj_set_textures(int32_t set); extern int32_t object_storage_load_set(void* data, const object_database* obj_db, const char* name); extern int32_t object_storage_load_set(void* data, const object_database* obj_db, uint32_t set_id); diff --git a/src/CRE/render.cpp b/src/CRE/render.cpp index 3945e695..4f1b7c15 100644 --- a/src/CRE/render.cpp +++ b/src/CRE/render.cpp @@ -380,7 +380,7 @@ namespace rndr { if (!lens_flare_texture) return; - GLuint tex = obj_database_get_obj_set_texture(5, 4549); + GLuint tex = object_storage_get_obj_set_texture(5, 4549); if (!tex) return; diff --git a/src/CRE/stage.cpp b/src/CRE/stage.cpp index 867c9a3b..c35cc43f 100644 --- a/src/CRE/stage.cpp +++ b/src/CRE/stage.cpp @@ -514,12 +514,12 @@ static void stage_disp(stage* s) { if (s->stage_data->lens_flare_texture != -1 && s->lens_flare) { int32_t object_set_id = s->stage_data->object_set_id; rndr::Render* rend = &rctx_ptr->render; - rend->lens_flare_texture = obj_database_get_obj_set_texture( + rend->lens_flare_texture = object_storage_get_obj_set_texture( object_set_id, s->stage_data->lens_flare_texture); if (rend->lens_flare_texture) { - rend->lens_shaft_texture = obj_database_get_obj_set_texture( + rend->lens_shaft_texture = object_storage_get_obj_set_texture( object_set_id, s->stage_data->lens_shaft_texture); - rend->lens_ghost_texture = obj_database_get_obj_set_texture( + rend->lens_ghost_texture = object_storage_get_obj_set_texture( object_set_id, s->stage_data->lens_ghost_texture); rend->lens_ghost_count = 16; rend->lens_shaft_inv_scale = s->stage_data->lens_shaft_inv_scale; diff --git a/src/ReDIVA/data_test/auth_2d_test.cpp b/src/ReDIVA/data_test/auth_2d_test.cpp index cf325262..98e4b408 100644 --- a/src/ReDIVA/data_test/auth_2d_test.cpp +++ b/src/ReDIVA/data_test/auth_2d_test.cpp @@ -4,10 +4,7 @@ */ #include "auth_2d_test.hpp" -#include "../../KKdLib/io/path.hpp" #include "../../KKdLib/prj/algorithm.hpp" -#include "../../KKdLib/sort.hpp" -#include "../../KKdLib/str_utils.hpp" #include "../../CRE/auth_2d.hpp" #include "../../CRE/data.hpp" #include "../../CRE/effect.hpp" diff --git a/src/ReDIVA/data_test/auth_3d_test.cpp b/src/ReDIVA/data_test/auth_3d_test.cpp index 1184a422..c46ae18c 100644 --- a/src/ReDIVA/data_test/auth_3d_test.cpp +++ b/src/ReDIVA/data_test/auth_3d_test.cpp @@ -4,10 +4,6 @@ */ #include "auth_3d_test.hpp" -#include "../../KKdLib/io/path.hpp" -#include "../../KKdLib/hash.hpp" -#include "../../KKdLib/sort.hpp" -#include "../../KKdLib/str_utils.hpp" #include "../../CRE/rob/rob.hpp" #include "../../CRE/clear_color.hpp" #include "../../CRE/data.hpp" diff --git a/src/ReDIVA/data_test/glitter_test.cpp b/src/ReDIVA/data_test/glitter_test.cpp index a9dc7c91..6136746d 100644 --- a/src/ReDIVA/data_test/glitter_test.cpp +++ b/src/ReDIVA/data_test/glitter_test.cpp @@ -4,8 +4,6 @@ */ #include "glitter_test.hpp" -#include "../../KKdLib/io/path.hpp" -#include "../../KKdLib/str_utils.hpp" #include "../../CRE/clear_color.hpp" #include "../../CRE/data.hpp" #include "../../CRE/render_context.hpp" diff --git a/src/ReDIVA/data_test/motion_test.cpp b/src/ReDIVA/data_test/motion_test.cpp index e8b18d7d..749c1ecb 100644 --- a/src/ReDIVA/data_test/motion_test.cpp +++ b/src/ReDIVA/data_test/motion_test.cpp @@ -9,6 +9,7 @@ #include "../../CRE/rob/skin_param.hpp" #include "../../CRE/clear_color.hpp" #include "../../CRE/data.hpp" +#include "../../CRE/render_context.hpp" #include "../../CRE/hand_item.hpp" #include "../../CRE/module_table.hpp" #include "../../CRE/pv_db.hpp" diff --git a/src/ReDIVA/data_test/stage_test.cpp b/src/ReDIVA/data_test/stage_test.cpp index 6e929fbb..2b9eb44c 100644 --- a/src/ReDIVA/data_test/stage_test.cpp +++ b/src/ReDIVA/data_test/stage_test.cpp @@ -4,15 +4,10 @@ */ #include "stage_test.hpp" -#include "../../KKdLib/io/path.hpp" -#include "../../KKdLib/sort.hpp" -#include "../../KKdLib/str_utils.hpp" #include "../../CRE/data.hpp" #include "../../CRE/effect.hpp" -#include "../../CRE/render_context.hpp" #include "../../CRE/stage.hpp" #include "../dw.hpp" -#include "../input.hpp" #include "../config.hpp" class DtwStg : public dw::Shell {