diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-06-11 10:41:03 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-06-11 10:41:03 -0300 |
commit | 9b8696d3dd92e2ed6f310ad0f0bf3c2182c9c6ae (patch) | |
tree | b2ed0515196bb774504b54aab0bf242992ac3d9f /core/SCsub | |
parent | 6f0b4678e26c04abfc88c0226c803e78a108de98 (diff) |
Light Baker!
-=-=-=-=-=-=
-Support for lightmap baker, have fun figuring out how it works before tutorial is published.
Diffstat (limited to 'core/SCsub')
-rw-r--r-- | core/SCsub | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/SCsub b/core/SCsub index 9a86c2943d..7eace22b73 100644 --- a/core/SCsub +++ b/core/SCsub @@ -19,9 +19,37 @@ f = open("global_defaults.cpp","wb") f.write(gd_cpp) f.close() +import os +txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0" +if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ): + e=os.environ["SCRIPT_AES256_ENCRYPTION_KEY"] + txt = "" + ec_valid=True + if (len(e)!=64): + ec_valid=False + else: + + for i in range(len(e)>>1): + if (i>0): + txt+="," + txts="0x"+e[i*2:i*2+2] + try: + int(txts,16) + except: + ec_valid=False + txt+=txts + if (not ec_valid): + txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0" + print("Invalid AES256 encryption key, not 64 bits hex: "+e) + +f = open("script_encryption_key.cpp", "wb") +f.write("#include \"globals.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n") +f.close() + env.add_source_files(env.core_sources,"*.cpp") + Export('env') import make_binders |