Ejemplo n.º 1
0
        static void ClearCenterOfMap(TerrainMap map)
        {
            int o = map.Cellwidth() >> 4;
            int p = (map.Cellwidth() - o) >> 1;
            int q = (map.Cellwidth() + o) >> 1;

            for (int i = p; i <= q; i++)
            {
                for (int j = p; j <= q; j++)
                {
                    map.SetMapBit(i, j, false);
                }
            }
        }
Ejemplo n.º 2
0
        static void DrawBoundaryFencesOnMap(TerrainMap map)
        {
            // QQQ it would make more sense to do this with a "draw line
            // QQQ on map" primitive, may need that for other things too

            int cw = map.Cellwidth();
            int ch = map.Cellheight();

            int r = cw - 1;
            int a = cw >> 3;
            int b = cw - a;
            int o = cw >> 4;
            int p = (cw - o) >> 1;
            int q = (cw + o) >> 1;

            for (int i = 0; i < cw; i++)
            {
                for (int j = 0; j < ch; j++)
                {
                    bool c = i > a && i < b && (i <p || i> q);
                    if (i == 0 || j == 0 || i == r || j == r || (c && (i == j || i + j == r)))
                    {
                        map.SetMapBit(i, j, true);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        void DrawRandomClumpsOfRocksOnMap(TerrainMap map)
        {
            if (_useRandomRocks)
            {
                const int SPREAD = 4;
                int       r      = map.Cellwidth();
                int       k      = RandomHelpers.RandomInt(50, 150);

                for (int p = 0; p < k; p++)
                {
                    int i = RandomHelpers.RandomInt(0, r - SPREAD);
                    int j = RandomHelpers.RandomInt(0, r - SPREAD);
                    int c = RandomHelpers.RandomInt(0, 10);

                    for (int q = 0; q < c; q++)
                    {
                        int m = RandomHelpers.RandomInt(0, SPREAD);
                        int n = RandomHelpers.RandomInt(0, SPREAD);
                        map.SetMapBit(i + m, j + n, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
	    static void ClearCenterOfMap(TerrainMap map)
		{
			int o = map.Cellwidth() >> 4;
			int p = (map.Cellwidth() - o) >> 1;
			int q = (map.Cellwidth() + o) >> 1;
			for (int i = p; i <= q; i++)
				for (int j = p; j <= q; j++)
					map.SetMapBit(i, j, false);
		}
Ejemplo n.º 5
0
	    static void DrawBoundaryFencesOnMap(TerrainMap map)
		{
			// QQQ it would make more sense to do this with a "draw line
			// QQQ on map" primitive, may need that for other things too

			int cw = map.Cellwidth();
			int ch = map.Cellheight();

			int r = cw - 1;
			int a = cw >> 3;
			int b = cw - a;
			int o = cw >> 4;
			int p = (cw - o) >> 1;
			int q = (cw + o) >> 1;

			for (int i = 0; i < cw; i++)
			{
				for (int j = 0; j < ch; j++)
				{
					bool c = i > a && i < b && (i < p || i > q);
					if (i == 0 || j == 0 || i == r || j == r || (c && (i == j || i + j == r)))
						map.SetMapBit(i, j, true);
				}
			}
		}
Ejemplo n.º 6
0
		void DrawRandomClumpsOfRocksOnMap(TerrainMap map)
		{
			if (_useRandomRocks)
			{
				const int SPREAD = 4;
				int r = map.Cellwidth();
				int k = RandomHelpers.RandomInt(50, 150);

				for (int p = 0; p < k; p++)
				{
					int i = RandomHelpers.RandomInt(0, r - SPREAD);
					int j = RandomHelpers.RandomInt(0, r - SPREAD);
					int c = RandomHelpers.RandomInt(0, 10);

					for (int q = 0; q < c; q++)
					{
						int m = RandomHelpers.RandomInt(0, SPREAD);
						int n = RandomHelpers.RandomInt(0, SPREAD);
						map.SetMapBit(i + m, j + n, true);
					}
				}
			}
		}