Many macro-related bug fixes, more convenient global variable names, code style changes #2
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.
Formatted the code to match commonly used C style
Added file format extension to indicate it is written in GLSL
Renamed global specific-use
seed
variable to__RNG_SEED__
to indicate it is being treated as a used-inaccessible variable.Also freed frequently used variable name
seed
.Removed unused input parameter
s
from macrorandom_get_seed()
. Also made it non-modifiable L-value, so syntax likerandom_get_seed() = 5.0
would be invalid.Fixed many macro inconveniences that would have made them unusable in most cases.
For example, there was this beautiful transition in macro
angle_difference(d,s)
:So parameter
s
can only contain multiplication, but any exposed addition or subtraction would be inversed as soon at it is passed into macro?Lets also take a look at the next macro
Now imagine it would be passed into the code like this:
The code above would be transformed into
which would indeed be equivalent of
which is not the result the user would expect from a code that originally read