mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
minor probs
This commit is contained in:
parent
14a2123db3
commit
8d28f9214d
@ -3978,27 +3978,28 @@ apply_texture(TextureContext *tc) {
|
|||||||
|
|
||||||
DXTextureContext *dtc = DCAST(DXTextureContext, tc);
|
DXTextureContext *dtc = DCAST(DXTextureContext, tc);
|
||||||
|
|
||||||
if( _pCurTexContext == dtc) {
|
int dirty = dtc->get_dirty_flags();
|
||||||
|
|
||||||
|
if( _pCurTexContext == dtc && dirty == 0) {
|
||||||
return; // tex already set (and possible problem in state-sorting?)
|
return; // tex already set (and possible problem in state-sorting?)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the texture image has changed, or if its use of mipmaps has
|
// If the texture image has changed, or if its use of mipmaps has
|
||||||
// changed, we need to re-create the image.
|
// changed, we need to re-create the image.
|
||||||
int dirty = dtc->get_dirty_flags();
|
|
||||||
if ((dirty & (Texture::DF_image | Texture::DF_mipmap)) != 0) {
|
if ((dirty & (Texture::DF_image | Texture::DF_mipmap)) != 0) {
|
||||||
// If this is *only* because of a mipmap change, issue a
|
// If this is *only* because of a mipmap change, issue a
|
||||||
// warning--it is likely that this change is the result of an
|
// warning--it is likely that this change is the result of an
|
||||||
// error or oversight.
|
// error or oversight.
|
||||||
if ((dirty & Texture::DF_image) == 0) {
|
if ((dirty & Texture::DF_image) == 0) {
|
||||||
dxgsg_cat.warning()
|
dxgsg_cat.warning()
|
||||||
<< "Texture " << *dtx->_texture << " has changed mipmap state.\n";
|
<< "Texture " << *dtc->_texture << " has changed mipmap state.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
dtc->DeleteTexture();
|
dtc->DeleteTexture();
|
||||||
if (dtc->CreateTexture(_d3dDevice,_cNumTexPixFmts,_pTexPixFmts) == NULL) {
|
if (dtc->CreateTexture(_d3dDevice,_cNumTexPixFmts,_pTexPixFmts) == NULL) {
|
||||||
// Oops, we can't re-create the texture for some reason.
|
// Oops, we can't re-create the texture for some reason.
|
||||||
dxgsg_cat.error()
|
dxgsg_cat.error()
|
||||||
<< "Unable to re-create texture " << *dtx->_texture << endl;
|
<< "Unable to re-create texture " << *dtc->_texture << endl;
|
||||||
|
|
||||||
release_texture(dtc);
|
release_texture(dtc);
|
||||||
enable_texturing(false);
|
enable_texturing(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user