Separate out the major UIs to get ready for their development, and enable debug button.
This commit is contained in:
parent
7eec67ffc8
commit
9b3b81683a
11 changed files with 154 additions and 116 deletions
|
@ -22,22 +22,13 @@ union ColorConv {
|
|||
uint32_t as_int;
|
||||
};
|
||||
|
||||
inline uint32_t dumb_lighting(uint32_t pixel, double distance) {
|
||||
if(distance < 1.0) return pixel;
|
||||
|
||||
ColorConv conv{.as_int=pixel};
|
||||
conv.as_color.r /= distance;
|
||||
conv.as_color.g /= distance;
|
||||
conv.as_color.b /= distance;
|
||||
|
||||
return conv.as_int;
|
||||
}
|
||||
|
||||
inline uint32_t new_lighting(uint32_t pixel, int level) {
|
||||
float factor = level * PERCENT;
|
||||
|
||||
ColorConv conv{.as_int=pixel};
|
||||
conv.as_color.r *= level * PERCENT;
|
||||
conv.as_color.g *= level * PERCENT;
|
||||
conv.as_color.b *= level * PERCENT;
|
||||
conv.as_color.r *= factor;
|
||||
conv.as_color.g *= factor;
|
||||
conv.as_color.b *= factor;
|
||||
|
||||
return conv.as_int;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue