do not draw D3DTextures which are == null

This commit is contained in:
Alexander Eckart committed 2012-03-18 19:39:04 +01:00
1 parent c2da29edc8
commit 9361c8b375
1 file changed
+9
+9
View File
@@ -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;