Added the ability to strip from files to the joiner script.

This commit is contained in:
Relintai 2024-01-05 10:24:13 +01:00
parent 9ed67cb07e
commit 8f3e3e3012
2 changed files with 19 additions and 0 deletions

View File

@ -6,9 +6,11 @@
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
/*************************************************************************/
//--STRIP
#include "core/math_defs.h"
#include "core/plane.h"
#include "core/vector3.h"
//--STRIP
/**
* AABB / AABB (Axis Aligned Bounding Box)

View File

@ -42,10 +42,27 @@ def print_includes(f):
print(l)
print_includes_dict[l] = 1
def strip_file(f):
if "//--STRIP" in f:
s = f.split("//--STRIP")
if len(s) % 2 != 1:
print("File likely has non-terminated //--STRIP comments!")
return f
f = ""
for i in range(len(s)):
if i % 2 == 0:
f += s[i]
return f
def process_file(f):
#print_includes(f)
f = strip_file(f)
#return f.replace('#include ', '//#include ')
return f