From d0197351abf395fd1ab4f9e4cd2b4360627d4f96 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Wed, 23 Oct 2002 02:48:50 +0000 Subject: [PATCH] dont fill textures w/o ram images --- panda/src/dxgsg8/dxTextureContext8.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/panda/src/dxgsg8/dxTextureContext8.cxx b/panda/src/dxgsg8/dxTextureContext8.cxx index afb91528a4..773c08c15d 100644 --- a/panda/src/dxgsg8/dxTextureContext8.cxx +++ b/panda/src/dxgsg8/dxTextureContext8.cxx @@ -1425,9 +1425,11 @@ IDirect3DTexture8 *DXTextureContext::CreateTexture(DXScreenData &scrn) { #endif #endif - hr = FillDDSurfTexturePixels(); - if(FAILED(hr)) { - goto error_exit; + if(_texture->has_ram_image()) { + hr = FillDDSurfTexturePixels(); + if(FAILED(hr)) { + goto error_exit; + } } // Return the newly created texture @@ -1443,6 +1445,12 @@ HRESULT DXTextureContext:: FillDDSurfTexturePixels(void) { HRESULT hr=E_FAIL; 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(); if (pbuf == (PixelBuffer *)NULL) { dxgsg_cat.fatal() << "CreateTexture: get_ram_image() failed\n";