OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
bgame_names Namespace Reference

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']

Detailed Description

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.

Function Documentation

◆ defined_in()

bgame_names.defined_in ( names,
text )
The names a C source defines (not only declares).

◆ header()

bgame_names.header ( names)

◆ load()

bgame_names.load ( path)

◆ main()

bgame_names.main ( )

◆ placeholders()

bgame_names.placeholders ( names)

◆ rename_asm()

bgame_names.rename_asm ( text,
names )
The .S labels and references of names (with the C underscore), renamed.

Variable Documentation

◆ BLOBS

list bgame_names.BLOBS = ['src/blobs/bss.c', 'build/native_gen/data32.c', 'build/native_gen/literals32.c']

◆ PREFIX

str bgame_names.PREFIX = 'eng_'

◆ ROOT

bgame_names.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))