From 9361c8b3754a072554d56d716d1837eabd252477 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 18 Mar 2012 19:39:04 +0100 Subject: [PATCH] do not draw D3DTextures which are == null --- Vocaluxe/Lib/Draw/CDirect3D.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 8a5acee8..45190cc1 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -1079,6 +1079,9 @@ namespace Vocaluxe.Lib.Draw { if ((Texture.index >= 0) && (_Textures.Count > 0) && (_D3DTextures.Count > Texture.index) && _TextureExists(ref Texture)) { + if (_D3DTextures[Texture.index] == null) + return; + //Calculate the position float x1 = (bounds.X - rect.X) / rect.W * Texture.width_ratio; float x2 = (bounds.X + bounds.W - rect.X) / rect.W * Texture.width_ratio; @@ -1166,6 +1169,9 @@ namespace Vocaluxe.Lib.Draw { if (_TextureExists(ref Texture)) { + if (_D3DTextures[Texture.index] == null) + return; + float x1 = 0f + begin * Texture.width_ratio; float x2 = Texture.width_ratio * end; float y1 = 0f; @@ -1206,6 +1212,9 @@ namespace Vocaluxe.Lib.Draw { if (_TextureExists(ref Texture)) { + if (_D3DTextures[Texture.index] == null) + return; + if (rect.W == 0f || rect.H == 0f || bounds.H == 0f || bounds.W == 0f || color.A == 0f || height <= 0f) return;