Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Engine] Improved room loading #129

Open
persn opened this issue Mar 15, 2017 · 0 comments
Open

[Engine] Improved room loading #129

persn opened this issue Mar 15, 2017 · 0 comments

Comments

@persn
Copy link
Contributor

persn commented Mar 15, 2017

MonoGame supports extending the Pipeline Content importer tool with custom data types and such. We should consider looking into improving our Room loader, the room loads walk maps, region maps, etc. with a lot of double storage to achieve this. A lot of this is because the maps are stored and imported as images/textures, however textures are loaded into GPU, and has to be loaded back to code, resulting in double storage. If we extend the Pipeline tool we can implement direct loading of these data maps, and also get a clean logical separation of code.

      public override sealed void Load()
      {
          this.background = this.Content.LoadTexture2D(this.backgroundID);

          this.walkAreaMask = this.Content.LoadTexture2D(this.walkAreaID);
          this.walkAreaBuffer = CopyTextureData(this.walkAreaMask);
          this.walkAreaNodes = this.CreateWalkNodes();

          foreach (Node walkAreaNode in this.walkAreaNodes)
          {
              walkAreaNode.Children = this.FindNeighbors(walkAreaNode);
          }

          this.hotspotsMask = this.Content.LoadTexture2D(this.hotSpotMaskID);
          this.hotspotMaskBuffer = this.FindHotspots(this.hotspotsMask);

          this.InitializeEvents();
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant