mirror of https://github.com/aap/librw.git
fixed pretty major bugs regarding frame dirty list
This commit is contained in:
parent
a391f263cb
commit
46542cccb0
|
@ -44,22 +44,10 @@ void
|
|||
Frame::destroy(void)
|
||||
{
|
||||
s_plglist.destruct(this);
|
||||
Frame *parent = this->getParent();
|
||||
Frame *child;
|
||||
if(parent){
|
||||
// remove from child list
|
||||
child = parent->child;
|
||||
if(child == this)
|
||||
parent->child = this->next;
|
||||
else{
|
||||
for(child = child->next; child != this; child = child->next)
|
||||
;
|
||||
child->next = this->next;
|
||||
}
|
||||
this->object.parent = nil;
|
||||
// Doesn't seem to make much sense, blame criterion.
|
||||
this->setHierarchyRoot(this);
|
||||
}
|
||||
if(this->getParent())
|
||||
this->removeChild();
|
||||
if(this->object.privateFlags & Frame::HIERARCHYSYNC)
|
||||
this->inDirtyList.remove();
|
||||
for(Frame *f = this->child; f; f = f->next)
|
||||
f->object.parent = nil;
|
||||
free(this);
|
||||
|
@ -74,6 +62,8 @@ Frame::destroyHierarchy(void)
|
|||
child->destroyHierarchy();
|
||||
}
|
||||
s_plglist.destruct(this);
|
||||
if(this->object.privateFlags & Frame::HIERARCHYSYNC)
|
||||
this->inDirtyList.remove();
|
||||
free(this);
|
||||
}
|
||||
|
||||
|
@ -121,9 +111,8 @@ Frame::removeChild(void)
|
|||
child->next = this->next;
|
||||
}
|
||||
this->object.parent = this->next = nil;
|
||||
this->root = this;
|
||||
for(child = this->child; child; child = child->next)
|
||||
child->setHierarchyRoot(this);
|
||||
// give the hierarchy a new root
|
||||
this->setHierarchyRoot(this);
|
||||
this->updateObjects();
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -32,17 +32,25 @@ rasterCreate(Raster *raster)
|
|||
case Raster::C8888:
|
||||
natras->internalFormat = GL_RGBA;
|
||||
natras->format = GL_RGBA;
|
||||
natras->type = GL_UNSIGNED_BYTE;
|
||||
natras->hasAlpha = 1;
|
||||
break;
|
||||
case Raster::C888:
|
||||
natras->internalFormat = GL_RGB;
|
||||
natras->format = GL_RGB;
|
||||
natras->type = GL_UNSIGNED_BYTE;
|
||||
natras->hasAlpha = 0;
|
||||
break;
|
||||
case Raster::C1555:
|
||||
// TODO: check if this is correct
|
||||
natras->internalFormat = GL_RGBA;
|
||||
natras->format = GL_RGBA;
|
||||
natras->type = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
natras->hasAlpha = 1;
|
||||
break;
|
||||
default:
|
||||
assert(0 && "unsupported raster format");
|
||||
}
|
||||
natras->type = GL_UNSIGNED_BYTE;
|
||||
|
||||
glGenTextures(1, &natras->texid);
|
||||
glBindTexture(GL_TEXTURE_2D, natras->texid);
|
||||
|
@ -89,6 +97,9 @@ rasterFromImage(Raster *raster, Image *image)
|
|||
case 24:
|
||||
format = Raster::C888;
|
||||
break;
|
||||
case 16:
|
||||
format = Raster::C1555;
|
||||
break;
|
||||
default:
|
||||
assert(0 && "image depth\n");
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ struct Frame : PluginBase<Frame>
|
|||
SUBTREESYNC = SUBTREESYNCLTM | SUBTREESYNCOBJ,
|
||||
SYNCLTM = HIERARCHYSYNCLTM | SUBTREESYNCLTM,
|
||||
SYNCOBJ = HIERARCHYSYNCOBJ | SUBTREESYNCOBJ,
|
||||
// STATIC = 0x10
|
||||
};
|
||||
|
||||
Object object;
|
||||
|
|
Loading…
Reference in New Issue