1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-16 21:05:22 +00:00

Rework texture loading, part 1

Major code/logic cleanups + it has a multithreaded batch mode now.
The VFS code doesn't like multiple threads at all,
so for now there's a big lock in front of where it matters.
Changed precacher, map/tileset, and worldmap loading to batched mode.

Still TODO:
- fix broken mod preview images
- reloading resources on debug key
- make mod recache entirely unnecessary
- actually drop resources when no longer needed
This commit is contained in:
fgenesis 2023-05-31 00:55:16 +02:00
parent 1100e286a6
commit 70b8dcdc3a
22 changed files with 758 additions and 817 deletions

View file

@ -491,11 +491,11 @@ nofollow:
{
if (texture)
{
if (texture->textures[0] != lastTextureApplied || repeatTexture != lastTextureRepeat)
if (texture->gltexid != lastTextureApplied || repeatTexture != lastTextureRepeat)
{
texture->apply(repeatTexture);
lastTextureRepeat = repeatTexture;
lastTextureApplied = texture->textures[0];
lastTextureApplied = texture->gltexid;
}
}
else
@ -866,21 +866,9 @@ void RenderObject::freeMotionBlur()
bool RenderObject::setTexture(const std::string &n)
{
std::string name = n;
stringToLowerUserData(name);
if (name.empty())
{
setTexturePointer(NULL);
return false;
}
if(texture && texture->getLoadResult() == TEX_SUCCESS && name == texture->name)
return true; // no texture change
CountedPtr<Texture> tex = core->addTexture(name);
CountedPtr<Texture> tex = core->getTexture(n);
setTexturePointer(tex);
return tex && tex->getLoadResult() == TEX_SUCCESS;
return tex->success;
}
void RenderObject::addChild(RenderObject *r, ParentManaged pm, RenderBeforeParent rbp, ChildOrder order)