| 1 |
"""Functions used to generate source files during build time""" |
| 2 |
|
| 3 |
import methods |
| 4 |
|
| 5 |
|
| 6 |
def make_splash(target, source, env): |
| 7 |
buffer = methods.get_buffer(str(source[0])) |
| 8 |
|
| 9 |
with methods.generated_wrapper(str(target[0])) as file: |
| 10 |
|
| 11 |
file.write(f"""\ |
| 12 |
static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14); |
| 13 |
inline constexpr const unsigned char boot_splash_png[] = {{ |
| 14 |
{methods.format_buffer(buffer, 1)} |
| 15 |
}}; |
| 16 |
""") |
| 17 |
|
| 18 |
|
| 19 |
def make_splash_editor(target, source, env): |
| 20 |
buffer = methods.get_buffer(str(source[0])) |
| 21 |
|
| 22 |
with methods.generated_wrapper(str(target[0])) as file: |
| 23 |
|
| 24 |
|
| 25 |
file.write(f"""\ |
| 26 |
static const Color boot_splash_editor_bg_color = Color(0.125, 0.145, 0.192); |
| 27 |
inline constexpr const unsigned char boot_splash_editor_png[] = {{ |
| 28 |
{methods.format_buffer(buffer, 1)} |
| 29 |
}}; |
| 30 |
""") |
| 31 |
|
| 32 |
|
| 33 |
def make_app_icon(target, source, env): |
| 34 |
buffer = methods.get_buffer(str(source[0])) |
| 35 |
|
| 36 |
with methods.generated_wrapper(str(target[0])) as file: |
| 37 |
|
| 38 |
file.write(f"""\ |
| 39 |
inline constexpr const unsigned char app_icon_png[] = {{ |
| 40 |
{methods.format_buffer(buffer, 1)} |
| 41 |
}}; |
| 42 |
""") |