mirror of
https://github.com/Relintai/sfw.git
synced 2025-01-03 05:09:36 +01:00
Added the ability to strip from files to the joiner script.
This commit is contained in:
parent
9ed67cb07e
commit
8f3e3e3012
@ -6,9 +6,11 @@
|
|||||||
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
//--STRIP
|
||||||
#include "core/math_defs.h"
|
#include "core/math_defs.h"
|
||||||
#include "core/plane.h"
|
#include "core/plane.h"
|
||||||
#include "core/vector3.h"
|
#include "core/vector3.h"
|
||||||
|
//--STRIP
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AABB / AABB (Axis Aligned Bounding Box)
|
* AABB / AABB (Axis Aligned Bounding Box)
|
||||||
|
@ -42,10 +42,27 @@ def print_includes(f):
|
|||||||
print(l)
|
print(l)
|
||||||
print_includes_dict[l] = 1
|
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):
|
def process_file(f):
|
||||||
#print_includes(f)
|
#print_includes(f)
|
||||||
|
|
||||||
|
f = strip_file(f)
|
||||||
|
|
||||||
#return f.replace('#include ', '//#include ')
|
#return f.replace('#include ', '//#include ')
|
||||||
|
|
||||||
return f
|
return f
|
||||||
|
Loading…
Reference in New Issue
Block a user