|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| tga (path) | |
| changed (a, b) | |
| config (effects) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| dict | DEFAULT_CLIENT = {115: 'build/check-linux-10/cod2_linux', 118: 'build/check-linux/cod2_linux'} |
| str | EFFECTS = 'fx/misc/missing_fx,fx/impacts/default_hit,fx/explosions/grenadeExp_water,fx/impacts/minefield,fx/explosions/large_vehicle_explosion,fx/explosions/tank_explosion' |
| tuple | MISSING = ('fx/impacts/fluff1.efx', 'fx/impacts/dirthit_mortar.efx') |
| str | SPOT = '3051 2178 80 210' |
| int | PITCH = -45 |
| str | GAMETYPE |
| int | DIFF = 40 |
| int | MIN_PIXELS = 500 |
| int | SECONDS = 420 |
A client draws effects: each one changes the picture where it plays.
python3 scripts/fx_test.py /path/to/CoD2 --protocol {115|118} [--binary PATH] [--effects FX,...] [--spot 'X Y Z YAW'] [--keep DIR]
Starts a client (cod2_linux) on its own game of mp_toujane with a gametype
that spawns the player at a fixed spot as it connects, looking up at the sky,
hides the HUD and the gun, and takes screenshots (TGA) by a config file. For
each effect it takes two shots without it, 12 frames apart, to measure how
much the picture changes by itself (the last effect's smoke drifting by), then
one 12 frames after fxTest started playing the effect again and again in
front of the player (fxSetTestPosition). Counts the pixels of a shot that
differ from the one before it by more than DIFF in some channel. Exits with 0
when every effect changes over MIN_PIXELS pixels more than the picture does
by itself, every effect loads (an effect that fails plays the placeholder
instead), every material loads, and the client still runs and leaves no
crash report. --keep copies the screenshots, the log and any crash report to
DIR. The client opens a window and needs a CD key in ~/.cod2/preferences;
without one the test is skipped (exit 0).
| fx_test.changed | ( | a, | |
| b ) |
The pixels of b that differ from a by more than DIFF in some channel.
| fx_test.config | ( | effects | ) |
| fx_test.main | ( | ) |
| fx_test.tga | ( | path | ) |
(width, height, rows of bytes) of an uncompressed 24 or 32 bit TGA.
| dict fx_test.DEFAULT_CLIENT = {115: 'build/check-linux-10/cod2_linux', 118: 'build/check-linux/cod2_linux'} |
| int fx_test.DIFF = 40 |
| str fx_test.EFFECTS = 'fx/misc/missing_fx,fx/impacts/default_hit,fx/explosions/grenadeExp_water,fx/impacts/minefield,fx/explosions/large_vehicle_explosion,fx/explosions/tank_explosion' |
| str fx_test.GAMETYPE |
| int fx_test.MIN_PIXELS = 500 |
| tuple fx_test.MISSING = ('fx/impacts/fluff1.efx', 'fx/impacts/dirthit_mortar.efx') |
| int fx_test.PITCH = -45 |
| fx_test.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| int fx_test.SECONDS = 420 |
| str fx_test.SPOT = '3051 2178 80 210' |