Commit graph

31 commits

Author SHA1 Message Date
Ron Koenderink
0a44c4893e (plane_flags, plane_ca): Add plane flags table.
(retreat_flags, ship_ca, land_ca, plane_ca): Add retreat flags table.

(nation_flags, nation_relations, nat_ca): Add nation flags and
nation relations tables.

(empfile_ca): Remove flags and file name fields.
They are internal and not needed by the client.
2005-11-09 22:56:43 +00:00
Ron Koenderink
23f134aa75 (empfile,mission_flags,ship_ca,land_ca,plane_ca): Add mission flags table. 2005-11-06 13:43:09 +00:00
41bf5be715 (UNMAPPED_INIT, UNMAPPED_CACHE, ARRAY_INIT, ARRAY_TABLE, PTR_INIT)
(PTR_CACHE): Rename.

(ARRAY_CACHE): New.
(empfile): Use it to set csize of elements EF_SHIP_CHR, EF_PLANE_CHR,
EF_LAND_CHR, EF_NUKE_CHR.
(ef_init_chr): Now that empfile[]'s initializer sets csize, remove the
temporary csize initialization here.  The value wasn't correct, but
better than nothing.
2005-11-03 18:25:26 +00:00
b2ae3257ca (empfile): Rename member ef_uid to uid for consistency with other
members.

(empfile): Reorder members for clearer documentation.

(EFF_IMMUTABLE): New.
(EFF_OPEN): Remove, use ~EFF_IMMUTABLE.

(empfile): Don't initialize member size to a useless value for EF_MAP
and EF_BMAP.  ef_init() writes the real value.
2005-10-30 12:50:13 +00:00
b96b9baced (rpt, page_headings): Declare with array size. Define without.
(empfile): Correctly initialize members cids, csize, fids for all
EFF_STATIC tables except EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR,
EF_NUKE_CHR, EF_META and the symbol tables.
2005-10-29 14:48:32 +00:00
ef48271974 (EF_TREATY_CHR, EF_TREATY_FLAGS): Rename for consistency with other flags.
(treaty_ca): Add missing EF_TREATY_FLAGS to selectors acond, bcond.
2005-10-29 14:36:10 +00:00
e612db5cb6 (tchrstr, tchr_ca): Remove, use struct symbol and symbol_ca. Users
changed.
(tchr, treaty_flags): Rename for consistency with other flags.
2005-10-29 14:10:23 +00:00
02ec5df820 (lookup, symbol): Rename. Rename members to match selectors and
better reflect their purpose.  Users changed.
(lookup_ca, symbol_ca): Rename.
2005-10-29 07:46:42 +00:00
19f2948620 (rpt): Add sentinel.
(EF_NEWS_CHR): New.
(empfile): Add its entry.
2005-10-29 06:27:00 +00:00
Ron Koenderink
551263cb07 (empfile,mdchr_ca,meta_type,meta_flags):
Add meta table and associated symbol tables.
2005-10-25 00:37:59 +00:00
babf467e15 (EFF_STATIC): New.
(empfile): Use it.
(ef_open): Oops on it (not implemented).
(ef_close): Implement it (trivial).
2005-10-24 23:35:18 +00:00
64d8f6babe (ef_open, EFF_RDONLY, EFF_CREATE, EFF_OPEN): Replace mode parameter
(really open flags, not mode) by new flags EFF_RDONLY, EFF_CREATE.
Open flags were needlessly general.  Callers changed.
(empfile): Member mode now unused, remove.
2005-10-24 18:18:59 +00:00
Ron Koenderink
898aaf3d3d (empfile, empfile_ca): New struct empfile member ef_uid. 2005-10-22 19:10:22 +00:00
Ron Koenderink
fcf5c59513 (castr,empfile,ship_chr,plane_chr,land_chr,nuke_chr):
Add table index to castr to create a reference to the symbol table.
Add "ship chr flags" table to empfile.
Add "plane chr flags" table to empfile.
Add "land chr flags" table to empfile.
Add "nuke chr flags" table to empfile.
Add EF_SHIP_CHR_FLAGS reference to ship_chr.
Add EF_PLANE_CHR_FLAGS reference to plane_chr.
Add EF_LAND_CHR_FLAGS reference to land_chr.
Add EF_NUKE_CHR_FLAGS reference to nuke_chr.

