Flowit-Game / Flowit

Minimalistic puzzle game
GNU General Public License v3.0
77 stars 7 forks source link

Implement alternate colorscheme option for accessibility (resolves #10) #25

Closed ywnico closed 1 year ago

ywnico commented 1 year ago

I hope this is an acceptable solution which is not too complicated. I don't have much experience with Java and Android development, but since I mostly followed ByteHamster's existing code (e.g., copying settings buttons) I hope it is ok. I can make any suggested changes, of course.

I did fear I might possibly be breaking ByteHamster's style of keeping everything very clean and separated in SettingsState.java lines 31 & 45-46, where I saved the glRenderer variable so that glRenderer.setColorscheme could be called from onTouchEvent. But I did not think of an alternative.

ByteHamster commented 1 year ago

Thanks! Is there a way to re-order the items instead of resizing? I'm not entirely sure which version of OpenGL we are using, but I think we are using 1.0. OpenGL 1.0 does not support textures of arbitrary size, so I think making the texture slightly larger like your change actually makes it 4 times larger internally.

ywnico commented 1 year ago

Oh, I didn't realize that. Indeed, there's enough blank space to rearrange the textures and keep it within 2048x2048 (I did also need to move the volume icons and header background).

ByteHamster commented 1 year ago

Thanks for updating! Would it somehow be possible to re-load the texture when changing the setting instead of always keeping both textures in memory? I don't know too much about OpenGL, but it feels like that should be somehow possible

ywnico commented 1 year ago

That does make sense.... I will look into how to do that.

ywnico commented 1 year ago

This update should solve the problem of loading textures when changing colors instead of preloading them.

ByteHamster commented 1 year ago

Awesome, thanks!