lots of changes to rasters; mostly mipmap support and DXT conversion

This commit is contained in:
aap
2020-11-11 09:34:36 +01:00
parent 3e2080ad56
commit 7e80d45cdb
19 changed files with 895 additions and 328 deletions

View File

@@ -95,6 +95,13 @@ PluginList::streamRead(Stream *stream, void *object)
cont:
length -= header.length;
}
// now the always callbacks
FORLIST(lnk, this->plugins){
Plugin *p = PLG(lnk);
if(p->alwaysCallback)
p->alwaysCallback(object, p->offset, p->size);
}
return true;
}
@@ -176,6 +183,7 @@ PluginList::registerPlugin(int32 size, uint32 id,
p->write = nil;
p->getSize = nil;
p->rightsCallback = nil;
p->alwaysCallback = nil;
p->parentList = this;
this->plugins.add(&p->inParentList);
allPlugins.add(&p->inGlobalList);
@@ -211,6 +219,19 @@ PluginList::setStreamRightsCallback(uint32 id, RightsCallback cb)
return -1;
}
int32
PluginList::setStreamAlwaysCallback(uint32 id, AlwaysCallback cb)
{
FORLIST(lnk, this->plugins){
Plugin *p = PLG(lnk);
if(p->id == id){
p->alwaysCallback = cb;
return p->offset;
}
}
return -1;
}
int32
PluginList::getPluginOffset(uint32 id)
{