private void loadLBD() { var start = DateTime.Now; Profiler.BeginSample("LBD"); _tix = ResourceManager.Load <TIX>(IOUtil.PathCombine(Application.streamingAssetsPath, TIXFile)); PsxVram.LoadVramTix(_tix); // get an array of all of the LBD files in the given directory // TODO: error checking for LBD path string[] lbdFiles = Directory.GetFiles(IOUtil.PathCombine(Application.streamingAssetsPath, LBDFolder), "*.LBD", SearchOption.AllDirectories); _cache.Clear(); int i = 0; foreach (var file in lbdFiles) { // load the LBD and create GameObjects for its tiles var lbd = ResourceManager.Load <LBD>(file); GameObject lbdObj = _lbdReader.CreateLBDTileMap(lbd, _cache); Debug.Log($"Cache entries: {_cache.Count}"); // position the LBD 'slab' based on its tiling mode if (Mode == LBDTiling.Regular) { int xPos = i % LBDWidth; int yPos = i / LBDWidth; int xMod = 0; if (yPos % 2 == 1) { xMod = 10; } lbdObj.transform.position = new Vector3((xPos * 20) - xMod, 0, yPos * 20); i++; } } Profiler.EndSample(); _loaded = true; var end = DateTime.Now; }
public IEnumerator LoadGameCoroutine() { // do game startup stuff here GameSettings.Initialize(); TResourceManager.RegisterHandler(new LBDHandler()); TResourceManager.RegisterHandler(new TIXHandler()); TResourceManager.RegisterHandler(new Texture2DHandler()); TResourceManager.RegisterHandler(new MaterialHandler()); ControlSchemeManager.Initialize(); DreamJournalManager.Initialize(); MapReader.MapScaleFactor = 1F; GameSettings.LoadSettings(); Shader.SetGlobalFloat("_FogStep", 0.08F); Shader.SetGlobalFloat("AffineIntensity", 0.5F); PsxVram.Initialize(); if (Application.isEditor) { // if we're running inside the editor, we want to have the mouse! GameSettings.SetCursorViewState(true); } yield return(LBDTilePool.InitialiseCoroutine()); // TODO //SaveGameManager.LoadGame(); OnGameDataLoaded.Raise(); }