(show_ship_capab,show_plane_capab,show_land_capab,
show_nuke_capab,ship_flags,land_flags,plane_flags,nuke_flags):
Move ship_flags nsc.c from show.c
Rename ship_flags to ship_chr_flags.
Move plane_flags nsc.c from show.c
Rename plane_flags to plane_chr_flags.
Move land_flags nsc.c from show.c
Rename land_flags to land_chr_flags.
Move nuke_flags nsc.c from show.c
Rename nuke_flags to nuke_chr_flags.
This is to accomodate future symbol table for EF_PLANE table.
2005-10-22 16:39:45 +00:00
Ron Koenderink
cf4faac293 (ef_init): Remove cadef member from fileinit,
insert directly into the empfile structure.
Add ef_type member to fileinit to identify rows with data.
Remove unused rows of fileinit.
2005-10-22 13:55:04 +00:00
Ron Koenderink
29d21997b9 (empfile[]) Add table of tables to empfile[]. 2005-10-22 12:38:58 +00:00
0ab9260151 (empfile, chr_camap): Merge chr_camap[] into empfile[]. No existing
user sees the new elements of empfile[].
(EF_SECTOR_CHR, EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR, EF_NUKE_CHR)
(EF_TREATY_CHR, EF_ITEM, EF_INFRASTRUCTURE, EF_PRODUCT): New.  Not yet
used.
(my_ef_byname): Replacement for ef_byname() that sees the new
elements.
(xdchr): Work with empfile[] instead of chr_camap[].
(xdump): Use my_ef_byname() instead of ef_byname() and
chridx_by_name().
(camap, chr_camap, chridx_by_name): Remove.
2005-10-21 19:38:37 +00:00
ff8c7c249a (empfile): Member itemoffs is unused since file.c rev. 1.15; remove. 2005-09-30 20:02:57 +00:00
Marc Olzheim
84bc824f65 Change 0 to NULL for pointer initializations. No functional changes. 2005-08-22 18:52:43 +00:00
326ac671ba (EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets
player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
2005-05-29 14:14:33 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
7f000ce9cc Fix ugly line breaks. 2005-03-10 19:17:15 +00:00
29da4b6cf4 (empfile, teldir, motdfil, downfil, disablefil, telfil, annfil)
(banfil, authfil, timestampfil): Make file names relative to DATADIR.
(main): emp_server and files change to the data directory.  fairland
has to write newcap_script to the initial current directory, so it
keeps it and makes file names relative to DATADIR absolute.
(fixup_files): Nothing to do, remove.  This fixes the following bug:
fixup_files() formed file names by appending ep->name instead of the
base name of ep->file to datadir.  Thus, fixup_files() changed file
names even when datadir had the compiled-in value.  When emp_config()
couldn't open econfig, it failed to call fixup_files(), and different
file names got used.  Note that with this revision the file names
revert to the names used before fixup_files() was introduced.  Closes
#1146080.
(print_config): Printing file names as comments is not really useful,
remove.
(otherfiles, ofiles): Unused, remove.
(emp_config, main): Previously, pconfig had to call emp_config() even
when it didn't want to read econfig, just to run fixup_files().  This
is no longer necessary.  Simplify.
2005-03-09 18:44:50 +00:00
Marc Olzheim
b20ce77e4b (EFF_COM): No longer in use after removal of 'variables' 2004-12-16 12:21:08 +00:00
Marc Olzheim
c6ef918f3a Cleanup #includes of (mostly a long time) unused header files.
No functional changes.
2004-12-13 16:47:13 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds.
To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
2004-03-03 16:54:22 +00:00
cfc7e113ef (wrgamesdef): Generate EMPDIR instead of EMPPATH(). Change callers of
EMPPATH() to use EMPDIR.  This avoids triggering MSVC bugs, and drops
support for traditional, pre-ISO cpp.  Closes #753935.
(gamedir, lostfil, playerbin, updatebin): Unused, remove.
2004-01-31 19:33:00 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00