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

Missing xhdpi and xxhdpi makes playing on modern phones almost impossible #20

Open
danielmmmm opened this issue Jul 6, 2017 · 2 comments

Comments

@danielmmmm
Copy link

Hei danishcake!

Are you still working on Shoko Rocket? It would be awesome if we could play this game on modern phones with high resolution displays. I wouldn't mind if everything was pixelated, but at least the controls and menu should be bigger, and the player field should filt the screen.

Is this difficult to achieve? Or is it just tedious work? If you can explain how to scale everything up, I would love to take over the tedious part!

Hilsen, Daniel

@danishcake
Copy link
Owner

danishcake commented Jul 7, 2017

So I actually got half way through implementing this years ago, but I've misplaced the code. I'll have a root through my archives to see if I can find what I was working on. The problem was that this code dates from when Android phones were slow and didn't have much hardware acceleration. To make things as fast as possible all the sprites were scaled ahead of time (see GameDrawer.java:Setup()). This meant that drawing bitmaps was a simple case of copying bytes.

Unfortunately early Android devices also enforced tiny managed heap sizes. 24, 16 or even 12 megabyte heaps were not unheard of. Pre-scaled sprites took up masses of memory and limited the range of devices ShokoRocket could run on.

Nowadays RAM is cheap and hardware is fast. The best solution is probably to

  1. Resample the SVG images at a decent (2x or 4x current) resolution)
  2. Update the animation xml files
  3. Load these directly and don't perform any scaling
  4. Perform all scaling at runtime in GameDrawer/Animation.java

@danielmmmm
Copy link
Author

What you proposed seams reasonable ... for someone who can script a little, but not code :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants