-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
43 lines (31 loc) · 1.76 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
this mod can be launched with qwsv262 or mvdsv (quakeworld servers)
Do not use double in mods, qvm does not support it.
Do not modify progdefs.h and g_public.h.
Use PROG_TO_EDICT, EDICT_TO_PROG for working with (gedict_t)->s.v entity
fields (like .owner, .enemy).
Map entities are described in g_spawn.c in tables:
field_t fields[]
spawn_t spawns[]
Missile spawn requires g_globalvars.newmis set.
dont use string arrys in one structure with other types ( q3asm place strings in different segment )
dont use map command with redirectcmd, executecmd, readcmd
compiler bugs/features:
# switch statements sometimes produce unsafe code if you use run-on in case
labels. ie. each case label must have it's own break statement OR no lines of
logic between the next case label.
# For integer types avoid using data types other than int. Specifically don't
use the short or unsigned char data types at all (info from ID). The Q3VM and
compiler do not deal with non-wordsize types well -- using them often results
in unpredictable behaviour.
# double does not exist, everything is 32bit. float does not undergo type
promotion when passed as a parameter.
Mac VM Endianness
The Mac VM is big endian (high byte first in integers and shorts), which means
you need to be careful with certain I/O operations. For example, you can't
serialize an integer to a file stream just by writing its bytes.
("trap_FS_Write(&i, 4, f)" - if "i" is an int - will produce different results
in the Mac VM than in the PC VM, in other words.)
Extracting bytes using shift operators and writing them to a temporary buffer
will work. Or write your own htonl(), etc. (It's easy to tell if you need to
swap bytes: assign an int to a constant, get a char* pointer to it, and check
the bytes.)