Adjusted function autogen to automatically pull includes
This commit is contained in:
parent
3fcc31e233
commit
f862b3ac21
|
@ -28,7 +28,6 @@ in_files = [
|
||||||
"src/pc/djui/djui_popup.h",
|
"src/pc/djui/djui_popup.h",
|
||||||
"src/pc/network/network_utils.h",
|
"src/pc/network/network_utils.h",
|
||||||
"src/pc/djui/djui_chat_message.h",
|
"src/pc/djui/djui_chat_message.h",
|
||||||
#"src/game/print.h",
|
|
||||||
"src/game/interaction.h",
|
"src/game/interaction.h",
|
||||||
"src/game/level_info.h",
|
"src/game/level_info.h",
|
||||||
"src/game/save_file.h",
|
"src/game/save_file.h",
|
||||||
|
@ -69,23 +68,7 @@ template = """/* THIS FILE IS AUTOGENERATED */
|
||||||
|
|
||||||
#include "smlua.h"
|
#include "smlua.h"
|
||||||
|
|
||||||
#include "game/level_update.h"
|
$[INCLUDES]
|
||||||
#include "game/area.h"
|
|
||||||
#include "game/mario.h"
|
|
||||||
#include "game/mario_step.h"
|
|
||||||
#include "game/mario_actions_stationary.h"
|
|
||||||
#include "audio/external.h"
|
|
||||||
#include "object_fields.h"
|
|
||||||
#include "engine/math_util.h"
|
|
||||||
#include "engine/surface_collision.h"
|
|
||||||
#include "pc/network/network_utils.h"
|
|
||||||
#include "src/pc/djui/djui_popup.h"
|
|
||||||
#include "src/game/print.h"
|
|
||||||
#include "src/game/interaction.h"
|
|
||||||
#include "src/game/level_info.h"
|
|
||||||
#include "src/game/save_file.h"
|
|
||||||
#include "src/game/sound_init.h"
|
|
||||||
#include "src/pc/djui/djui_gfx_utils.h"
|
|
||||||
|
|
||||||
$[FUNCTIONS]
|
$[FUNCTIONS]
|
||||||
|
|
||||||
|
@ -293,6 +276,14 @@ def build_binds(processed_files):
|
||||||
s += build_bind(function)
|
s += build_bind(function)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
|
def build_includes():
|
||||||
|
s = ''
|
||||||
|
for f in in_files:
|
||||||
|
if not f.endswith('.h'):
|
||||||
|
continue
|
||||||
|
s += '#include "%s"\n' % f
|
||||||
|
return s
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
def process_function(fname, line):
|
def process_function(fname, line):
|
||||||
|
@ -473,12 +464,20 @@ def main():
|
||||||
|
|
||||||
built_functions = build_functions(processed_files)
|
built_functions = build_functions(processed_files)
|
||||||
built_binds = build_binds(processed_files)
|
built_binds = build_binds(processed_files)
|
||||||
|
built_includes = build_includes()
|
||||||
|
|
||||||
filename = get_path(out_filename)
|
filename = get_path(out_filename)
|
||||||
|
|
||||||
|
gen = template \
|
||||||
|
.replace("$[FUNCTIONS]", built_functions) \
|
||||||
|
.replace("$[BINDS]", built_binds) \
|
||||||
|
.replace("$[INCLUDES]", built_includes)
|
||||||
|
|
||||||
with open(filename, 'w') as out:
|
with open(filename, 'w') as out:
|
||||||
out.write(template.replace("$[FUNCTIONS]", built_functions).replace("$[BINDS]", built_binds))
|
out.write(gen)
|
||||||
print('REJECTS:')
|
|
||||||
print(rejects)
|
print('REJECTS:\n%s' % rejects)
|
||||||
|
|
||||||
doc_files(processed_files)
|
doc_files(processed_files)
|
||||||
|
|
||||||
global total_functions
|
global total_functions
|
||||||
|
|
|
@ -3,24 +3,22 @@
|
||||||
|
|
||||||
#include "smlua.h"
|
#include "smlua.h"
|
||||||
|
|
||||||
#include "game/level_update.h"
|
#include "src/audio/external.h"
|
||||||
#include "game/area.h"
|
#include "src/engine/surface_collision.h"
|
||||||
#include "game/mario.h"
|
#include "src/game/camera.h"
|
||||||
#include "game/mario_step.h"
|
#include "src/game/characters.h"
|
||||||
#include "game/mario_actions_stationary.h"
|
#include "src/game/mario_step.h"
|
||||||
#include "audio/external.h"
|
#include "src/game/mario.h"
|
||||||
#include "object_fields.h"
|
|
||||||
#include "engine/math_util.h"
|
|
||||||
#include "engine/surface_collision.h"
|
|
||||||
#include "pc/network/network_utils.h"
|
|
||||||
#include "src/pc/djui/djui_popup.h"
|
#include "src/pc/djui/djui_popup.h"
|
||||||
#include "src/game/print.h"
|
#include "src/pc/network/network_utils.h"
|
||||||
|
#include "src/pc/djui/djui_chat_message.h"
|
||||||
#include "src/game/interaction.h"
|
#include "src/game/interaction.h"
|
||||||
#include "src/game/level_info.h"
|
#include "src/game/level_info.h"
|
||||||
#include "src/game/save_file.h"
|
#include "src/game/save_file.h"
|
||||||
#include "src/game/sound_init.h"
|
#include "src/game/sound_init.h"
|
||||||
#include "src/pc/djui/djui_gfx_utils.h"
|
#include "src/pc/djui/djui_gfx_utils.h"
|
||||||
|
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
// camera.h //
|
// camera.h //
|
||||||
//////////////
|
//////////////
|
||||||
|
|
Loading…
Reference in New Issue