forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_builders.py
More file actions
42 lines (32 loc) · 1.4 KB
/
main_builders.py
File metadata and controls
42 lines (32 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Functions used to generate source files during build time"""
import methods
def make_splash(target, source, env):
buffer = methods.get_buffer(str(source[0]))
with methods.generated_wrapper(str(target[0])) as file:
# Use a neutral gray color to better fit various kinds of projects.
file.write(f"""\
static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14);
inline constexpr const unsigned char boot_splash_png[] = {{
{methods.format_buffer(buffer, 1)}
}};
""")
def make_splash_editor(target, source, env):
buffer = methods.get_buffer(str(source[0]))
with methods.generated_wrapper(str(target[0])) as file:
# The editor splash background color is taken from the default editor theme's background color.
# This helps achieve a visually "smoother" transition between the splash screen and the editor.
file.write(f"""\
static const Color boot_splash_editor_bg_color = Color(0.125, 0.145, 0.192);
inline constexpr const unsigned char boot_splash_editor_png[] = {{
{methods.format_buffer(buffer, 1)}
}};
""")
def make_app_icon(target, source, env):
buffer = methods.get_buffer(str(source[0]))
with methods.generated_wrapper(str(target[0])) as file:
# Use a neutral gray color to better fit various kinds of projects.
file.write(f"""\
inline constexpr const unsigned char app_icon_png[] = {{
{methods.format_buffer(buffer, 1)}
}};
""")