mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
dont fill textures w/o ram images
This commit is contained in:
parent
c56d92f5d5
commit
d0197351ab
@ -1425,9 +1425,11 @@ IDirect3DTexture8 *DXTextureContext::CreateTexture(DXScreenData &scrn) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hr = FillDDSurfTexturePixels();
|
if(_texture->has_ram_image()) {
|
||||||
if(FAILED(hr)) {
|
hr = FillDDSurfTexturePixels();
|
||||||
goto error_exit;
|
if(FAILED(hr)) {
|
||||||
|
goto error_exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the newly created texture
|
// Return the newly created texture
|
||||||
@ -1443,6 +1445,12 @@ HRESULT DXTextureContext::
|
|||||||
FillDDSurfTexturePixels(void) {
|
FillDDSurfTexturePixels(void) {
|
||||||
HRESULT hr=E_FAIL;
|
HRESULT hr=E_FAIL;
|
||||||
assert(IS_VALID_PTR(_texture));
|
assert(IS_VALID_PTR(_texture));
|
||||||
|
|
||||||
|
if(!_texture->has_ram_image()) {
|
||||||
|
dxgsg_cat.warning() << "CreateTexture: tried to fill surface that has no ram image!\n";
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
PixelBuffer *pbuf = _texture->get_ram_image();
|
PixelBuffer *pbuf = _texture->get_ram_image();
|
||||||
if (pbuf == (PixelBuffer *)NULL) {
|
if (pbuf == (PixelBuffer *)NULL) {
|
||||||
dxgsg_cat.fatal() << "CreateTexture: get_ram_image() failed\n";
|
dxgsg_cat.fatal() << "CreateTexture: get_ram_image() failed\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user