|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| load (path) | |
| header (names) | |
| defined_in (names, text) | |
| placeholders (names) | |
| rename_asm (text, names) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| str | PREFIX = 'eng_' |
| list | BLOBS = ['src/blobs/bss.c', 'build/native_gen/data32.c', 'build/native_gen/literals32.c'] |
Writes the eng_ names of the engine's bgame globals.
python3 scripts/bgame_names.py
In the client the engine's bgame (for cgame) and CoD2rev-Plus's (for the
local server) both run, and they name some globals alike. For each name in
test/engine_bgame_names.txt this writes:
- src/headers/engine_bgame_names.h: '#define name eng_name', which
common_types.h includes, so every C source of the engine (the bgame, cgame,
the blobs and their imp_ pointers) uses the eng_ name;
- src/compat/server_bgame_names.cpp: a placeholder for each eng_ name the
C blobs (BLOBS) do not define, in the dedicated server, which leaves the
engine's bgame out but still links the imp_ pointers that take their
addresses.
The MinGW blobs (.win.S) spell the labels themselves; they are renamed once
with --rename-asm FILE.
| bgame_names.defined_in | ( | names, | |
| text ) |
The names a C source defines (not only declares).
| bgame_names.header | ( | names | ) |
| bgame_names.load | ( | path | ) |
| bgame_names.main | ( | ) |
| bgame_names.placeholders | ( | names | ) |
| bgame_names.rename_asm | ( | text, | |
| names ) |
The .S labels and references of names (with the C underscore), renamed.
| list bgame_names.BLOBS = ['src/blobs/bss.c', 'build/native_gen/data32.c', 'build/native_gen/literals32.c'] |
| str bgame_names.PREFIX = 'eng_' |
| bgame_names.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |