all is in the title too..
Details
Diff Detail
Event Timeline
i've made a inline function to fill the color array, it make the code a lot cleaner and readable I think.
Very close to ready! Glad you got rid of those glColor calls.
| source/blender/editors/include/UI_interface.h | ||
|---|---|---|
| 311 | const float color[4] It's always RGBA and drawing does not change the values. Hmm... seems drawing might change alpha value depending on use_alpha. We can figure this out now or commit & do it better later. (I vote to commit soon & improve later). | |
| source/blender/editors/space_outliner/outliner_draw.c | ||
| 1384 | Use 1.0f as style guide suggests, here and in other places. | |
Quickly looking through the patch looking (almost!) ready :)
Yes, please use const for array parameters that aren't return arguments. For the compiler, an array is a pointer so you're actually passing the memory address, not the array values. If the called function changes the values stored at that address, it doesn't only change the array locally, but also for the callers that pass it. The const tells the programmer to not change the array itself. The compiler will throw warnings if he does (although he could ignore them or even cast to non-const).
| source/blender/blenlib/BLI_math_color.h | ||
|---|---|---|
| 143 | This can be removed. | |
Thanks for the explaination.
Hmm... seems drawing might change alpha value depending on use_alpha. We can figure this out now or commit & do it better later. (I vote to commit soon & improve later).
I don't touch it for now no?
| source/blender/blenlib/BLI_math_color.h | ||
|---|---|---|
| 143 | yes, sure!!! Stupid copy/paste whitout thinking. | |
| source/blender/editors/include/UI_interface.h | ||
|---|---|---|
| 311 | float color[4] with no const. I have a feeling this code will be redone later, so it doesn't need to be const-perfect. More important to get rid of legacy OpenGL calls! | |
| source/blender/editors/interface/interface_draw.c | ||
| 422 | float color[4] | |
| source/blender/editors/interface/interface_intern.h | ||
| 685 | [4] | |
| source/blender/editors/interface/interface_widgets.c | ||
| 215 | [4] | |