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

Refactor renderengine #155

Merged
merged 5 commits into from Aug 2, 2018

Conversation

Projects
None yet
2 participants
@steffen-wilke
Copy link
Collaborator

steffen-wilke commented Aug 2, 2018

  • Add static Renderers for Image, Text and Shape
  • Remove static methods from because the Renderengines sole purpose is to render stuff relative to the environment/camera of the game. For the actual rendering, it'll use the static renderers internally.
  • Clean up/Streamline Particle implementations

steffen-wilke added some commits Jul 31, 2018

Introduce static ImageRenderer
- This class contains all static methods from the RenderEngine that are used to draw images on a Graphics2D object.
Add TextRenderer
- This class contains all static rendering methods for Text from the RenderEngine.
Introduce a ShapeRenderer that handles Shape -> Graphics2D
- Clean up and streamline the Particle implementations.
- Particles now render themseves using the RenderEngine to be properly scaled and positioned in the environment.
- Everything that renders shapes or their outline should use this renderer.

@steffen-wilke steffen-wilke merged commit 1473421 into master Aug 2, 2018

3 checks passed

codeclimate 12 fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@steffen-wilke steffen-wilke deleted the refactor-renderengine branch Aug 2, 2018

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

TheRamenChef commented Aug 2, 2018

the Renderengines [sic] sole purpose is to render stuff relative to the environment/camera of the game.

If that’s the case, then shouldn’t the camera be owned by the render engine?

@steffen-wilke

This comment has been minimized.

Copy link
Collaborator

steffen-wilke commented Aug 6, 2018

Honestly, I'm not 100% sure. I've thought about this a lot and I don't have a clear answer on this just yet.
I've also thought about making the Camera a part of the environment which might potentially allow for multiple cameras in the engine but I'm not sure yet if, for the sake of simplicity, this is a good idea.
Thank's for the valuable input though, although it causes me some headache :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment