Esempio n. 1
0
    public static void Load(string Path, string MapName, Vector2 coords)
    {
        ThreadWorking = true;
        //float startTime = Time.time;
        long milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        blockData                     = new BlockDataType();
        blockData.ChunksData          = new List <ChunkData>();
        blockData.terrainTexturePaths = new List <string>();
        blockData.terrainTextures     = new Dictionary <string, Texture2Ddata>();
        blockData.textureFlags        = new Dictionary <string, TerrainTextureFlag>();
        blockData.heightScales        = new Dictionary <string, float>();
        blockData.heightOffsets       = new Dictionary <string, float>();

        ParseADT_Main(Path, MapName, coords);
        ParseADT_Tex(Path, MapName, coords);
        //if (ADTSettings.LoadWMOs || ADTSettings.LoadM2s)
        //ParseADT_Obj(Path, MapName, coords);
        ADT_ProcessData.GenerateMeshArrays();
        if (ADTSettings.LoadShadowMaps)
        {
            ADT_ProcessData.AdjustAlphaBasedOnShadowmap(MapName);
        }
        ADT_ProcessData.Load_hTextures();
        AllBlockData.Enqueue(blockData);

        long millisecondsB = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        finishedTime = (millisecondsB - milliseconds) / 1000f;

        ThreadWorking = false;
    }
Esempio n. 2
0
    // Run Terrain Mesh Parser //
    public static void LoadTerrainMesh(string Path, string MapName, Vector2 Coords)
    {
        ThreadWorkingMesh = true;
        long millisecondsStart = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        DiscordController.mapName = MapName;

        ADTRootData.meshBlockData = new ADTRootData.MeshBlockData();
        ADTRootData.meshBlockData.meshChunksData = new List <ADTRootData.MeshChunkData>();

        ParseADT_Main(Path, MapName, Coords);
        ADT_ProcessData.GenerateMeshArrays();

        if (working)
        {
            ADTRootData.MeshBlockDataQueue.Enqueue(ADTRootData.meshBlockData);
        }

        long millisecondsStop = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        finishedTimeTerrainMesh = (millisecondsStop - millisecondsStart) / 1000f;

        ThreadWorkingMesh = false;
    }