示例#1
0
        ///<summary>
        /// Do any initialization of the rendering context here, such as
        /// setting background colors, setting up lighting, or performing
        /// preliminary calculations.
        /// </summary>
        public void GLSetupRC(Types.GlobalInfo a_info)
        {
            int i, k;

            info = a_info;

            // timing setup
            OTSetup();
            info.fTime    = (float)TimeInSecondsSinceStart() + info.flurryRandomSeed;
            info.fOldTime = info.fTime;
            info.optMode  = Types.OPT_MODE_SCALAR_BASE;

            // initialize particles

            for (i = 0; i < info.smoke.smokev.particles.Length; i++)
            {
                for (k = 0; k < info.smoke.smokev.particles[i].dead.i.Length /*4*/; k++)
                {
                    info.smoke.smokev.particles[i].dead.i[k] = TRUE;
                }
            }

            for (i = 0; i < /*12*/ info.spark.Length; i++)
            {
                info.spark[i].mystery = 1800 * (i + 1) / /*13*/ (info.spark.Length + 1);             //HACK
                info.spark[i].UpdateSpark();
            }

            //foreach(Spark s in info.spark)
            //{
            //	s.mystery = 1800 * (i + 1) / 13;
            //	s.UpdateSpark();
            //}

            // setup the defaults for OpenGL
            Gl.glDisable(Gl.GL_DEPTH_TEST);
            Gl.glAlphaFunc(Gl.GL_GREATER, 0.0f);
            Gl.glEnable(Gl.GL_ALPHA_TEST);
            Gl.glShadeModel(Gl.GL_FLAT);
            Gl.glDisable(Gl.GL_LIGHTING);
            Gl.glDisable(Gl.GL_CULL_FACE);
            Gl.glEnable(Gl.GL_BLEND);

            Gl.glViewport(0, 0, (int)info.sys_glWidth, (int)info.sys_glHeight);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluOrtho2D(0, info.sys_glWidth, 0, info.sys_glHeight);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();

            Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
                        #if !USEFADEHACK
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);             //HACK GLsetupRC() hack for fading startup
                        #endif

            Gl.glEnableClientState(Gl.GL_COLOR_ARRAY);
            Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY);
            Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY);
        }
示例#2
0
        //Randomizer rand;

        public Star(Types.GlobalInfo a_info)
        {
            info = a_info;
            InitStar();
        }
示例#3
0
 public Spark(Types.GlobalInfo a_info)
 {
     info=a_info;
     InitSpark();
 }
示例#4
0
 public Smoke(Types.GlobalInfo a_info)
 {
     info   = a_info;
     smokev = new SmokeV(NUMSMOKEPARTICLES);
 }
示例#5
0
 public Particle(Types.GlobalInfo a_info)
 {
     info=a_info;
     InitParticle();
 }
示例#6
0
 public Spark(Types.GlobalInfo a_info)
 {
     info = a_info;
     InitSpark();
 }
示例#7
0
 public Particle(Types.GlobalInfo a_info)
 {
     info = a_info;
     InitParticle();
 }
示例#8
0
        ///<summary>
        /// Do any initialization of the rendering context here, such as
        /// setting background colors, setting up lighting, or performing
        /// preliminary calculations.
        /// </summary>
        public void GLSetupRC(Types.GlobalInfo a_info)
        {
            int i,k;
            info=a_info;

            // timing setup
            OTSetup();
            info.fTime = (float)TimeInSecondsSinceStart() + info.flurryRandomSeed;
            info.fOldTime = info.fTime;
            info.optMode = Types.OPT_MODE_SCALAR_BASE;

            // initialize particles

            for (i = 0; i < info.smoke.smokev.particles.Length; i++) {
                for (k = 0; k < info.smoke.smokev.particles[i].dead.i.Length/*4*/; k++) {
                    info.smoke.smokev.particles[i].dead.i[k] = TRUE;
                }
            }

            for (i = 0; i < /*12*/info.spark.Length; i++) {
                info.spark[i].mystery = 1800 * (i + 1) / /*13*/(info.spark.Length+1);//HACK
                info.spark[i].UpdateSpark();
            }

            //foreach(Spark s in info.spark)
            //{
            //	s.mystery = 1800 * (i + 1) / 13;
            //	s.UpdateSpark();
            //}

            // setup the defaults for OpenGL
            Gl.glDisable(Gl.GL_DEPTH_TEST);
            Gl.glAlphaFunc(Gl.GL_GREATER, 0.0f);
            Gl.glEnable(Gl.GL_ALPHA_TEST);
            Gl.glShadeModel(Gl.GL_FLAT);
            Gl.glDisable(Gl.GL_LIGHTING);
            Gl.glDisable(Gl.GL_CULL_FACE);
            Gl.glEnable(Gl.GL_BLEND);

            Gl.glViewport(0, 0, (int)info.sys_glWidth, (int)info.sys_glHeight);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluOrtho2D(0, info.sys_glWidth, 0, info.sys_glHeight);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();

            Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
            #if !USEFADEHACK
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT); //HACK GLsetupRC() hack for fading startup
            #endif

            Gl.glEnableClientState(Gl.GL_COLOR_ARRAY);
            Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY);
            Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY);
        }
示例#9
0
 //Randomizer rand;
 public Star(Types.GlobalInfo a_info)
 {
     info=a_info;
     InitStar();
 }