DATA_TEST_OBJECT fix
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "disp_manager.hpp"
|
||||
#include "../gl_state.hpp"
|
||||
#include "../object.hpp"
|
||||
#include "../render_manager.hpp"
|
||||
#include "../shader_glsl_ft.hpp"
|
||||
#include "../sprite.hpp"
|
||||
@@ -2396,6 +2397,24 @@ namespace mdl {
|
||||
|
||||
static const mat4* rob_chara_item_equip_mat = 0;
|
||||
|
||||
HOOK(void, FASTCALL, DataTestObjectManager__Disp, 0x0000000140293E30, __int64 a1) {
|
||||
if (*(int32_t*)(a1 + 0x88) == 3 || *(int32_t*)(a1 + 0x74) < 0
|
||||
|| *(int32_t*)(a1 + 0x74) >= *(int32_t*)(a1 + 0x70))
|
||||
return;
|
||||
|
||||
int32_t set_id = obj_database_get_set_id(*(int32_t*)(a1 + 0x68));
|
||||
int32_t id = obj_database_get_obj_set_obj_id(*(int32_t*)(a1 + 0x68), *(int32_t*)(a1 + 0x74));
|
||||
disp_manager->set_obj_flags((mdl::ObjFlags)(*(int32_t*)(a1 + 0x84) | mdl::OBJ_40 | mdl::OBJ_20));
|
||||
mat4 mat;
|
||||
mat4_rotate_xyz(*(float_t*)(a1 + 0x78), *(float_t*)(a1 + 0x7C), *(float_t*)(a1 + 0x80), &mat);
|
||||
|
||||
vec3 pos = 0.0f;
|
||||
sub_1405E8A20(shadow_ptr_get(), 0, &pos);
|
||||
disp_manager->set_shadow_type(SHADOW_CHARA);
|
||||
disp_manager->entry_obj_by_object_info(&mat, object_info((uint16_t)id, (uint16_t)set_id));
|
||||
disp_manager->set_obj_flags((mdl::ObjFlags)0);
|
||||
}
|
||||
|
||||
HOOK(void, FASTCALL, sub_14031AF10, 0x000000014031AF10, obj_axis_aligned_bounding_box* aabb, color4u8_bgra color) {
|
||||
mdl::EtcObj etc(mdl::ETC_OBJ_SPHERE);
|
||||
etc.color = color;
|
||||
@@ -2495,6 +2514,7 @@ namespace mdl {
|
||||
|
||||
WRITE_NOP_6(0x0000000140512BE6);
|
||||
|
||||
INSTALL_HOOK(DataTestObjectManager__Disp);
|
||||
INSTALL_HOOK(sub_14031AF10);
|
||||
INSTALL_HOOK(sub_14031AFE0);
|
||||
INSTALL_HOOK(DispManager__entry_obj);
|
||||
|
||||
@@ -18,10 +18,14 @@ obj_skin* (FASTCALL* obj_database_get_object_skin)(object_info obj_info)
|
||||
= (obj_skin * (FASTCALL*)(object_info obj_info))0x000000014045A3E0;
|
||||
obj_mesh_vertex_buffer* (FASTCALL* object_info_get_mesh_vertex_buffer)(object_info obj_info, int32_t a2)
|
||||
= (obj_mesh_vertex_buffer * (FASTCALL*)(object_info obj_info, int32_t a2))0x000000014045A480;
|
||||
int32_t(FASTCALL* obj_database_get_obj_set_obj_id)(int32_t set_index, int32_t obj_index)
|
||||
= (int32_t(FASTCALL*)(int32_t set_index, int32_t obj_index))0x000000014045A750;
|
||||
GLuint(FASTCALL* obj_database_get_obj_set_texture)(int32_t set, int32_t tex_id)
|
||||
= (GLuint(FASTCALL*)(int32_t set, int32_t tex_id))0x000000014045A8F0;
|
||||
prj::vector<GLuint>* (FASTCALL* obj_database_get_obj_set_textures)(int32_t set)
|
||||
= (prj::vector<GLuint> * (FASTCALL*)(int32_t set))0x000000014045A9E0;
|
||||
int32_t(FASTCALL* obj_database_get_set_id)(int32_t set_index)
|
||||
= (int32_t(FASTCALL*)(int32_t set_index))0x000000014045AA10;
|
||||
|
||||
static void obj_vertex_add_bone_weight(vec4& bone_weight, vec4i16& bone_index, int16_t index, float_t weight);
|
||||
static void obj_vertex_validate_bone_data(vec4& bone_weight, vec4i16& bone_index);
|
||||
|
||||
@@ -504,8 +504,10 @@ extern obj* (FASTCALL* object_info_get_object)(object_info obj_info);
|
||||
extern obj_mesh_index_buffer* (FASTCALL* object_info_get_mesh_index_buffer)(object_info obj_info, int32_t a2);
|
||||
extern obj_skin* (FASTCALL* obj_database_get_object_skin)(object_info obj_info);
|
||||
extern obj_mesh_vertex_buffer* (FASTCALL* object_info_get_mesh_vertex_buffer)(object_info obj_info, int32_t a2);
|
||||
extern int32_t(FASTCALL* obj_database_get_obj_set_obj_id)(int32_t set_index, int32_t obj_index);
|
||||
extern GLuint(FASTCALL* obj_database_get_obj_set_texture)(int32_t set, int32_t tex_id);
|
||||
extern prj::vector<GLuint>* (FASTCALL* obj_database_get_obj_set_textures)(int32_t set);
|
||||
extern int32_t(FASTCALL* obj_database_get_set_id)(int32_t set_index);
|
||||
|
||||
extern int32_t obj_material_texture_type_get_texcoord_index(
|
||||
obj_material_texture_type type, int32_t index);
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
Shadow** shadow_ptr = (Shadow**)0x000000014CC587B8;
|
||||
|
||||
void(FASTCALL* sub_1405E8A20)(Shadow* shad, int32_t index, vec3* pos)
|
||||
= (void(FASTCALL*)(Shadow* shad, int32_t index, vec3 * pos))0x000000014063FA90;
|
||||
|
||||
Shadow* shadow_ptr_get() {
|
||||
return *shadow_ptr;
|
||||
}
|
||||
|
||||
@@ -60,4 +60,6 @@ struct Shadow {
|
||||
|
||||
static_assert(sizeof(Shadow) == 0x2F8, "\"Shadow\" struct should have a size of 0x2F8");
|
||||
|
||||
extern void(FASTCALL* sub_1405E8A20)(Shadow* shad, int32_t index, vec3* pos);
|
||||
|
||||
extern Shadow* shadow_ptr_get();
|
||||
|
||||
Reference in New Issue
Block a user