Click here to Skip to main content
12,250,546 members (50,107 online)
Click here to Skip to main content
Articles » Multimedia » DirectX » Games » Downloads

Stats

27.3K views
1.4K downloads
34 bookmarked
Posted

Game Engine

, 20 Nov 2009 CPL
A game engine first prototype
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();

        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Public License Version 1.0 (CPL)

Share

About the Author

Member 3873633
Software Developer
Croatia Croatia
Programer

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 20 Nov 2009
Article Copyright 2009 by Member 3873633
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid