|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| load_types (path) | |
| program (prologue, types) | |
| keys (types) | |
| objcopy_for (compiler) | |
| measure (compiler, flags, source, tmp, tag, types) | |
| variant_flags (variant) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| SRC = os.path.join(ROOT, 'src') | |
| dict | PROTOCOL = {'linux': 118, 'linux-10': 115, 'mingw': 118, 'linux-client-x64': 118} |
| tuple | X64_VARIANTS = ('linux-client-x64',) |
| tuple | ENGINE_VM_TYPES = ('VariableUnion', 'VariableValue', 'VariableValueInternal') |
Compares struct layouts between this repo's headers and CoD2rev-Plus's.
python3 scripts/layout_parity.py [--variant linux|linux-10|mingw|linux-client-x64]
python3 scripts/layout_parity.py --headers-a A.h --headers-b B.h --types T.txt --flags "-m32"
Each line of the types file (default test/layout_parity_types.txt) is a type
name, optionally followed by ':field1,field2,...' (# comments); a name ending
in '~' compares only the fields, not sizeof. For each side a
C++ program prints sizeof and offsetof of every field; the two results are
compared. Side A is this repo (common_types.h and imports.h inside extern "C"),
side B is CoD2rev-Plus (qcommon.h, script_public.h, server.h and g_shared.h); both use the flags of the
variant's build in build/check-<variant>/. Nothing is run: each side's
values are an array in a section of its own (.lpar) of the compiled object,
which objcopy reads, so the mingw variant needs no wine. Prints 'ok <type>' or
'DIFF <type>: <field> <A> != <B>', and exits with 0 when nothing differs.
| layout_parity.keys | ( | types | ) |
| layout_parity.load_types | ( | path | ) |
| layout_parity.main | ( | ) |
| layout_parity.measure | ( | compiler, | |
| flags, | |||
| source, | |||
| tmp, | |||
| tag, | |||
| types ) |
| layout_parity.objcopy_for | ( | compiler | ) |
The objcopy of the compiler's toolchain (i686-w64-mingw32-g++ -> i686-w64-mingw32-objcopy).
| layout_parity.program | ( | prologue, | |
| types ) |
A source whose layout_values array holds, in the order of keys(types), each type's sizeof and its fields' offsetof.
| layout_parity.variant_flags | ( | variant | ) |
(compiler, flags) of an engine C++ source in build/check-<variant>, without -c/-o/source.
| tuple layout_parity.ENGINE_VM_TYPES = ('VariableUnion', 'VariableValue', 'VariableValueInternal') |
| dict layout_parity.PROTOCOL = {'linux': 118, 'linux-10': 115, 'mingw': 118, 'linux-client-x64': 118} |
| layout_parity.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| layout_parity.SRC = os.path.join(ROOT, 'src') |
| tuple layout_parity.X64_VARIANTS = ('linux-client-x64',) |