using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MTV3D65;
namespace gefx
{
public class Clouds
{
private TVTextureFactory TF;
private TVMaterialFactory Mats;
public TVAtmosphere Atmos;
private int cloudsIntTex;
public float Speed=0;
public string CloudsTextureEX="no texture select";
public float Altitude = 0f;
public int CloudsLayers=-1;
public int Width;
public int Height;
public Clouds()
{
TF = new TVTextureFactory();
Atmos = new TVAtmosphere();
}
public void AddClouds(string CloudsText)
{
if (Atmos != null)
{
CloudsTextureEX = CloudsText;
cloudsIntTex = TF.LoadTexture(CloudsText, "CloudsDDSPic", -1, -1, CONST_TV_COLORKEY.TV_COLORKEY_BLACK);
Atmos.Clouds_Create(1, 1024, 1024);
Atmos.Clouds_SetLayerParameters(0, 500, cloudsIntTex);
Altitude = 500;
Atmos.Clouds_SetLayerAnimation(0, true, 0.01f * Speed , 0.01f * Speed );
CloudsLayers++;
Width = 1024;
Height = 1024;
}
}
public void AddSpeed(float pSpeed, int Layer)
{
if (Atmos != null)
{
Speed = pSpeed;
Atmos.Clouds_SetLayerAnimation(Layer, true, 0.01f * Speed, 0.01f * Speed);
}
}
public void AddClouds(string CloudsText, int layernumber,float Visina,float W, float H)
{
if (Atmos != null)
{
if (layernumber < CloudsLayers)
{
CloudsTextureEX = CloudsText;
cloudsIntTex = TF.LoadTexture(CloudsText, "CloudsDDSPic" + layernumber.ToString(), -1, -1, CONST_TV_COLORKEY.TV_COLORKEY_BLACK, true);
Atmos.Clouds_Create(layernumber, W, H);
Atmos.Clouds_SetLayerParameters(layernumber, Visina, cloudsIntTex);
Altitude = Visina;
Atmos.Clouds_SetLayerAnimation(layernumber, true, 0.01f * Speed , 0.01f * Speed );
CloudsLayers++;
Width = (int )W;
Height = (int )H;
}
}
}
public void AddClouds(string CloudsText, float Visina, float W, float H, float Speeds)
{
if (Atmos != null)
{
CloudsTextureEX = CloudsText;
cloudsIntTex = TF.LoadTexture(CloudsText, "CloudsDDSPic" , -1, -1, CONST_TV_COLORKEY.TV_COLORKEY_BLACK, true);
Atmos.Clouds_Create(1, W, H);
Atmos.Clouds_SetLayerParameters(0, Visina, cloudsIntTex);
Altitude = Visina;
Atmos.Clouds_SetLayerAnimation(0, true, 0.01f * Speeds, 0.01f * Speeds);
CloudsLayers++;
Speed = Speeds;
Width = (int)W;
Height = (int)H;
}
}
public void AddClouds(string CloudsText, int layernumber, float Visina, TVLandscape Land)
{
if (Atmos != null)
{
if (layernumber < CloudsLayers)
{
CloudsTextureEX = CloudsText;
cloudsIntTex = TF.LoadTexture(CloudsText, "CloudsDDSPic" + layernumber.ToString(), -1, -1, CONST_TV_COLORKEY.TV_COLORKEY_BLACK, true);
Atmos.Clouds_Create(layernumber, (float )Land.GetLandWidth() , (float )Land.GetLandHeight() );
Atmos.Clouds_SetLayerParameters(layernumber, Visina, cloudsIntTex);
Atmos.Clouds_SetLayerAnimation(layernumber, true, 0.01f * Speed , 0.01f * Speed );
Altitude = Visina;
Width = Land.GetLandWidth();
Height = Land.GetLandHeight();
CloudsLayers++;
}
}
}
public void DrawClouds()
{
Atmos.Atmosphere_Render();
}
}
}