Added some functions for future

This commit is contained in:
korenkonder
2024-01-08 01:43:18 +03:00
parent 0655222c73
commit 3918531482
7 changed files with 645 additions and 4 deletions
+26
View File
@@ -298,6 +298,32 @@ HOOK(texture*, FASTCALL, texture_load_tex_2d, 0x000000014069B8E0,
width, height, max_mipmap_level, data_ptr, use_high_anisotropy);
}
bool texture_txp_set_load(txp_set* t, texture*** texs, uint32_t* ids) {
if (!t || !texs || !ids)
return false;
size_t count = t->textures.size();
*texs = force_malloc<texture*>(count + 1);
texture** tex = *texs;
for (size_t i = 0; i < count; i++)
tex[i] = texture_txp_load(&t->textures[i], texture_id(0, ids[i]));
tex[count] = 0;
return true;
}
bool texture_txp_set_load(txp_set* t, texture*** texs, texture_id* ids) {
if (!t || !texs || !ids)
return false;
size_t count = t->textures.size();
*texs = force_malloc<texture*>(count + 1);
texture** tex = *texs;
for (size_t i = 0; i < count; i++)
tex[i] = texture_txp_load(&t->textures[i], ids[i]);
tex[count] = 0;
return true;
}
void texture_patch() {
INSTALL_HOOK(texture_load_tex_cube_map);
INSTALL_HOOK(texture_load_tex_2d);