mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
tools/makectx: Use cl.exe /EP /P for file preprocessing.
Creates a messy file with a lot of newlines but allows for adding DX structs.
This commit is contained in:
parent
7ab43368f0
commit
e7cdfa76dd
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ ISLE.EXE
|
|||||||
LEGO1.DLL
|
LEGO1.DLL
|
||||||
build/
|
build/
|
||||||
*.swp
|
*.swp
|
||||||
|
*.i
|
||||||
|
|||||||
@ -1,43 +1,15 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# Tool to make simple context, currently the basic Mx* structures.
|
import argparse
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
|
|
||||||
ctxfile = open('ctx.h', 'w')
|
parser = argparse.ArgumentParser(allow_abbrev=False,
|
||||||
|
description='Verify Exports: Compare the exports of two DLLs.')
|
||||||
|
parser.add_argument('cppfile', metavar='cppfile', help='Path to the C++ File to preprocess.')
|
||||||
|
|
||||||
# These are the only files we can include, hopefully soon decomp.me can deal with DirectX files. There is no need to bundle all the thousands of lines DX5 headers have, its not like all of it is probably going to be used.
|
args = parser.parse_args()
|
||||||
ctxfile.write('#include <string.h>\n')
|
if not os.path.isfile(args.cppfile):
|
||||||
ctxfile.write('#include <windows.h>\n')
|
parser.error('Specified C++ file does not exist.')
|
||||||
|
|
||||||
# The order is important!
|
os.system('cl.exe /EP /P ' + args.cppfile)
|
||||||
# In the future, *all* the files can be done - but there will always be some headers that need to be placed in before others.
|
|
||||||
# Later, when this initial list is complete, and DirectX header files are available on decomp.me, then we can bundle in everything that is not order-dependent (that isn't already in the list.)
|
|
||||||
# This will periodically need updating depending on what classes include stuff from others - for now, these are the most likely basics.
|
|
||||||
# This context should be enough to match basic functions, once manually adding in context for the intended class.
|
|
||||||
# This pastebin shows class inheritance. This can help us a lot: https://pastebin.com/AQAiurwC
|
|
||||||
headerfiles = [
|
|
||||||
# Basic definitions/types/base classes
|
|
||||||
'LEGO1/compat.h',
|
|
||||||
'LEGO1/mxtypes.h',
|
|
||||||
|
|
||||||
'LEGO1/mxcore.h',
|
print('Preprocessed file. It will be in the directory you executed in this command as "(filename).i".')
|
||||||
'LEGO1/mxstring.h',
|
|
||||||
'LEGO1/mxhashtable.h',
|
|
||||||
'LEGO1/mxvariable.h',
|
|
||||||
'LEGO1/mxvariabletable.h',
|
|
||||||
|
|
||||||
'LEGO1/mxcriticalsection.h',
|
|
||||||
'LEGO1/mxomni.h',
|
|
||||||
|
|
||||||
'LEGO1/legostate.h',
|
|
||||||
|
|
||||||
'LEGO1/mxentity.h',
|
|
||||||
'LEGO1/legoentity.h',
|
|
||||||
]
|
|
||||||
|
|
||||||
for i in headerfiles:
|
|
||||||
ctxfile.write('\n// Start of ' + i + '\n')
|
|
||||||
for line in open(i):
|
|
||||||
if not line.startswith('#include'):
|
|
||||||
ctxfile.write(line)
|
|
||||||
ctxfile.write('\n// End of ' + i + '\n')
|
|
||||||
Loading…
Reference in New Issue
Block a user