mirror of
https://github.com/korenkonder/ReDIVA.git
synced 2026-09-30 18:58:08 +03:00
Same thing
This commit is contained in:
+3
-3
@@ -2155,15 +2155,15 @@ static void obj_set_handler_get_shader_index_texture_index(obj_set_handler* hand
|
||||
continue;
|
||||
|
||||
obj_material_texture_data& texture = k;
|
||||
uint32_t texture_id = texture.tex_index;
|
||||
uint32_t tex_index = texture.tex_index;
|
||||
texture.tex_index = -1;
|
||||
texture.texture_index = 0;
|
||||
|
||||
std::pair<uint32_t, uint32_t>* tex_id_data = handler->tex_id_data.data();
|
||||
uint32_t tex_id_num = (uint32_t)handler->tex_id_data.size();
|
||||
for (uint32_t l = tex_id_num; l; l--, tex_id_data++)
|
||||
if (tex_id_data->first == texture_id) {
|
||||
texture.tex_index = texture_id;
|
||||
if (tex_id_data->first == tex_index) {
|
||||
texture.tex_index = tex_index;
|
||||
texture.texture_index = tex_id_data->second;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -392,6 +392,12 @@ int32_t shader_set_data::get_index_by_name(const char* name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char* shader_set_data::get_name_by_index(int32_t index) {
|
||||
if (index >= 0 && index < size)
|
||||
return shaders[index].name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void shader_set_data::load(farc* f, bool ignore_cache,
|
||||
const char* name, const shader_table* shaders_table, const size_t size,
|
||||
const shader_bind_func* bind_func_table, const size_t bind_func_table_size,
|
||||
|
||||
@@ -104,6 +104,7 @@ struct shader_set_data {
|
||||
GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices);
|
||||
void enable_primitive_restart();
|
||||
int32_t get_index_by_name(const char* name);
|
||||
const char* get_name_by_index(int32_t index);
|
||||
void load(farc* f, bool ignore_cache, const char* name,
|
||||
const shader_table* shaders_table, const size_t size,
|
||||
const shader_bind_func* bind_func_table, const size_t bind_func_table_size,
|
||||
|
||||
Reference in New Issue
Block a user