Conversation
fix: sketchy macro transitions
Author
|
Oh, and, by the way, there is still some work to be done. There are three macros that will not work unless you rewrite them without parameter duplication, but at this point, I think, it would be easier and more convenient to just make them all functions already. I marked these issued macros with TODOs. |
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.
Formatted the code to match commonly used C style
Added file format extension to indicate it is written in GLSL
Renamed global specific-use
seedvariable 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
sfrom macrorandom_get_seed(). Also made it non-modifiable L-value, so syntax likerandom_get_seed() = 5.0would 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
scan 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