Minor improvements to gl-Tron#7
Open
flide wants to merge 14 commits into
Open
Conversation
This is my first attempt to make this game more interesting. In this first try, I have limited the trail left behind. Interestingly the trail left behind currenly is measured in number of turns (was already there in the code, could not help it). So, for now the max trail left is 10 turns. Should make this configurable.
Borrowed the logging mechanism from my another project TouchBoard. and a few cosmetic changes to the code while trying to understand it.
With the previous Logger, the className tag was needed to be set for each class in it's constructor : inconvenient and too-much to remember. So, made it now mandatory to pass the class when calling the Logger methods. Also, added wrappers to the functions in case the programmer gets as lazy as me and don't want to type the WHOLE name for the logging functions.
The changes are all cosmetic. All I am trying to do is understand the code so pepering it up with the log statements and indenting the code to my taste. Git is still new to me, don't really know how to use it. So I think all these changes are not relevent for the branch "trail", so want to switch back to master. Hence, commiting all changes.
Found that the android.os.Handler object was being imported but was not used anywhere to do anything. So removed the references to the same from all places.
There were 2 variables _x and _y declared in the class as private but were used only in one function where there were set and then passed to the renderer. Could not see how they contributed to the class, so removed them and refactored the code to work without them.
Have only added a few logging statments and changed another few intentations, no major refactoring yet.
Since the GLSurfaceView.Renderer is an interface and functionallity-vise is very similar to a view (albit a bit more specific), I found it easier to remove an extra layer of object-calling/message-passing (whatever-it-was) to be... not necessery. Hence, merged the OpenGLView and OpenGLRenderer classes and refactored (I have come to love that term) the OpenGLRenderer class completely.
Borrowed the setImmersive function from the Touchboard application. Games should be run in fullscreen, so here it is.
Switched the whole code to make it work with android.opengl.GLES10 package. Since I am hoping to upgrade the code to GLES 2.0 and maybe to GLES 3.0, hopefully this is the first step towards it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following improvements (according to me ) have been made :