Example #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;
    }
Example #2
0
    // Run Terrain Texture Parser //
    public static void LoadTerrainTextures(string Path, string MapName, Vector2 Coords)
    {
        ThreadWorkingTextures = true;
        long millisecondsStart = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

        ADTTexData.textureBlockData = new ADTTexData.TextureBlockData();
        ADTTexData.textureBlockData.textureChunksData = new List <ADTTexData.TextureChunkData>();

        ParseADT_Tex(Path, MapName, Coords);
        if (SettingsTerrainImport.LoadShadowMaps)
        {
            ADT_ProcessData.AdjustAlphaBasedOnShadowmap(MapName);
        }
        ADT_ProcessData.Load_hTextures();

        if (working)
        {
            ADTTexData.TextureBlockDataQueue.Enqueue(ADTTexData.textureBlockData);
        }

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

        finishedTimeTerrainTextures = (millisecondsStop - millisecondsStart) / 1000f;

        ThreadWorkingTextures = false;
    }