Auth 2D stuff

This commit is contained in:
korenkonder
2023-03-04 03:46:44 +03:00
parent bfc52a1729
commit cd53da270a
42 changed files with 7007 additions and 386 deletions
+3 -14
View File
@@ -1688,20 +1688,9 @@ texture* obj_database_get_obj_set_texture(int32_t set, uint32_t tex_id) {
if (!handler)
return 0;
std::pair<uint32_t, uint32_t>* texture = handler->tex_id_data.data();
size_t length = handler->tex_id_data.size();
size_t temp;
while (length > 0)
if (tex_id <= texture[temp = length / 2].first)
length /= 2;
else {
texture += temp + 1;
length -= temp + 1;
}
if (texture != handler->tex_id_data.data() + handler->tex_id_data.size()
&& tex_id == texture->first)
return (*textures)[texture->second];
auto elem = handler->tex_id_data.find(tex_id);
if (elem != handler->tex_id_data.end())
return (*textures)[elem->second];
return 0;
}