Skip to content

Commit cc2fdc3

Browse files
committed
Merge pull request godotengine#111015 from Alexofp/texture-compression-build-option
Scons option to enable CVTT and Betsy compression in export templates
2 parents 58a6412 + 5a0f29f commit cc2fdc3

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

modules/betsy/config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
def can_build(env, platform):
2-
return env.editor_build
2+
return env.editor_build or env["betsy_export_templates"]
3+
4+
5+
def get_opts(platform):
6+
from SCons.Variables import BoolVariable
7+
8+
return [
9+
BoolVariable(
10+
"betsy_export_templates",
11+
"Enable Betsy image compression in export template builds (increases binary size)",
12+
False,
13+
),
14+
]
315

416

517
def configure(env):

modules/cvtt/config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
def can_build(env, platform):
2-
return env.editor_build
2+
return env.editor_build or env["cvtt_export_templates"]
3+
4+
5+
def get_opts(platform):
6+
from SCons.Variables import BoolVariable
7+
8+
return [
9+
BoolVariable(
10+
"cvtt_export_templates",
11+
"Enable CVTT image compression in export template builds (increases binary size)",
12+
False,
13+
),
14+
]
315

416

517
def configure(env):

modules/cvtt/register_types.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include "register_types.h"
3232

33-
#ifdef TOOLS_ENABLED
34-
3533
#include "image_compress_cvtt.h"
3634

3735
void initialize_cvtt_module(ModuleInitializationLevel p_level) {
@@ -47,5 +45,3 @@ void uninitialize_cvtt_module(ModuleInitializationLevel p_level) {
4745
return;
4846
}
4947
}
50-
51-
#endif // TOOLS_ENABLED

modules/cvtt/register_types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030

3131
#pragma once
3232

33-
#ifdef TOOLS_ENABLED
34-
3533
#include "modules/register_module_types.h"
3634

3735
void initialize_cvtt_module(ModuleInitializationLevel p_level);
3836
void uninitialize_cvtt_module(ModuleInitializationLevel p_level);
39-
40-
#endif // TOOLS_ENABLED

0 commit comments

Comments
 (0)