This is the mail archive of the
xconq-cvs@sources.redhat.com
mailing list for the Xconq project.
xconq ./ChangeLog curses/ccmd.c curses/cconq.c ...
- To: xconq-cvs at sourceware dot cygnus dot com
- Subject: xconq ./ChangeLog curses/ccmd.c curses/cconq.c ...
- From: shebs at sourceware dot cygnus dot com
- Date: 18 Dec 2000 16:50:51 -0000
CVSROOT: /cvs/xconq
Module name: xconq
Changes by: shebs@sources.redhat.com 2000-12-18 08:50:50
Modified files:
. : ChangeLog
curses : ccmd.c cconq.c cconq.h cdraw.c
kernel : ai.c ai.h cmd.c config.h game.h generic.c
gvar.def help.c init.c iplayer.c mkrivers.c
mkterr.c mkunits.c mplayer.c nlang.c oplayer.c
plan.c ps.c read.c run.c run2.c score.c side.c
supply.c table.def ui.c ui.h unit.c utype.def
world.c world.h write.c
mac : maccmd.c macwins.c
tcltk : tkcmd.c tkconq.h tkinit.c tkmain.c tkmap.c
Log message:
Eliminate the macros MAXUTYPES, MAXTTYPES, MAXMTYPES, and
MAXATYPES, size all type handling dynamically.
* config.h (MAXUTYPES, MAXTTYPES, MAXMTYPES, MAXATYPES): Remove.
* game.h (NONUTYPE, NONTTYPE, NONMTYPE, NONATYPE): Define to be -1.
(count_terrain_subtypes, numcelltypes, numbordtypes, numconntypes,
numcoattypes): Declare here instead of in world.h.
(tmp_u_array, tmp_t_array): Declare.
* gvar.def (edge-terrain, river-sink-terrain): Don't use type
bounds.
* table.def (adjacent-terrain-effect, terrain-exhaustion-type): Ditto.
* utype.def (obsolete, wrecked-type): Ditto.
* generic.c (count_terrain_subtypes, numcelltypes, etc): Move here
from world.c.
(tmp_u_array, tmp_t_array): New globals.
(curmaxutypes, curmaxmtypes, curmaxttypes, curmaxatypes): Set to
defaults convenient for the first allocation.
(create_unit_type): New function.
(disallow_more_unit_types, disallow_more_terrain_types): New functions.
(allocate_table): Use them.
* help.c (tm_table_row_desc): Remove, never used.
* init.c (check_game_validity): Call disallow_* to make sure
some type arrays are computed and cached.
(calculate_globals): Ditto.
(make_initial_materials): Use tmp_t_array.
* mkrivers.c (make_up_river_borders): Ditto.
* mkterr.c (elev_range, elev_lo, elev_hi, raw_range, raw_lo,
raw_hi): New static globals.
(compose_area, compose_earthlike_area): Use them.
(make_random_terrain, fix_adjacent_terrain,
flatten_liquid_terrain): Use tmp_t_array.
* mkunits.c (make_countries): Dynalloc local arrays.
(country_is_complete, make_independent_units): Use tmp_u_array.
* nlang.c (ohd_nums, ohd_incomplete): New static globals.
(others_here_desc, occupants_desc): Use them.
* plan.c (plan_colonize_support): Use tmp_u_array.
(gctc_supply): New static global.
(good_cell_to_colonize): Use it.
* ps.c (summary_of_seen_units_at): Use tmp_u_array.
* read.c (default_supply): Remove, no longer to use.
(init_predefined_symbols): Remove its setup.
(interp_unit_default): Similarly.
(interp_unit): Don't use default_supply.
(interp_utype): Remove test for too many types, call
create_unit_type.
(interp_ttype, interp_mtype, interp_atype): Remove tests
for too many types.
(too_many_types): Remove, no longer needed.
(rd_u_arr): New static global.
(interp_standing_order, read_utype_doctrine): Use it.
* run.c (rau_incrs): New static global.
(run_advanced_units): Use it.
(apr_type): New static global.
(auto_pick_unit_research, auto_pick_side_research): Use it.
(auto_pick_new_build_task): Use tmp_u_array.
* run2.c (ttotals, uttotals): New static globals.
(run_economy): Use them.
* score.c (sum_property): Use tmp_u_array.
* side.c (new_doctrine): Call disallow_more_unit_types.
* supply.c (mad): New static global.
(init_supply_system): Set it up.
* unit.c (create_unit): Allocate numlivebytype and completenesses.
(oc_numtypes): New static global.
(can_occupy_unit): Use it.
(toc_numtypes, type_can_occupy_cell): Similarly.
(ocw_numtypes, can_occupy_cell_without): Similarly.
(tocw_numtypes, type_can_occupy_cell_without): Similarly.
(conn_num_types, can_occupy_conn_1): Similarly.
(can_carry, type_can_occupy): Use tmp_u_array.
(num_each_type, shared_each_type): New static globals.
(eject_excess_occupants): Use them.
(shortest_unique_name): Dynalloc firstuniq, use it as flag
instead of shortestdone.
(shortest_generic_name): Similarly.
* write.c (write_table): Increase histogram size.
* ai.c (atc_type): New static global.
(assign_to_colonize): Use it.
(pbt_prefs, pbt_fringe_terrain, pbt_enemy_types,
pbt_num_to_transport): New static globals.
(preferred_build_type): Use them.
* ai.h (Strategy): Declare strengths etc as arrays of pointers
instead of 2D arrays, unitlist and unitlistcount as pointers.
(Theater): Similarly for numassigned, numneeded, etc.
(strength_est, etc): New macros (not used yet).
* iplayer.c (iru_numoffensive, iru_numdefensive): New static globals.
(iplayer_review_units): Use them.
* mplayer.c (mplayer_create_strategy): Allocate strength arrays.
(create_theater): Dynalloc numassigned etc fields.
(estimate_strengths, mplayer_read_strengths, mplayer_save_state):
Change to pointer-to-pointer refs.
(mru_numoffensive, mru_numdefensive): New static globals.
(mplayer_review_units): Use them.
* oplayer.c: Similarly.
* cmd.c (gt_amts, gt_rslts): New static globals.
(do_one_give, do_one_take): Use them.
* ui.h (VP draw_materials): Make into a pointer.
* ui.c (new_vp): Allocate draw_materials field.
* maccmd.c (do_one_add_terrain): Use tmp_t_array.
* macwins.c (side_research_dialog): Make participants static global.
* tkconq.h (UI material_color, etc): Change from array to pointer.
(UI cell_color, cell_shades): Rename from cellcolor and cellshades.
(UI best_timages): Similarly.
(UI unitpics, unitmasks, bestmimages): Remove, not used.
(Map uvec, ustr, tvec, tstr): Change from array to pointer.
* tkcmd.c (do_add_terrain, do_remove_terrain): Use tmp_t_array.
(do_build): Use tmp_u_array.
* tkinit.c (utype_indexes, mtype_indexes): Change to pointers.
(init_display): Remove inits of unused fields, alloc space for
cell_shades and material_color.
(init_material_images): Remove setup of bestmimages.
(init_terrain_images): Allocate for best_timages and terrpics.
(init_shades): Use array-of-array refs to cell_shades.
* tkmain.c (last_num_units_in_play, last_num_units_incomplete):
Change from arrays to pointers.
(init_redraws, update_unit_type_list): Allocate them.
(create_map): Alloc map uvec, ustr, etc.
* tkmap.c: Update refs to renamed fields.
(MapW draw_aux_terrain, draw_materials): Make into pointers.
* ccmd.c (do_build): Use tmp_u_array.
* cconq.c (init_display): Use numutypes to size allocs.
(ask_unit_type, ask_terrain_type): Use array of int instead of short.
* cdraw.c (draw_type_list_entry): Init lasttypevisible from numutypes.
* cconq.c (do_dir_2): Fix a variable name.
* cconq.h: Use #else instead of #elif.