Ejemplo n.º 1
0
        public GameData(uint width, uint depth)
        {
            this.version = VERSION_200;

            this.width       = width;
            this.depth       = depth;
            this.data        = new uint[width * depth];
            this.avoidSearch = new byte[width * depth];

            this.bumpMappingEnabled = AS_NO;
            this.floorRenderingMode = RM_CHECKERBOARD;

            this.texture = "";
            this.bumpMap = "";

            this.startPoint     = new VecGeneric <int>(2);
            this.startDirection = new VecGeneric <int>(2);
            this.emeraldColor   = new VecGeneric <float>(3);
            this.checkerColor1  = new VecGeneric <float>(3);
            this.checkerColor2  = new VecGeneric <float>(3);
            this.skyBackcolor1  = new VecGeneric <float>(3);
            this.skyBackcolor2  = new VecGeneric <float>(3);
            this.starsColor1    = new VecGeneric <float>(3);
            this.starsColor2    = new VecGeneric <float>(3);

            // Right
            this.startDirection.Data[0] = -1;
            this.startDirection.Data[1] = 0;

            for (int i = 0; i < width * depth; i++)
            {
                this.data[i]        = GameData.C_NOTHING;
                this.avoidSearch[i] = GameData.AS_NO;
            }
        }
Ejemplo n.º 2
0
        private static VecGeneric <float> ColorToVecGeneric(Color color)
        {
            VecGeneric <float> v = new VecGeneric <float>(3);

            v.Data[0] = color.R / 255.0f;
            v.Data[1] = color.G / 255.0f;
            v.Data[2] = color.B / 255.0f;
            return(v);
        }
Ejemplo n.º 3
0
 private static Color VecGenericToColor(VecGeneric <float> v)
 {
     return(Color.FromArgb((int)(v.Data[0] * 255), (int)(v.Data[1] * 255), (int)(v.Data[2] * 255)));
 }