diff options
author | Aki <please@ignore.pl> | 2024-04-10 00:53:34 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-04-10 00:53:34 +0200 |
commit | 4409303f4f2999ae7c4e65ff7553480e6968740f (patch) | |
tree | d111aac66cbaf312b59c082e8679c914946114cb /StarsEx | |
parent | 3cc6b923edb69907794c3dc6daa61a445b3a56c0 (diff) | |
download | starshatter-4409303f4f2999ae7c4e65ff7553480e6968740f.zip starshatter-4409303f4f2999ae7c4e65ff7553480e6968740f.tar.gz starshatter-4409303f4f2999ae7c4e65ff7553480e6968740f.tar.bz2 |
Fixed converters crashing on loading textures when they were available
Diffstat (limited to 'StarsEx')
-rw-r--r-- | StarsEx/D3DXImage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/StarsEx/D3DXImage.cpp b/StarsEx/D3DXImage.cpp index 21b1fae..5145ac5 100644 --- a/StarsEx/D3DXImage.cpp +++ b/StarsEx/D3DXImage.cpp @@ -11,7 +11,6 @@ D3DX image file loader */ - #include "D3DXImage.h" #include "VideoDX9.h" @@ -66,7 +65,6 @@ bool D3DXImage::Load(char *filename) if (buf) { fread(buf, len, 1, f); fclose(f); - success = LoadBuffer(buf, len); } @@ -100,6 +98,8 @@ bool D3DXImage::LoadBuffer(BYTE* buf, int len) IDirect3DSurface9* surf = 0; IDirect3DDevice9* dev = VideoDX9::GetD3DDevice9(); + if (dev == nullptr) + return success; hr = dev->CreateOffscreenPlainSurface( width, |