2003-12-31  Hans Ronne <hronne@comhem.se>

	Fix comment that sneaked into impl_build.
	* ui.c (impl_build): Remove comment.

2003-12-31  Jim Kingdon  <kingdon@panix.com>

	* kernel/plan.c (victim_here): Change 0,1 captstatus to boolean
	can_be_captured.
	(victim_here): Move occstatus inside the block where it is used/set.

2003-12-31  Hans Ronne <hronne@comhem.se>

	Fix so that you can set build tasks at a distance also in the 
	Mac PPC interface. Generalize and improve the code that 
	checks for ability to build units in specific places. Default 
	to 1 instead of 99 units in the absence of either a doctrine 
	or a prefix argument. Provide improved testing for ability
	to build and feedback on the result.
	* macconq.c (adjust_cursor): Add case BUILD_MODAL.
	* macconq.h (BUILD_MODAL): Add it to modal enum.
	(aux_build): Prototype extern.
	(do_build_at): Prototype extern.
	* macmouse.c (do_mouse_down_map_content): Add case
	BUILD_MODAL.
	* macunit.c (hit_closeup_dialog): Call aux_build instead 
	of net_set_build_task.
	(hit_unit_build_dialog): Call aux_build instead of 
	net_set_build_task.
	(update_build_menu): Also test for uu_build_range.
	* maccmd.c (tmpcmdarg): Rename unused int to tmpcmdtype.
	(tmpcmdcurse): Rename unused int to tmpcmdrun.
	(unit_do_build_2): Remove unused function and prototype.
	(do_build_at): New function.
	(aux_build): New function.
	* tkcmd.c (impl_build): Move function and prototype
	to the kernel.
	(do_build): Adapt for use of new impl_build.
	(aux_build): Adapt for use of new impl_build.
	(aux_build_2): Adapt for use of new impl_build.
	* sdlscreen.c (impl_build): Don't prototype here.
	(build_button_fn): Add side argument in call to
	impl_build.
	* sdlcmd.c (impl_build): Don't prototype here.
	(do_build): Adapt for use of new impl_build. Add 
	message code from the tcltk interface.
	(aux_build): Adapt for use of new impl_build.Add 
	message code from the tcltk interface.
	(aux_build_2): Adapt for use of new impl_build.
	* ccmd.c (impl_build): remove function and prototype.
	(do_build): Pass side in calls to impl_build.	
	* xcmd.c (impl_build): remove function and prototype.
	(do_build): Pass side in call to impl_build.	
	(aux_build): Pass side in call to impl_build.	
	* ui.h (impl_build): Prototype extern.
	* ui.c (impl_build): New generalized function. Moved here
	from the interface code.
	* unit.h (side_can_put_type_at): Prototype extern.
	(side_can_put_type_at_without): Prototype extern.
	(type_can_occupy_without): Prototype extern.
	(unit_can_build_type_at): Prototype extern.
	* unit.c (side_can_put_type_at): New function.
	(side_can_put_type_at_without): New function.
	(type_can_occupy_without): New function.
	(unit_can_build_type_at): New function.
	(type_can_occupy_cell): Reformat to make clearer 
	and remove some unnecessary vaiables.
	(type_can_occupy_cell_without): Reformat to make 
	clearer and remove some unnecessary vaiables.
	
	Improve handling of the modal mode in the Mac interface.
	Don't drop out of modal mode just because we failed to set 
	a task. Do exit if we switch current unit instead.
	* maccmd.c (get_a_position): Reset map_modal to 
	NO_MODAL if m_nearest_boundary returns FALSE.
	* macmouse.c (do_mouse_down_map_content): Don't 
	reset map_modal to NO_MODAL here.
	(unselect_all): Reset map_modal to NO_MODAL here.

	Fix compiler warning in the curses interface.
	* cdraw.c: Add linefeed at the end of the file.
	
	Further tweaks to the tcltk resignation dialogs.
	* tkconq.tcl (ask_bool_mode): Set -expand true 
	instead of -pady 12 for .bool.msg.

2003-12-30  Jim Kingdon  <kingdon@panix.com>

	* kernel/plan.c (victim_here): Use enum rather than 0,1,2,3 for
	occstatus.

	* kernel/autotest.c (test_side_setup): Test that we can make sides
	work from autotests.
	(test_victim_here): Start writing victim_here tests, right now
	vestigial.

2003-12-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Squash two firing bugs in Tcl/Tk interface with one fix.
        * tkcmd.c (common_fire_at): Get rid of call to unit_at, which 
        would return the first unit, friend or foe. Instead iterate 
        through view stack and pick out the first unit not on 
        attacker's side, if there is any such unit. This accomplishes 
        two things. First, this prevents a player from cheating by 
        probing all cells in firing range, hoping to uncover an unseen 
        enemy unit (the code would report "Noting to fire at!" from 
        unit_at()'s omniscient perspective rather than a non-see-all 
        side's less knowledgable one). Second, this allows a player 
        to fire into a cell which contains his or her own units. This 
        is a mixed blessing, since friendly fire incidents can occur 
        because of the way the firing code is currently set up.

2003-12-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make the AI more intelligent regarding its choice of victims 
        and how long it attacks them.
        * plan.c (victim_here): In the case where we cannot capture a 
        unit by attacking it, we may be attacking it for other reasons, 
        such as because it is a transport that can basically withstand 
        our attacks and that might have occupants. In this case, and if 
        we cannot tell whether it has occupants or not, then we need to 
        break off the engagement instead of becoming fixated. Check to 
        see if the previously executed task was a multiply-executed hit 
        task against the unit we are presently [re]considering. If so, 
        and the above conditions were met, then do not reconsider the 
        unit any further.
        * task.c (do_hit_unit_task): If number of execs exceeds 3, 
        then return TASK_IS_COMPLETE to planner. Task may not actually 
        be complete, but the planner will be in a better position to 
        decide (with victim_here and friends). This also has the 
        effect of helping a Random plan be more, __well, random; this 
        slightly improves the AI's behvior in games which do not have 
        a scorekeeper, such as colonizer.g.
          (do_hit_position_task): Likewise. Also, check to see if a 
        friendly unit is in the target cell before setting up a 
        fire-into action.

        * plan.c (find_unit_task_by_type): Return the first task in a 
        unit's task list matching this type, else return NULL.

2003-12-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix compilation problem in recent patch.
        * move.c (choose_move_direction): Relocate declaration of 
        'u2' to top of code to make sure that some C compilers do 
        not choke.

2003-12-28  Eric McDonald  <mcdonald@phy.cmich.edu>

        Tweak to packed boolean tables implementation.
        * misc.h (get_packed_bool): If true, then return Xconq's 
        'TRUE' value rather than any non-zero value.
        * autotest.c (test_packed_bool_tables): Make the 
        'get_packed_bool' tests specifically look for 'TRUE' in 
        places where they could not previously.

        * ChangeLog: Add forgotten mention of changes to Bellum 
        Aeternum on 2003-12-27.

2003-12-28  Eric McDonald  <mcdonald@phy.cmich.edu>

        * Makefile.in: No need for 'all' subtarget for 'dist'. Making 
        a dist filters out almost everything generated by 'all'.

        Implement tables of packed booleans to provide a fast, 
        space-efficient method for Xconq to use precomputed bools. 
        (I have some uses envisioned for the AI, but even the 
        referee code may be able to benefit.)
        * autotest.c (test_packed_bool_tables): New test that 
        examines all aspects of the packed bools implementation.
          (autotest): Invoke 'test_packed_bool_tables' function.
        * misc.h (struct a_packed_bool_table): New struct which is 
        used b the packed bools implementation. Typedef to 
        'PackedBoolTable'.
          (get_packed_bool): New macro for looking at a truth value 
        from a packed bool table.
          (set_packed_bool): New macro for setting a truth value in a 
        packed bool table.
          (valid_packed_bool_table): New macro for checking to see if 
        it is looking at a valid, initialized packed bool table.
          (create_packed_bool_table): New prototype.
          (init_packed_bool_table): New prototype.
          (destroy_packed_bool_table): New prototype.
        * util.c (create_packed_bool_table): Allocate a new packed 
        bool table, and set up its parameter fields. But do not 
        allocate the actual table array. We defer this so that a 
        function intended to use the table can determine if it needs 
        to fill it out first, since it might not be the creator of the 
        table.
          (init_packed_bool_table): Allocate the array which holds the 
        packed bools, and scrub it with zeros.
          (destroy_packed_bool_table): Deallocate the array of packed 
        bools if necessary, and then deallocate the table structure 
        itself.
        
        Provide a switch for toggling aspects of the long-range path 
        computation. (This will probably be more useful once I find 
        a way to lie to the pathfinder to cut down on the amount of 
        work it does, __until the caching situation is sorted out.)
        * config.h: Add new define 'USE_LR_PATHING', and have it 
        be undefined by default.
        * move.c (choose_move_direction): Wrap early section of this 
        function with 'USE_LR_PATHING' to cut down on wasted function 
        calls and tests.
        * path.c (path_get_next_move): Wrap path cache access with 
        'USE_LR_PATHING'.

        Make movement code more efficient on average.
        * move.c (choose_move_direction): Use a generally less expensive 
        test to see if one unit type can carry another. (This may be a 
        candidate for packed bool tables. :-)

        Improve AI victim-finding to prevent too many units from ganging 
        up on what may be a nearly worthless transport.
        * plan.c (side_planning_to_hit): New prototype and function. 
        Checks to see if any unit on a given side is tasked to hit a 
        given unit type in a given cell.
          (unit_planning_to_hit): New prototype and function. Checks to 
        see of a given unit is planning to hit a given unit type in a 
        a given cell.
          (victim_here): If a unit is thinking about going after a transport 
        with dubious occupant status, then check to see if other units on 
        the same side are already going after it.

2003-12-27  Eric McDonald  <mcdonald@phy.cmich.edu>

        Simpler, easier-to-manipulate 'dist' target for creating Xconq 
        source tarballs.
        * Makefile.in (dist): Grab all files by default and then filter 
        out those that we clearly don't want to include in the tarball. 
        This is simpler than making a list of files that we do want, 
        which was done previously.

2003-12-27  Hans Ronne <hronne@comhem.se>

	Fix bug that prevented units that can fire from doing so.
	* combat.c (could_hit): Add correct handling of defaulting
	case (-1) for uu_fire_hit.

	Enable drawing of unit images in the Mac PPC interface also 
	at very small magnifications, similar to the tcltk interface.
	* macdraw.c (draw_unit_image): Return only if sw <= 0. 
	Add 1 pixel to box size before drawing shadows.
	* macrows.c (draw_row): Test for hw > 1 instead of 2.

	Make the beaches look less garish in color.
	* beach44x48.gif: Soften to resemble desert.

2003-12-27  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix configure/build system so that only one executable 
        named 'xconq' is created amongst all of the interfaces. 
        Only the default interface gets the executable named 
        'xconq'; the other interfaces fall back on 'tkconq', 
        'cconq', 'xtconq', and 'sdlconq' as appropriate.
        * configure.in: Add 'TKCONQ_EXEC_NAME', 'CCONQ_EXEC_NAME', 
        'XTCONQ_EXEC_NAME', and 'SDLCONQ_EXEC_NAME', and set them 
        to default values corresponding to their interfaces. Assign 
        one of them to 'xconq' depending on which interface is 
        selected.
        * configure: Regenerated.
        * tcltk/Makefile.in: Bind new variable 'TKCONQ_EXEC_NAME' 
        to '@TKCONQ_EXEC_NAME@', and use variable where appropriate. 
        Change 'xconq' target to '$(TKCONQ_EXEC_NAME)' and changes 
        references to it to this as well.
        * sdl/Makefile.in: Likewise, but for 'SDLCONQ_EXEC_NAME'.
        * curses/Makefile.in: Likewise, but for 'CCONQ_EXEC_NAME' 
        and 'cconq' target.
        * x11/Makefile.in: Likewise, but for 'XTCONQ_EXEC_NAME' and 
        'xtconq' target.

        * ui.c (xform_unit): Make broader test on the unit to xform. 
        Check not just whether it is alive, but whether it is in play.

        * world.h (radius_covers_n_cells): New macro. Calculates the 
        number of cells (integer area) that would be covered under a 
        circumscribing radius of a given length. (I see this as being 
        useful to determine whether to search a unit list for all units 
        within a certain distance, as opposed to all cells within a 
        radius. For example, a unit with an ai-tactical-range of 20 
        would have to scour 1261 cells, but the number of units in a 
        game could quite reasonably be significantly less than that.)

        * ai.c, plan.c: Reformat some lines for 80 cols.

2003-12-26  Hans Ronne <hronne@comhem.se>

	Fix some build problems.
	* conq.h (victim_here): Add missing numvictims argument 
	to the prototype.
	* combat.c (type_damage_amount_max): Move to plan.c which
	is where this function is used.
	* plan.c (type_damage_amount_max): Move function here and
	add missing prototype.
	(compute_damage_ratio): Add missing parentheses at the end
	of the g_combat_model().

	Fix problem with tcltk resign game messages.
	* tkconq.tcl (ask_bool_mode): Set .bool.msg -pady 12.

2003-12-26  Eric McDonald  <mcdonald@phy.cmich.edu>

        Rewritten victim-finding code for the AI.
        * config.h: Define 'INT_MAX' if not already defined. (This is 
        probably a hack in the pejorative sense. What really should 
        be done is to make sure that we have some form of 'limits.h' 
        to include on every platform and then the correct the max int 
        value.)
        * conq.h (type_damage_amount_max): New prototype.
          (victim_here): Revised prototype.
        * misc.h (DICE): Transplanted from 'ai.c'.
        * unit.h (type_can_build): New prototype.
          (type_can_build_type): New prototype.
        * world.h (limited_search_around): New prototype.
        * ai.c (ai_go_after_victim): Replace call to 'search_around' 
        function with call to 'limited_search_around'.
          (enemy_close_by): Use new 'victim_here' predicate function.
          (DICE): Move this macro to 'misc.h'.
        * combat.c (capture_chance): Check to see if a unit type's 
        ACP to capture, fire, and attack even allow it to capture. If 
        not, then this is euqivalent to a capture chance of 0. Also, 
        indepside is not NULL, but a real side; fix a test to reflect 
        this.
          (could_hit): Check ACP to attack and fire as well as 
        the probability tables.
          (type_damage_amount_max): New function. (Possibly this not 
        the right location for it, since combat.c should be referee 
        code. But this is certainly combat-related.) Based on 
        'uu_damage' and 'uu_fire_damage' determine what is the 
        maximum damage one unit type can do to another. Decodes dice 
        spec integer representations as necessary.
        * plan.c (compute_damage_ratio): New prototype. New function. 
        (Probably this should not be located in 'plan.c'.) Does a 
        fairly simple comparison of the relative firepowers of two 
        unit types.
          (victim_here): Rewritten function. Now takes a pointer to an 
        integer victim counter as an argument. Increment counter when 
        a suitable victim is found. Check to see of potential victims 
        are transports, and if so, do/can they have occupants of what 
        types. Check to see if the potential victim could readily make 
        the hunter, the hunted (i.e., Transports attacking Battleships 
        are probably not a good idea). Do many other tests as well. 
        (Function is now quite large and should be chopped up into 
        smaller bits of functionality, perhaps. Also its current 
        location, 'plan.c', is perhaps not the right place for it.)
          (worth_capturing): Simplify logic with the side effect that 
        the actual best capture chance value is returned rather than 
        just a boolean. The original boolean sense of the test is still 
        preserved however.
          (go_after_victim): Replace call to 'search_around' with 
        'limited_search_around'. (Probably 'go_after_victim' should go 
        away, since 'ai_go_after_victim' duplicates it, but is in a 
        better location.)
        * unit.c (type_can_build): New function. Check to see if a 
        given unit type can build any other unit type.
          (type_can_build_type): New function. Check to see if a 
        given unit type can build another given unit type.
        * world.c (limited_search_around): New function. Flavor of 
        'search_around' that takes an argument that determines how 
        many positive results should be accumulated from the given 
        predicate function before cutting and returning to the caller.

        The start of better resupply logic for the AI.
        * plan.c (past_halfway_point): Base on doctrine instead of the 50% 
        assumption. (Perhaps this function should be located in a 
        different file.)
        * task.c (do_resupply_task): Write some commented out code to 
        proactively take supplies from a transport (and fellow occs) 
        rather than go into reserve and wait for the supplies. (The 
        code is commented out because of a performance issue. The 
        occ is searching the transport for supplies and discovering 
        itself as a source of supplies. This must be addressed before 
        the code can be uncommented. Also treasury transfers should be 
        dealt with.)

        Catch a segfault and improve an earlier segfault catch.
        * task.c (do_occupy_task): Use 'find_unit_dead_or_alive' right 
        from the start, instead of calling 'find_unit' and then 
        'find_unit_dead_or_alive' if the unit is not found. Also, 
        expand debugging diagnostic to cover the whole not in-play case, 
        rather than just a dead unit.
          (do_pickup_task): Duplicate the above catch but for occupants 
        to picked up rather than transports to be entered.

        Code formatting cosmetics.
        * ai.c: Reformat some comments and overly long lines of code.
        * plan.c: Likewise.
        * task.c: A few whitespace improvements.

        Improved Bellum Aeternum. Please see lib/ChangeLog-bellum for 
        details.

2003-12-25  Hans Ronne <hronne@comhem.se>

	Make the Also list unfinished games checkbox a user settable 
	preference item.
	* macconq.h (default_listallgames): Declare extern int.
	* macdefs.h (diPrefsAllGames): New dialog item.
	* macinit.c (create_newgame_dialog): Set diNewGameCheckBox
	 and listallgames from default_listallgames.
	* macprefs.c (default_listallgames): Initialize to FALSE.
	(interp_mac_ui_data): Handle default_listallgames.
	(ui_update_state): Handle default_listallgames.
	(set_preferences): Handle case diPrefsAllGames.
	(add_preferences_topic_items): Handle diPrefsAllGames.
	(save_preferences_settings): Handle diPrefsAllGames.
	* Xconq.r (DITL 701 "Preferences Network"): Add Also list 
	unfinished games checkbox item.
	* tkconq.tcl (prefs): Set prefs(listallgames) to 0.
	(add_new_game_dialog_items): Declare global list_all_games
	and set it from [ listallgames ].
	(init_newprefs): Set newprefs(listallgames).
	(add_files_prefs_items): Add checkbox filesf.listallgames.
	(ok_preferences): Set listallgames.
	* tkmain.c (listallgames): Declare new int.
	(tk_listallgames): New TclCmdFn and prototype.
	(initial_ui_init): Add tcl_cmd listallgames.
	(interp_unix_ui_data): Handle listallgames.
	(tk_save_prefs): Handle listallgames.
	(ui_update_state): Handle listallgames.
	
	Clean up the tcltk timer handler code.
	* tkmain.c (initial_ui_init): Remove commented out call 
	to Tcl_DoWhenIdle. Call check_network directly instead of 
	creating a redundant extra time handler here.
	(check_network): Remove commented out Tcl_DoWhenIdle
	call. 

	Further tweaks to the tcltk resignation dialogs.
	* tkcmd.c (aux_quit_save): Tweak text.
	* tkconq.tcl (ask_bool_mode): Configure toplevel .bool to
	240 x 160 pixels and set pack propagate to false. Tweak
	paddings of dialog items.

2003-12-25  Hans Ronne <hronne@comhem.se>

	Fix sync bug in the path-finding code that specifically affects
	the Bellum game.
	Note: this hack was originally proposed by Peter Garrone as a
	way to fix the more general sync bug in the path-finding code
	that affected a large number of games. It did not fix that bug 
	completely, but disabling the path cache (see 2003-12-04)
	did. However, even after the path cache had been disabled, the
	Bellum game continued to produce sync errors. The move.c
	hack fixes those errors.
	* move.c (select_better_path_node): Disable flip_coin call 
	at the end.

2003-12-24  Hans Ronne <hronne@comhem.se>

	Improve the code for switching ai control on and off. Remaining
	problems with this code contributed to the bug below.
	* ai.c (force_replan): Prototype extern for use in set_side_ai.
	(set_side_ai): Set need_ai_for_new_side and need_ai_init_turn
	flags instead of calling init_ai and ai_init_turn. Call force_replan
	directly on all computers instead of net_force_replan locally to
	save time. Test for gameinited before doing this to avoid needless
	replanning when toggling ais in the player setup dialog. Ensure
	that the ai info is updated by calling update_side_display.

	Fix insidious bug which caused sync errors due to the mplayer
	changing side->startx and side->starty without broadcasting it 
	properly. Note: should go through mplayer and ai code and weed
	out other non-broadcasted actions that change the state.
	* kernel.h (set_side_startx): New prototype.
	(set_side_starty): New prototype.
	kpublic.h (net_set_side_startx): New prototype.
	(net_set_side_starty): New prototype.
	* mplayer.c (mplayer_calc_start_xy): New function and
	prototype. Broadcasting clone of calc_start_xy in side.c.
	(create_initial_theaters): Call mplayer_calc_start_xy
	instead of calc_start_xy.
	* side.c (set_side_startx): New function.
	(set_side_starty): New function.
	* tp.c (net_set_side_startx): New function.
	(net_set_side_starty): New function.
	(receive_side_prop): Handle case startx and starty.
	
	Implement better support for debugging sync errors by
	dumping out all the csum components for both master and
	client into separate files. Make this happen automatically
	on csum errors. Also dump the randstate (should perhaps
	be part of checksum).
	* conq.h (dump_checksums): Prototype extern so that it is
	available both in the interfaces and in the kernel.
	* tp.c (cfp): Initialize static FILE to NULL.
	(dumped_checksums): Initialize static int to FALSE.
	(dump_checksums): New function. 
	(csum_printf): New function and prototype. 
	(receive_game_checksum): Call dump_checksums and
	set the dumped_checksums flag.
	(receive_error): Call dump_checksums and set the 
	dumped_checksums flag.

2003-12-22  Hans Ronne <hronne@comhem.se>

	Make the Mac SDL interface compile and run again.
	* sdlmac.c (initial_vrefnum): Declare extern short.
	(initial_dirid): Declare extern int.
	(main): Capture initial_vrefnum and initial_dirid.
	(preferences_filename): Delete dummy function.

	Simplify network disconnect procedure if the game is over.
	* macconq.c (event_loop): Don't check numremotes for the
	master since ok_to_exit already is set at this point.
	(exit_macconq): Don't call send_quit if ok_to_exit already
	has been set.
	(update_turn_display): Use dside explicitly.
	* tkmain.c (tk_run_game): Don't check numremotes for 
	the master since ok_to_exit already is set at this point.
	(exit_xconq): Don't call send_quit if ok_to_exit already
	has been set.
	* sdlmain.c (ok_to_exit): Declare extern int.
	(exit_xconq): Don't call send_quit if ok_to_exit already 
	has been set.

	Fix indepside bug in the side resignation code.
	* score.c (side_loses): Test indepside->ingame before
	giving advanced units to indepside.

	Increase font sizes in the tcltk end of game dialogs.
	* tkconq.tcl (ask_bool_mode): Increase default size of .bool
	Use titlefont for message string and button labels. Tweak
	some paddings. Change message aspect to 500.

	Fix sporadic update problems with tcltk dialog windows.
	* tkconq.tcl (center_above_curmap): Call update idletasks
	after focus -force.
	(center_on_screen): Call update idletasks after focus -force.
	(bring_to_front): Cell update idletasks after focus -force.
	(popup_game_dialog): Cell update idletasks at the end.
	(popup_variants_dialog): Cell update idletasks at the end.
	(popup_player_dialog): Cell update idletasks at the end.

	Fix some glitches involving the Mac PPC interface worldmap.
	* macmap.c (create_map): Add RGBBackColor(&whitecolor).
	Move call to SelectTheWindow to the end. Call HideTheWindow
	after SizeWindow for the worldmap.
	* Xconq.r (wctb 140 "World Map"): Set beckground color to
	LemonChiffon.
	
	Fix various problem when turning map panels on and off 
	in the Mac PPC interface.
	* macmap.c (create_map): Always set map->draw_topline 
	and map->draw-topunit to 0 for worldmap.
	(draw_map): Call my_SetPortWindowPort first and set
	RGBBackColor(&whitecolor).
	* macmenus.c (toggle_map_topline): Enable commented 
	out code that now seems to work fine.

	Fix so that the Mac PPC Chat dialog does not pop up if it has
	not been asked for.
	* macinit.c (add_remote_locally): Skip show_chat_dialog
	call at the end.

	Fix so that resignation to nobody works also when there is no 
	indepside in the game.
	* tp.c (net_resign_game): Pass -1 to broadcast_side_property
	if side2 is NULL.
	(receive_side_prop): Pass NULL to resign_game if the side
	number is -1.

	Rewrite the tcltk resignation code so that it works just 
	like in the mac interface.
	* tkmain.c (ok_to_exit): Declare extern int.
	(told_outcome): Declare and initialize static int.
	(want_to_exit): Declare and initialize static int.
	(tk_set_want_to_exit): New TclCmdFn and prototype.
	(initial_ui_init): Define tcl_cmd set_want_to_exit.
	(tk_run_game): Call exit_xconq if want_to_exit is set.
	(update_turn_display): Test for side_lost(dside) and use
	dside explicitly.
	* tkconq.tcl (popup_game_over_dialog): Set want_to_exit
	instead of calling exit_xconq.

	Fix long-standing bug that would cause desync whenever the 
	master resigned or lost to indepside.
	* tp.c (receive_side_prop): Don't pass NULL to resign_game
	if resigning to indepside. Pass indepside instead.

	Fix so that the tcltk startup dialog is removed just before 
	map creation rather than after it.
	* tkinit.c (init_display): Call eval_tcl_cmd to withdraw
	.newgame right before calling create_map.
	* tkconq.tcl (set_players): Dont call withdraw_window
	for .newgame here.

	Fix so that the tcltk startup dialog does not jump back to 
	the center of the screen if moved to an offside location.
	* tkconq.tcl (popup_game_dialog): Remove call to
	center_on_screen .newgame at the end.

	Fix so that the tcltk Game Over dialog is dismissed before 
	quitting the game. Also flash its buttons when pressed.
	* tkconq.tcl (game_over_dialog): Call .gameover.quitnow
	flash and dismiss_game_over_dialog before exit_xconq
	for the Quit Now button and its key binding. Flash the 
	Continue button if pressed.

	Fix bugs that would prevent the last player in a network 
	game from exiting normally.
	* sdlmain.c (exit_xconq): Test if numremotes > 1 instead
	of 0 before calling send_quit.
	(check_network): Decrease numremotes when a remote
	player quits the game.
	* tkmain.c (exit_xconq): Test if numremotes > 1 instead
	of 0 before calling send_quit.
	(check_network): Decrease numremotes when a remote
	player quits the game.

2003-12-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Address "1 ACP per no movement" bug reported by Jim and 
        Lincoln. (More still needs to be done to properly fix it. 
        There may be more than one point of failure causing it.)
        * kernel/move.c (do_move_action): Add else case to handle 
        attempted movement that may or may not be legal, but is not 
        currently addressed by the code. Notify the player if such 
        movement is attempted, and make sure that ACP is not 
        deducted in such case.

2003-12-20  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make the AI more intelligent about picking which targets to 
        beat up on.
        * plan.c (victim_here): Do not target immobile independent 
        units. They are likely to be cities or such, and we don't want 
        to reduce them to rubble before capturing (if we can capture). 
        (In the future, the code should be made to check if the 
        immobile indep is blocking a good path or if it has known 
        occupants that can be attacked.)

        Changes to Bellum Aeternum to reflect the greater AI 
        "thoughtfulness".

2003-12-17  Hans Ronne <hronne@comhem.se>

	Fix failure of client startup dialogs to proceed beyond the New 
	Game Dialog in the tcltk interface when using Open Game.
	* tkconq.tcl (popup_splash_screen): Don't bind the Open Game 
	button to remove_splash_screen_dialog_items.
	(popup_game_dialog): Don't bind the Open Game button to 
	remove_new_game_dialog_items.
	(new_game): Don't call remove_new_game_dialog_items here.
	(popup_open_dialog): Remove remover argument.
	(popup_variants_dialog): Call remove_new_game_dialog_items
	and remove_splash_screen_dialog_items here instead. 

	Make sure network clients cannot use New Game or Open Game
	commands and buttons after they connect to the master.
	* tkconq.tcl (popup_splash_screen): Add code for kicking the
	windows manager awake if necessary.
	(popup_game_dialog):Don't bind Return to new_game for 
	network clients.
	(popup_variants_dialog): Don't bind Return to set_variants 
	for network clients.
	(set_variants): Move globals to head of procedure.
	(popup_world_size_dialog): Don't bind Return to 
	world_size_ok_cmd for network clients.
	(popup_real_time_dialog): Don't bind Return to 
	real_time_ok_cmd for network clients.
	(popup_player_dialog): Don't bind Return to set_players 
	for network clients. Move globals to head of procedure.
	(join_game): Add code that disables the New Game and Open
	Game buttons and their key bindings.
	(popup_chat): Don't disable New Game and Open Game here.
	Call withdraw_window ".chat" instead of dismiss_chat. Add 
	key binding of Escape to Close button.
	(dismiss_chat): Remove procedure.

	Minor tweak of the tcltk startup dialogs.
	* tkconq.tcl (popup_variants_dialog): Don't set borderwidth 
	to 0 for the Open Game button.
	(popup_player_dialog): Don't set borderwidth to 0 for the 
	Open Game button.

2003-12-16  Hans Ronne <hronne@comhem.se>

	Fix crashes in MacOS X when clicking on a grayed out side
	in the Player Setup Dialog (thanks to Shawn Medero for
	reporting this bug).
	* macinit.c (set_player_setup_button_states): Rewrite
	with tests that side and player exists everywhere.
	(hit_player_setup_dialog): Set tmppid and tmpsid to -1
	if tmpplayer or tmpside does not exist.

2003-12-16  Hans Ronne <hronne@comhem.se>

	Fix so that the tcltk simple "Save" command works again.
	* tkconq.tcl (popup_game_save): Don't set forcedpopup.
	Use fname by default for filename.

	Add missing prototype which escaped checkin.
	* kpublic.h (net_save_game): Declare extern.

2003-12-15  Hans Ronne <hronne@comhem.se>

	Fix graphics bug that sometimes would hose the map display in 
	restored games under Windows.
	* imf.c (write_pixmap): Pass orig_pixelsize instead of pixelsize
	to computed_rowbytes if pixelsize has been mangled.

2003-12-15  Eric McDonald  <mcdonald@phy.cmich.edu>

        Enhance the configuration system to deal with strict ANSI C 
        compliance. Some headers or contents of some headers are not 
        included with this level of compliance.
        * configure.in: Add "-ansi -pedantic" to 'CPPFLAGS' if using 
        gcc. Comment out; this is premature: there are other things 
        that need to be thought through, such as the fact that 
        'winsock2.h' provides 'struct timeval' on Win32 and thus we 
        need to test for that.
        * configure: Regenerated.

        Fix various problems related to invoking Xconq from a 
        working directory that does not correspond to its home 
        directory on Windows.
        * kernel/module.c (open_module_saved_game): After trying various 
        standard locations, try opening the file with the exact 
        given "-f" argument. This is necessary for the ".xcq" and 
        ".g" associations to work properly.
        * kernel/socket.c: If '_STRICT_ANSI_' is defined then file access 
        flags that we take for granted may not be defined in 'fcntl.h'. 
        Define 'O_RDONLY', 'O_WRONLY', and 'O_RDWR' if they are not 
        already defined.
        * kernel/system.h (extract_dirname): New prototype. Only for 
        WIN32 systems.
        * kernel/win32.c: Include 'limits.h' to get 'PATH_MAX'. New 
        global variable 'xcq_program_name'; initialize to NULL.
          (cygwin_conv_to_full_win32_path): New prototype corresponding 
        to standard Cygwin API function. 
          (default_library_pathname): If 'xcq_program_name' is not 
        NULL, then build up default library path from the dir part 
        of its path, else do the usual construction involving the 
        'XCONQDATA' macro.
          (game_homedir): Unbreak Tkconq on Cygwin. Must give Windows 
        Tcl acceptable Windows paths; it doesn't know anything about 
        Cygwin mount points or paths. The 
        'cygwin_conv_to_full_win32_path' function expands Cygwin 
        mount points to their corresponding Windows paths. Also add 
        commented out code to convert Windows path to Cygwin/Windows 
        mixed path, since it seems that we can get away with these, if 
        we want to....
          (extract_dirname): New function that gets the dirname from a 
        given path. The path may be either in Unix or Windows form.
        * tcltk/tkwin32.c: Declare extern var 'xcq_program_name'.
          (WinMain): Swipe a copy of the executable's path and put it 
        in 'xcq_program_name'.

        Slightly restructure Tcl/Tk makefile template to give finer 
        control over library linkage.
        * tcltk/Makefile.in: Split 'ALL_COMMON_LIBS' into 
        'ALL_COMMON_LIBS1', 'ALL_COMMON_LIBS2', and 
        'ALL_COMMON_LIBS3'. Make 'xconq' and 'imfapp' targets 
        use the new linking arrangement.

        * tcltk/tkconq.tcl: Reformat a comment for 80 cols.

        Update and enhance Windows installer script for Xconq.
        * tcltk/xconq.nsi: 'README-win' and 'INSTALL-win' now have ".txt" 
        extensions; reflect this in the file manifest. Add an "Open" 
        shell extension and icon association for ".g" files. Ident some 
        parts of the script for additional readibility. Give the HTML 
        TOC files ".htm" extensions instead of ".html" extensions; (in 
        hindsight a file copy should be done instead of a rename so that 
        the internal links which point back tothe TOC's are not broken).
        Add shortcut to 'INSTALL-win.txt' if that file was installed.

        ReANSIfy Xconq.
        * sdl/sdlwin32.c: Convert double-slash comments into traditional 
        C comments.

2003-12-14  Eric McDonald  <mcdonald@phy.cmich.edu>

        Tweaks to Bellum Aeternum. Please see 'lib/ChangeLog-bellum' 
        for details.

2003-12-14  Hans Ronne <hronne@comhem.se>

	Fix so that files are not saved twice in single player games.
	* tp.c (net_save_game): Test for my_rid > 0 before calling
	save_game for the master.
	
	Fix string allocation bug in the Mac PPC save game code.
	* macmenus.c (save_the_game): Allocate cursavename if 
	necessary and use strcpy to copy tmp strings into it. Only
	change cursavename if the name was changed.

2003-12-14  Hans Ronne <hronne@comhem.se>

	Clean out obsolete string lists and other unused resources 
	from the Mac PPC interface.
	* mac.c (news_filename): Always use NEWSFILE instead
	of checking siNews first.
	* macconq.c (images_refnum): Remove extern short.
	(prefs_refnum): Initialize in macprefs.c instead.
	(get_files): Remove function and prototype.
	(main): Call get_preferences directly instead of get_files.
	* macconq.h (images_refnum): Remove extern short.
	* macdefs.h (sFilenames): Remove string list.
	(siPreferences): Remove string.
	(siLibFolder): Remove string.
	(siLibMacFolder): Remove string.
	(siResources): Remove string.
	(siSounds): Remove string.
	(siImfDir): Remove string.
	(siNews): Remove string.
	(siSavedGame): Remove string.
	(siCheckpoint): Remove string.
	(siErrorSave): Remove string.
	(siStatistics): Remove string.
	(sImagesFilenames): Remove string list.
	* macprefs.c (prefs_refnum): Initialize here instead.
	(open_preferences): Use PREFERENCESFILE instead of 
	siPreferences to find the file name.
	* Xconq.r (STR# 128 "Filenames"): Remove string list.
	(STR# 129 "Images"): Remove string list.
	(TEXT 128): Remove empty styled text entry.
	(XCgm 128 "intro"): Remove unused resource.

	Fix linefeed bugs reported by Eric McDonald.
	* colonizer.g: Change it to Unix file format.
	* space-civ.g: Change it to Unix file format.
	* pg.imf: Change it to Unix file format.

	Tweak the tcltk player setup dialog.
	* tkconq.tcl (add_player_dialog_items): Remove 
	capitalization of player list titles.
	
2003-12-14  Hans Ronne <hronne@comhem.se>

	Fix so that saving in non-default locations still works under
	Windows and Unix even though we removed the full path from 
	module->filename.
	* conq.h (write_game_module): Add a second argument with 
	a pointer to the full path filename.
	* ccmd.c (do_save): Add second argument in write_game_module
	call. Note: this code seems to be broken since module->filename
	is undefined. Should perhaps fix it later.
	* macdesign.c (designer_save_dialog): Add second argument in
	write_game_module call with a pointer to module->filename.
	* tkmain.c (tk_designer_save): Add second argument in
	write_game_module call with a pointer to argv[2]. Use
	find_name(argv[2]) instead for module->filename.
	* tp.c (download_game_module): Pass NULL as second 
	argument in write_game_module call.
	* write.c (write_entire_game_state): Pass fname as
	second argument in write_game_module call.
	(write_game_module): Add fname argument and pass it
	instead of module->filename to open_file. Check that fname
	exists before the call.
	* xcmd.c (aux_save_1_1): Pass tmpmodule->filename as
	second arguement to write_game_module.

	General cleanup of includes, prototypes and platform
	specific code. Try to separate xconq specific stuff from 
	the latter. Also untangle some more knots in the tcltk 
	interface.
	* conq.h (close_displays): Don't prototype here.
	* misc.h (close_displays): Prototype here instead.
	* tkiapp.c (system.h): Include it instead of prototyping
	all the platform specific stuff.
	(default_library_pathname): Remove prototype.
	(default_images_pathname): Remove prototype.
	(init_signal_handlers): Remove prototype.
	(imfsample_cmd): Remove prototype.
	(default_images_pathname): Remove prototype.
	(default_images_pathname): Remove prototype.
	* tkimf.h (XSetTile): Handle it separately from XFlush
	and XSynchronize so that the Mac is treated correctly.
	(imfsample_cmd): Prototype extern here instead.
	* tkisamp.c (tclMac.h): Include it on the Mac.
	(tkMac.h): Include it on the Mac.
	(imfsample_cmd): Move prototype to tkimf.h.
	(XSetTile): Move prototype to tkimf.h.
	* iappmac.c (extern "C"): Declare ifdef __cplusplus.
	(USE_NON_CONST): Define it.
	(tclMacCommonPch.h): Include it.
	(tclMac.h): Include it.
	(tkMac.h): Include it.
	(interp): Declare extern Tcl_Interp.
	* unix.c (close_displays): Remove prototype.
	(stop_handler): Declare static instead of extern.
	(crash_handler): Declare static instead of extern.
	(hup_handler): Declare static instead of extern.
	* win32.c (close_displays): Remove prototype.
	(stop_handler): Declare static instead of extern.
	(crash_handler): Declare static instead of extern.
	(hup_handler): Declare static instead of extern.
	* module.c (save_name): Remove static pointer.

	Fix null pointer crashes under certain conditions in 
	the file name code.
	* mac.c (game_filename): Check that namevar exists.
	* unix.c (game_filename): Check that namevar exists.
	* win32.c (game_filename): Check that namevar exists.

	Fix build problems with imfapp etc. and unify file names
	on all platforms by moving some xconq-specific code from 
	the platform support files to module.c.
	* mac.c (save_fname): Remove static int.
	(checkpoint_fname): Remove static int.
	(error_save_fname): Remove static int.
	(statistics_fname): Remove static int.
	(game_filename): New function.
	(saved_game_filename): Remove function.
	(checkpoint_filename): Remove function.
	(statistics_filename): Remove function.
	* misc.h (saved_game_name): Remove prototype.
	* module.c (preferences_name): New pointer.
	(saved_game_name): Remove function.
	(saved_game_filename): New function.
	(checkpoint_filename): New function.
	(statistics_filename): New function.
	(preferences_filename): New function.
	* module.h (saved_game_filename): Prototype extern.
	(checkpoint_filename): Prototype extern.
	(statistics_filename): Prototype extern.
	(preferences_filename): Prototype extern.
	* system.h (game_filename): Prototype extern.
	(saved_game_filename): Remove prototype.
	(checkpoint_filename): Remove prototype.
	(statistics_filename): Remove prototype.
	(preferences_filename): Remove prototype.
	* unix.c  (preferences_name): Remove pointer.
	(game_filename): Don't prototype here.
	(saved_game_filename): Remove function.
	(checkpoint_filename): Remove function.
	(statistics_filename): Remove function.
	(preferences_filename): Remove function.
	* win32.c (preferences_name): Remove pointer.
	(game_filename): Don't prototype here.
	(saved_game_filename): Remove function.
	(checkpoint_filename): Remove function.
	(statistics_filename): Remove function.
	(preferences_filename): Remove function.
	* macmenus.c (save_the_game): Call find_name for
	saved_game_filename instead of saved_game_name.
	* tkiapp.c (saved_game_name): Remove function.
	* tkmac.c (preferences_filename): Remove function.

	Add code for synchronized saving of network games on all
	computers in standardized platform-specific locations. Move
	some module-loading code from the interfaces to the kernel
	and rewrite it so that library modules and saved games are
	handled differently. Standardize saved game locations on all
	platforms and save network games in those places.
	* conq.h (add_library_path): Move prototype here.
	* config.h (PATH_SIZE): Define here instead.
	* keyword.def (K_FILENAME): Add new keyword.
	* kpunlic.h (net_save_game): New prototype.
	* misc.h (save_game): New prototype.
	* mac.c (save_fname): Remove pointer.
	(homedir): New static pointer.
	(XCONQSAVE): Define string as ":save".
	(saved_game_filename): Simplify. Use game_homedir 
	and saved_game_name to set the filename.
	(save_game): New function.
	(game_homedir): New function.
	(open_module_library_file): Remove function.
	(open_module_explicit_file): Remove function.
	* module.c (open_module_library_file): New function and
	prototype. Moved here from interface and rewritten.
	(open_module_saved_game): New function and prototype.
	Replaces open_module_explicit_file in the interfaces.
	(open_module): Rewrite so the library files and saved
	games are handled correctly. Always check for a saved
	game before searching the game library.
	* read.c (interp_game_module): Handle case K_FILENAME.
	* system.h (game_homedir): Prototype extern.
	(open_module_library_file): Remove prototype.
	(open_module_explicit_file): Remove prototype.
	(add_library_path): Move prototype to conq.h.
	* tp.c (net_save_game): New function.
	(download_game_module): Handle saved games (f) and 
	library modules (g) separately. Use the presence of a 
	filename to tell them apart.
	(receive_packet): Add case f that handles loading of modules
	from saved games.Add case w that handles saving of modules
	from network games.
	* unix.c (save_game): New function.
	(game_homedir): Don't prototype here.
	(saved_game_filename): Call saved_game_name instead 
	of using the SAVEFILE macro.
	(game_homedir): Don't declare static.
	(open_module_library_file): Remove function.
	(open_module_explicit_file): Remove function.
	* win32.c (save_game): New function.
	(game_homedir): Don't prototype here.
	(game_homedir): Don't declare static. Change default 
	homedir from . to ./save. Call CreateDirectory instead 
	of mkdir for CodeWarrior.
	(saved_game_filename): Call saved_game_name instead 
	of using the SAVEFILE macro.
	(open_module_library_file): Remove function.
	(open_module_explicit_file): Remove function.
	* write.c (PATH_SIZE): Move it to config.h.
	(write_entire_game_state): Set module name to mainmodule 
	name and module filename to find_name(fname).
	(write_game_module): Write the module filename for
	key(K_FILENAME).
	* macdesign.c (designer_save_dialog): Call net_save_game
	instead of write_entire_game_state.
	* macmenus.c (save_the_game): Call net_save_game
	instead of write_entire_game_state.
	* tkmain.c (tk_game_save): Call net_save_game
	instead of write_entire_game_state.
	(tk_start_saved_game): Peel off the path before setting
	the mainmodule filename.

	Similar fixes to the saving of checkpoint files.
	* run2.c (save_checkpoint): Call save_game instead 
	of write_entire_game_state.
	* mac.c (checkpoint_fname): Remove pointer.
	(checkpoint_filename): Tweak output. Use 
	game_homedir to set the file saving path.
	* unix.c (checkpoint_filename): Tweak output.
	* win32.c (checkpoint_filename): Tweak output.

	Move the scores files to the saved game directory under 
	MacOS and Windows.
	* mac.c (open_scorefile_for_reading): Switch to the
	game_homedir before reading.
	(open_scorefile_for_writing): Switch to the
	game_homedir before writing.
	* win32.c (XCONQSCORES): Remove macro.
	(open_scorefile_for_reading): Simplify.
	(open_scorefile_for_writing): Simplify.
	(scorenamebuf): Remove static pointer.
	(score_file_pathname): Remove unused function 
	and prototype.
	
	Clean out some dummy functions and unused prototypes.
	* imfapp.c (add_library_path): Remove dummy function
	and prototype.
	* init.c (patch_object_references): Declare static instead 
	of extern.
	* module.c (patch_object_references): Remove prototype
	of unused function.
	
	Standardize saved game file names on all platforms.
	* imfapp.c (saved_game_name): Add dummy function.
	* module.c (save_name): Declare static pointer.
	(saved_game_name): New function.
	* misc.h (saved_game_name): New prototype.
	* mac.c (saved_game_filename): Call saved_game_name.
	* tkiapp.c (saved_game_name): Add dummy function.
	* unix.c (saved_game_filename): Call saved_game_name
	instead of using SAVEFILE in the game_filename call.
	* win32.c (savegamename): Remove static pointer since 
	we don't want the saved game name to remain the same.
	(saved_game_filename): Call saved_game_name.
	(checkpoint_filename): Change the file extension from 
	xconq to xcq.

	Fix the saved game code on both Mac OS Carbon and Classic so 
	that files always are saved in the current directory, even if 
	General Controls says otherwise.
	* mac.c (open_file): Restore curvrefnum and curdirid after
	looking in xconq start directory.
	* macconq.c (DisplayPutFile): New function.
	(saveDlgHook): New function and prototype.
	* macconq.h (DisplayPutFile): New prototype.
	* macdesign.c (designer_save_dialog): Rewrite so that it
	always saves files in the current directory. Call DisplayPutFile 
	instead of SFPutFile in the Classic code. Remove the redundant 
	call to set_game_file_type. Use default_library_pathname as 
	the default save location. Always restore initial_vrefnum and 
	initial_dirid before returning. Use HSetVol instead of SetVol.
	* macmenus.c (save_the_game): Rewrite so that it always 
	saves files in the current directory. Call DisplayPutFile instead 
	of SFPutFile in the Classic code. Remove the redundant call to 
	set_game_file_type. Use game_homedir as the default save 
	location. Always restore initial_vrefnum and initial_dirid 
	before returning. Use HSetVol instead of SetVol.

	Fixes to the current directory setting code on the Mac.
	* macconq.c (main): Set initial_vrefnum and initial_dirid
	already here, i.e. as early as possible.
	(get_files): Don't set initial_vrefnum and initial_dirid here.
	* macinit.c (open_game_from_fsspec): Remove the redundant
	call to HSetVol.
	(open_game_from_name_and_volume): Restore initial_dirid
	and initial_vrefnum when the module has been loaded.
	* tkmac.c (initial_vrefnum): Declare extern short.
	(initial_dirid): Declare extern long.
	(main): Capture initial_vrefnum and initial_dirid.

	Fix so that default save name and directory works in MacTCL
	and WinTCL. Also remove caching of stale saved file name.
	* tkconq.tcl (popup_game_save): Remove code that disables
	initialfile on the mac. Add code that sets the working directory
	to dname before saving the file and also restores it afterwords. 
	Remove caching of filenames.

	Remove some unixisms from the Windows code.
	* win32.c (game_filename): Change "\\" to "/".
	(default_library_pathname): Change "\\" to "/".
	(default_images_pathname): Change "\\..\\" to "/../".
	(checkpoint_filename): Change "\\" to "/". 
	(score_file_pathname): Change "\\" to "/".
	(make_pathname): Change "\\" to "/".

	Fix bug in the Mac Classic save game code that would
	prevent the correct save directory from being set.
	* macdesign.c (designer_save_dialog): Pass NULL 
	instead of reply.fName as first argument to SetVol.
	* macmenus.c (save_the_game): Pass NULL instead 
	of reply.fName as first argument to SetVol.
	
	Fix some compiler warnings.
	* autotest.c (set_node_data): Prototype extern.
	* move.c (set_node_data): Prototype extern.
	
	Make xconq and skelconq build under C++ again.
	* autotest.c (make_longer_msg): Typecast xmalloc
	return value to (char *).
	(make_longer_msg_long): Typecast xmalloc
	return value to (char *).
	* write.c (init_write): Typecast xmalloc
	return value to (char *).

	Make some changes in Eric's last checkin in order to facilitate
	a merge with the new code.
	* config.h: Remove all ifdef UNIX. Use the new file names also on
	the Mac and add an ifdef WIN32 in those cases where we want a 
	txt extension on Windows.
	* module.h (old_preferences_filename): Move prototype here.
	* system.h (old_preferences_filename): Move to module.h.
	* module.c (old_preferences_filename): Move function here.
	* unix.c (old_preferences_filename): Move to module.h.
	* tkmain.c (tk_save_prefs): Remove unused statbuf.

2003-12-13  Eric McDonald  <mcdonald@phy.cmich.edu>

        Start conversion to new Xconq file naming schema.
        * kernel/config.h: Include supporting headers for stat(2) on Unix 
        systems. New 'NEWSFILE' is 'XconqNews'. New 'SCOREFILE' is 
        'XconqScores'. New var 'OLD_SCOREFILE' is 'scores.xcq'. New 
        'STATSFILE' is 'XconqStats'. New 'SAVEFILE' is 'Save.xcq'.
        New 'ERRORFILE' is 'ErrorSave.xcq'. New 'PREFERENCESFILE' is 
        'XconqPrefs'. New var 'OLD_PREFERENCESFILE' is 'prefs.xcq'.
        * kernel/init.c (saved_game): Unused, remove.
        * kernel/score.c (read_scorefile): Fall back on old scorefile if 
        the new one cannot be opened for reading.
        * kernel/system.h (old_preferences_filename): New function 
        prototype.
        * kernel/unix.c (checkpoint_filename): Capitalize names of 
        checkpoint files and use a ".xcq" extension rather than a ".xconq" 
        extension with them.
          (old_preferences_filename): New function. Returns name of old 
        preferences file.
        * tcltk/tkmain.c (get_preferences): If on Unix platform then 
        check for the existence of new preferences file. If it doesn't 
        exist then don't open a blank one, but try opening the old 
        prefs file instead.
        * sdl/sdlmain.c (get_preferences): Likewise.

        * aclocal.m4: Fix typographical errors. Thanks to Tom Low-shang 
        for pointing these out.
        * configure: Regenerated.

2003-12-09  Jim Kingdon  <kingdon@panix.com>

	* kernel/unit.c (kill_unit): Get rid of variable
	recent_dead_flushed; it is set but never consulted.

	* kernel/unit.c (kill_self_unit): Extract from kill_unit_aux for
	clarity.

2003-12-04  Jim Kingdon  <kingdon@panix.com>

        * kernel/move.c (cost_to_move_on_path): Get rid of local 
        variables which were poorly named anyway (tx,ty,x,y).

2003-12-06  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add some more logic to the Tcl/tk configury to help accomodate 
        older Debian systems.
        * aclocal.m4: If 'TCL_INCLUDE_SPEC' is still empty after 
        other attempts to fill it, then see if 'TCL_VERSION' and 
        'TCL_PREFIX' are defined. If so, then synthesize an includes 
        flag based on them. Similarly for Tk.
        * configure: Regenerated.

2003-12-03  Jim Kingdon  <kingdon@panix.com>

	* kernel/autotest.c (test_path_disembark): New test (still doesn't
	show the bug in question, but a reasonable test to keep).

	Fix uninitialized variable (flags in struct path_node_data).
	Turns out not to be the bug I was chasing, but it can't be good.
	* kernel/move.c (set_node_data): Clear flags.
	* kernel/dir.h, kernel/move.c (NODIR): Constant as alternate way
	of saying "-1".
	* kernel/autotest.c: Add tests for set_node_data and for
	path_get_next_move.

2003-12-04 Hans Ronne <hronne@comhem.se>

	Eliminate desync problem in the path-finding code by
	disabling the cache (possible fix suggested by Peter 
	Garrone). Note: should figure out how to cache paths
	without causing sync problems.
	* path.c (path_get_next_move): Comment out call to
	get_dir_from_cache.

2003-12-01  Jim Kingdon  <kingdon@panix.com>

	Fix bug which produced a warning every time one tried to save the
	game:
	* kernel/skelconq.c (low_run_warning, low_init_warning): Exit on
	warnings, so they don't show up as "pass" in autotests.
	* kernel/autotest.c (test_save): New test, which catches this bug.
	* kernel/write.c, kernel/misc.h (find_name): Extract the module
	name code from write_entire_game_state to here.  Allocate the
	buffer in init_write.

2003-12-01 Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to December 2003.

	Fix so that it is possible to start network games from 
	saved game files by disabling loading of saved players
	in that case.
	* read.c (interp_form): Only call interp_player in 
	case K_PLAYER if we are not in a network game.

	Fix so that the network clients are more intelligent 
	about finding the correct saved game file to open. Note: 
	should go through this code on all three platforms and
	make sure saved games always are searched for in the
	platform-specific location. 
	* mac.c (open_module_explicit_file): Don't add a .g
	extension when calling make_pathname since we are
	not looking for a library file here.
	* unix.c (open_module_explicit_file): Rewrite like
	the mac code. Search all library paths for a file named
	like the module if module->filename is not found.
	* win32.c (open_module_explicit_file): Rewrite like
	the mac code. Search all library paths for a file named
	like the module if module->filename is not found.
	(open_module_library_file): Add module->filename
	check like in the unix code.
	* write.c (write_entire_game_state): Add code that
	strips off path names before setting module->name
	so that the latter always agrees with the saved file
	name. Keep the full path in module->filenane.

	Fix compiler warning about unwanted assignment.
	* task.c (do_occupy_task): Break out assignment 
	from the if clause.

2003-11-30  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make the Xconq apps compile with strict ANSI/ISO C89 
        conformance turned on ("-ansi -pedantic" on GCC).
        (Note: The code appears to be trigraph-safe.)
        (Note: Some interesting warnings pertaining to maximum 
        allowable constant string length and constant conversion 
        overflows should be thought about some more. The latter 
        warnings are quite prolific with the bitmaps files, as 0x80 
        is being assigned to signed chars.)
        * kernel/path.c, kernel/ps.c, kernel/read.c, kernel/tp.c,
        tcltk/tkmain.c, x11/xdraw.c: Remove all "//" comments that 
        are used to quell K&R-style function headings. Convert all 
        other "//" comments to "/* stuff */" comments.

2003-11-30  Eric McDonald  <mcdonald@phy.cmich.edu>

        Address another possible buffer overrun in the Tcl/Tk 
        code.
        * kernel/config.h: If 'MAC' is defined then define 
        'AVOID_OBSTACK'. Can also be used for testing by 
        temporarily checking if 'UNIX' or 'WIN32' is defined.
        * tcltk/tkmain.c (tk_library_paths): Perform conversion 
        from "sprintf(interp->result, ...)" form to 
        "Tcl_SetResult(interp, ...)" form. Also, use less costly 
        means of initializing the buffer.

        Fix possible memory leak.
        * tcltk/tkmap.c (mapw_cmd): Get rid of direct assignment 
        of a char * to 'interp->result'. Replace with 
        Tcl_SetResult call.

2003-11-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix crash caused by attempting to enter a dead transport.
        * kernel/task.c (do_occupy_task): If find_unit returns 
        NULL, then the transport is likely dead. Add verification 
        of and safeguard against this.

        Cosmetic adjustment of comment.
        * kernel/run.c (move_one_unit_multiple): Adjust lines of 
        comment to fit in 80 cols.

2003-11-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Patch from Peter Garrone (modified). Fixes and expanded 
        capabilities for the new path code. Thanks Peter.
        * kernel/ai.c (blocked_by_enemy): Formatting fix. 
        Check against entire stack of units rather than just a 
        unit in a cell.
          (attack_blockage): Modify assertion to handle extended 
        directions (for border slides). Make sure that a unit in 
        a cell exists before asking about its various properties.
        * kernel/conq.h: Change the 'CMD_*' family of defines to 
        be powers of 2 instead of straight counting numbers.
        Define 'PND_UNMAPPED'. Add 'flags' member to 
        'path_node_data' data structure.
          (path_clear_cache): New prototype.
        * kernel/dir.h: Define 'NUMPATHS' to 12. Change 'DIRX' and 
        'DIRY' arrays to have 12 direction deltas rather than 6 as 
        part of the new border slide code. Declare extern array of 
        opposing directions, 'diropp'. Redefine 'opposite_dir' in 
        terms of this.
        * kernel/move.c (do_move_action): Rewrite a large chunk of 
        this function.
          (unit_can_border_slide): New function. Check to see if a 
        border slide can be performed.
          (pathable_point_for_unit_type): Initialize 'mpcost' to 0.
        Look for border slides as part of path. If unit can be on 
        a certain cell, add the move cost to the path cost rather 
        than replace the path cost with the move cost.
          (pathable_point): Remove my earlier hack that made 
        exploration work. Replace with code that sets the 
        'PND_UNMAPPED' flag in the 'path_node_data' struct. Add note 
        that border slides should be checked for at a certain place 
        in the code. Formatting fix.
          (choose_move_direction): Incorporate logic involving the 
        'PND_UNMAPPED' flag and the extended border slide directions. 
        Make sure that path cache gets cleared once a unit wanders 
        into a cell that was unexplored when the path was calculated. 
        Add logic pertaining to border slides.
          (get_cached_move_direction): Modify assert to account for 
        the extended compass.
          (get_path_direction_count): Incorporate logic pertaining to 
        border slides.
          (cost_to_move_on_path): Consider whether a unit has enough 
        MP to use a transport.
          (select_better_path_node): Initialize 'ps0' and 'ps1' to 0. 
        Set them to the people sides at the two cells to choose from.
        * kernel/path.c (path_clear_cache): New function. Used to 
        clear path cache when entering cells that were unknown at time 
        of path computation. (This part of the patch was modified so 
        that the code would compile with a C++ compiler.)
        * kernel/task.c (do_approach_subtask): Remove 'cmdlfags' 
        parameter from prototype.
          (do_move_to_task): Declare some new variables. Initialize 
        'cmdflags' to 'CMD_USE_TRANSPORT'. If distance between 
        current and new position is 0, then return 'TASK_IS_COMPLETE'.
        Handle exploration. Miscellaneous checks to determine if task 
        succeeded. Remove #if 0'd out section of code. Call 
        'do_approach_subtask' to handle various cases instead of 
        handling them here.
          (do_approach_subtask): Remove 'cmdflags' paramter from 
        declaration. Remove old handling of unexplored terrain because 
        pathing code can now deal with it. Add note regarding future 
        implementation of border slide logic.
          (do_occupy_task): Declare some new variables. Initialize 
        'cmdflags' to 'CMD_USE_TRANSPORT'. Test for some more task 
        failure conditions. Call 'do_approach_subtask' with the 
        reduced number of arguments.
          (do_pickup_task): Declare some new variables. Test for some 
        more task failure conditions. Partially rewrite pickup tasking. 
        Call 'do_approach_subtask' with the reduced number of arguments.
        * kernel/util.c: Make 'dirx' and 'diry' arrays have 'NUMPATHS' 
        members instead of 'NUMDIRS' members as part of border slide 
        handling. Define new array, 'diropp', and initialize it to 
        the direction numbers of opposing directions.
        * kernel/world.c (closest_dir): Add handling of border slide 
        directions as well. Define number of arc minutes in a full 
        circle.

2003-11-29  Eric McDonald  <mcdonald@phy.cmich.edu>

        Protect against buffer overruns in the Tcl/Tk apps 
        by using the official Tcl interpreter result field 
        manipulation mechanism. This may also lock that piece 
        of memory if Tcl is running in multiple threads. So 
        it may be safer, even with trivial writes to the buffer.
        * tcltk/tkiapp.c (get_imf_name_cmd): Convert 
        "sprintf(interp->result, "%s", string)" to 
        "Tcl_SetResult(interp, string, deallocator)".
        * tcl/tk/tkmain.c (tk_side_lib_entry): Likewise.
          (tk_ttype_name): Likewise.
          (tk_atype_name): Likewise.
          (tk_t_image_name): Likewise.
          (tk_utype_name): Likewise.
          (tk_u_image_name): Likewise.
          (tk_mtype_name): Likewise.
          (tk_m_image_name): Likewise.
          (tk_side_name): Likewise.
          (tk_side_adjective): Likewise.
          (tk_side_emblem): Likewise.
          (tk_short_side_title): Likewise.
          (tk_side_ingame): Likewise.
          (tk_simple_player_title): Likewise.
          (tk_simple_player_name): Likewise.
          (tk_player_aitypename): Likewise.
          (tk_player_displayname): Likewise.
          (tk_assigned_side): Likewise.
          (tk_assigned_player): Likewise.
          (tk_exchange_players): Likewise.
          (tk_feature_info): Likewise.
          (tk_feature_desc): Likewise.
          (tk_version_string): Likewise.
          (tk_copyright_string): Likewise.
          (tk_available_advance): Likewise.
          (tk_current_advance): Likewise.
          (tk_agreements): Likewise.

2003-11-28 Hans Ronne <hronne@comhem.se>

	Separate master and client debug output in order to
	facilitate debugging of the network code when running
	two apps from the same directory.
	* mac.c (open_file): Handle Xconq-Master.DebugOut
	and Xconq-Client.DebugOut.
	* tp.c (my_rid): Don't initialize here.
	(master_rid): Don't initialize here.
	* util.c (my_rid): Initialize here instead.
	(master_rid): Initialize here instead.
	(update_debugging): Direct master and client output to
	Xconq-Master.DebugOut and Xconq-Client.DebugOut.
	(toggle_debugging): Direct master and client output to
	Xconq-Master.DebugOut and Xconq-Client.DebugOut.

2003-11-28  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix bug that was causing segfaults in xform_unit.
        * kernel/combat.c (do_overrun_action): After 
        processing surrenders of enemy units, make sure that 
        the capturing unit is still alive before doing the 
        next stages of the overrun action.
        * kernel/ui.c (xform_unit): Ensure that unit is alive 
        before doing anything else. Complain if the 
        function was passed a dead unit.

        Add safeguard to action directing code.
        * kernel/run.c (move_one_unit_multiple): Ensure that 
        unit is alive before attempting anything else.

2003-11-28  Eric McDonald  <mcdonald@phy.cmich.edu>

        Lay the groundwork for incorporating a curses lib 
        for Win32.
        * configure.in: Remove commented out test for 
        'bits/time.h'. Add 'CURSES_TARGET', 'CURSES_DIR', 
        and 'CURSES_LIB' vars. Test for the existence of 
        'curses.h' and 'ncurses.h'. Set above vars and 
        add "-DUSE_XCONQ_CURSES" to compiler flags if the 
        system does not appear to have a Curses lib.
        * configure: Regenerated.

        Add missing missing dependency to kernel makefile.
        * kernel/Makefile.in: Add 'timestuff.h' to list 
        list of headers being used from the 'missing' dir.

        Help Tcl/Tk app build under MinGW32, which has no 
        bcopy implementation (_bcopy exists in libiberty, 
        but we should try to avoid linking that in, and we 
        would have to provide a prototype anyway).
        * tkmain.c: Do not include 'obstack.h' since that it 
        is redundant; it comes from another of the earlier 
        includes. Undef any 'bcopy' macro that may be out there. 
        Def 'bcopy' in terms of 'memcpy', which is identical to 
        the way 'help.c' handles it.

2003-11-26 Hans Ronne <hronne@comhem.se>

	Add two new games contributed by Elijah Meeks.
	* lib/cil.g: New game file "Cast Iron Life".
	* lib/cil.imf: New image family file.
	* lib/cil-rules.g: New game support file.
	* lib/cil-sides.g: New game support file.
	* lib/cil-units.g: New game support file.
	* lib/noram.g: New map file.
	* lib/opal.g: New map file.
	* lib/spec.g: New game file "Specula".
	* lib/spec.imf: New image family file.
	* lib/spec-rules.g: New game support file.
	* lib/spec-units.g: New game support file.
	* lib/spec-sides.g: New game support file.
	* lib/imf.dir: Add all cil and spec image families.
	* images/cil.gif: New image file.
	* images/cil8.gif: New image file.
	* images/cil-flags8x8.gif: New image file.
	* images/cil-flags16x16.gif: New image file.
	* images/spec1.gif: New image file.
	* images/spec2.gif: New image file.
	* images/spec8.gif: New image file.
	
2003-11-25 Hans Ronne <hronne@comhem.se>

	Add three new games contributed by Lincoln Peters.
	* bolodd2.g: New game with "Tank battles, D&D style".
	* colonizer.g: New game about "Futuristic planet colonization".
	* space-civ.g: New game about "Space civilization".

	Fix so that imfapp compiles again in the Mac interface.
	* imfapp.c (xconq_libs): Remove redundant definition.

	Make the tcltk chat window the same vertical size as the 
	startup dialogs.
	* tkconq.tcl (popup_chat): Set height of .chat.mid to 330.

	Fix minor glitch in the Mac advanced closeup dialog.
	* macunit.c (draw_advanced_content): Test that the 
	unit has a name before drawing it.
	
	Don't use advanced closeups for incomplete units.
	* macunit.c (create_unit_closeup): Test for completed
	before creating a simple or advanced closeup.
	(draw_unit_closeup): Test for completed before drawing
	a simple or advanced closeup.

2003-11-24  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add new buffer size define and use it.
        * kernel/cmdline.c: Remove define for 'TMPBUFSIZE'. Change 
        all references from 'TMPBUFSIZE' to 'CLIBUFSIZE'.
        * kernel/cmdline.h: Define 'CLIBUFSIZE'.

        Fix potential buffer overflow with Tcl/Tk library path 
        processing.
        * kernel/system.h: Define 'XCQ_PATH_LEN_MAX'.
        * tcltk/tkmain.c: Include 'obstack.h' if not on the Mac.
          (tk_library_paths): Change 'buf' var from 500 to 
        XCQ_PATH_LEN_MAX*2 in size if on Mac, else make 'buf' 
        var be of type 'TextBuffer' (which contains an obstack).
        Conditonally compile old code on Mac, and new code on 
        everything else. New code grows an obstack of concatenated 
        library paths. Once that obstack is full grown, an 
        appropriate buffer is allocated for it and the Tcl/Tk 
        interpreter result is set using Tcl_SetResult. The original 
        code path was tested by adding "|| defined(UNIX)" to the 
        conditional macros.

2003-11-23 Hans Ronne <hronne@comhem.se>

	Fix bug in the Mac interface that prevented network 
	clients from loading the mainmodule.
	* macinit.c (select_game): Restore game_already_loaded
	test that was removed on 2003-06-08.
	
	Fix bug in the Mac interface that prevented AIs from being
	correctly assigned to non-human players.
	* macinit.c (hit_player_setup_dialog): Remove code for
	setting rid which is now not properly executed here.
	(launch_game_2): Put rid setting code here instead,
	similar to the tcltk interface.

	Back out of Game Over dialog changes in the Mac interface
	that caused problems in network games. Note: resignation
	of client now works fine, but there is still desynch if the
	master looses the game. Should fix this before a release.
	* macconq.c (event_loop): Remove endofgame code.
	(update_turn_display): Add back endofgame code that was
	moved to event_loop on 2003-11-16.

	Fix crashes under MacOS9 when running two apps at the
	same time.
	* macgworld.c (update_gworld): Only call DisposeGWorld
	plus NewGWorld ifdef MACOSX. Else call UpdateGWorld as
	in the old code.

2003-11-23 Hans Ronne <hronne@comhem.se>

	Fix network bug in the new module loading code that
	caused desynch errors in the "intro" game.
	* tp.c (receive_packet): Call check_game_validity after
	load_game_module in case g so that object references 
	are patched also in network client modules.

2003-11-23  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add some safeguards against a common crash.
        * kernel/ui.c (xform_unit): Make sure that unit is not a 
        null pointer. Also make sure that unit is in the map 
        area, since the for_all_stack macro uses unit_at which 
        references the map area without checking bounds. 

2003-11-22  Eric McDonald  <mcdonald@phy.cmich.edu>

        Finish converting lists of subshell commands in makefiles 
        from sequential to contingent executions.
        * curses/Makefile.in: Replace ";" with "&&" in all lists 
        of subshell commands.
        * kernel/Makefile.in: Likewise.
        * missing/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise.
        * tcltk/Makefile.in: Likewise.
        * x11/Makefile.in: Likewise.
        * Makefile.in: Likewise, but it is much less important here 
        except for stylistic consistency.

2003-11-22  Eric McDonald  <mcdonald@phy.cmich.edu>

        Finally make the gettimeofday(2) test work for C++. 
        * configure.in: Put includes and ifdefs in the 
        designated includes argument to AC_TRY_LINK rather 
        than the code argument.
        * configure: Regenerated.

        Remove duplicate definitions of the 'xconq_libs' symbol, 
        and relocate to a low-lib file, since low-lib is common 
        to the suite of Xconq apps. This change helps make C++ 
        linking of Imfapp and the image converter utils be 
        successful.
        * kernel/init.c: Remove definitions of 'xconq_libs' and 
        'last_user_xconq_lib'.
        * tcltk/tkiapp.c: Likewise.
        * x11/xcutil.c: Comment out definition of 'xconq_libs'.
        * kernel/util.c: This file is part of low-lib and seems to 
        be the most appropriate home for the transplants, so 
        define 'xconq_libs' and 'last_user_xconq_lib' here.

        * kernel/misc.h: Cosmetic improvement to a comment.

        Address overlooked item on my timestuff migration checklist.
        * missing/timestuff.h: Only include 'sys/time.h' if 'UNIX', 
        '__CYGWIN__', '__MINGW32__', or 'GUSI' is defined. Should 
        not be included normally on Mac or Windows.

2003-11-22  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix various compilation and linking issues so that 
        Tcl/Tk and SDL Xconq will build "out of the box" on 
        pure MinGW32. (Note: Curses Xconq does not yet build 
        on pure MinGW32.)
        * aclocal.m4: If 'TCL_LDFLAGS' not defined, then try 
        using 'TCL_LIB_FILE'. Likewise for 'TK_LDFLAGS' and 
        'TK_LIB_FILE'. Also, tack on anything else that might 
        improve Tcl/Tk linking chances by appending 'TK_LIBS' 
        to 'TK_LDFLAGS'.
        * configure.in: Add tests for 'struct timezone' and 
        add "-DNEED_STRUCT_TIMEZONE" to the 'HFLAGS' if the 
        platform is found wanting. Add 'WIN32_COMMON_LIBS' 
        and 'WIN32_COMMON_TARGETS' vars to help makefiles 
        choose to do the right thing depending on whether 
        MinGW32 on Cygwin or pure MinGW32 is being used. Also 
        make sure that pure MinGW32 is getting 'HFLAGS' 
        instead of 'ALT_HFLAGS' and that 'libwsock32.a' is 
        being linked in.
        * configure: Regenerated.
        * kernel/socket.c (accept_remote_connection): Make sure 
        the correct argument type is being passed to the accept 
        call, so that C++ compilation is not broken.
        * missing/timestuff.h: Conditionally define 'struct 
        timezone'.
        * sdl/Makefile.in: Make use of the new 'WIN32_COMMON_LIBS' 
        and 'WIN32_COMMON_TARGETS' macros.
        * tcltk/Makefile.in: Add '@W32API_LIBS@' macro expander 
        to 'ALL_WIN32_LIBS' to help pure MinGW32 build correctly.
        * tcltk/tkiapp.c: Unextern 'xconq_libs'. (Note: This means 
        that we now have a tug-of-war between g++ on my Mdk Linux and 
        gcc on pure MinGW32. Must find another way to address the 
        situation.)

        Additional documentation from Stanley Sutton. Thanks Stanley.
        * INSTALL-win.txt: New section on how to setup a Windows 
        Tcl/Tk build for Xconq. Outdated or incomplete information is 
        mentioned in editorial comments. Original text from Stanley 
        Sutton to xconq7 mailing list on 2002/11/07:
            http://sources.redhat.com/ml/xconq7/2002/msg00890.html

2003-11-22 Hans Ronne <hronne@comhem.se>

	Finally fix timestuff so that it works on all platforms
	with CodeWarrior and/or the GUSI libraries.
	* timestuff.h (sys/time.h): Also test for the GUSI 
	libraries before including it.
	(NEED_STRUCT_TIMEVAL): Define it on the Mac if 
	we don't have the GUSI libraries.
	* timestuff.c (gettimeofday): Move ifdefs inside the
	function body. Add content ifdef MAC.
	* mac.c (timeval): Remove conditional definition.
	(gettimeofday): Remove function and prototype.
	* util.c (timeval): Remove conditional definition.
	(gettimeofday): Remove conditional prototype.
	* win32.c (timeval): Remove conditional definition.
	(gettimeofday): Remove function and prototype.
	
	Clean out some commented out stuff.
	* socket.c (sys/time.h): Remove include.
	* unix.c (sys/time.h): Remove include.
	(gettimeofday): Remove function.

2003-11-22 Hans Ronne <hronne@comhem.se>

	Disable the tcltk help system on MacOS < 8.6 since the
	obstack code crashes there.
	* tkconq.tcl (create_map_menus): Don't create the help
	menu if running MacOS < 8.6.
	(popup_help_dialog): Return if running MacOS < 8.6.
	
	Fix minor compiler warning.
	* run.c (run_advanced_units): Remove unused ints.
	
	Fix so that the Windows apps build again under CodeWarrior.
	* timestuff.h (sys/time.h): Include it ifndef __MWERKS__
	instead of ifndef MAC.
	* win32.c (gettimeofday): Restore function and prototype
	that are needed by CodeWarrior.

2003-11-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Some cleanup and fixes to time-related implementations.
        * missing/timestuff.h: Conditionally include 'sys/time.h' based 
        on platform (note: also need to consider config test for this 
        file).
        * kernel/config.h: Remove some includes that are now handled 
        through 'missing/timestuff.h'.

2003-11-20  Jim Kingdon  <kingdon@panix.com>

	* doc/hacking.texi (Testing): New section.
	(Rationale and Future Directions): Add references between this and
	the GDL Design Decisions node.  Quick hack until we can reorganize
	the material.

	* configure.in: Comment out AC_PROG_CXX.
	* configure: Regenerate (I have autoconf 2.53, hope that's OK).

	* missing/Makefile.in: Use "cd foo && something" idiom rather than
	"cd foo; something" - this give a better error if someone hasn't
	run "cvs update -d" yet.
	* kernel/Makefile.in (skelconq): Also link libmissing.a.

2003-11-19  Jim Kingdon  <kingdon@panix.com>

	* doc/hacking.texi (GDL Design Decisions): New section.

2003-11-19  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Put nearly all of our time-related spaghetti in one pot.
        Move missing 'struct timeval' and 'gettimeofday' 
        defintions to 'missing/util'. (Note: Still need to test 
        under Cygwin/Mingw32 and on Mac.)
        * missing/util: New directory.
        * missing/timestuff.h: New header with unified handling of 
        time-related things.
        * missing/util/.cvsignore: New CVS control file.
        * missing/util/timestuff.c: Conditional implementation of 
        time-related things.
        * missing/util/Makefile.in: New makefile template for 
        building missing utility implementations.
        * configure.in: Add 'missing/snprintf/Makefile' to list of 
        makefiles to create.
        * kernel/config.h: Include 'timestuff.h'. (Note: Conditional 
        include of sys/time.h before this can probably be removed 
        now. It is transitional cruft.)
        * kernel/socket.c: Comment out include of 'sys/time.h'.
        * kernel/unix.c: Remove stupid C++ include hack for 
        'sys/time.h'. Comment out include of 'sys/time.h'.
        * kernel/util.c: Remove Unix and Win32 specific parts of 
        time-related screwing around.
        * kernel/win32.c: Comment out include of 'sys/time.h'.
        * missing/Makefile.in: Add new targets related to the new 
        'util' directory, and the time-related things, in particular.
        Also clone 'subdir_do' target from top-level makefile 
        template, and adapt it to its new location.

        Miscellaneous improvements to configure system.
        * configure.in: Remove now defunct, commented out test for 
        snprintf(3). Add 'AC_PROG_CPP', 'AC_PROG_CXX', and 
        'AC_PROG_CXXCPP'. Add test to see if our supposed C compiler 
        is actually a C++ compiler; the results of this test may be 
        useful in future configuration endeavors. Replace 
        'AC_TRY_LINK_FUNC' test for gettimeofday(2) with an 
        'AC_TRY_LINK' test instead; (note: still does not work 
        properly for C++). (Note: Also need to provide information 
        if the check for 'sys/time.h' fails.)
        * configure: Regenerated.

        Minor tweak to Bellum Aeternum. Please see lib/ChangeLog-bellum 
        for details. 

2003-11-16 Hans Ronne <hronne@comhem.se>

	Include the core tcl scripts as styled TEXT resources in the
	Mac tcltk apps, so that they can run without tcltk installed
	on the system. The resources were copied from Tk8.4.shlb
	and Tcl8.4.shlb in MacTCL 8.4.2.
	* iappmac.r (TEXT 2000 "init"): Add resource.
	(TEXT 2000 "init"): Add resource.
	(TEXT 2001 "auto"): Add resource.
	(TEXT 2002 "package"): Add resource.
	(TEXT 2003 "history"): Add resource.
	(TEXT 2004 "word"): Add resource.
	(TEXT 2005 "parray"): Add resource.
	(TEXT 3001 "tk"): Add resource.
	(TEXT 3002 "button"): Add resource.
	(TEXT 3003 "dialog"): Add resource.
	(TEXT 3004 "entry"): Add resource.
	(TEXT 3005 "focus"): Add resource.
	(TEXT 3006 "listbox"): Add resource.
	(TEXT 3007 "menu"): Add resource.
	(TEXT 3008 "optMenu"): Add resource.
	(TEXT 3009 "palette"): Add resource.
	(TEXT 3010 "scale"): Add resource.
	(TEXT 3011 "scrlbar"): Add resource.
	(TEXT 3012 "tearoff"): Add resource.
	(TEXT 3013 "text"): Add resource.
	(TEXT 3014 "bgerror"): Add resource.
	(TEXT 3015 "console"): Add resource.
	(TEXT 3016 "msgbox"): Add resource.
	(TEXT 3017 "comdlg"): Add resource.
	(TEXT 3018 "spinbox"): Replace resource.
	(TEXT 3019 "panedwindow"): Replace resource.
	(TEXT 3020 "msgcat"): Add resource.	
	* tkmac.r (TEXT 2000 "init"): Add resource.
	(TEXT 2000 "init"): Add resource.
	(TEXT 2001 "auto"): Add resource.
	(TEXT 2002 "package"): Add resource.
	(TEXT 2003 "history"): Add resource.
	(TEXT 2004 "word"): Add resource.
	(TEXT 2005 "parray"): Add resource.
	(TEXT 3001 "tk"): Add resource.
	(TEXT 3002 "button"): Add resource.
	(TEXT 3003 "dialog"): Add resource.
	(TEXT 3004 "entry"): Add resource.
	(TEXT 3005 "focus"): Add resource.
	(TEXT 3006 "listbox"): Add resource.
	(TEXT 3007 "menu"): Add resource.
	(TEXT 3008 "optMenu"): Add resource.
	(TEXT 3009 "palette"): Add resource.
	(TEXT 3010 "scale"): Add resource.
	(TEXT 3011 "scrlbar"): Add resource.
	(TEXT 3012 "tearoff"): Add resource.
	(TEXT 3013 "text"): Add resource.
	(TEXT 3014 "bgerror"): Add resource.
	(TEXT 3015 "console"): Add resource.
	(TEXT 3016 "msgbox"): Add resource.
	(TEXT 3017 "comdlg"): Add resource.
	(TEXT 3018 "spinbox"): Replace resource.
	(TEXT 3019 "panedwindow"): Replace resource.
	(TEXT 3020 "msgcat"): Add resource.	

2003-11-16 Hans Ronne <hronne@comhem.se>

	Fix update of player entries when sides are removed.
	* macinit.c (hit_player_setup_dialog): Change uptodate index
	from selectedplayer to i in case diPlayerSetupRemove.
	
	Fix background color bug when scrolling the help window.
	* machelp.c (help_vscroll_fn): Set listcolor before calling
	TEScroll and restore maincolor when done.
	(do_mouse_down_help): Set listcolor before calling TEScroll 
	and restore maincolor when done.

2003-11-16  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Minor fixes to Bellum Aeternum. See lib/ChangeLog-bellum 
        for details.

        Move Xconq's RPM spec file to 'tcltk' dir with the plan 
        that other spec files can exist for other interfaces in 
        their repsective directories.
        * xconq.spec: Remove and transplant to 'tcltk'.
        * tcltk/xconq.spec: Add.

2003-11-16  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Close up some possible buffer overflow exploits which can 
        happen while Xconq is still sgid 'games'. Thanks to the 
        Debian project for tracking these bugs.
        * kernel/cmdline.c (parse_command_line): Truncate 
        excessively long arguments. (Note: This is not a complete 
        fix. Some of the buffers that the cl args are placed into 
        are smaller than the truncation size, and thus need to be 
        protected as well.)
        * kernel/side.c (player_desig): Change sprintf call to 
        snprintf call to prevent the XCONQCONFIG and DISPLAY 
        env variables from being used to carry out an exploit.

2003-11-16 Hans Ronne <hronne@comhem.se>

	Improve the player setup list. Use a green box for the
	selected player entry. Update only entries that need to
	be updated. Use ltgraycolor instead of gray_out_rect.
	* macinit.c (playerh): Increase to 23.
	(uptodate): short array, dimension to MAXSIDES + 1.
	(create_player_setup_dialog): Set playerh to 23.
	(draw_player_setup_dialog): Zero uptodate array.
	(draw_player_setup_list): Set playerh to 23. Check and
	set uptodate for each entry. Cell RGBBackColor(&goodcolor)
	for selectedplayer. Tweak tmprect and emblem positions.
	Call RGBForeColor(&ltgraycolor) for sides not ingame.
	Draw dark gray frames for all players and light gray
	frames for empty entries.
	(select_player): Set uptodate to FALSE for previous and
	current selection.
	(do_key_down_player_setup): Call DrawDialog instead
	of draw_player_setup_dialog. 
	(hit_player_setup_dialog): Set uptodate to FALSE for
	all entries that are changed.

	Fix crashes in MacOS X when simple unit closeups are 
	closed by clicking on the OK button.
	* macunit.c (hit_closeup_dialog): Break before setting 
	anything in case OkButton if advanced is false.
	
	Fix button confusion in closeup dialogs.
	* macunit.c (draw_simple_closeup): Change default item 
	from CancelButton to OkButton.
	
	Fix glitch in the display of the splashpicture.
	* macinit.c (draw_splash_dialog): Call InsetRect before 
	framing the splashpicture.

	Fix color glitch in designer utypepopup menu.
	* macdesign.c (draw_design_window_tool): Restore the
	background to maincolor or goodcolor in case unittool 
	depending on whether the tool is selected or not.
	
	Fix glitches involving designer feature_edit_button.
	* macdesign.c (draw_design_window_tool): Redraw both 
	oldtool and poppedtool if they differ from tooltype in case 
	featuretool.
	* Xconq.r (CNTL 401 "Feature Edit Button"): Tweak button
	position by 1 pixel so that the button does not overdraw 
	the separator line.
	
	Fix item colors in designer feature rename dialog.
	* macdesign.c (feature_rename_dialog): Save and restore the
	port. Call SetWindowContentColor if hasWindowsLib. Call
	my_SetPortWindowPort and RGBBackColor(&maincolor).

	Fix default buttons in instructionswin and helpwin so 
	that they always work under both MacOS 9 and MacOS X.
	* machelp.c (create_instructions_window): Call 
	SetWindowDefaultButton if TARGET_API_MAC_CARBON.
	(draw_instructions): Don't call SetWindowDefaultButton 
	and DrawControls here.
	(create_help_window): Call SetWindowDefaultButton 
	if TARGET_API_MAC_CARBON.
	(draw_help): Don't call SetWindowDefaultButton and
	DrawControls here. Call draw_construction instead.
	
	Fix bugs involving the default button in constructionwin.
	* macwins.c (create_construction_window): Call
	SetWindowDefaultButton if TARGET_API_MAC_CARBON
	 here instead. Change its arg from instructionswin to 
	 constructionwin.
	 (draw_construction): Incorporate remaining code from
	 draw_construction_default.
	 (draw_construction_default): Remove function & prototype.
	 (adjust_construction_controls): Call draw_construction
	 instead of draw_construction_default.
	
	Fix bug with constructbutton appearing in the map window.
	* macwins.c (draw_construction): Save and restore port.
	(do_key_down_construction): Save and restore the port 
	for all return branches.

	Fix so that buttons in non-modal dialogs are flashed 
	briefly when they are hit. Note: should make this 
	work also under MacOS X.
	* macconq.c (flash_button): New function.
	* macconq.h (flash_button): New prototype.
	* machelp.c (do_key_down_help): Call flash_button.
	(do_key_down_instructions): Call flash_button.
	* macinit.c (hit_splash_dialog): Call flash_button.
	(hit_chat_dialog): Call flash_button.
	(hit_newgame_dialog): Call flash_button.
	(hit_variants_dialog): Call flash_button.
	(hit_player_setup_dialog): Call flash_button.
	* macunit.c (do_key_down_closeup): Call flash_button.
	(hit_closeup_dialog): Call flash_button.
	* macwins.c (do_mouse_down_construction): Call
	TrackControl after FindControl.
	(do_key_down_construction): Call flash_button.
	(hit_research_dialog): Call flash_button.
	(hit_gameover_dialog): Call flash_button.
	(hit_alert_dialog): Call flash_button.
	
	Fix problem with recursion in hit_newgame_dialog.
	* macinit.c (hit_newgame_dialog): Call start_new_game
	and close_window instead of hit_newgame_dialog in case
	diNewGameList.
	
	Remove unused Cancel button in progress dialog.
	* macdefs.h (diProgressCancel): Remove item.
	* Xconq.r (DITL 132 "Progress"): Remove button.

	Fix so that the gameover dialog is not shown until it is 
	ready for keyboard input from the player.
	* macconq.c (event_loop): Call show_gameover_dialog 
	and set told_outcome if endofgame is true.
	(update_turn_display): Don't call show_gameover_dialog 
	and set told_outcome here.
	
	Fix crashes when world_shape_win etc. are reopened.
	* macinit.c (real_time_dialog): Always call my_GetNewDialog.
	(world_shape_dialog): Always call my_GetNewDialog.
	(more_variants_dialog): Always call my_GetNewDialog.
	
	Increase the sizes of the startup dialogs to 520 x 420
	pixels in order to accomodate splashpicture without scaling.
	* Xconq.r (DITL 128 "Splash"): Tweak item positions.
	(DITL 129 "New Game"): Tweak item positions.
	(DITL 130 "Player Setup"): Tweak item positions.
	(DITL 131 "Variants"): Tweak item positions.
	(DLOG 128 "Splash"): Increase size.
	(DLOG 129 "New Game"): Increase size.
	(DLOG 130 "Player Setup"): Increase size.
	(DLOG 131 "Variants"): Increase size.

2003-11-15  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Fix path-finding failure when destination includes unexplored 
        hexes. (Note: This fix is probably incomplete, because now one 
        must make sure that a unit following a path does not run 
        into terrain in which it wrecks or vanishes; that would be 
        bad....)
        * kernel/move.c (pathable_point_for_unit_type): If terrain is 
        not visible to side, then simply increment its path cost by 1 
        and return TRUE (which means that it is an allowed hex, or we 
        pretend it is anyway).
          (pathable_point): Comment out terrain visibility test that 
        returns 0 (FALSE).

2003-11-15 Hans Ronne <hronne@comhem.se>

	Fix crashes in path-finding code.
	* ai.c (blocked_by_enemy): Return 0 instead of 
	uninitialized value if destination is in adjacent cell.

2003-11-15 Hans Ronne <hronne@comhem.se>

	Fix null pointer crashes in submodule games without connections
	(e.g. Duel) due to next_conn_type not yet being allocated when 
	patch_object_references first is called. Solution: reorganize the
	startup code so that patch_object_references is called only when
	all modules and submodules have loaded. Do this from within
	check_game_validity to minimize hacking of the interface code.
	Further, make sure all new types are disallowed (and things like
	next_conn_type allocated) before patch_object_references is
	executed the first time.
	* conq.h (patch_object_references): Don't prototype extern.
	* init.c (patch_object_references): Prototype static.
	(disallow_more_types): New function and prototype.
	(check_game_validity): Call first disallow_more_types and
	then patch_object_references.
	* module.c (load_game_module): Don't call patch_object_references.
	(do_module_variants): Don't call patch_object_references.
	* tp.c (receive_packet): Don't call patch_object_references.

	Improve the ability of patch_object_references to pack units
	into transports correctly so that it only has to run once (this 
	fix was promted by the above changes, which caused problems
	with some poorly defined submodule games).
	* init.c (patch_object_references): Rewrite and enable code 
	that tries to load exisiting units into the new one. Improve code
	that tries to load the new unit into an exisiting unit. Remove
	some unused or unnecessary code.

	Fix color bug after drawing 1-bit emblems in the Mac interface.
	* macdraw.c (draw_side_emblem): Restore oldfore and oldback
	before returning. 

	Use same win game color in the Mac and tcltk interfaces.	
	* tkconq.tcl (popup_game_over_dialog): Change LightGreen 
	to PaleGreen1.

2003-11-14 Hans Ronne <hronne@comhem.se>

	Fixes to the path-finding code from Peter Garrone.
	* ai.c (assert.h): Include it.
	(blocked_by_enemy): Return 0 if point_in_dir fails.
	(attack_blockage): Return 0 if point_in_dir fails. Call
	assert on in_area returns.
	* move.c (assert.h): Include it.
	(do_move_action): Call assert on dir. Break out of loop
	if interior_point_in_dir returns false.
	(pathable_point_for_unit_type): Return 0 if 
	point_in_dir fails. 
	(choose_move_direction): Call assert on dir before 
	returning it (2 times).
	(get_cached_move_direction): Call assert on dir before 
	returning it.
	(cost_to_move_on_path): Call assert on dir.
	* task.c (assert.h): Include it.
	(do_approach_subtask): Call assert on dir. Return
	TASK_FAILED if point_in_dir fails. Iterate over NUMDIRS
	instead of 6. Continue if point_in_dir fails.

2003-11-14  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Include forgotten fix from Peter Garrone.
        * path.c (struct node): Make 'g' and 'h' ints instead of 
        shorts.

2003-11-14 Hans Ronne <hronne@comhem.se>

	Colorize the Mac PPC interface so that the codes works on 
	all systems from 8.1 to X.2. Use same colors as in the tcltk 
	interface.
	* maccmd.c (message_dialog): Save and restore the port. Call
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	(unit_rename_dialog): Save and restore the port. Call
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	(create_command_window): Call RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	(draw_command): Call my_SetPortWindowPort and
	RGBBackColor(&maincolor) then RGBBackColor(&listcolor).
	Call EraseRect for commandtextrect. Don't call TESetSelect.
	* maccolors.c (ltgraycolor): Change from 49000 to 40000.
	(listcolor): Intialize to (0xF000, 0xFF00, 0xFF00).
	(badcolor): Intialize to (0xF000, 0xC000, 0xCB00).
	(goodcolor): Intialize to (0x9A00, 0xFF00, 0x9A00).
	(maincolor): Intialize to (0xFFFF, 0xFFFF, 0xCCCC).
	(set_side_colors): Call 2 x RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	(set_feature_color): Call 2 x RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	(set_terrain_color): Call RGBBackColor(&maincolor).
	Call SetWindowContentColor if hasWindowsLib.
	* macconq.c (update_side_display): Don't set the port to
	gamewin here.
	(update_turn_display): Don't set the port to gamewin or
	map->window here.
	(update_clock_display): Don't set the port to gamewin here.
	(update_all_progress_displays): Don't set the port to 
	gamewin here.
	* macconq.h (listcolor): Declare new RGBColor.
	(badcolor): Declare new RGBColor.
	(goodcolor): Declare new RGBColor.
	(maincolor): Declare new RGBColor.
	* macdesign.c (show_design_window): Always call
	SelectTheWindow and ActivateTheWindow. Also call
	draw_design_window.
	(create_design_window): Call SetWindowContentColor 
	if hasWindowsLib. Don't call SelectTheWindow here.
	(draw_design_window): Call RGBBackColor(&maincolor).
	(draw_design_window_tool): Call RGBBackColor(&goodcolor)
	for current tool, else RGBBackColor(&maincolor). Remove
	obolete color code.
	(designer_save_dialog): Save and restore the port. Call
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	(designer_reshape_dialog): Save and restore the port. Call
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	* macdraw.c (draw_side_emblem): Save and restore old
	colors before drawing emblems on white background.
	(draw_terrain_sample): Save and restore old colors before 
	drawing terrain images on white background.
	* machelp.c (show_instructions_window): Move call
	to draw_instructions to the end.
	(create_instructions_window): Call SetWindowContentColor 
	if hasWindowsLib.
	(draw_instructions): Call RGBBackColor(&maincolor).
	(create_help_window): Call RGBBackColor(&maincolor).
	Tweak position of helptopicrect so that the line is no longer
	overwritten. Call SetWindowContentColor if hasWindowsLib.
	(draw_help): Call RGBBackColor(&maincolor). Call
	RGBBackColor(&whitecolor) before drawing unit images and
	RGBBackColor(&listcolor) before updating helptopic. Then
	restore maincolor. Draw a separating line below the title.
	(do_key_down_help): Call RGBBackColor(&listcolor) and
	restore maincolor at the end.
	(grow_help): Call RGBBackColor(&maincolor).
	(zoom_help): Call RGBBackColor(&maincolor).
	* macinit.c (show_splash_dialog): Call SetWindowContentColor
	if hasWindowsLib.
	(draw_splash_dialog): Call RGBBackColor(&maincolor).
	(create_chat_dialog): Call SetWindowContentColor if 
	hasWindowsLib.
	(draw_chat_dialog): Call RGBBackColor(&maincolor).
	(create_newgame_dialog): Call SetWindowContentColor if 
	hasWindowsLib.
	(draw_newgame_dialog): Call RGBBackColor(&maincolor).
	(create_variants_dialog): Call SetWindowContentColor if 
	hasWindowsLib. Clean out commented out code.
	(draw_variants_dialog): Call RGBBackColor(&maincolor).
	(world_shape_dialog):  Save and restore the port. Call
	SetWindowContentColor if hasWindowsLib. Remove commented
	out call to SelectTheWindow that would crash this modal dialog.
	Call my_SetPortWindowPort and RGBBackColor(&maincolor).
	Don't set world_shape_win to nil.
	(real_time_dialog):  Save and restore the port. Call
	SetWindowContentColor if hasWindowsLib. Remove commented
	out call to SelectTheWindow that would crash this modal dialog.
	Call my_SetPortWindowPort and RGBBackColor(&maincolor).
	Don't set real_time_win to nil.
	(more_variants_dialog):  Save and restore the port. Call
	SetWindowContentColor if hasWindowsLib. Remove commented
	out call to SelectTheWindow that would crash this modal dialog.
	Call my_SetPortWindowPort and RGBBackColor(&maincolor).
	Don't set more_variants_win to nil.
	(create_player_setup_dialog): Call SetWindowContentColor 
	if hasWindowsLib.
	(draw_player_setup_dialog): Call RGBBackColor(&maincolor).
	(configure_indepside_dialog):  Save and restore the port. Call
	SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	(open_progress_dialog): Call SetWindowContentColor if 
	hasWindowsLib.
	(announce_lengthy_process): Save and restore the port. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	(announce_progress): Save and restore the port. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	Call ShowWindow and SelectWindow instead of SelectTheWindow.
	(finish_lengthy_process): Save and restore the port. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	Call ShowWindow and SelectWindow instead of SelectTheWindow.
	* maclist.c (create_list): Call SetWindowContentColor if 
	hasWindowsLib.
	(draw_list): Call RGBBackColor(&maincolor).
	(redraw_unit_list_entry): Call RGBBackColor(&maincolor).
	* macmap.c (draw_top_line): Call RGBBackColor(&maincolor)
	at start and restore whitecolor at the end.
	(draw_control_panel): Call RGBBackColor(&maincolor) at 
	start and restore whitecolor at the end.
	(draw_unit_info): Call RGBBackColor(&maincolor) at 
	start and restore whitecolor at the end.
	* macmenus.c (do_about_box): Save and restore the port. 
	Call SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).	
	Don't call HideWindow.
	(find_location_dialog): Save and restore the port. 
	Call SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).	
	(worldmap_dialog): Call SetWindowContentColor if 
	hasWindowsLib. Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).	
	(find_unit_dialog): Save and restore the port. 
	Call SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).	
	(set_offscreen_buffers): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&maincolor).	
	(set_meridians): Call SetWindowContentColor if 
	hasWindowsLib. Call RGBBackColor(&maincolor).	
	(side_rename_dialog): Save and restore the port. 
	Call SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	(toggle_map_topline): Call RGBBackColor(&maincolor).	
	(toggle_map_topunit): Call RGBBackColor(&maincolor).	
	* macprefs.c (set_preferences): Save and restore the port. 
	Call SetWindowContentColor if hasWindowsLib. Call 
	my_SetPortWindowPort and RGBBackColor(&maincolor).
	Call SelectWindow.
	* macunit.c (create_unit_closeup): Call 
	RGBBackColor(&maincolor). Call SetWindowContentColor 
	if hasWindowsLib.
	(draw_unit_closeup):  Call RGBBackColor(&maincolor).
	(draw_simple_closeup):  Call RGBBackColor(&maincolor)
	before and after drawing the unit images (also for occs and
	transport images.
	(draw_advanced_closeup):  Call RGBBackColor(&maincolor)
	before draw_city_map and restore maincolor when done.
	Similarly for occ panels. Also restore maincolor after calls 
	to draw_unit_image and draw_unit_size.
	(toggle_landuse_one_cell): Call RGBBackColor(&whitecolor)
	and restore maincolor when done.
	(show_unit_build_dialog): 	Call SetWindowContentColor if 
	hasWindowsLib. Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(draw_unit_build_dialog): Call RGBBackColor(&maincolor).
	(unit_research_dialog): Call SetWindowContentColor if 
	hasWindowsLib. Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).	
	(unit_plan_dialog): Call SetWindowContentColor if 
	hasWindowsLib. Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	* macwins.c (create_game_window): Call 
	SetWindowContentColor if hasWindowsLib. Call 
	RGBBackColor(&maincolor).
	(draw_game): Call RGBBackColor(&maincolor).
	(draw_game_date): Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(draw_game_clocks): Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(draw_game_progress): Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(draw_game_side): Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(draw_side_status): Call my_SetPortWindowPort and 
	RGBBackColor(&maincolor).
	(create_construction_window): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&maincolor).
	(draw_construction): Call RGBBackColor(&maincolor).
	(draw_construction_default): Call RGBBackColor(&maincolor).
	Remove redundant my_SetPortWindowPort call.
	(show_research_dialog): Call SetWindowContentColor 
	if hasWindowsLib. 
	(draw_research_dialog): Call RGBBackColor(&maincolor).
	(side_research_dialog): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&maincolor).
	(create_history_window): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&listcolor).
	(draw_history): Call RGBBackColor(&listcolor).
	(create_notice_window): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&listcolor).
	(draw_notice): Call RGBBackColor(&listcolor).
	(create_scores_window): Call SetWindowContentColor 
	if hasWindowsLib. Call RGBBackColor(&listcolor).
	(draw_scores): Call RGBBackColor(&listcolor).
	(show_gameover_dialog): Call SetWindowContentColor
	and set to goodcolor, badcolor or maincolor depending on
	outcome if hasWindowsLib.
	(draw_gameover_dialog): First set maincolor. Then set to 
	goodcolor, badcolor or maincolor depending on outcome.
	(show_alert_dialog): Call SetWindowContentColor if 
	hasWindowsLib. Call my_SetPortWindowPort and 
	RGBBackColor(&badcolor).
	(draw_alert_dialog): Call RGBBackColor(&badcolor).
	
	Reorder window juggling code when launching the Mac app.
	* macinit.c (hit_splash_dialog): Call start_game_load_stage
	and show_newgame_dialog before close_window.
	(hit_newgame_dialog): Don't call HideWindow(newgamewin).	
	(hit_variants_dialog): Call launch_game before close_window.
	(hit_player_setup_dialog): Call HideTheWindow(playersetupwin)
	in case diPlayerSetupOK. Call launch_game_2 before close_window.
	
	Fix crashes in MacOS X due to null pointers to colorschemes.
	* maccolors.c (set_default_side_colors): Test that the side
	exists before dereferencing its colorscheme.
	(build_sides_popup): Comment out code that loads also the
	non-existing sides into the menu.
	* macmenus.c (side_rename_dialog): Test that colorscheme
	exists before setting it. Also change side to dside for clarity.

	Fix popup menu bug in the colors menus that would cause 
	crashes under MacOS 8.1 by removing now obsoleted code
	for setting the control max to the number of menu items.
	* maccolors.c (set_side_colors): Remove obsolete code.
	(set_feature_color): Remove obsolete code.
	(set_terrain_color): Remove obsolete code.

	Fix bug that would misposition the Notice window outside
	the main screen under MacOS 8.1.
	* macwins.c (create_notice_window): Add missing call to
	ShowWindow in non-WindowsLib branch.

	Fix color bug for the Notice window under MacOS 8.1.
	* macwins.c (create_notice_window): Use wNotice as
	template instead of wFloatResize.
	* Xconq.r (WIND 136 "Notices"): Change the Window 
	definition ID to 1063 (floating resizable).
	
	Tweak som dialog item positions to fit MacOS X.
	* Xconq.r (DITL 201 "Side Rename"): Tweak items.
	(DLOG 201 "Side Rename"): Tweak dialog size.
	(DITL 202 "Rename"): Tweak item positions.
	(DITL 501 "Designer Save"): Tweak item positions.
	(CNTL 401 "Feature Edit Button"): Tweak position.

	Center alert dialogs on the main screen.
	* Xconq.r (ALRT 1000 "Init Warning"): Center position.
	(ALRT 1001 "Init Error"): Center position.
	(ALRT 1002 "Run Warning"): Center position.
	(ALRT 1003 "Run Error"): Center position.
	(ALRT 1004 "Images Missing"): Center position.
	(ALRT 1005 "Out of Memory Alert"): Center position.
	(ALRT 4000 "Two Button Alert"): Center position.
	(ALRT 4001 "One Button Alert"): Center position.
	(DLOG 900 "Game Over"): Center position.
	(DLOG 4000 "Two Button Alert"): Center position.
	(DLOG 4001 "One Button Alert"): Center position.

	Clean up the other window definitions and get rid of 
	wFloatFixed and wFloatResize.
	* macdefs.h (wFloatResize): Change to wWorldMap.
	(wFloatFixed): Change to wInstructions.
	* macdesign.c (create_design_window): Use wDesign as 
	template instead of wFloatFixed.
	* macmap.c (create_map): Use wWorldMap as template 
	instead of wFloatResize.
	* macwins.c (create_game_window): Use wGame as 
	template instead of wFloatFixed.
	* Xconq.r (WIND 128 "Game"): Change the Window 
	definition ID to 1057 (floating fixed).
	(WIND 129 "Design"): Change the Window definition 
	ID to 1057 (floating fixed).
	(WIND 139 "Float Fixed"): Remove.
	(WIND 140 "Float Resize"): Rename to World Map.
	(WIND 141 "Instructions"): Renumber to 139.
	(WIND 142 "Chat"): Remove.
	(wctb 139 "Float Fixed"): Remove.
	(wctb 140 "Float Resize"): Rename to World Map 
	and change to no background color.
	(wctb 141 "Instructions"): Renumber to 139.
	(wctb 142 "Chat"): Remove.
	
	Clean up and colorize the Mac PICT resources.
	* macdefs.h (pEmptyPict): Remove.
	(pDotDotDot): Define as 134.
	* macinit.c (init_cursors): Use pDotDotDot.
	* Xconq.r (PICT 128 "Empty Pict"): Remove.
	(PICT 129 "Map Controls BL"): Colorize LemonChiffon.
	(PICT 130 "Map Controls TL"): Colorize LemonChiffon.
	(PICT 131 "up/down arrow"): Colorize LemonChiffon.
	(PICT 132 "up/down arrow - up"): Colorize LemonChiffon.
	(PICT 133 "up/down arrow - down"): Colorize LemonChiffon.
	(PICT 134 "dotdotdot"): Colorize LemonChiffon.
	(PICT 2002 "New Game Decor"): Colorize LemonChiffon.
	(PICT 3001 "You Won!"): Colorize PaleGreen1.
	(PICT 3002 "You Lost!"): Colorize pink.
	(PICT 4004 "Build Icon"): Colorize LemonChiffon.
	(PICT 4005 "Research Icon"): Colorize LemonChiffon.
	
	Add  dctb resources for all dialogs and alerts (an empty dctb
	is needed for colorization of dialog items by RGBBackColor in 
	all non-Carbon code, and a regular dctb is needed to supply the
	window background in pre-WindowsLib code). The color used
	was (0xFFFF, 0xFFFF, 0xCCCC) which is close to LemonChiffon
	in the tcltk interface. Use (0xFF00, 0xC000, 0xCB00) which
	is close to pink in the two Alert Dialogs.
	* Xconq.r (dctb 128 "Splash"): Add dialog color table.
	(dctb 129 "New Game"): Add dialog color table.
	(dctb 130 "Player Setup"): Add dialog color table.
	(dctb 131 "Variants"): Add dialog color table.
	(dctb 132 "Progress"): Add dialog color table.
	(dctb 133 "About"): Add dialog color table.
	(dctb 134 "World Shape"): Add dialog color table.
	(dctb 135 "Real Time"): Add dialog color table.
	(dctb 136 "More Variants"): Add dialog color table.
	(dctb 138 "Configure Indepside"): Add dialog color table.
	(dctb 139 "Chat"): Add dialog color table.
	(dctb 201 "Side Rename"): Add dialog color table.
	(dctb 202 "Rename"): Add dialog color table.
	(dctb 203 "Feature Edit"): Add dialog color table.
	(dctb 205 "Message"): Add dialog color table.
	(dctb 207 "Find Location"): Add dialog color table.
	(dctb 208 "Find Unit"): Add dialog color table.
	(dctb 501 "Designer Save"): Add dialog color table.
	(dctb 502 "Designer Reshape"): Add dialog color table.
	(dctb 700 "Preferences"): Add dialog color table.
	(dctb 800 "Set Offscreen Buffers"): Add dialog color table.
	(dctb 801 "Set Side Colors"): Add dialog color table.
	(dctb 802 "Set Feature Colors"): Add dialog color table.
	(dctb 803 "Advanced Closeup"): Add dialog color table.
	(dctb 804 "Unit Research"): Add dialog color table.
	(dctb 805 "Global Science"): Add dialog color table.
	(dctb 806 "Set Meridians"): Add dialog color table.
	(dctb 807 "Unit Build"): Add dialog color table.
	(dctb 808 "Unit Plan"): Add dialog color table.
	(dctb 809 "World Map Info"): Add dialog color table.
	(dctb 810 "Simple Closeup"): Add dialog color table.
	(dctb 811 "Side Research"): Add dialog color table.
	(dctb 812 "Set Terrain Colors"): Add dialog color table.
	(dctb 900 "Game Over"): Add dialog color table.
	(dctb 1000 "Init Warning"): Add dialog color table.
	(dctb 1001 "Init Error"): Add dialog color table.
	(dctb 1002 "Run Warning"): Add dialog color table.
	(dctb 1003 "Run Error"): Add dialog color table.
	(dctb 1004 "Images Missing"): Add dialog color table.
	(dctb 1005 "Out of Memory Alert"): Add dialog color table.
	(dctb 4000 "Two Button Alert"): Add dialog color table.
	(dctb 4001 "One Button Alert"): Add dialog color table.
	
	Remove item color table which is no longer needed.
	* Xconq.r (ictb 4000 "Two Button Alert"): Remove.

	Add wctb resources for all windows (for the same reasons as
	above). Use (0xFFFF, 0xFFFF, 0xCCCC) which is close to 
	LemonChiffon for most windows, (0xF000, 0xFF00, 0xFF00) 
	which is close to azure for the Notice, Scores and History 
	windows.
	* Xconq.r (wctb 128 "Game"): New windows color table.
	(wctb 128 "Game"): New windows color table.
	(wctb 129 "Design"): New windows color table.
	(wctb 130 "Map"): New windows color table.
	(wctb 131 "List"): New windows color table.
	(wctb 132 "Unit Closeup"): New windows color table.
	(wctb 133 "History"): New windows color table.
	(wctb 134 "Construction"): New windows color table.
	(wctb 135 "Help"): New windows color table.
	(wctb 136 "Notices"): New windows color table.
	(wctb 137 "Command"): New windows color table.
	(wctb 138 "Scores"): New windows color table.
	(wctb 139 "Float Fixed"): New windows color table.
	(wctb 140 "Float Resize"): New windows color table.
	(wctb 141 "Instructions"): New windows color table.
	(wctb 142 "Chat"): New windows color table.
		
	Clean out unused dialogs in the Mac PPC interface.
	* Xconq.r (DLOG 160 "Mplayer"): Delete.
	(DLOG 200 "Side Closeup"): Delete.
	(DLOG 206 "Message Receive"): Delete.
	(DLOG 600 "Instructions"): Delete.
	(DLOG 601 "Unit Type Desc"): Delete.
	(DLOG 602 "Material Type Desc"): Delete.
	(DLOG 603 "Terrain Type Desc"): Delete.
	(DLOG 604 "Game Module Desc"): Delete.
	(DLOG 1000 "Init Warning"): Delete.

	Clean out unused dialog items in the Mac PPC interface.
	* Xconq.r (DITL 160 "Mplayer Items"): Delete.
	(DITL 200 "Side Closeup Items"): Delete.
	(DITL 206 "Side Message Receive Items"): Delete.
	(DITL 600 "Instructions Items"): Delete.
	(DITL 601 "Unit Type Desc Items"): Delete.
	(DITL 602 "Material Type Desc Items"): Delete.
	(DITL 603 "Terrain Type Desc Items"): Delete.
	(DITL 604 "Game Module Desc Items"): Delete.

	Give some dialogs and dialog items more logical names. 
	* Xconq.r: Remove "Items" from all DITL resource names.
 	(DLOG 138 "Configure Side"): Rename to "Configure Indepside".
	(DITL 138 "Configure Side Items"): Rename to "Configure Indepside".
	(DLOG 800 "Map View Offscreen"): Rename to "Set Offscreen Buffers".
	(DLOG 809 "World Map"): Rename to "World Map Info".
	(DITL 809 "World Map Items"): Rename to "World Map Info".

	* macdefs.h: Clean out unused dialogs and item constants.
	Rearrange remaining dialogs in number order.
	(dBuildPlan): Remove dialog 301 and its items.
	(dMultiBuild): Remove dialog 302 and its items.
	(dInstructions): Remove dialog 600 and its items.
	(dUnitTypeDesc): Remove dialog 601 and its items.
	(dMaterialTypeDesc): Remove dialog 602 and its items.
	(dTerrainTypeDesc): Remove dialog 603 and its items.
	(dGameModuleDesc): Remove dialog 604 and its items.
	
	Tweak default unit images in the Mac interface.
	* macdraw.c (draw_unit_image): Tweak imagerects 
	for boxes used as default unit images (3 times). 

2003-11-13 Hans Ronne <hronne@comhem.se>

	Contribution from Peter Garrone: new improved 
	path-finding code based on the Astar algorithm.
	* ai.c (desired_direction_impassable): Rewrite.
	(could_be_ferried): Rewrite.
	(blocked_by_enemy): Rewrite.
	(attack_blockage): Rewrite.
	* ai.h (blocked_by_enemy): Remove last argument.
	(attack_blockage): Remove last argument.
	* conq.h (CMD_NONE): Define as 0.
	(CMD_AVOID_ENEMY): Define as 1.
	(CMD_USE_TRANSPORT): Define as 2.
	(path_node_data): New struct.
	(choose_move_direction): New prototype.
	(get_cached_move_direction): New prototype.
	(pathway_transport_change): New prototype.
	(path_node_data_index): New prototype.
	(same_path_nodes): New prototype.
	(set_path_node_from_key): New prototype.
	(get_path_cost_estimate): New prototype.
	(get_path_direction_count): New prototype.
	(set_dir_path_node_data): New prototype.
	(cost_to_move_on_path): New prototype.
	(path_get_next_move): New prototype.
	(path_get_next_cached_move): New prototype.
	(path_get_next_cached_node): New prototype.
	(select_better_path_node): New prototype.
	(choose_move_dirs): Remove prototype.
	(plausible_move_dir): Remove prototype.
	* iplayer.c (iplayer_react_to_task_result): 
	Change blockage code.
	* move.c (can_be_carried): New static int. 
	(path_cb_cnt): New static int.
	(target_distance): New static int.
	(do_move_action): Call choose_move_direction.
	(pathable_point_for_unit_type): New function.
	(pathable_point): New function.
	(set_node_data): New function.
	(choose_move_direction): New function.
	(pathway_transport_change): New function.
	(get_cached_move_direction): New function.
	(path_node_data_index): New function.
	(same_path_nodes): New function.
	(set_path_node_from_key): New function.
	(get_path_cost_estimate): New function.
	(get_path_direction_count): New function.
	(set_dir_path_node_data): New function.
	(cost_to_move_on_path): New function.
	(select_better_path_node): New function.
	* mplayer.c (mplayer_react_to_task_result): Change 
	blockage code.
	* task.c (choicestate): Remove enum.
	(compare_directions): Remove function and prototype.
	(do_approach_subtask): Add dist and cmdflags args to
	prototype. Rewrite function.
	(could_directly_board_ferry): New function.
	(do_move_to_task): Add dist and cmdflags args in call 
	to do_approach_subtask.
	(do_occupy_task): Add dist and cmdflags args in call 
	to do_approach_subtask.
	(do_pickup_task): Add dist and cmdflags args in call 
	to do_approach_subtask.
	(choose_move_dirs): Remove function.
	(plausible_move_dir): Remove function.
	(xs[NUMDIRS]): Remove array.
	(ys[NUMDIRS]): Remove array.
	(terrs[NUMDIRS]): Remove array.
	(compare_directions): Remove function.
	(sort_directions): Remove function.
	(create_move_to_task): Don't set task->args[4].
	(create_occupy_task): Don't set task->args[1].
	* path.c: New source file with path-finding code.
	* kernel/Makefile.in (OBJS): Add path.o.
	(MW32_OBJS): Add path_mw32.o.
	(path.o): Add $(ALL_H) $(KERNEL_H).

2003-11-12  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Help some systems find their Tk headers if the Tk includes 
        directory is different than the Tcl includes directory. (Thanks 
        to Peter Garrone for reporting this issue.)
        * aclocal.m4: Add test for defined 'TK_INCLUDE_SPEC'. If not 
        defined, then check for 'TK_INC_DIR', and synthesize 
        'TK_INCLUDE_SPEC'.
        * tcltk/Makefile.in: Remove usage of 'TK_BUILD_INCLUDES'; this 
        is only for local Tcl/Tk build sources. Add 'TK_INCLUDE_SPEC' 
        macro expander to 'TK_CFLAGS'; on many systems this will be 
        translated to nothing on makefile creation.

        Finish converting the snprintf build to always use a forced 
        override of any existing snprintf implementation, even if the 
        build was not prepared by configure scripts.
        * missing/snprintf/snprintf.c: Uncomment macro definitions 
        'HAVE_SNPRINTF' and 'PREFER_PORTABLE_SNPRINTF', and protect 
        them with #ifndef to prevent any accidental double defines.
        * missing/Makefile.in: Comment out now unnecessary 
        'SNPRINTF_CFLAGS' and 'ALT_SNPRINTF_CFLAGS' macro expanders.
        * configure.in: Comment out everything pertaining to 
        'SNPRINTF_CFLAGS' and 'ALT_SNPRINTF_CFLAGS'. Also remove test 
        for vsnprintf.
        * configure: Regenerated.

        Fix casting problem with snprintf implementation.
        * missing/snprintf/snprintf.c (snprintf): Result of a memchr(3) 
        call is void *, and so it should be cast before assigning to 
        a const char *. Tested with g++ to make sure Xconq still can be 
        built as a C++ app.

        Fix g++ build issues.
        * kernel/unix.c: If 'NEED_GETTIMEOFDAY' defined, then define our 
        own gettimeofday(2) function. Steal code from 'win32.c'. Only 
        include 'sys/time.h' with C compiler; C++ name mangling causes 
        linking difficulties otherwise. (Note: All of these different 
        gettimeofday and struct timeval special cases are total 
        spaghetti. I will hopefully fix all of this in the near future 
        by moving it to 'missing', and then compiling based solely on 
        'NEED_GETTIMEOFDAY'. Platforms such as Metrowerks and Visual C 
        will be carefully considered when the day arrives....)
        * kernel/util.c: Declare extern gettimeofday(2) if 
        'NEED_GETTIMEOFDAY' defined. (Note: More spaghetti, Strega 
        Nona.)
        * tcltk/tkiapp.c: Extern 'xconq_libs' to avoid linkage 
        problems with 'xconq_libs' in 'x11/xcutil.c'.
        * x11: (Note that 'xtconq' does not build as a C++ app. Should 
        we even bother to fix this?)

        Do recursive cleanup under 'missing' dir.
        * missing/Makefile.in: Make sure that 'snprintf' subdir gets 
        targeted for recursive cleaning. (Note: Should adopt the the 
        do_subdir mechanism used in the top-level makefile.)

2003-11-12 Hans Ronne <hronne@comhem.se>

	Fix crashes in materials display code due to the user area layer 
	not being malloced. To prevent future problems, make sure this
	layer is malloced already in the startup code instead (thanks to
	Lincoln Peters for reporting this bug).
	* run.c (run_advanced_units): Remove allocate_area_users
	call which is no longer needed.
	* world.c (final_init_world): Call allocate_area_users if there
	are any advanced units in the game.

	Fix materials conversion bug that would hang the civ2 game
	after 1-2 turns.
	* run.c (run_advanced_units): Add converted materials to
	production[m2] instead of supply[m2]. Remove check for
	overflow of supply[m2]. Break up the materials loop so that
	all production and conversion is finished before the supply is
	increased and transfer to treasury takes place.

2003-11-10  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Finish hooking in the missing functions support, in 
        particular snprintf(3) support.
        * kernel/config.h: Include 'snprintf.h'.
        * kernel/Makefile.in: Add 'missingsrcdir' variable. 
        Add 'MISSING_H' variable. Add 'MISSING_H' to 'ALL_H' 
        list. Add 'missingsrcdir' as an include path for 
        'ALL_CFLAGS'.
        * curses/Makefile.in: Add 'missingsrcdir' variable. 
        Add 'missingsrcdir' as an include path for 'ALL_CFLAGS'.
        * sdl/Makefile.in: Likewise.
        * tcltk/Makefile.in: Add 'missingsrcdir' variable. Add 
        'missingsrcdir' as an include path for 
        'ALL_COMMON_CFLAGS'. Remove 'MISSING_LIB' from 
        'ALL_COMMON_LIBS'.
          (xconq): Add 'MISSING_LIB' in the correct linking 
        order.
          (imfapp): Add 'MISSING_LIB' in the correct linking 
        order.
        * x11/Makefile.in: Add 'missingsrcdir' variable. 
        Add 'missingsrcdir' as an include path for 'ALL_CFLAGS'.
          (x2imf): Add 'MISSING_LIB' in the correct linking 
        order.
          (imf2x): Add 'MISSING_LIB' in the correct linking 
        order.
          (xshowimf): Add 'MISSING_LIB' in the correct linking 
        order.
        * missing/snprintf.h: Make sure that the portable 
        snprintf(3) and vsnprintf(3) prototypes are always 
        available, even on systems that already have snprintf 
        implementations. Furthermore, override (using macros) 
        the calls to the system implementations (if present).

        Use vsnprintf(3) to guard against some buffer overflows. 
        (Note: In the first 3 functions below, a strncat(3) 
        call should also be used instead of strcat(3), but this 
        will require more thought before handling.)
        * kernel/util.c (tprintf): Patch from Erik Sigra 
        (submitted to the list on 2003/08/10), applied with 
        modifications. Convert vsprintf call to vsnprintf call. 
        Also, replace numeric literal buffer size with defined 
        constant buffer size, 'TBUFSIZE'.
          (tnprintf): Likewise.
          (vtprintf): Likewise.
          (init_error): Likewise, but no TBUFSIZE change.
          (init_warning): Likewise, but no TBUFSIZE change.
          (run_error): Likewise, but no TBUFSIZE change.
          (run_warning): Likewise, but no TBUFSIZE change.
        * Define constant 'TBUFSIZE'.

        * configure.in: Fix small formatting glitch.
        * configure: Regenerated. 

2003-11-09  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Remove old versions of Windows text files.
        * INSTALL-win: Goodbye.
        * README-win: Goodbye.

2003-11-09  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Add new CRLF-delimited versions of important text files for 
        the Windows platform.
        * COPYING.txt
        * README-win.txt
        * INSTALL-win.txt: Complete rewrite with expanded and 
        updated information, including how to use WinCVS with the 
        Xconq CVS repository. Removed some dated information.

        * aclocal.m4: Comment out questionable path filter for 
        'TCL_INCLUDE_SPEC'. Not sure why I put it there in the 
        first place....
        * configure: Regenerated.

        Update Windows installer script file to reflect a new 
        Cygwin build platform and to change menu choices for the 
        installation type.
        * tcltk/xconq.nsi: New InstType entries. Bundle newer 
        Cygwin curses DLL.

        Link icons into Windows SDL executable.
        * sdl/Makefile.in: Add new variable 'WINDRES'. Add 'xcqicon.o' 
        to 'WIN32_XCONQ_OBJS'.
          (xcqicon.o): New target. Build linker object from Xconq.RC,  
        Xconq.ico, and Xcdoc.ico.

2003-11-06 Hans Ronne <hronne@comhem.se>

	Fix splash picture-related crashes under Mac OSX.
	* macinit.c (center_pict): Comment out function and prototype.
	(draw_splash_dialog): Comment out call to center_pict.
	(draw_newgame_dialog): Comment out call to center_pict.

	Remove the Help item from the Apple menu.
	* macdefs.h (miAppleHelp): Remove menu item.
	* macmenus.c (do_menu_command): Remove case miAppleHelp.
	* Xconq.r (MENU 128 "Apple"): Remove Help item.
	
	Move Instructions from the Apple to the Windows menu.
	* macdefs.h (miAppleInstructions): Remove menu item.
	(miWindowsAgreements): Remove unused menu item 9.
	(miWindowsInstructions): Define as menu item 9.
	* macmenus.c (do_menu_command): Remove case
	miAppleInstructions. Add case miWindowsInstructions.
	(adjust_menus): Remove case miAppleInstructions. Add case 
	miWindowsInstructions.
	* Xconq.r (MENU 128 "Apple"): Remove Instructions item.
	(MENU 135 "Windows"): Change Agreements to Instructions. 
	Enable item, remove submeny and set command char to 9.

	Add question mark at first Xconq item in the Mac Help menu.
	* machelp.c (init_help_menu): Add call to SetItemMark ? 
	for the first Xconq item loaded into the Help menu.

2003-11-04 Hans Ronne <hronne@comhem.se>

	Fix clunky menu support on Unix systems by chopping up the
	tcltk help menu if necessary.
	* tkconq.tcl (create_map_menus): Add code for chopping up 
	the help menu. Also set tearoff to false for all menus.
	(adjust_windows_menu): Change to fit no tearoff item.
	
2003-11-04  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Make icons get bound to Tcl/Tk Windows executables. (Note: Need 
        to do the same for SDL Windows executable.)
        * tcltk/Makefile.in: Add new variable 'WINDRES'. Add 'xcqicon.o' 
        to 'WIN32_XCONQ_OBJS' and 'iappicon.o' to 'WIN32_IMFAPP_OBJS'.
          (xcqicon.o): New target. Build linker object from Xconq.RC,  
        Xconq.ico, and Xcdoc.ico.
          (iappicon.o): New target. Build linker object from Imfapp.RC 
        and Imfapp.ico. 

        Make tkconq go the extra mile to locate tkconq.tcl and read it 
        in. (Note: This whole portion of code should be redone. Also 
        the Tcl script side of things needs to be made smarter wrt to 
        finding things.)
        * tcltk/tkmain.c: Check relative to the current working directory 
        for tkconq.tcl.

        Add script for creating Windows installer with NSIS (Nullsoft 
        Scriptable Install System; 
        http://nsis.sourceforge.net/site/index.php).
        * tcltk/xconq.nsi: New file.

2003-11-03 Hans Ronne <hronne@comhem.se>

	Finally fix long-standing and serious bug that would cause the tcltk
	interface to crash due to bad pointers whenever a map was closed by 
	clicking the close box. Solution: don't delete any maps that have been
	closed, just withdraw them by trapping WM_DELETE_WINDOW.
	Furthermore, implement a solution similar to the Mac interface
	where available maps (also those that have been withdrawn) are 
	appended to the Windows menu, from which they can be easily
	activated. Finally, disable closing of the window if there is only
	one map left, to prevent Windows and Unix users (who need the 
	menubar of the map window) from being trapped in limbo.
	* tkconq.tcl (popup_map): New tcl procedure.
	(close_map): New tcl procedure.
	(create_map_window): Trap WM_DELETE_WINDOW and call
	close_map instead. Add code for appending existing maps to the 
	Windows menu.
	(adjust_windows_menu): Add code for dynamically updating
	the list of available maps. 
	 
2003-11-03 Hans Ronne <hronne@comhem.se>

	Add document icons for the Windows TCL and SDL apps.
	* sdl/Xconq.RC(ICON2): Define as Xcdoc.ico.
	* sdl/Xcdoc.ico: New document icon file.
	* tcltk/Xconq.RC(ICON2): Define as Xcdoc.ico.
	* tcltk/Xcdoc.ico: New document icon file.

2003-11-03 Hans Ronne <hronne@comhem.se>

	Add a new Help menu in the Mac PPC interface.
	* macconq.h (init_help_menu): Prototype extern.
	* macdefs.h (mHelp): Define as kHMHelpMenuID.
	* machelp.c (add_mac_help_nodes): Move some code from
	create_help_window to new function and prototype. Change
	first_help_node key from "help" to "Xconq Help".
	(create_help_window): Call add_mac_help_nodes.
	(init_help_menu): New function.
	* macinit.c (launch_game_2): Call init_help_menu.
	* macmenus.c (do_menu_command): Handle case mHelp.

	Make the Mac PPC help window larger by default.
	* Xconq.r (CNTL 130 "Close Button"): Tweak position.
	(WIND 135 "Help"): Make it 560 x 420 pixels.
	
	Adjust positions of buttons in instructionswin.
	* machelp.c (create_instructions_window): Tweak positions
	of openhelpbutton and closewinbutton.

	Add INSTALL-win to the CVS checkout. Remove the
	obsolete win directory.
	* modules/moduels (xconq-top-win): New top level module
	with INSTALL-win.
	(xconq-win): Include xconq-top-win. Remove win directory.
	(xconq): Include xconq-top-win. Remove win directory.

2003-11-02 Hans Ronne <hronne@comhem.se>

	Fix problem on Windows due to curmap_number not working.
	* tkconq.tcl (create_map_menus): Pass $mapn instead of
	curmap_number to init_help_menu. Note: should figure out
	why curmap_number fails on Windows.

2003-11-02 Hans Ronne <hronne@comhem.se>

	Fix so that the new tcltk Help menu loads the help nodes.
	* tkmain.c (tk_init_help_menu): new TclCmdFn and prototype.
	* tkconq.tcl (create_map_menus): Call init_help_menu.
	(add_help_topic_menu): New tcl procedure.
	(get_help_on_topic): New tcl procedure.

2003-11-02 Hans Ronne <hronne@comhem.se>

	Move the Xconq Help command to a separate Help menu, as 
	suggested by Peter Garrone.
	* tkconq.tcl (create_map_menus): Remove Help command
	from File menu. Create $map.menubar.help and put the Help
	command there instead. Note: should figure out how to load
	all help nodes into this menu. 

2003-11-01 Hans Ronne <hronne@comhem.se>

	Add Windows and Mac OS icons for imfapp.
	* IMFApp.r (BNDL 128): New bundle resource.
	(FREF 128): New file reference resource.
	(icl4 128): New application icon.
	(icl8 128): New application icon.
	(ICN# 128): New application icon.
	(icns 128): New high resolution application icons.
	(ics# 128): New application icon.
	(ics4 128): New application icon.
	(ics8 128): New application icon.
	* iappmac.r (BNDL 128): New bundle resource.
	(FREF 128): New file reference resource.
	(icl4 128): New application icon.
	(icl8 128): New application icon.
	(ICN# 128): New application icon.
	(icns 128): New high resolution application icons.
	(ics# 128): New application icon.
	(ics4 128): New application icon.
	(ics8 128): New application icon.
	* tcltk/Imfapp.RC: New resource script file.
	* tcltk/Imfapp.ico: New icon file.
	
	Fix Mac linefeeds in resource script files. 
	* sdl/Xconq.RC: Change to DOS linefeeds.
	* tcltk/Xconq.RC: Change to DOS linefeeds.

	Add the missing missing directory to xconq-base so 
	that the CVS checkout builds again.
	* modules/modules (xconq-base): Add xconq/missing.

2003-11-01  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Mostly hook in the missing functions library and snprintf 
        functionality. (Note: These things are not quite ready for use 
        yet. 'missing' must still be provided as an includes dir. Also 
        need to determine whether to hoist variable declarations 
        outside of flow control constructs in 'snprintf.c'.)
        * configure.in: Disable separate test for vsnprintf(3). 
        Add 'missing/Makefile' and 'missing/snprintf/Makefile' to 
        list of makefiles to configure. Do not add snprintf-
        related macro definitions to 'HFLAGS' and 'ALT_HFLAGS' as this 
        clutters the make output and can possibly trigger 
        "interesting" behavior in standard includes; instead assign 
        and substitute in 'SNPRINTF_CFLAGS' and 'ALT_SNPRINTF_CFLAGS', 
        and use them only in the snprintf build.
        * Makefile.in: Add 'missing' to 'SUBDIRS' variable, and expand 
        that list to be multi-line.
        * missing/Makefile.in: New makefile template. Controls build 
        of all replacement modules and packages them into a library for 
        linking into exectuables.
        * missing/.cvsignore: New CVS control file. Ignore 'Makefile'.
        * missing/snprintf/Makefile.in: New makefile template. Controls 
        build of snprintf replacement modules.
        * missing/snprintf/.cvsignore: New CVS control file. Ignore 
        'Makefile'.
        * missing/snprintf/snprintf.h: Move up one directory level in 
        anticipation of 'missing' becoming an includes dir. (Note: 
        snprintf.c is self-contained and does not rely on this header.)
        * missing/snprintf.h: Relocated file.
        * kernel/Makefile.in: Add subtargets to ensure that new library 
        of missing functions gets built.
          (libconqlow.a): Add 'missing-lib' subtarget.
          (libconqlow_mw32.a): Add 'missing-mw32-lib' subtarget.
          (missing-lib): New target. Go to 'missing' dir and invoke 
        'libmissing.a' target.
          (missing-mw32-lib): New target. Go to 'missing' dir and 
        invoke 'libmissing_mw32.a' target.
        * tcltk/Makefile.in: Add 'MISSING_LIB' path variable. Add 
        'MISSING_LIB' to list of libraries to link against.
        * curses/Makefile.in: Likewise.
        * x11/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise, and for MW32 varieties as well.

        Fix issue with some compile flags being clobbered by config 
        system.
        * configure.in: Make sure that 'HFLAGS' does not get clobbered 
        during host-specific processing.
        * configure: Regenerated.

2003-10-31 Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to November 2003.

	Improve Xconq icons on the Mac and Windows platforms. 
	Add high resolution icons for Windows XP and Mac OSX.
	* Xconq.r (icl4 128): Improved application icon.
	(icl4 129): Improved document icon.
	(icl4 130): Remove unused stationary icon.
	(icl4 131): Remove unused resource icon.
	(icl8 128): Improved application icon.
	(icl8 129): Improved document icon.
	(icl8 130): Remove unused stationary icon.
	(icl8 131): Remove unused resource icon.
	(ICN# 128): Improved application icon.
	(ICN# 129): Improved document icon.
	(ICN# 130): Remove unused stationary icon.
	(ICN# 131): Remove unused resource icon.
	(icns 128): New high resolution application icons.
	(icns 129): New high resolution document icons.
	(ics# 128): Improved application icon.
	(ics# 129): Improved document icon.
	(ics# 130): Remove unused stationary icon.
	(ics# 131): Remove unused resource icon.
	(ics4 128): Improved application icon.
	(ics4 129): Improved document icon.
	(ics4 130): Remove unused stationary icon.
	(ics4 131): Remove unused resource icon.
	(ics8 128): Improved application icon.
	(ics8 129): Improved document icon.
	(ics8 130): Remove unused stationary icon.
	(ics8 131): Remove unused resource icon.
	* tkmac.r (icl4 128): Improved application icon.
	(icl4 129): Improved document icon.
	(icl8 128): Improved application icon.
	(icl8 129): Improved document icon.
	(ICN# 128): Improved application icon.
	(ICN# 129): Improved document icon.
	(icns 128): New high resolution application icons.
	(icns 129): New high resolution document icons.
	(ics# 128): Improved application icon.
	(ics# 129): Improved document icon.
	(ics4 128): Improved application icon.
	(ics4 129): Improved document icon.
	(ics8 128): Improved application icon.
	(ics8 129): Improved document icon.
	* sdlmac.r: New Mac resource file copied from tkmac.r. 
	* sdl/Xconq.RC: Add Windows resource file for the sdl app.
	* sdl/Xconq.ico: Add Windows icon file for the sdl app.
	* tcltk/Xconq.ico: Improve existing application icons and 
	add high resolution icons for Windows XP.
	
	Remove junk that sneaked in in the last checkin.
	* Xconq.r (usro 0): Delete.
	(icns -16455 "Binding Override"): Delete.
	
	Move the platform-specific code for the mac sdl app 
	to the sdl directory and give it a more logical name.
	* mac/macsdl.c: Rename to sdl/sdlmac.c.

2003-10-27  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Fix kernel lib dependencies issue with interface targets.
        * Makefile.in: Remove 'all-kernel' subtarget from 
        'all-tkconq', 'all-sdlconq', 'all-xtconq', and 'all-cconq' 
        targets.
        * tcltk/Makefile.in: Change references to the 'KERNEL_LIB' 
        and 'LOW_LIB' variables to 'kernel-lib' and 'low-lib', 
        respectively, in the target lists, but leave them 
        unchanged in the linker arguments. This helps us because 
        the new target names are not also file names which prevents 
        Make from invoking "Make-like" behavior on them.
          (KERNEL_LIB): Change to 'kernel-lib'.
          (LOW_LIB): Change to 'low-lib'.
        * x11/Makefile.in: Likewise.
        * curses/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise, and with 'KERNEL_MW32_LIB', 
        'LOW_MW32_LIB', 'kernel-mw32-lib', and 'low-mw32-lib' as 
        well. Also remove commented out build rules for old 
        'all-xconq', 'xconq', 'all-wconq', and 'wconq' targets.

        Cosmetic enhancements to Bellum Aeternum. Details in 
        lib/ChangeLog-bellum.

2003-10-26  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Add compound terrain effects to model 0 combat. No game modules 
        appeared to need modification as a result of this feature.
        * combat.c (maybe_hit_unit): Iterate through aux terrain types, 
        factoring in any effects from 'ut_attack_terrain_effect', 
        'ut_fire_attack_terrain_effect', 'ut_defend_terrain_effect', 
        and 'ut_fire_defend_terrain_effect'.

        Many changes to Bellum Aeternum. Please see lib/ChangeLog-bellum 
        for details.

2003-10-25 Hans Ronne <hronne@comhem.se>

	Fix MACOSX-dependent include problems in macimf.c.
	* macimf.c (QuickTime/QuickTime.h): Only include it if not
	using CodeWarrior. Else include ImageCompression.h.

	Remove more Platinum-specific hacks. Reorder map creation
	code for worldmap and fix some bugs. Add code for setting standard
	states for small windows that will zoom vertically only, and not
	reposition the top left corner.
	* macconq.c (set_vertical_standard_state): New function.
	* macconq.h (set_vertical_standard_state): New prototype.
	* machelp.c (zoom_help): Call set_vertical_standard_state.
	* macmap.c (create_map): Use GetWindowBounds etc. to compute
	correct positions of the worldmapwin. Move call to MakeFloat
	inside the first worldmap branch. Move title setting code
	inside the first branches.
	* macwins.c (zoom_construction): Calculate the max number 
	of cells and then call set_vertical_standard_state. Call 
	my_GetWindowPortBounds at the end to ensure that the new 
	winrect is invalidated.
	(zoom_history): Call set_vertical_standard_state.
	(create_notice_window): Use GetWindowBounds etc. to compute 
	correct position of noticewin. Remove unused if clause.
	(zoom_notice): Call set_vertical_standard_state.
	(zoom_scores): Call set_vertical_standard_state.

	Tweak listbox positions in constructionwin.
	* macwins.c (calc_construction_rects): Offset all rects to
	the right by constructmargin. 

	Fix crashes in Mac OS 8.1 due to calling ResizeWindow with 
	a weak-linked WindowsLib.
	* macconq.c (grow_window): Call GrowWindow instead of
	ResizeWindow if hasResizeWindow is false. Use return value
	or sizerect depending on hasResizeWindow. Add explicit call to
	SizeWindow if hasResizeWindow is false.

	Untangle WindowsLib-dependence from Carbon-dependence
	and move the associated checks from compile-time to runtime.
	Note: should go through all the Carbon macros in macheads.h
	and remove WindowsLib-dependent stuff.
	* macconq.h (hasWindowsLib): Prototype extern int.
	(hasResizeWindow): Prototype extern int.
	* macconq.c (hasWindowsLib): Initialize to false.
	(hasResizeWindow): Initialize to false.
	(check_runtime_environment): New static function and 
	prototype for setting hasWindowsLib and hasResizeWindow.
	(main): Call check_runtime_environment first of all.
	(stagger_window): Check hasWindowsLib instead of calling 
	Gestalt again.
	(set_standard_state): Check hasWindowsLib instead of
	calling Gestalt again.
	* macgworld.c (scroll_map_window): Check hasWindowsLib 
	instead of calling Gestalt again.
	* macwins.c (create_game_window): Check hasWindowsLib 
	instead of calling Gestalt again.

	Fix bug in zooming of historywin under MacOS 9.
	* macwins.c (zoom_history): Add back LocalToGlobal calls
	that were deleted during attempt to carbonize the code.
	
	Replace compile target dependent use of GetWindowBounds by
	runtime testing for Mac OS 8.5 and higher. Fix bug when using
	WindowPeek by calling ShowWindow first, so that strucRgn
	always is defined.
	* macconq.c (stagger_window): Call Gestalt and get the system
	version before using GetWindowBounds. Call ShowWindow before
	WindowPeek.
	(set_standard_state): Call Gestalt and get the system version 
	before using GetWindowBounds. Call ShowWindow before
	WindowPeek.
	* macgworld.c (scroll_map_window): Call Gestalt and get the 
	system version before using GetWindowBounds. Continue with 
	the loop if IsVisible is false. 
	* macwins.c (create_game_window): Call Gestalt and get the 
	system version before using GetWindowBounds. Call ShowWindow 
	before WindowPeek.
	Call my_SetPortWindowPort so that positioning of the window
	works in all cases.
	
	Fix zooming of all windows so that it works under MacOS X.
	* macwins.c (zoom_history): Use SetWindowStandardState
	instead of WindowPeek if TARGET_API_MAC_CARBON.
	(zoom_construction): Use SetWindowStandardState
	instead of WindowPeek if TARGET_API_MAC_CARBON.
	(zoom_notice): Add call to my_GetWindowPortBounds. 
	Use SetWindowStandardState instead of WindowPeek if 
	TARGET_API_MAC_CARBON.
	(zoom_scores): Add call to my_GetWindowPortBounds. 
	Use SetWindowStandardState instead of WindowPeek if 
	TARGET_API_MAC_CARBON.
	* machelp.c (zoom_help): Use SetWindowStandardState
	instead of WindowPeek if TARGET_API_MAC_CARBON.
	* macconq.c (set_standard_state): Don't use WindowPeek 
	if TARGET_API_MAC_CARBON. Use SetWindowStandardState
	and GetRegionBounds to instead. Add a call to 
	my_GetWindowPortBounds.
	
	Generalize code for setting window standard and user states 
	on the Mac so that it works for all themes both in OS9 and OSX. 
	Fix several bugs.
	* macconq.c (set_standard_state): Scrap Platinum-specific
	hacks. Use the difference between strucRgn and winrect to
	calculate the borders for each window. Then peel off these 
	borders - 1 pixel. Use topLeft and botRight macros in the
	LocalToGlobal calls.
	(stagger_window): Remove Platinum-specific hacks. Use
	the difference between strucRgn and winrect to calculate 
	the borders for each window instead.
	(position_on_screen): Remove !TARGET_API_MAC_CARBON
	test sine this code is Carbon-compatible and necessary for
	correct staggering of windows.
	* macinit.c (init_display): Create worldmap before the
	main map to avoid white box on the latter.
	* maclist.c (create_list): Move my_SetPortWindowPort
	call to a position before stagger_window call so that 
	positioning of windows works in all cases.
	* macmap.c (create_map): Remove Platinum-specific
	hacks. Call set_standard_state followed by ZoomWindow
	instead for first_windows. Move my_SetPortWindowPort
	call to a position before this code so that positioning of
	windows works in all cases.
	* Xconq.r (WIND 130 "Map"): Move to top left corner.
	(WIND 131 "List"): Move to top left corner.
	
	Fix crashes under MacOS 8.1 due to non-existent controls
	being dereferenced.
	* maclist.c (set_list_scrollbars): Check that the scrollbars
	exist before setting them. 
	* macmap.c (adjust_map_decor): Check that the scrollbars
	exist before setting them. 
	
	Remove the obsolete fullsize_map global and its associated
	code in the preferences. Always zoom the first map to the
	standard state (full screen) instead.
	* maccolors.c (fullsize_map): Remove global int.
	* macconq.h (fullsize_map): Don't declare extern int.
	* macdefs.h (diPrefsFullSize): Remove and renumber items.
	* macmap.c (create_map): Don't check fullsize_map. 
	* macprefs.c (interp_mac_ui_data): Don't set fullsize_map.
	(ui_update_state): Don't push fullsize_map.
	(add_preferences_topic_items): Don't add diPrefsFullSize.
	(set_preferences): Don't handle diPrefsFullSize.
	(save_preferences_settings): Don't handle diPrefsFullSize.
	* Xconq.r (DITL 701 "Preferences Network Items"): Remove
	FullSize checkbox and renumber the dialog items.

	Fix so that the map window's user state is set correctly.
	* macconq.c (stagger_window): Save the user state after
	positioning the window.
	
	Remove unnecessary WindowPeek in pre-Carbon code by
	always using SetWindowStandardState (defined already in
	System 7).
	* macconq.c (set_standard_state): Don't use WindowPeek.
	Use SetWindowStandardState instead.
	* machelp.c (zoom_help): Use SetWindowStandardState 
	instead of WindowPeek.
	* macwins.c (zoom_construction): Don't use WindowPeek.
	Use SetWindowStandardState instead.
	(zoom_history): Use SetWindowStandardState instead of 
	WindowPeek.
	(zoom_notice): Use SetWindowStandardState instead of 
	WindowPeek.
	(zoom_scores): Use SetWindowStandardState instead of 
	WindowPeek.
	
	Tweak position of buttons in simple closeups so that the
	constrcution points are not obscured in Mac OSX.
	* Xconq.r (DITL 810 "Simple Closeup"): Move buttons.

2003-10-21  MA Dunzi <mniw@sol.dti.ne.jp>

	* lib/ng-japanese.g: typo.

2003-10-20  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Add 'all-kernel' dependencies to top-level makefile 
        template as a temporary measure until the interface-
        specific dependencies can be made to work properly.
        * Makefile.in: Add 'all-kernel' as a subtarget for 
        'all-tkconq', 'all-sdlconq', 'all-xtconq', and 
        'all-cconq'. Also remove commented out section for 
        'all-ximfapp'.

        Add support for compound terrain visibility effects.
        * kernel/game.h: Declare head node and array for linked 
        list of aux terrain tpes.
          (for_all_aux_terrain_types): New iterator macro. Loops 
        through linked list of all aux terrain types.
        * kernel/generic.c: Declare 'numauxttypes'. Init pointers 
        for aux terrain lists to NULL, since the proper functoning 
        of the code relies on this.
          (disallow_more_terrain_types): Allocate array for aux 
        terrain types linked list.
          (count_terrain_subtypes): Add support for counting up 
        'numauxttypes' and building the linked list of all aux 
        terrain types.
        * kernel/side.c: Implement compound terrain visibility 
        effects.
          (see_cell): Compute compound visibility effect.
          (test_for_successful_viewer): Likewise.
        * kernel/table.def: Change max value for ut_visibility from 
        100 to TABHI.

        Fix up games that use 'visibility' table and which have units 
        that set their visibility to != 100% for all terrain types, 
        including aux terrains which may be present.
        * lib/russian-rev.g: Make terrorists ('t') have 100% 
        visibility on aux terrain types. This will multiply with their 
        10% visibility on cell terrain types to yield a net visibility 
        of 10%.
        * lib/u-bellum.g: See lib/ChangeLog-bellum for details.

2003-10-19  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Finish cleaning Tcl/Tk related things out of x11 dir.
        * x11/Makefile.in: Remove commented out sections.
        * tcltk/Makefile.in: Transplant comment from x11 
        makefile template. Transplant 'LIB_INSTALL_DIR' and 
        'LIB_RUNTIME_DIR' from x11 makefile template. Add 
        'TCL_DL_LIBS' to 'TCLTK_LIBS'.

2003-10-19  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Create directory hierarchy for substitute function 
        implementations. Dump off a substitute snprintf and 
        vsnprintf implementation. I will hook it into the 
        Xconq configure and build system in the times to come.
        Implementation is provided and maintained by Mark 
        Martinec (http://www.ijs.si/software/snprintf/) 
        (http://mailman.ijs.si/listinfo/snprintf-announce). 
        Software is under Frontier Artistic License, but is 
        allowed to be distributed under GPL. Thanks Mark.
        * missing: New directory.
        * missing/snprintf: New directory.
        * missing/snprintf/with_autoconf: New directory. This 
        will eventually disappear once its contents have been 
        merged into Xconq, as appropriate.
        * missing/snprintf/INSTALL: New file.
        * missing/snprintf/LICENSE.txt: New file.
        * missing/snprintf/README: New file.
        * missing/snprintf/README.html: New file.
        * missing/snprintf/snprintf.c: New file. Provides C99- 
        compliant usage. Provides portable implementations of 
        snprintf(3), vsnprintf(3), asprintf(3), vasprintf(3), 
        asnprintf(3), and vasnprintf(3), though the last four 
        use dynamic allocation and hence should probably be 
        avoided.
        * missing/snprintf/snprintf.h: New file. Provide 
        prototypes for above.
        * missing/snprintf/test.c: New file. Provide testing of 
        implementation and some benchmarking/profiling.
        * missing/snprintf/with_autoconf/*: New files: acconfig.h, 
        aclocal.m4, config.guess, config.h.in, config.sub, 
        configure, configure.in, INSTALL, install-sh, LICENSE.txt, 
        ltconfig, ltmain.sh, Makefile.am, Makefile.in, missing, 
        mkinstalldirs, stamp-h.in, and working.in. These files 
        provide autoconf, autoheader, automake, and libtool support; 
        the Xconq project may wish to loot some of these in the 
        process of modernizing the configure and build systems. 
        Parts may of these files may be integrated directly to 
        provide better snprintf support in Xconq. These all should 
        disappear over time as they are absorbed into Xconq. 
        Additional autoconf functions may be needed from Caolan 
        McNamara (http://www.csn.ul.ie/~caolan/publink/autoconf).

2003-10-19  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Fix formatting of previous patch to aclocal.m4. Give 
        the configure system another hope of finding the Tcl 
        headers. Filter common includes search paths from 
        'TCL_INCLUDE_SPEC'.
        * aclocal.m4
        * configure: Regenerated.

2003-10-19  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Finish adding and reworking MinGW32 support under Cygwin.
        * configure.in: Uncomment "personality" iterator for 
        stucture and function tests. Mention to user why the 
        tests are being run a second time when MinGW32 is present 
        under Cygwin. Make the NEED_* macros be defined in 
        'HFLAGS' or 'ALT_HLFAGS' rather than 'CFLAGS'. Add 
        'ALT_HOBJS' variable.
        * Makefile.in (all-tkconq): Remove 'all-kernel' from 
        target list. Better to let the interface makefiles 
        hit this target since they know about any special flags 
        that need to be passed.
        * curses/Makefile.in: Remove conditional building of 
        libconq.a and libconqlow.a. Let the kernel makefile 
        decide.
        * x11/Makefile.in: Likewise.
        * tcltk/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise, and for libconq_mw32.a and 
        libconqlow_mw32.a. Add 'scoresdir' variable to be used 
        with custom flags passed to kernel make. Hit the 
        'mw32-prep' target in the kernel makefile before building 
        the mw32 kernel libs.
        * kernel/Makefile.in: Add 'MW32_OBJS' and 'MW32_LOBJS' 
        variables, which are just 'OBJS' and 'LOBJS' with a special 
        extension denoting MinGW32-specific linker objects. Also 
        place "loud" notices above the start of the 'OBJS' and 'LOBJS' 
        definitions to make sure that their new counterparts get 
        updated if they are updated. Add 'ALT_HOBJS' variable. 
        Remove 'clean-objs' and 'clean-kobjs' targets and all 
        references to them.
          (mw32-prep): New target. Make working MinGW32 copies of all 
        regular sources in the kernel directory.
          (clean): Make sure that the working MinGW32 copies of the 
        sources get wiped away during a clean.
        * kernel/.cvsignore: Add working MinGW32 copies of the sources 
        to list of files to be ignored by CVS.

        Help the configure system be more intelligent about finding 
        Tcl/Tk headers and libraries.
        * aclocal.m4: Substitute 'TCL_INCLUDE_SPEC' for the benefit of 
        systems that keep all the Tcl/Tk headers in subdirs which are 
        not part of the standard includes search paths. Should probably 
        filter out those 'TCL_INCLUDE_SPEC' values which correspond to 
        standard includes search paths to prevent any <> vs. "" 
        problems. Add 'TCL_LDFLAGS' and 'TK_LDFLAGS', and try to find 
        some useful libs if 'TCL_LIB_SPEC' and 'TK_LIB_SPEC' are left 
        unassinged by their respective *Config.sh files.
        * tcltk/Makefile.in: Remove unused, always unbound '@TCLHDIR@' 
        and '@TKHDIR@' macro expanders. Use the '@TCL_INCLUDE_SPEC@' 
        macro expander with 'TCL_CFLAGS'. Allow 'TK_CFLAGS' to 
        continue its dubious usage of '@TK_BUILD_INCLUDE@', which 
        really only makes sense in the case of a Tcl/Tk build local to 
        Xconq. Add new variables 'TCL_LDFLAGS' and 'TK_LDFLAGS' which 
        replace 'TCL' and 'TK'; use the new '@TCL_LDFLAGS@' and 
        '@TK_LDFLAGS@' macro expanders with these variables.
        * configure: Regenerated.

2003-10-18 Hans Ronne <hronne@comhem.se>

	Fix search path bug for the MacTCL IMFApp.
	* tkiapp.c (ui_init): Untangle Mac and non-Mac code. First
	assume that IMFApp is in the xconq top directory and search
	in :tcltk, then look in other loactions on the Mac.

2003-10-18 Hans Ronne <hronne@comhem.se>

	Make sure that changes in unit supplies respect the capacity 
	limit set by um_storage_x. Fix several other bugs in the 
	material distributing code. Note: supply overflow is still
	permitted in run_economy since the distribution code relies
	heavily on it. Should figure out what to do about this. Should
	also check the code in supply.c for overflow.
	* actions.c (do_produce_action): Clip to storage before and
	not after incrementing supply, to prevent overflow. Try to
	distribute the excess amount, and then fill up the producer
	again.
	(do_extract_action): Clip to storage before and not after 
	incrementing supply, to prevent overflow. Try to distribute 
	the excess amount, and then fill up the extractor again.
	(check_create_common): Clip to storage when calculating
	what can be moved from the treasury to creator. Add check
	that we can store enough materials to create the new unit.
	(do_create_in_action): Add test for storage space and 
	run_warning.
	(do_create_at_action): Add test for storage space and 
	run_warning.
	(check_build_action): Clip to storage when calculating
	what can be moved from the treasury to builder. Add check
	that we can store enough materials to build the new unit.
	(do_build_action): Add test for storage space and 
	run_warning.
	(do_alter_cell_action): Clip to storage before and not 
	after incrementing supply, to prevent overflow. Try to
	distribute the excess amount, and then fill up unit2 again.
	(do_remove_terrain_action): Clip to storage before and 
	not after incrementing supply, to prevent overflow. Try to
	distribute the excess amount, and then fill up unit2 again.
	* run.c (run_advanced_units): Only do conversion if there
	is room for the new material.
	* task.c (set_build_task): Clip salvaged materials to the
	storage space.
	* run2.c (try_transfer_aux): Divide instead of multiply
	by 4 to avoid numeric overflow. Rewrite + 8 / 9 formula 
	to avoid overflow. Add commented out run_warning calls
	for overflow. 
	(run_economy): Clip to TABHI where necessary to avoid
	serious overflow. Note: it would be better to abolish all
	overflow, but this code relies on overflow to drive the
	distribution of materials.
	
	Fix apparent bug in the survival_time code.
	* run2.c (survival_time): Don't add already consumed
	materials this turn to tmp.
		
	Fix bug in building material salvaging code.
	* task.c (set_build_task): Change u2 to u in salvage code.
	(push_build_task): Change u2 to u in salvage code.

	Improve material distribution code by testing in give_away
	instead of for distribute_material for positive amt, so that
	the stack loops can execute until we run out of material.
	* actions.c (give_away): Return if amt is not positive.
	(distribute_material): Don't test if amt is positive before
	calling give_away or starting a loop. Break out of the loop
	instead when amt reaches zero. Change for_all_stack call
	to for_all_stack_with_occs.
	
	Fix absurd case where one side's unit could use another side's
	units to resupply itself by making extraction from independent 
	units work only if there is no indepside in the game.
	* actions.c (check_extract_action): Always check that
	g_no_indepside_ingame is true before plundering units.
	(do_extract_action): Check that g_no_indepside_ingame
	is true.
	* unit.c (can_extract_at): Check g_no_indepside_ingame
	before plundering independent units.
	
	Improve extraction code so that the extract action works also
	if the combined amount of material in terrain and independent 
	units is enough.
	* actions.c (check_extract_action): Compute total amount of
	material that is available and return A_ANY_OK if enough.
	(do_extract_action): Rewrite. Call extract_one_round, then
	distribute_material if necessary, and then extract_one_round
	once again.
	(extract_one_round): New function and prototype. Collects
	material from all possible sources until we have enough.
	
	Fix so that materials are consumed only if a creation or build
	actions are successful.
	* actions.c (do_create_in_action): Move materials checking 
	code and run_warning to the beginning. Consume materials 
	only after the unit has been created. 
	(do_create_at_action): Move materials checking code and 
	run_warning to the beginning. Consume materials only after 
	the unit has been created.
	(do_build_action): Consume materials only after the build 
	step, in a separate mtype loop.

	Put an upper limit on the treasury size for each mtype and
	check this limit when adding stuff to the treasury. Also fix 
	several other bugs in the material handling code.
	* gvar.def (g_treasury_size): New gvar. Set to VARHI by 
	default. Note: should really implement this as an mtype
	property instead, after making them long.
	* actions.c (transfer_supply): Comment out code that puts
	excess material in the treasury. Just transfer the smaller
	amount instead. However, add check of m_treasury_size to
	the commented out code.
	(do_create_in_action): Check that the treasury has enough
	material if used and trigger the run_warning if it does not.
	Further, abort creation and return A_ANY_ERROR instead
	of allowing it to proceed. Don't consume the creator supply
	if creation was aborted.
	(do_create_at_action): Check that the treasury has enough
	material if used and trigger the run_warning if it does not.
	Further, abort creation and return A_ANY_ERROR instead
	of allowing it to proceed. Finally, fix serious bug that made
	creation free due to missing line that should decrement the
	creator's supplies.
	(do_build_action): Don't consume the builder's supply if 
	building was aborted.
	* run.c (run_side_research): Make rp and maxrp long in
	case the treasury has accumulated more than TABHI of m. 
	Init maxrp to VARHI.
	(give_all_to_treasury): Don't transfer more material
	than there is room for in the treasury.
	(run_advanced_units): Don't transfer more material
	than there is room for in the treasury. Remove hardcoded
	TABHI check. Use check for remaining space instead.
	(run_population): Loot the treasury a second time between
	feeding and growth.

	Add Peter Garonne's material capacity code (modified). 
	Fix some bugs in the exisiting materials display code and 
	add support for font preferences.
	* conq.h (format_number): New prototype.
	* nlang.c (format_number): New function.
	* side.c (side_material_supply): New function.
	(side_material_production): New function.
	(side_material_storage): New function.
	* side.h (side_material_supply): New prototype.
	(side_material_production): New prototype.
	(side_material_storage): New prototype.
	* tkmain.c (update_side_display): Check nummtypes
	before calling update_material_display.
	(update_material_display): Rewrite so that it calls the
	above functions in side.c and nlang.c instead.
	* tkconq.tcl (fill_in_unit_type_list): Add capacity text
	tags. Tweak positions of all tags and add separate tags for
	each header so that it can be positioned properly.
	(update_unitlist_capacity): New procedure.
	(ok_preferences): Add code for setting the new font in 
	the materials list.

	Make base_production available to the material display 
	code so that occupants are handled correctly.
	* run2.c (base_production): Move function to unit.c.
	* unit.h (base_production): Prototype extern.
	* unit.c (base_production): Move function here.
	
	Reduce the risk for numeric overflow in side treasuries by 
	making them long instead of short. Note: should really make
	mtype properties in general long to handle supply overflow
	in idividual units.
	* side.c (create_side): xmalloc treasury as long.
	* side.h (Side): Declare treasury as long.
	* read.c (interp_treasury_list): New function and prototype. 
	Clone of interp_mtype_value_list with long arr arg.
	(fill_in_side): Call interp_treasury_list instead in case 
	K_TREASURY.
	* write.c (write_treasury_list): New function and prototype. 
	Clone of write_mtype_value_list with long arr arg.
	(write_side_properties): Call write_treasury_list instead
	for key K_TREASURY.
	
	Fix bug that caused units that were not inside_area to be 
	counted as real units.
	* side.c (num_units_incomplete): Test for in_play 
	instead of alive.

	Fix bug in Windows version checking for GDI support.
	* tkwin32.c (check_windows_version):Explicitly set
	dwOSVersionInfoSize to sizeof(OSVERSIONINFO).

	Fix bug in Windows terrain transition drawing code.
	* tkmap.c (draw_terrain_transitions): Don't draw mask
	offset 1 pixel. Note: this fixes bug with the terrain images, 
	but reintroduces a minor glitch with solid colors. Should
	figure out some other solution to the pixel offset problem.

	Fix strange bug that sometimes caused saved files 
	on the Mac to acquire the "Essential" Finder label.
	* mac.c (open_file): Don't declare and initialize 
	FInfo *finfo to NULL. Declare FInfo finfo instead.
	(open_scorefile_for_writing): Ditto.
	
	Fix so that deletion of old checkpoint files works 
	in the Mac PPC and Mac TCL interfaces.
	* mac.c (remove_file): Add content (a call to FSpDelete) 
	to this dummy function.

	Fix redundancy in make_trial_assignments code.
	* init.c (make_trial_assignments): Remove redundant
	test for indepside->ingame.
	
	Fix bug in the description of collection tasks.
	* nlang.c (task_desc): Change (arg0, arg1) to (arg1, arg2)
	in case TASK_COLLECT.

	Simplify descriptions of develop tasks.
	* nlang.c (task_desc): Tweak output for TASK_DEVELOP.

	Add description of toolup status in build tasks.
	* nlang.c (task_desc): Add code that handles toolups in 
	case TASK_BUILD.

	Fix typo in the tcl code.
	* tkconq.tcl (sdtfont): Change to stdfont everywhere.
	
	Fix Linux compiler warning.
	* tp.c: Trim the end of the file.
	
2003-10-18  Eric McDonald  <mcdonald at phy dot cmich dot edu>

        Help the configure system find the Tcl/Tk config scripts on 
        a Debian system. (Issue reported by Peter Garrone.)
        * aclocal.m4: Add checks for tclConfig.sh in 
        /usr/lib/tcl[7-9]* and tkConfig.sh in /usr/lib/tk[7-9]*.
        * configure: Regenerated.

2003-10-15  Jim Kingdon  <kingdon@panix.com>

	* Makefile.in (all-tkconq): Depend on all-kernel.
	* kernel/Makefile.in (libconq.a): Don't depend on clean-kobjs.
	(libconqlow.a): Don't depend on clean-lobjs.

2003-10-15 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Remove an item from the TODO list for the next release.
        * doc/TODO: Remove item about unpacking/install intructions 
        for Windows Xconq.

        Make some documentation corrections.
        * doc/refman.texi: Explicitly mention TABHI and PROPHI so 
        that they can be referred to in the documentation. Correct 
        table 'scuttle-chance' to be TableUU instead of TableUT.
        Correct 'hit-falloff-range' to be UnitPropertyType 
        rather than TableUU. Correct table 'mp-to-enter-unit' and 
        remove commentary after table 'mp-to-leave-unit' to reflect 
        that the transport is NOT, in fact, penalized any MP 
        from these tables (thanks Michael S. Jones for finding this 
        one). 

2003-10-13 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Fix the code dealing with hit-falloff-range.
        * kernel/combat.c (maybe_hit_unit): Old code was simply 
        wrong on several counts: (a) it failed to take into 
        account fire-hit-chance as an alternative to hit-chance, 
        (b) it clobbered the previously computed hit chance, 
        (c) it calculated a value it never used, and (d) the 
        actual interpolation was not correct. The new code 
        addresses these issues and provides additional 
        safeguards. Tested using hacked 'bomber' units from 
        lib/ww2-div-eur.g: 'range' = 60, 'hit-falloff-range' = 
        0, and 'hit-at-max-range-effect' = 0% against all utypes.

2003-10-12 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Fix small error in the X11 makefile template.
        * x11/Makefile.in (install-imfconvs-only): Change 2nd 
        'chown' to 'chgrp'.

        Update unit display after a capture.
        * kernel/combat.c (capture_unit): After a unit has 
        garrisoned some of its strength in the captured unit, 
        refresh the display of the unit stats.

        Numerous changes and tweaks to Bellum Aeternum. See 
        lib/ChangeLog-bellum for details.

2003-10-09 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Add more paths for imfapp to search for its Tcl scripts.
        * tcltk/tkiapp.c (ui_init): Also look in 
        '../share/xconq/tcltk', 'tcltk', and '.'. Make "ximfapp" 
        aware that it is now called "imfapp".

        Prep configure system for improvements in its Cygwin 
        testing.
        * configure.in: Add (commented out) loop for Cygwin to 
        be tested with both its normal personality and its 
        strict Mingw32 personality.
        * configure: Regenerated from configure.in.

2003-10-08 Eric McDonald <mcdonald at phy dot cmich dot edu>

	Add config tests and append defines to CFLAGS accordingly.
	* configure.in: Test for struct timeval, gettimeofday(2), 
	snprintf(3), and vsnprintf(3), and set corresponding 
	'NEED_' macros if necessary.
	* configure: Regenerate from configure.in.

2003-10-07 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Update the various .cvsignore files.
        * tcltk/.cvsignore: Remove old executable names. Add new 
        executable names.
        * sdl/.cvsignore: Likewise.
        * curses/.cvsignore: Likewise.

        Make sure that only xconq[.exe] is being installed setuid; 
        the x11 apps and imfapp should not be. Also make sure 
        these programs are being chowned to the specified gameuser 
        and gamegroup.
        * x11/Makefile.in: Add IAPPPERM for the x11 image apps.
        Chown, chgrp, and chmod xshowimf, x2imf, imf2x with 
        appropriate values during install.
        * tcltk/Makefile.in: Add IAPPERM and chmod imfapp to these 
        permissions instead of GAMEPERM.

        Remove Tcl/Tk from build flags in x11 makefile template.
        * x11/Makefile.in: Remove Tcl and Tk search paths, as 
        xtconq does not need them.

        Clean up Tcl/Tk makefile template.
        * tcltk/Makefile.in: Comment out SelFile related things 
        since Tcl/Tk has its own file selection dialog. Get rid of 
        erroneous 'x11srcdir' variable and use fixed relative paths 
        instead. Why? Because, in theory, one should be able to 
        build Xconq in different dir hierarchy than the source dir 
        hierarchy.

        Update "first sight" text docs.
        * INSTALL: Rip out references to Win32 things, since they are 
        now addressed in INSTALL-win. Mention other interfaces beside 
        Tcl/Tk. Add xconq7 list address in a "contacts" section at 
        the end.
        * README: Change welcome message to include '7.5 Prerelease' 
        instead of '7.4'.
        * README-win: Do not assume that xconq.exe is in the 'bin' 
        subdir. Change reference to 'doc-html' dir to 'html' dir.

        Update Xconq's RPM spec file.
        * xconq.spec: Change version and release number to reflect 
        new prerelease RPM naming scheme. Update 'Source0' to 
        reflect the name of the archive the latest RPM's were built 
        from. Change 'ximfapp' to 'imfapp' in package manifest.

2003-10-06 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Simplification and enhancement of the Xconq configury and 
        build system.
        * configure.in: Remove commented out 'ALL_CFLAGS' assigment.
        Add 'SDL_CONFIG' variable and assign path of 'sdl-config' 
        program, if detected, else none. Add commented out checks 
        for struct timeval and gettimeofday(2); will finish 
        implementing after some more research and thought. Add more 
        platform redirector variables: PLATFORM_XCONQ_OBJS, 
        PLATFORM_IMFAPP_OBJS, PLATFORM_XCONQ_TARGETS, 
        PLATFORM_IMFAPP_TARGETS, PLATFORM_ALL_TARGETS, and
        PLATFORM_INSTALL_TARGETS. If 'SDL_CONFIG' has a path, then 
        assign 'SDL_LIBS' and 'SDL_CFLAGS' by running it; still need 
        to disable the SDL build, if 'SDL_CONFIG' is none. Remove 
        compile flags from the cygwin32 case of 'ALT_HFLAGS'; SDL 
        configuration provides appropriate build flags. Comment out 
        old 'SDL_LIB' variable; it is no longer used. Change shell 
        style comments to m4 style comments, just to be safe. Set 
        default X11 app-defaults dir based on host.
          (enable-alternate-x11-app-defaults-dir): New option. Set 
        the path to X11 app-defaults dir.
        * configure: Regenerated from configure.in.
        * Makefile.in: Remove commented out sections. 
        Remove 'all-kernel' from subtargets of the master build 
        targets, because kernel subtargets exist in each of the 
        individual interface makefiles and these ensure that proper 
        compile flags are being passed to build the kernel libs. Use 
        new '@x11_app_defaults_dir@' macro expander.
          (all-tkconq): Tell interface to target 'all-xconq' instead of 
        '$(ALLTARGET)' since 'all-wconq' is dead.
          (all-sdlconq): Likewise.
          (install-tkconq): Likewise.
          (install-sdlconq): Likewise.
        * curses/Makefile.in (KERNEL_LIB): Only make lib if it has not 
        been built.
          (LOW_LIB): Likewise.
          (install-cconq): Install either cconq or cconq.exe depending 
        on what got built. (Should eventually change to xconq for 
        consistency.)
          (clean): Remove *.exe along with other things.
        * x11/Makefile.in: Use new '@x11_app_defaults_dir@' macro 
        expander.
          (KERNEL_LIB): Only make lib if it has not been built.
          (LOW_LIB): Likewise.
        * tcltk/Makefile.in: Declare platform-specific sets of 
        XCONQ_OBJS, IMFAPP_OBJS, XCONQ_TARGETS, IMFAPP_TARGETS, 
        ALL_TARGETS, and INSTALL_TARGETS. Remove commented out cruft. 
          (all-xconq): Unified build for Unix and Win32 platforms.
          (xconq): Likewise.
          (imfapp): Likewise.
          (all-wconq): Remove.
          (wconq): Remove.
          (wimfapp): Remove.
          (KERNEL_LIB): Only make lib if it has not been built.
          (LOW_LIB): Likewise.
          (install-xconq-only): Install either xconq or xconq.exe 
        depending on what got built.
          (install-imfapp-only): Install either imfapp or imfapp.exe 
        depending on what got built.
          (install-wconq): Remove.
          (install-wconq-only): Remove.
          (install-wimfapp-only): Remove.
        * sdl/Makefile.in: Add 'W32API_LIBS' to supplement mingw32 
        build. Comment out old 'SDL_LIB'. Add 'SDL_CFLAGS' and 
        'SDL_LIBS' and get their values from macro expanders of the 
        same name. Add 'KERNEL_MW32_LIB' and 'LOW_MW32_LIB'. Hack 
        appropriate kernel and low libs into platform-specific libs 
        vars as appropriate. Declare platform-specific sets of 
        XCONQ_OBJS, XCONQ_TARGETS, ALL_TARGETS, and INSTALL_TARGETS.
        Add platform redirectors: PLATFORM_CFLAGS, PLATFORM_INCLUDES, 
        PLATFORM_LDFLAGS, PLATFORM_LIBS, PLATFORM_XCONQ_OBJS, 
        PLATFORM_XCONQ_TARGETS, PLATFORM_ALL_TARGETS, and 
        PLATFORM_INSTALL_TARGETS. Set 'HFLAGS' to the '@ALT_HFLAGS@' 
        macro expander.
          (KERNEL_MW32_LIB): Tell special mingw32 kernel lib to be 
        built.
          (LOW_MW32_LIB): Tell special mingw32 low lib to be built.
          (all-xconq): Unified build for Unix and Win32 platforms.
          (xconq): Likewise.
          (all-wconq): Comment out.
          (wconq): Comment out.
          (install-wconq): Remove.
          (install-wconq-only): Remove.
          (install-xconq): Unified install for Unix and Win32.
          (install-xconq-only): Install either xconq or xconq.exe 
        depending on what got built.
        * kernel/Makefile.in (libconq.a): Invoke 'clean-kobjs' 
        subtarget.
          (libconq_mw32.a): New target. Build mingw32 kernel lib.
          (libconqlow.a): Invoke 'clean-lobjs' subtarget.
          (libconqlow_mw32.a): New target. Build mingw32 low lib.
          (clean-kobjs): New target. Remove kernel obj files.
          (clean-lobjs): New target. Remove low lib obj files.

        Help Win32 apps build if some time-related things are not 
        defined.
        * kernel/win32.c: Define struct timeval and gettimeofday(2) 
        if necessary.
        * kernel/util.c: Make sure struct timeval gets defined in 
        mingw32 mode if necessary.

        Windows build and install documentation.
        * INSTALL-win: New file. Revision of file submitted by 
        Juergen Ruehle. Thanks Juergen. 

2003-10-06 Hans Ronne <hronne@comhem.se>

	Fix bug in the checkpoint files preferences on all platforms
	by separating checkpoint_interval from want_checkpoints
	also in the kernel.
	* conq.h (want_checkpoints): Declare extern int.
	* run2.c (want_checkpoints): Initialize to FALSE.
	(checkpoint_interval): Initialize to 0.
	(save_checkpoint): Also test for want_checkpoints.
	* macprefs.c (interp_mac_ui_data): Set want_checkpoints.
	(ui_update_state): Update want_checkpoints.
	(set_preferences): Also toggle diPrefsInterval on and off
	when toggling diPrefsCheckpoint.
	(add_preferences_topic_items): Set diPrefsCheckpoint
	from want_checkpoints instead of checkpoint_interval.
	Toggle diPrefsInterval on or off depending on the value of 
	diPrefsCheckpoint.
	(save_preferences_settings): Don't test for itemnum != 0 
	when setting checkpoint_interval.
	* tkmain.c (tk_save_prefs): Save want_checkpoints.
	(ui_update_state): Update want_checkpoints.
	(interp_unix_ui_data): Set want_checkpoints.
	
	Minor fixes to the Mac PPC Preferences dialog.
	* Xconq.r (MENU 700 "Preferences Popup"): Change
	"Network" to "Network & Files".
	(DITL 701 "Preferences Network Items"): Tweak item
	positions. Change "Game Statistics" to "Statistics".

2003-10-05 Hans Ronne <hronne@comhem.se>

	Patch from Peter Garrone (modified) that lists materials 
	supplies and production capacities at the bottom of the unit 
	list pane.
	* tkmain.c (tk_nummtypes): New TclCmdFn and prototype.
	(tk_m_image_name): New TclCmdFn and prototype.
	(update_material_display): New function and prototype.
	(update_side_display): Call update_material_display.
	* tkconq.tcl (list_icon_size): Change to utype_icon_size.
	(mtype_icon_size): New global. Initialize to 16.
	(create_map_window): Add new code for computing the
	listwinheight based on the number of utypes and mtypes.
	(fill_in_unit_type_list): Rewrite. Add code for drawing
	material info at the end of the list.
	(update_unitlist_material): New tcl procedure.
	(update_unitlist_supply): New tcl procedure.
	(update_unitlist_production): New tcl procedure.
	
	Remove debugging hack that sneaked in with the last commit.
	* tkiapp.c (ui_init): Remove Tk_MakeWindowExist call.

2003-10-05 Hans Ronne <hronne@comhem.se>

	Fix Mac OSX save file dialogs so that the file type and creator 
	is set correctly for saved files. Add code for replacing existing
	files and for setting the default directory and file name in the
	dialog.
	* macconq.c (initial_vrefnum): Don't declare here.
	(initial_dirid): Don't declare here.
	* macconq.h (initial_vrefnum): Declare extern short.
	(initial_dirid): Declare extern long.
	* macmenus.c (save_the_game): Rewrite so that it works. 
	Add OSType fileType and init to 'TEXT'. Add OSType creatorType 
	and init to XconqSignature. Pass these OSTypes instead of raw 
	data to NavPutFile. Call AEGetNthDesc instead of AEGetNthPtr 
	so that AEDesc loc is set correctly. Add calls to BlockMoveData,
	FSpDelete, FSpCreate and NavCompleteSave that are needed to
	handle replace file cases and complete the save operation. Add
	FSMakeFSSpec call that sets the directory to initial_vrefnum.
	Set options flags and savedFileName correctly.
	* macdesign.c (designer_save_dialog): Rewrite as above, but
	break instead of return on errors.
	* mac.c (initial_vrefnum): Initialize here.
	(initial_dirid): Initialize here.
	(statistics_filename): Rewrite as above, but set the creator 
	to 'ttxt' instead of XconqSignature.
	* imfapp.c (save_imf_dir_file): Rewrite as above, but set
	the creator to 'ttxt' instead of XconqSignature, set file name
	to "imf.dir" and use the current directory.
	(save_imf_file): Rewrite as above, but set the creator to 
	'ttxt' instead of XconqSignature, set the name to "images.imf" 
	and use the current directory.
	(save_resource_file): Rewrite as above, but set the creator 
	to 'RSED' instead of XconqSignature, the file type to 'rsrc', 
	the file name to "images.imf Images" and use the current 
	directory.

	Fix Mac file code so that correct creators and file types are 
	set also when files are saved without a dialog.
	* mac.c (open_file): Add code that sets creator and file type
	whenever a file is written or appended to. Set creator to
	XconqSignature for playable files and to 'ttxt' for other files.
	(open_scorefile_for_writing): Add code that sets the creator 
	to 'ttxt'.

	Give checkpoint files turn numbers in the Mac interface, 
	similar to the Unix and Windows interfaces.
	* mac.c (checkpoint_filename): Rewrite so that it works
	like in the other interfaces.

2003-10-04 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Patch from Peter Garrone (modified). Tabulate how units use 
        each material in the help node of each material.
        * help.c (dump_material_unit_summary): New function definition.
        Provide properly formatted output for reporting functions.
          (describe_mtype): Report entries from um_base_production, 
        um_base_consumption, um_storage_x, um_consumption_as_occupant, 
        um_occ_production, um_acp_to_extract, um_to_act, um_to_move, 
        um_to_attack, um_to_fire, um_consumption_per_move, 
        um_consumption_per_attack, um_consumption_per_fire, 
        um_to_create, um_to_build, um_consumption_on_creation, 
        um_consumption_per_build, um_to_repair, 
        um_consumption_per_repair, um_outlength, um_inlength, 
        um_initial, and um_storage_x.
          (describe_ttype): Report entries from ut_mp_to_enter, 
        ut_mp_to_leave, ut_attack_terrain_effect, 
        ut_defend_terrain_effect, ut_vanishes_on, and ut_wrecks_on.

        Patch from Peter Garrone. Make unit list display the shortest 
        names for a given unit type.
        * unit.c (shortest_unique_name): If another short name is not 
        present, then ask to display unit char.

        Patch from Peter Garrone (modified). Properly escape an escaped 
        backslash for Tcl/Tk.
        * tkmain.c (init_unit_type_list): Expand '\\' to "\\\\" and call 
        eval_tcl_cmd with a string instead of a char.

        Thanks Peter.

2003-10-03 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Move Bellum Aeternum entries from this ChangeLog to a dedicated 
        change log file.
        * ChangeLog: Remove Bellum-related entries.
        * lib/ChangeLog-bellum: New file. Receive transplant of Bellum 
        entries.

2003-10-01 Hans Ronne <hronne@comhem.se>

	Update the pre-release version date.
	* version.h (VERSION): Change to October 2003.

	Fix crashes on Windows ME and below due to built-in limit in
	the GDI resource memory. Set the poor_memory flag on these
	platforms and restrict the graphics by eliminating unseen fuzz,
	terrain transitions and all terrain images except for power 4
	and 5 images. Also limit the number of subimages to 3 in these
	cases.
	* imf.h (poor_memory): Declare extern short.
	(Image): Add short isterrain flag.
	* imf.c (poor_memory): Initialize to false by default.
	(interp_image): Limit the number of terrain subimages to 
	3 if poor_memory is true. Set img->isterrain to true in case
	K_TERRAIN.
	(best_image): Skip all basic terrain images except power 4 
	and 5 images if poor_memory is true.
	(write_imf): Write K_TERRAIN if img->isterrain is true.
	* ui.c (describe_imf): Handle img->isterrain flag.
	* tkimf.c (tk_interp_image): Skip all basic terrain images
	except power 4 and 5 images if poor_memory is true. Also 
	skip all terrain patterns if use_clip_mask is false since they 
	are not supported yet on Windows.
	* tkinit.c (init_other_images): Don't init generic_transition 
	and generic_fuzz if poor_memory is true. Further, don't init 
	generic_fuzz if the terrain is already visible.
	* tkmap.c (draw_map_overhead): Don't call draw_unseen_fuzz
	or draw_terrain_transitions if poor_memory is true.
	* tkwin32.c (check_windows_version): New function and
	prototype that sets poor_memory on Windows ME and below.
	(WinMain): Call check_windows_version.
	* terrain.imf (terrain): Set this flag for all non-connection
	non-border non-tile terrain images. 
	
	Fix display glitch for terrain transitions when drawing solid 
	color terrain on Windows. Note: this is a hack. Should figure 
	out why the pixels don't line up correctly.
	* tkmap.c (draw_terrain_transitions): Draw both the mask 
	and the image one extra time offset 1 pixel vertically.
	
	Fix bug in the Mac PPC interface that caused side emblems 
	to be misplaced at low magnifications when using the generic 
	unit images (boxes) instead of uimg.
	* macdraw.c (draw_unit_image): Use sw and sh instead of
	uimg->w and uimg->h in emblem position tweaking code.

2003-09-29 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Fix bug in the 'disband' action.
        * actions.c (check_disband_action): Remove test for whether 
        type has sufficient ACP to perform the action. What matters 
        is whether the unit itself actually has the ACP.

        Add platform flags to simplify the build machinery for the 
        Tcl/Tk and SDL interfaces on Unix and Win32.
        * tcltk/Makefile.in: Rearrange flags and make rules to take 
        advantage of the platform flags.
        * sdl/Makefile.in: Likewise. (Rearrangement unfinished 
        though.)

2003-09-27 Hans Ronne <hronne@telia.com>

	Overhaul of the font system in the tcltk interface. Make all fonts
	except the map font user settable. Add full font specifications for 
	all displayed text items. Add several new fonts that are derived
	from the user settable stdfont. Make sure all dialogs scale with
	font size by setting pack propagate to true.
	* tkconq.tcl (stdfont): Change fixed font to textfont everywhere.
	(bigfont): Change fixed font to boldfont everywhere.
	(textfont): Rename user-settable font to stdfont.
	(bigfont): New font. Make 2 point larger than stdfont.	 
	(titlefont): New font. Bold and 2 point larger than stdfont.
	(hugefont): New font Bold and 3 times the size of stdfont.
	(mapfont): New fixed font used only for the map.
	(prefs): Change default font_size to 9 under Windows.
	(popup_splash_screen): Set all fonts from prefs(font_family)
	and prefs(font_size).
	(add_new_game_dialog_items): Use titlefont for Xconq title.
	(add_variants_dialog_items): Use titlefont for title. Add pady 2
	for checkboxes.
	(add_world_size_dialog_items): Set fonts for all text items.
	(add_real_time_dialog_items): Set fonts for all text items.
	(add_player_dialog_items): Use titlefont for titles and change
	text to upper case. Tweak text tag positions. Use bigfont for the
	listed sides. Set boldfont for all labels and buttons.
	(popup_indepside_config): Change pack propagate to true. Set
	boldfont for all text items. Add padx 6 for lab1.
	(popup_chat): Set sdtfont for text entry items and listbox.
	(create_map_window): Set all fonts from prefs(font_family)
	and prefs(font_size). Use mapfont for mainfont and featurefont
	in the map.
	(popup_contour_interval_dialog): Set pack propagate to true.
	Set fonts for all text items.
	(popup_meridian_interval_dialog): Set pack propagate to true.
	Set fonts for all text items.
	(adjust_map_font_sizes): Use mapfont instead of bigfont to
	set mainfont and featurefont.
	(ask_bool_mode): Set pack propagate to true. Set boldfont for
	buttons and labels.
	(popup_find_dialog): Set pack propagate to true. Set boldfont 
	for buttons and labels and stdfont for text entry.
	(popup_research_dialog): Add padx 15 for .research.bottom.
	Set boldfont for buttons and labels and stdfont for listbox.
	(popup_scores): Set boldfont for button and stdfont for text.
	(popup_preferences_dialog): Set pack propagate to true and
	chnage padx to 8 for prefs.main.v.
	(add_map_prefs_items): Set boldfont for menus and buttons.
	Add pady 2 for checkboxes.
	(add_fonts_prefs_items): Set boldfont for all buttons. Add
	several mroe font sizes to the popup menus. Tweak size of
	the sample text widget.
	(add_files_prefs_items): Set boldfont for checkboxes and 
	labels and stdfont for text entry.
	(add_network_prefs_items): Add pady 2 for labels and text
	entries. Set stdfont for text entries.
	(add_imagery_prefs_items): Set boldfont and add pady 2 
	for checkboxes.
	(ok_preferences): Set all fonts from prefs(font_family)
	and prefs(font_size). Reinit fonts for all text items in 
	the help, scores, research, prefs, design, dsave, contour,
	meridian and find dialogs with all subframes.
	(popup_help_dialog): Remobe fixed bigfont. Set boldfont
	for all buttons and titlefont for the heading tag.
	(popup_game_over_dialog): Remove fixed verybigfont. Set
	hugefont for fate label, boldfont for buttons and stdfont for
	the hint label.
	(popup_design_palette): Set boldfont for buttons and menu.
	Change button label to Done and add padx 15.
	(make_terrain_paint_frame): Set boldfont for menus.
	(make_unit_paint_frame): Set boldfont for menus.
	(make_people_paint_frame): Set boldfont for menu.
	(make_control_paint_frame): Set boldfont for menu.
	(make_feature_paint_frame): Set boldfont for menus,
	buttons and labels and stdfont for text entries.
	(make_elev_paint_frame): Set stdfont for text entries
	and boldfont for labels, menus and buttons.
	(make_temp_paint_frame): Set stdfont for text entries
	and boldfont for labels, menus and buttons.
	(make_clouds_paint_frame): Set stdfont for text entries
	and boldfont for labels, menus and buttons.
	(make_winds_paint_frame): Set boldfont for labels and
	menus.
	(popup_designer_save): Set boldfont for buttons and labels 
	and stdfont for text entry. Add pady 4 for all checkboxes.
	
	Fix checkbox label text so that it is not too close to the box 
	when small font sizes are used.
	* tkconq.tcl (add_new_game_dialog_items): Add space in
	checkbox label.
	(add_variants_dialog_items): Add spaces in checkbox labels.
	(popup_indepside_config): Add spaces in checkbox labels.
	(add_map_prefs_items):  Add spaces in checkbox labels.
	(add_files_prefs_items): Add space in checkbox label.
	(add_imagery_prefs_items): Add spaces in checkbox labels.
	(popup_designer_save): Add spaces in checkbox labels.
	
	Fix vertical position of first line in the unit info pane so 
	that it works with different font sizes.
	* tkconq.tcl (create_map): Add lineheight / 2 instead of
	3 pixels to ypos. Add lineheight /2 instead of 2 pixels to
	canvas height.

	Fix bug that made the unit list pane too long vertically.
	* tkconq.tcl (create_map_window): Add 4 instead of 6 
	pixels to list_entry_height.
	
	Remove unnecessary labels from the unit list pane.
	* tkconq.tcl (create_map_window): Don't add one extra 
	lineheight to listwinheight.
	(fill_in_unit_type_list): Remove Type and Num labels.
	Init sy to 0 instead of 16.
	
	Make the unit list pane more narrow by dividing the text 
	for each unit type on two lines.
	* tkconq.tcl (fill_in_unit_type_list): Init tsy to sy + 
	ist_icon_size/2. Tweak all text tag positions. 

	Fix designer palette so that designer mode is turned off also 
	when the palette is closed by using the close box.
	* tkconq.tcl (popup_design_palette): Set designer to 1. Add wm 
	protocol .design WM_DELETE_WINDOW close_design_palette. 
	Change button command to close_design_palette. Change Return 
	key binding to close_design_palette.
	(close_design_palette): New tcl procedure that first calls
	execute_long_command and then withdraw_window.

	Fix display glitch in Mac game window without scorekeepers.
	* macwins.c (create_game_window): Add 3 pixels to the 
	gamesidehgt if keeping_score is false.
	
2003-09-24 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Make configure process help makefiles pick up platform-
        specific compile and link flags.
        * configure.in: Set PLATFORM_CFLAGS, PLATFORM_INCLUDES, 
        PLATFORM_LDFLAGS, PLATFORM_LIBS, and ALT_HFLAGS 
        according to host type.
        * configure: Regenerated from configure.in.
        * tcltk/Makefile.in: Lay foundation for using new 
        PLATFORM_* expanders.

2003-09-20 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Make assorted changes to the configure template.
        * configure.in: Split mingw32 and cygwin host processing.
        Fix the default UI_TARGET value to be tkconq instead of 
        tcltk (thanks to Peter Garrone for describing the symptoms 
        of this error).
        * configure: Regenerated from configure.in.

        Remove '-g' debugging flag from the CFLAGS in the Makefile 
        templates, since @CFLAGS@ expands to '-g -O2' on GCC 
        systems and we cannot be sure that '-g' is appropriate on 
        all non-GCC systems.
        * Makefile.in: Remove '-g' from CFLAGS.
        * SelFile/Makefile.in: Likewise.
        * curses/Makefile.in: Likewise.
        * kernel/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise.
        * tcltk/Makefile.in: Likewise.
        * x11/Makefile.in: Likewise.

        Clean out win directory.
        * win/Makefile.in: Remove.

        Update version info for "new" month of September.
        * kernel/version.h: Update month.

2003-09-17 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Simplify top-level Makefile. Reorient build targets to be 
        interface specific rather than platform specific. Rip out 
        or comment out all Tcl/Tk and SDL related things in the 
        Makefile template in the X11 directory, so that there is no 
        confusion about where various interfaces are now being 
        built.
        * Makefile.in: Add, change, and disable various targets. 
          (all): Redirect to all-$(UI_TARGET).
          (all-xconq): Comment out old functionality. Redirect to 
        all-$(UI_TARGET).
          (all-tkconq): New target. Cloned from old all-xconq 
        target sans the directory selector. Also, use $(ALLTARGET) 
        to handle both Unix and Windows builds.
          (all-sdlconq): Uncomment. Point at sdl dir rather than 
        x11 dir. Use $(ALLTARGET) to handle both Unix and Windows 
        builds.
          (all-wconq): Comment out.
          (all-cconq): Move target nearer to other UI build targets.
          (install): Redirect to install-$(UI_TARGET).
          (install-only): Comment out old functionality. Redirect to 
        install-$(UI_TARGET). This target should actually go away 
        shortly in the future.
          (install-xconq): Comment out old functionality. Redirect to 
        install-$(UI_TARGET).
          (install-tkconq): New target. Cloned from old install-xconq 
        target sans the directory selector. Also, use $(INSTALLTARGET) 
        to handle both Unix and Windows installs.
          (install-sdlconq): New target. Cloned from old install-xconq 
        target minus the directory selector. Also, use $(INSTALLTARGET)
        to handle both Unix and Windows installs.
        * x11/Makefile.in: Rip out or comment out all Tcl/Tk and SDL 
        related make variables. Remove or comment out various targets 
        related to the aforementioned interfaces.
          (all): Redirect to xtconq target.
          (xconq): Comment out old functionality. Redirect to xtconq 
        target.
          (sdlconq): Remove.
          (ximfapp): Comment out. Keep for reference but probably 
        remove shortly in the future.
          (install-only): Comment out old functionality. Redirect to 
        install-xtconq target.
          (xconq.o): Remove dependency rule.
          (ximfapp.o): Remove dependency rule.

        Play tug-o-war with Jim.
        * x11/xconq.c: Remove.
        * x11/ximfapp.c: Remove.
        * x11/.cvsignore: Remove ximfapp since it is no longer built 
        in this directory. Leave xconq to accomodate future build 
        changes, which will allow xtconq to be named xconq.

2003-09-16  Jim Kingdon  <kingdon@panix.com>

	* x11/.cvsignore: Add new targets xconq and ximfapp.

2003-09-16 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Enable all possible build targets by default. Also lay 
        groundwork for simplifying top-level Makefile. Enhance 
        configure options.
        * configure.in: Add, deprecate, and enhance options.
          (enable-sdl): Deprecate.
          (enable-ui): New option. Set UI_TARGET.
          (enable-alternate-scoresdir): Mention default directory 
        in help.
        * configure: Regenerated from configure.in.
        * Makefile.in: Add @UI_TARGET@ macro expander. Change SDL_LIB 
        test for 'all-xconq','all-wconq', and 'install-xconq' to 
        UI_TARGET test as a stop-gap until 'tkconq' target appears 
        and 'all-wconq' target goes away.
          (all-sdlconq): Comment out until we are ready to bring it 
        back.
        * sdl/Makefile.in: Add `sdl-config --static-libs` to list of 
        libraries when building Win32 SDL interface.

2003-09-14 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Restructure build process so that both Tcl/Tk and SDL apps 
        for both X11 and Windows build in the interface directories 
        rather than the platform directories.
        * Makefile.in: Accomodate Tcl/Tk and SDL builds and installs 
        for the X11 app targets (sans xtconq).
          (all-xconq): Bounce the build into either the sdl or tcltk 
        directory as decided by SDL_LIB.
          (all-ximfapp): Comment out. No longer use this directly.
          (install-only): Refine the installation process.
          (install-xconq): Bounce the install into either the sdl or 
        tcltk directory as decided by SDL_LIB.
        * sdl/Makefile.in: Better organize the compile and link flags 
        for greater flexibility. Use appropriate compile and link flags 
        according to platform. Improve cleanup. Add and change some 
        targets.
          (all): Render impotent, because this makefile is now 
        multifunction.
          (all-xconq): New target. Assume duties of retired counterpart 
        in x11 directory.
          (xconq): New target. Build the X11 xconq app.
          (manpages): New target. Build the Xconq man page.
          (all-wconq): New target. Build the Win32 xconq app and 
        associated libraries.
          (wconq): New target. Build the Win32 xconq app.
          ($KERNEL_LIB): New target. Get libconq.a built for 
        executables.
          ($LOW_LIB): New target. Get libconqlow.a built for 
        executables.
          (all-libs): New target. Assume previous duties of the 'all' 
        target.
          (install): Legacy target. Redirect to new 'install-libs' 
        target.
          (install-only): Legacy target. Redirect to new 
        'install-libs-only' target.
          (install-libs): New target. Assume previous duties of 
        'install' target.
          (install-libs-only): New target. Assume previous duties of 
        'install-only' target.
          (install-xconq): New target. Install the complete Xconq 
        suite for X11.
          (install-wconq): New target. Install the complete Xconq 
        suite for Win32.
          (install-xconq-only): New target. Install the xconq app.
          (install-wconq-only): New target. Install the wconq app.
          (install-manpages-only): New target. Get the xconq man page 
        installed.
          (extraclean): New target. Transplant from Makefile.in in 
        tcltk directory.
          (sdlunix.o): New dependency.
          (sdlwin32.o): New dependency.
        * sdl/sdlunix.c: New file. Copied from x11/xconq.c.
        * sdl/.cvsignore: Ignore the executables that can be built 
        in this directory.
        * tcltk/Makefile.in: Better organize the compile and link flags 
        for greater flexibility. Use appropriate compile and link flags 
        according to platform. Add and change some targets.
          (all-xconq): New target. Assume duties of retired counterpart 
        in x11 directory.
          (xconq): New target. Build the X11 xconq app.
          (ximfapp): New target. Build ximfapp.
          (manpages): New target. Build the Xconq man page.
          ($XCUTIL_OBJ): New target. Get xcutil.o built for ximfapp.
          (x2imf): New target. Get x2imf built.
          (imf2x): New target. Get imf2x built.
          (install-xconq): New target. Install the complete Xconq 
        suite for X11.
          (install-wconq): Add wimfapp to installation.
          (install-xconq-only): New target. Install the xconq app.
          (install-ximfapp-only): New target. Install ximfapp.
          (install-manpages-only): New target. Get the xconq man 
        page installed.
          (install-ximfconvs-only): New target. Get the X11 imf 
        converter apps installed.
          (tkunix.o): New dependency.
          (iappunix.o): New dependency.
        * tcltk/iappunix.c: New file. Copied from x11/ximfapp.c.
        * tcltk/tkunix.c: New file. Copied from x11/xconq.c.
        * tcltk/xcutil.h: New file. Copied from x11/xcutil.h. Needed 
        in this directory until some header issues are taken care of.
        * tcltk/.cvsignore: Ignore the executables that can be built 
        in this directory.
        * x11/Makefile.in: Add and change some targets.
          (install-only): Hit separate targets for X11 imf converter 
        apps and man pages.
          (install-xtconq): Hit separate target for X11 imf converter
        apps.
          (install-ximfconvs-only): Install the X11 imf converter apps.
          (install-manpages-only): Install the xconq man.
        * x11/.cvsignore: Remove entries for executables that are no 
        longer built in this directory.

2003-09-07  Jim Kingdon  <kingdon@panix.com>

	* kernel/util.c: Don't comment out K&R-style function
	declarations; just remove them.

2003-09-08 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Build Windows Tcl/Tk apps in tcltk directory instead of 
        win directory.
        NOTE: Still need to do the same for Windows SDL apps. Indeed, 
        this change may break the Windows SDL build. I will fix it 
        ASAP. In the meantime, the win directory will not be retired 
        to the Attic.
        * Makefile.in: Add SDL_LIB so that we can discern between 
        Tcl/Tk and SDL builds for a given platform. Remove 
        config.cache file during cleanup.
          (all-wconq): Bounce the build into either the sdl or tcltk 
        directory as decided by SDL_LIB.
          (all-tcltk): Change tcltk submake target from 'all' to 
        'all-libs'.
        * configure.in: No longer append win/Makefile to list of 
        makefiles.
        * configure: Regenerated from configure.in.
        * tcltk/Makefile.in: Add variables for the libs that are needed 
        to link into the Xconq apps. Make sure that only the static 
        libraries built for the Tcl/Tk interface are removed during 
        cleanup, and not all .a files. Remove config.cache during 
        cleanup. Add and change some targets.
          (all): Render impotent, because this makefile is now 
        multifunction.
          (all-libs): New target. Assume previous duties of the 'all' 
        target.
          (all-wconq): New target. Assume duties of its retired 
        counterpart in win directory.
          (wconq): New target. Build wconq.exe.
          (wimfapp): New target. Build wimfapp.exe.
          ($KERNEL_LIB): New target. Get libconq.a built for 
        executables.
          ($LOW_LIB): New target. Get libconqlow.a built for 
        executables.
          (install): Legacy target. Redirect to new install-libs target.
          (install-only): Legacy target. Redirect to new 
        install-libs-only target.
          (install-libs): New target. Assume previous duties of 'install' 
        target.
          (install-wconq): New target. Make sure that wconq got built and 
        install it.
          (install-wconq-only): New target. Install wconq.
          (install-wimfapp-only): New target. Install wimfapp. 
          (extraclean): New target. Transplant from Makefile.in in win 
        directory.
          (tkwin32.o): New dependency.
          (iappwin32.o): New dependency.

        Handle case when Cygwin environment does not have complete set
        of standard headers, and is thus missing timeval struct.
        * kernel/util.c: Add ifdef for Cygwin environment and undefined 
        system time header macro. 

2003-09-04 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Update xconq.spec to take advantage of yesterday's update 
        of the Makefile templates.
        * xconq.spec: Increment release number to 3. Get rid of 
        path variables being passed to make commands.

2003-09-03 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Use macro expanders in Makefile templates for greater config 
        flexibility. Do this for exec_prefix, bindir, libdir, mandir, 
        and infodir, but not datadir and docdir, for the time being.
        * Makefile.in: Change hardcoded relative paths to expanders.
        * kernel/Makefile.in: Likewise. 
        * tcltk/Makefile.in: Likewise.
        * lib/Makefile.in: Likewise.
        * SelFile/Makefile.in: Likewise.
        * curses/Makefile.in: Likewise.
        * doc/Makefile.in: Likewise.
        * images/Makefile.in: Likewise.
        * sdl/Makefile.in: Likewise.
        * x11/Makefile.in: Likewise.

        Minor aesthetic improvement to configure script.
        * configure.in: Capitalize argument assignments for the 
        enable options.
        * configure: Regenerated from configure.in.

2003-08-31 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Revise documentation.
        * refman.texi: Indicate the way hit-by now behaves.

        Use um_hit_by as a multiplier table for calculating ammo 
        consumption.
        * combat.c (fire_on_unit): Check if a given ammo type should 
        be consumed when hitting the defender. If so, then consume 
        the amount of the defender's hit-by multiplier times the 
        consumption-per-fire or consumption-per-attack as appropriate.
          (attack_unit): Likewise.
          (enough_ammo_to_fire_at_unit): Make sure that the attacker 
        has enough ammo to fire, as calculated by the defender's hit-by 
        value multiplied by the attacker's consumption-per-fire value or 
        consumption-per-attack value, as appropriate.
          (enough_ammo_to_attack_unit): Make sure that the attacker 
        has enough ammo to attack, as calculated by the defender's 
        hit-by value multiplied by the attacker's consumption-per-attack 
        value.
        * help.c (describe_utype): Revert back to using the default 
        formatter. 

        Use some macro expanders as the first step in adding flexibility 
        to (and conforming to a generally accepted practice in) the 
        Makefile templates.
        * kernel/Makefile.in: Use @exec_prefix@ and @bindir@.

2003-08-30 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Update and improve documentation.
        * refman.texi: Add entry for minimal-sea-for-docks. 
        Rewrite entries for hit-by, consumption-per-attack, and 
        consumption-per-fire. Correctly identify ai-tactical-range 
        as a UnitTypeProperty rather than GlobalVariable.
        * syntax.texi: Add lexemes for sides-wanted and in-order.
        * design.texi: Replace reference to hits-with with 
        material-to-{fire,attack} and consumption-per-{fire,attack}.

        Treat um_hit_by as a table of boolean values.
        * combat.c (fire_on_unit): Simply test for verity rather than 
        whether the table entry is > 0.
          (enough_ammo_to_attack_unit): Likewise.
          (enough_ammo_to_fire_at_unit): Likewise.
          (attack_unit): Likewise. 
        * help.c (describe_utype): Use tb_bool_desc to format output.

2003-08-29 Hans Ronne <hronne@telia.com>

	Improve advanced terrain images and fix some glitches. 
	Make all 3 gifs identical with 8 subimages of each type.
	* advt12x13.gif: Update terrain images.
	* advt24x26.gif: Update terrain images.
	* advt44x48.gif: Update terrain images.
	* advt32x32.gif: Update terrain images.
	* terrain.imf: Increase subimage count to 8 and add size
	12x13 for all adv-x image families.

2003-08-28 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Add new configuration options and improve option 
        aesthetics. Update Makefile templates to use new options.
        * configure.in (enable-alternate-gameuser): New option.
          (enable-alternate-gamegroup): New option.
          (enable-alternate-scoresdir): Clearer help string.
          (enable-sdl): Change option position. Improve help string 
        formatting.
        * Makefile.in: Use @gameuser@ and @gamegrp@ expanders.
        * curses/Makefile.in: Likewise.
        * images/Makefile.in: Likewise.
        * lib/Makefile.in: Likewise.
        * tcltk/Makefile.in: Likewise.
        * win/Makefile.in: Likewise.
        * x11/Makefile.in: Likewise.
        * configure: Regenerated from configure.in.
        * INSTALL: Mention new configure options.

2003-08-28 Hans Ronne <hronne@telia.com>

	Fix crashes in the Mac interface due to array overflow.
	* macwins.c (draw_side_status): Change numscorekeepers
	to numscorekeepers - 1.
	
	Fix area resizing problems in the Mac startup code.
	* macinit.c (implement_variants): Comment out the 
	init warning and area resizing code.

	Tweak Mac font sizes to fit both Mac OS9 and OSX.
	* macconq.c (init_fonts): Set small_font_size to 10
	ifdef MACOSX else 9.

	Add Cave of Amazement to the game directory.
	* game.dir (cave2): Add module.

	Add smaller sizes of the civt and eur terrain images.
	* civt12x13.gif: New terrain image file.
	* civt24x26.gif: New terrain image file.
	* eur12x13.gif: New terrain image file.
	* eur24x26.gif: New terrain image file.
	* terrain.imf: Update info for the bocage, flooded, hill,
	urban and all civ-x image families. Use adv-hills for
	the missing tiles and tcolors in the hill image family.

2003-08-26 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Added the first beta release of the Bellum Aeternum game 
        modules.
        * bellum.g: Main game module.
        * uu-bellum.g: Unit-unit interactions for Bellum.
        * u-bellum.g: Unit definitions and unit-terrain and 
        unit-material interactions for Bellum.
        * t-bellum.g: Material and terrain definitions and 
        terrain-material interactions for Bellum.
        * game.dir: Insert Bellum into list of games.

2003-08-25 Eric McDonald <mcdonald at phy dot cmich dot edu>

        Fix a divide by zero introduced by the previous checkin.
        * move.c (type_can_have_enough_mp): If unit's speed is 0, 
        then do not try to divide by it. Just return FALSE, 
        because the unit is not mobile.
 
2003-08-25 Hans Ronne <hronne@telia.com>

	Major overhaul of the ai construction code. Fix so that ships
	no longer are built in inland cities by implementing a global
	test that uses the area.landsea_regions layer, similar to the
	resupply code. Also fix buzzing due to failed build tasks and
	several bugs in the ai precomputation code. Improve and
	unify several tester functions. Add a new utype property that
	determines how big a body of water should be to enable naval
	construction by the unit type.
	* actions.c (type_can_have_enough_acp): New function.
	(can_have_enough_acp): Call type_can_have_enough_acp.
	* ai.c (type_can_leave_unit): New function and prototype.
	(suitable_port): New function and prototype.
	(preferred_build_type): Rewrite and fix bug that caused
	plan_exec buzzing due to failing transport build tasks.
	Add test if naval units can be used before building them.
	(ai_init_shared): Rewrite and simplify the part that inits
	naval, ground and air types and fix several bugs. Remove
	requirement that air types have no size in the terrain. Call
	type_can_move_in_terrain, type_can_occupy_terrain and
	type_survives_in_terrain.
	* conq.h (type_can_have_enough_acp): New prototype.
	(type_can_move_in_terrain): New prototype.
	(type_can_have_enough_mp): New prototype.
	* move.c (terrain_always_impassable): Rewrite and fix bugs.
	(type_can_move_in_terrain): New function.
	(type_can_have_enough_mp): New function.
	* unit.c (type_survives_in_terrain): New function.
	(type_survives_in_cell): Call type_survives_in_terrain.
	(type_can_occupy_empty_cell): New function.
	(type_can_occupy_terrain): New function.
	(can_occupy_cell_without): Replace redundant code with a
	call to type_can_occupy_cell_without.
	(ocw_numtypes): Remove static int.
	* unit.h (type_survives_in_terrain): New prototype.
	(type_can_occupy_empty_cell): New prototype.
	(type_can_occupy_terrain): New prototype.
	* utype.def (u_minimal_sea_for_docks): New utype 
	property. Set it by default to 30 cells.

 	Fix bug in ai code that prevented construction tasks from being
 	set correctly. Note: should do away with these return values and
 	the domore test in ai_adjust_plan.
 	* ai.c (run_ai_plan_adjust): Add comment about domore.
 	* iplayer.c (iplayer_adjust_plan): Always return true.
 	* mplayer.c (iplayer_adjust_plan): Always return true.
 
 	Further fixes to the scorekeeeper output.
	* macwins.c (last_status_score1): Remove array.
	(last_status_score): New array. Initialize to null.
	(draw_game): Set last_status_score to null when adding side.
	Allocate elements in last_status_score array if null.
	(draw_game_side): Zero all elements in last_status_score
	before calling draw_side_status. 
	(draw_side_status): Rewrite score display code. Add support
	for last_status_score array. Redraw scores if an element in 
	the array changed, or if the side status changed.
	* tkmain.c (update_side_score_display): Iterate over
	i starting at 1 instead of using sk->id.

	Tweak grouping boxes in the tcltk interface so that they are
	drawn exactly like in the Mac interface.
	* tkmap.c (draw_unit_and_occs): Reduce heigth by 1 pixel.
	Increase width by 1 pixel unles big_unit_images. Offset sy
	by 2 pixel for occs without occs.
	(draw_unit_view_and_occs): Reduce heigth by 1 pixel.
	Increase width by 1 pixel unles big_unit_images. Offset sy
	by 2 pixel for occs without occs.

	Shift grouping box contents by 1 pixel to the right in 
	all interfaces.
	* ui.c (xform_occupant): Add 1 pixel to sxp.
	(xform_occupant_view): Add 1 pixel to sxp.

	Fix minor bug in scorekeeper output.
	* nlang.c (side_score_desc): Test for empty_string
	before using sk->title.

2003-08-24 Hans Ronne <hronne@telia.com>

 	Improve scorekeeper output. Distinguish between last-side-wins
 	and last-alliance-wins. Add the side score in parenthesis in the
 	latter case. Always write the scorekeeper title if it exists, and
 	always give it a number if numscorekeepers > 1. Compute the
 	alliance score correctly in case last-alliance-wins.
 	* nlang.c (side_score_desc): Rewrite function with the above
 	improvements included.
 	* score.c (has_allies): New function.
 	(alliance_point_value): New function.
 	* score.h (has_allies): New prototype.
 	(alliance_point_value): New prototype.

	Add the ability to display more than one scorekeeper output to the
	tcltk interface, similar to the Mac interface.
	* tkconq.tcl (create_map_window): Use numscorekeepers to
	compute game_entry_height.
	(fill_in_side_list): Use numscorekeepers to compute 
	game_entry_height. Add separate tags for each scorekeeper.
	(ok_preferences): Config the font for each scorekeeper line.
	* tkmain.c (tk_numscorekeepers): New TclCmdFn and prototype.
	(update_side_score_display): Pass scorekeeper id instead to the
	tcl interpreter.

 	Fix so that each scorekeeper gets its own line in the Mac game
 	window. Also fix so that graying out of loosing sides works by
 	calling draw_game_side from within draw_side_status, but
 	without infinite recursion.
 	* macwins.c (gamesidescorehgt): Change to 12.
 	(create_game_window): Add one line for each scorekeeper.
 	(draw_game): Pass drawstatus true to draw_game_side. 
 	(draw_game_side): Add drawstatus argument to function and
 	prototype. Test for side2->ingame before drawing ai icons.
 	Test for drawstatus before calling draw_side_status.
 	(draw_side_status): Remove commented out code. Call
 	draw_game_side with drawstatus false if side2 just lost
 	the game. Rewrite the score drawing code so that each
 	scorekeeper gets its own line.

 	Fix so that the Mac instructions window is big enough.
 	* machelp.c (create_instructions_window): Move the help 
 	and close buttons.
 	* Xconq.r (WIND 141 "Instructions"): Increase the size of 
 	the window.
 
 	Tweak the appearance of the Mac Game Over dialog.
 	* Xconq.r (DLOG 900 "Game Over"): Increase its height.
	(DITL 900 "Game Over Items"): Tweak item positions.

	Tweak default fonts and sizes in the Mac interface so that they 
	look good both under OS9 and OSX.
	* macconq.c (init_fonts): Change small_font_id to Geneva,
	small_font_size to 10 and large_font_id to Geneva. 

 	* ng-sides.g (default-side-names): Fix typo in comments.

2003-08-18 Hans Ronne <hronne@telia.com>
 
 	Fix unnecessary warnings when a module (usually ng-weird) is 
	included more than once. Also make sure open_module returns 
	false in that case, even if the warning has been disabled.
	* read.c (include_module): Pass false to load_game_module.
	* module.c (open_module): Untangle init_warning calls from the 
	rest of the code so that false can be returned even if warnings have
	been disabled.

	Fix so that bogus 'bays' generated at the edge of the area and cells 
	within small lakes are not named as bays.
	* mkterr.c (bay_point): Return false if (nx, ny) is not inside 
	the area. Also return false if region size is less than 6 cells.

	Fix bug that freezed the tcltk interface if simultaneous display 
	of clouds and temperatures was attempted.
	* tkmap.c (draw_clouds_row): Reset FillStyle and Foreground
	color when done drawing clouds.

	Enable the display of weather by default if it is available.
	* macmap.c (create_map): Set draw_temperature, draw_clouds
	and draw_winds to true.
	* tkconq.tcl (prefs): Set prefs(temperature), prefs(clouds) and
	prefs(winds) to 1.

	Fix so that winds and temperatures are not drawn on top of each
	other in the Mac interface.
	* macdraw.c (draw_temperature): Tweak sy position of text. 
	Also return if power < 4.

	Fix crashing bug in the Mac set terrain Colors menu.
	* maccolors.c (set_terrain_color): Check if t_image_name 
	is non-empty before using it.

	Fix some compiler warnings.
	* plan.c (can_be_auto_repaired): Remove unused m.
	* task.c (do_repair_task): Remove unused m.
	
	Make text in unfinished game checkbox text more explicit.
	* tkconq.tcl (add_new_game_dialog_items): Change text to "Also
	list unfinished games".
	* Xconq.r (DITL 129 "New Game Items"): Change text to "Also
	list unfinished games".

	Clean up the PICT resources in the Mac interface.
	* xconq.r (PICT 135 "panzer"): Remove.
	(PICT 136 "galaxy"): Remove.
	(PICT 137 "1756"): Remove.
	(PICT 138 "voyages"): Remove.
	(PICT 139 "magellan"): Remove.
	(PICT 1000 "standard"): Remove.
	(PICT 1002 "intro"): Remove.
	(PICT 1010 "classic"): Remove.
	(PICT 1011 "ww2"): Remove.
	(PICT 1020 "crater-lake"): Remove.
	(PICT 1021 "normandy"): Remove.
	(PICT 1040 "cherbourg"): Remove.
	(PICT 1041 "gettysburg"): Remove.
	(PICT 1042 "ww2-eur-42"): Remove.
	(PICT 1043 "pelops"): Remove.
	(PICT 2000 "New Splash"): Remove.
	(PICT 4004 "Worker"): Rename to "Build Icon".
	(PICT 4005 "Wizard"): Rename to "Research Icon".	

2003-08-17  Eric McDonald <mcdonald at phy dot cmich dot edu>
 
        Update RPM spec file.
        * xconq.spec: Modify Packager field to help acknowledge Stan's 
        contribution in creating the original spec file. Strip unneeded 
        path from Source field. Copy pre-built HTML documentation 
        during install, and add it to the RPM-designated doc files.
        Increment package release number.

        Address failure to escape the backslash character when writing 
        out escaped strings.
        * lisp.c (escaped_string): Properly escape backslash char.
        * lisp.c (safe_escaped_string): Likewise.

        Continue modernization of GDL reference manual.
        * refman.texi: Reflect Hans' addition of sides-wanted, 
        side-namer, default-side-namer, and the in-order naming method.
        Also fix interpolation-list display glitch that appeared in 
        the HTML docs produced from the Texinfo source.

2003-08-17 Hans Ronne <hronne@telia.com>

	Fix bug in recent change to firing code that would cause fire_at
	tasks to be set for non-mobile units out of range.
	* ai.c (ai_fire_at_opportunity): Only add u_ai_tactical_range to 
	range if the unit is mobile.
	* plan.c (fire_at_opportunity): Only add u_ai_tactical_range to 
	range if the unit is mobile.

	Fix bug that would cause repeated build tasks for colonizing units
	to be queued in some games. Note: should get rid of ai build code in
	plan.c altogether after further testing. It is hardly used at all right 
	now since ai_adjust_plan handles all building.
	* plan.c (plan_colonize): Don't call plan_colonize_support first.
	Call it only if we have neither tasks nor main goal.

	Fix so that only explicit repair tasks are set for non-mobile units.
	* plan.c (repair_if_damaged): Return if the unit is non-mobile
	before proceeding to non-explicit repair.

	Fix so that non-mobile units can resupply and rearm by 
	explicit extraction of material.
	* plan.c (rearm_if_low): Return for non-mobile units only
	after explicit extraction has been tested. 
	(resupply_if_low): Return for non-mobile units only after 
	explicit extraction has been tested.

	Fix so that task execution proceeds as normal if a repair task
	could not be set.
	* plan.c (repair_if_damaged): Return false if the call to
	can_be_auto_repaired returns false.

	Fix so that all repair and resupply code uses the same code to
	compute operating ranges.
	* plan.c (can_be_auto_repaired): real_operating_range_best
	called instead of the for_all_material_types macro. 

	Test if a resupply task can be set before proceeding with it 
	so that the task queue is not unnecessarily cleared.
	* plan.c (can_be_resupplied): New function and prototype.
	(resupply_if_low): Call can_be_resupplied. Return false
	if the test fails.
	(rearm_if_low): Call can_be_resupplied. Return false
	if the test fails.

	Fix tmpunit bug in can_be_auto_repaired.
	* plan.c (can_be_auto_repaired): Set tmpunit to unit at the
	start so that it always is defined.

	Fix problem with aborted rearming of planes from carriers
	due to the latter holding on to ammo instead of sharing it.
	* run2.c (can_satisfy_need): Share half of the remaining 
	supplies. Do not try to stay above the resupply_percent of
	the donor.

	Fix problem with planes getting stuck on carriers due to
	premature ending of rearming when their resupply_percent 
	had been restored.
	(run_economy): Always try to resupply units fully rather
	than just up to resupply_precent, since this is what is
	tested for by do_resupply_task.

	Fix so that bombers etc. really use up their ammo before 
	returning to their bases in the standard game.
	* stdunit.g (default-doctrine): Set rearm-percent to 0.

2003-08-14 Hans Ronne <hronne@telia.com>

	Fix so that the carbonized MacPPC app compiles again.
	* macmap.c (invert_map): Use my_SetPortWindowPort
	instead of calling SetPort directly.
	
	Fix so that the Colors meny works correctly again for all
	terrain type images and colors.
	* maccolors.c (set_terrain_color): Untangle image name
	and terrain name checking code and fix bugs. Add check for
	terrain type names within the while loop.

2003-08-11  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to August 2003.

	Improve resupply and repair code by testing if ships and land
	units have direct access to the destination unit.
	* task.c (direct_access_to): New function and prototype. Uses
	the area.landsea_regions layer to test if destination is globally
	accessible to a unit.
	(auto_repair_at): Check direct_access_to first.
	(resupply_test): Check direct_access_to first.
	* world.c (final_init_world): Compute area.landsea_regions
	if not already done in mkterr.c at this point so that the area
	layer is available to the repair and resupply code.

	Fix bug in ai precomputing code that messed up the assignment 
	of ground and naval mobile units.
	* ai.c (ai_init_shared): Skip connections, overlays and borders
	when computing u_naval_mobile etc. Note: should reexamine all
	cases where for_all_terrain_types is used in view of the recent
	changes in how connections work.

	Fix pointer bug in will_be_auto_repaired and make sure the
	auto-repair code is inited correctly also if we are restoring a
	saved game.
	* init.c (calculate_globals): Move auto-repair init code from
	run_auto_repair here so that it is inited correctly also when
	restoring a saved game.
	* kernel.h(any_auto_repair): Declare extern short.
	 (will_be_auto_repaired): Change type from char to short.
	* run2.c (any_auto_repair): Init to FALSE instead of -1.
	(will_be_auto_repaired): Change type from char to short.
	(run_auto_repair): Move the auto-repair init and xmalloc
	code to calculate_globals.

	Fix bug in the repair doctrine code, which made it impossible
	to satisfy the test if the doctrine repair_percent was 100.
	* plan.c (repair_if_damaged): Change > to >= in test.

	Move hp-recovery test back to repair_if_damaged, where 
	it really belongs and set up a repair task if satisfied.
	* plan.c (repair_if_damaged): Move the hp-recovery test 
	here and call set_repair_task followed by execute_task.
	(can_be_auto_repaired): Move the hp-recovery test to
	repair_if_damaged.

	Fix so that the mplayer checks if a unit is heading back for 
	resupply or repair before hijacking it to do a pickup task.
	* mplayer.c (search_for_available_transport): Skip over
	units that have queued a resupply or repair task.

	Improve the calculations of operating ranges. Use the unit's
	real supplies of materials instead of its theoretical storage
	capacities to compute how far it can go.
	* plan.c (plan_offense): Call real_operating_range_best 
	instead of operating_range_best for the unit type.
	* task.c (do_collect_task): Call real_operating_range_best 
	instead of operating_range_best for the unit type.
	(do_resupply_task): Call real_operating_range_best instead
	of operating_range_best for the unit type.
	(do_repair_task): Call real_operating_range_best instead 
	of iterating over for_all_material_types.
	* unit.c (real_operating_range_best): New function.
	(real_operating_range_worst): New function. 
	* unit.h (real_operating_range_best): New prototype.
	(real_operating_range_worst): New prototype.

	Fix so that a failed resupply task does not block execution
	of the following repair task by setting last_task_outcome
	to TASK_FAILED.
	* plan.c (resupply_if_low): If the resupply task fails,
	then call clear_task_agenda and clear_task_outcome so 
	that we may continue with either a rearm or repair task 
	or normal plan execution.
	(rearm_if_low): If the resupply task fails, then call 
	clear_task_agenda and clear_task_outcome so that we 
	may continue with either a repair task or normal plan 
	execution.
	(repair_if_damaged): If the repair task fails, then call 
	clear_task_agenda and clear_task_outcome so that we 
	may continue with normal plan execution.

	Add support for explicit terrain extraction in the automatic 
	resupply task code.
	* plan.c (rearm_if_low): Call set_resupply_task followed
	by execute_task if check_extract_action returns true.
	(resupply_if_low): Call set_resupply_task followed
	by execute_task if check_extract_action returns true.
	* task.c (do_resupply_task): Call prep_extract_action and 
	set TASK_PREPPED_ACTION if check_extract_action 
	returns true.

	Remove debugging code mistakenly left in the mplayer.
	* mplayer.c (estimate_strengths): Clean up the code.

2003-08-09  Hans Ronne <hronne@telia.com>

	Make it possible to name sides randomly instead of having to rely
	on 'A', 'B', 'C' etc. in the absence of side names. At the same time,
	fix bug that caused indepside to be named '@' in such games.
	* gvar.def (side-namer): New gvar. Default to default-side-names.
	* init.c (rename_side_for_player): Don't rename indepside.	
	* mknames.c (make_up_side_name): Add support for using the
	side-namer gvar. Don't run namer code for indepside.
	* ng-sides.g: New file with default side namer.

	Permit random renaming of sides in the tcltk interface even if
	the side library is empty.
	* tkmain.c (tk_can_rename): Don't test g_side_lib() != lispnil.
	* tkconq.tcl (select_player): Only disable plbuttons.sidelib
	but not plbuttons.rename if num_avail_side_names is zero.
	(add_player_dialog_items): Don't disable plbuttons.rename if
	num_avail_side_names is zero. Also enable plbuttons.sidelib
	if num_avail_side_names is non-zero. Note: still does not enable 
	the menu when sides are recycled. Should figure out why.

	Fix so that the Mac Rename button is disabled for indepside.
	* macinit.c (set_player_setup_button_states): Disable the 
	"Rename" button for indepside.

	Fix bug that would cause crashes when sides were deleted in the
	player setup dialog due to units being left with undefined sides.
	Also fix crashes in ai init code due to bogus side pointers being
	dereferenced after side removal.
	* init.c (remove_side_and_player): Either give away the side's 
	units to indepside, or kill them if indepside is not around. Set 
	both side and player pointers to NULL at the very end.

	Fix so that it is impossible to remove sides below sides-min.
	* init.c (remove_side_and_player): Check that numsides is
	above g_sides_min.
	* macinit.c (set_player_setup_button_states): Check that
	numsides is above g_sides_min. 
	* tkconq.tcl (select_player): Check that numsides is above
	minsides before enabling "Remove" button.
	(update_allplayer_buttons): Enable or disable "Remove"
	button depending on numsides > minsides. Also test if the
	selected side is indepside or a human player.
	* tkmain.c (tk_minsides): New TclCmdFn and prototype.

	Add the possibility of defining both a minimal numer of sides
	and a preferred number of sides in synthesized games.
	* gvar.def (sides-wanted): New gvar. Default to 2 for now.
	Note: should change default after going through game modules.
	* init.c (make_trial_assignments): Use g_sides_wanted
	between g_sides_min and g_sides_max.
	
	Add code that will help to catch the dead transport bug.
	* unit.c (enter_transport): Add run_error if the unit is 
	trying to enter a dead transport.
	
	Fix missing space bug in past_unit_handle and simplify 
	the code in the other unit handles.
	* nlang.c (apparent_unit_handle): Move inserted spaces.
	(medium_long_unit_handle): Move inserted spaces.
	(past_unit_handle): Add missing space.

2003-08-07  Hans Ronne <hronne@telia.com>

	Back out of colonizer fix that broke the Empire game.
	* plan.c (plan_colonize): Don't return after calling
	plan_colonize_support since the latter just pushes
	build tasks without executing them.

	Fix decimal auto-repair errors in some game modules.
	* 3rd-age.g (auto-repair): Change 100 to 100.00.
	* gettysburg.g (hp-per-repair): Change 2 to 2.00.
	* monster.g (hp-per-repair): Change 150 to 1.50.
	* napoleon.g (hp-recovery): Change 1 to 1.00.
	* postmodern.g (hp-per-repair): Add dots everywhere.

2003-08-06  Hans Ronne <hronne@telia.com>

	Fix long-standing bug by which units who could not possibly 
	auto-repair got stuck forever in reserve mode trying to do
	auto-repair. The basic problem was that the repair code only 
	checked if a unit type existed that could repair our unit, but not 
	if our side had such a unit or if it was nearby. To fix this, the
	checks for will_be_auto_repaired have been replaced by new 
	functions (auto_repair_at and can_be_auto_repaired) that
	scan all trusting units within range for their ability to repair 
	our particular unit.
	* plan.c (can_be_auto_repaired): New function and prototype. 
	Figures out if tmpunit can be repaired by staying put or moving 
	within range of a repairing unit.
	(repair_if_damaged): Rewrite. Call auto_repair_at instead of 
	just testing for will_be_auto_repaired.
	* task.c (auto_repair_at): New function and prototype.
	(do_repair_task): Rewrite. Use auto_repair_at instead of 
	repair_test as search_around argument. 

	Add debugging support in the resupply and repair task code.
	* task.c (do_repair_task) Add a Dprintf message in case the 
	repair task fails.
	(do_resupply_task) Add a Dprintf message in case the 
	resupply task fails.

	Remove dubious set_unit_reserve call if resupply task fails.
	Note: if the task fails, something is wrong and going into
	reserve mode won't fix things.
	* task.c (do_resupply_task): Don't call set_unit_reserve
	if the resupply task fails.

	Add support for explicit self-repair by the damaged unit in 
	the automatic repair task code.
	* plan.c (repair_if_damaged): Call set_repair_task followed
	by execute_task if check_repair_action returns true.
	* task.c (do_repair_task): Call prep_repair_action and set 
	TASK_PREPPED_ACTION if check_repair_action returns true.

	Fix bug in the repair task code that tested for unit_trusts_unit 
	the wrong way. Also always iterate over occupants in the repair
	code.
	* plan.c (repairs_here): Iterate over for_all_stack_with_occs 
	insted of just for_all_stack.
	* run2.c (auto_repair_from_here): Simplify code by iterating 
	over for_all_stack_with_occs instead of for_all_stack followed 
	by for_all_occs_with_occs.
	* task.c (repair_here): Swap unit and tmpunit args. Iterate over 
	for_all_stack_with_occs insted of just for_all_stack.

	Fix serious bugs in the resupply, rearm and repair code that would 
	cause buzzing between these tasks and regular plan execution when
	a move-to task had been scheduled by the resupply or repair code.
	* plan.c (rearm_if_low): Return execute_task result instead of 
	false for TASK_MOVE_TO.
	(resupply_if_low): Return execute_task result instead of false 
	for TASK_MOVE_TO.	
	(repair_if_damaged): Return execute_task result instead of 
	false for TASK_MOVE_TO.

	Add more informative descriptions of the different repair tasks.
	* kernel.h (repairmode): Enumerate NO_REPAIR, SELF_REPAIR,
	HP_RECOVERY and AUTO_REPAIR.
	* nlang.c (task_desc): Use args[0] to describe the various types
	of repair tasks correctly.
	(goal_desc): Change to Hold for GOAL_UNIT_OCCUPIED.
	* task.c (do_repair_task): Set args[0] to the correct repairmode 
	and args[1] and args[2] to x and y in case AUTO_REPAIR.

	Simplify and clean up do_repair_task. Add the new unit_doctrine 
	repair_complete instead of hard-coded 80% value.
	* side.c (new_doctrine): Initialize repair_complete to 100%.
	* side.h (a_doctrine): Add short repair_complete.
	* task.c (do_repair_task): Remove test for repair_percent since
	this is already tested for in repair_if_damaged. Check the new
	unit_doctrine repair_complete first of all. Break up if else if
	chain into separate if clauses. Move the range computing code
	to where it is first needed. Remove hard-coded 80% value.

	Remove redundant execute_task calls in the plan execution code.
	* plan.c (plan_offense): Don't call execute_task again if already
	called in rearm_if_low, resupply_if_low or repair_if_damaged.
	(plan_defense): Don't call execute_task again if already called in 
	rearm_if_low, resupply_if_low or repair_if_damaged.
	(plan_exploration): Don't call execute_task again if already called 
	in resupply_if_low or repair_if_damaged.
	(plan_colonize): Don't call execute_task again if already called 
	in resupply_if_low or repair_if_damaged.

	Fix bug in the code for switching to plan_colonize_support.
	* plan.c (plan_colonize): Return after plan_colonize_support
	call instead of proceeding with plan_colonize.

	Fix so that colonizing units carry through with offensive tasks
	before trying to colonize the current cell.
	* plan.c (plan_colonize): Test for TASK_HIT_UNIT etc first.

	Improve the responsiveness of the ai when it is turned on in 
	the middle of a game.
	* ai.c (set_side_ai): Call ai_init_turn if the ai is turned on so
	that the strategy and theater code is recomputed right away.
	(ai_decide_plan): Call ai_react_to_action after to_decide_plan
	pointer execution instead of before it to ensure that tasks set by
	the tactical reaction are not overwritten.

	Simplify and improve the ai reaction code by testing directly for
	resupply and repair tasks instead of trying to figure out indirectly
	if a unit is doing resupply or repair. Rearrange header content
	accordingly.
	* ai.c (ai_react_to_action): Test directly if TASK_REPAIR or
	TASK_RESUPPLY has been set instead of recomputing things by
	calling will_be_auto_repaired, low_on_supplies_one and 
	low_on_ammo_one.
	* ai.h (any_auto_repair): Don't declare it here.
	(will_be_auto_repaired): Don't declare it here.
	* kernel.h (will_be_auto_repaired): Declare extern char pointer.
	(auto_repair_range_max): Declare extern short pointer.
	* plan.c (ai.h): Don't include it here.
	* run2.c (will_be_auto_repaired): Initialize it to NULL.
	(auto_repair_range_max): Initialize it to NULL.

	Fix bug that would cause unarmed units in combat model 1 to 
	try in vain to capture other units.
	* combat.c (model_1_attack): Add comment.
	(capture_chance): Add special code for combat model 1.

	Add the ability to name units in order from a given list by 
	using the keyword K_IN_ORDER.
	* kernel.h (sort_units): Don't prototype here.
	* keyword.def (K_IN_ORDER): Define as "in-order".
	* mknames.c (run_namer): Handle case K_IN_ORDER.
	(name_units_randomly): Call sort_units first, and then use
	unit side lists instead of the global unit list for naming.
	* unit.h (sort_units): Prototype here instead.

	Fix bug that caused units created by encounter with lucky 
	huts in the civ2 game to be incomplete.
	* unit.c (change_unit_type): Set unit2->cp to u_cp(newtype).

	Make sure that new units created by change_unit_type (i.e. 
	advanced tribes in the civ2 game) are named correctly.
	* unit.c (change_unit_type): Call make_up_unit_name.

	Further tweaks to self-unit related notification messages.
	* unit.c (change_unit_side): Call short_side_title instead of
	side_name. Call it again before side_loses messages.
	(kill_unit_aux): Call short_side_title before side_loses
	messages.

	Fix so that event-notices and event-narratives also work with
	unit-vanished (used in several games).
	* nlang.c (pattern_matches_event): Add case H_UNIT_VANISHED
	with same code as H_UNIT_STARVED.
	(event_desc_from_list): Add case H_UNIT_VANISHED with same 
	code as H_UNIT_STARVED.

	Improve debugging support in the precomputing ai code.
	* ai.c (basic_worth): Change wording in DMprintf message from 
	"worth" to "basic worth".
	(basic_hit_worth): Calculate worth before returning it. 
	(basic_capture_worth): Calculate worth before returning it. 

2003-08-03  Eric McDonald <emcdonal@cps.cmich.edu>

        Update the RPM spec file.
        * xconq.spec: Alter install paths to reflect common 
        conventions. Change version number. Build texinfo 
        files. Install texinfo files along with the man page. 
        Copy the README, COPYING, and ChangeLog files to a 
        Xconq documentation directory during install. Point out 
        documentation files and directories to RPM. 

2003-07-26  Hans Ronne <hronne@telia.com>

	Add back some stuff needed to compile the x11 interface.
	* kpublic.h (download_to_player): Add back prototype.
	* tp.c (download_to_player): Add back function.
	(send_assignment): Add back function.
	(send_randstate): Add back function.

	Fix another compile error in the x11 interface.
	* xmap.c (move_the_selected_unit): Call type_can_occupy_cell
	instead of can_occupy_cell.

	Fix possible buffer overflow problem in default_player_spec 
	on Unix (thanks Steve Kemp).
	* xconq.c (make_default_player_spec): Limit it to BUFSIZE -1.
	* xtconq.c (make_default_player_spec): Limit it to BUFSIZE -1.

	Fix bug that prevented the wrecking code from working correctly.
	* unit.c (change_unit_type): Call type_can_occupy_cell_without
	instead of type_can_occupy_cell so that the unit to be wrecked is
	not counted twice.

	Fix so that units that can fire add the tactical range to their firing 
	range when seeking targets. Note: without this change, such units 
	would remain stuck in the same cell since they could always hit 
	any targets they found without moving.
	* ai.c (ai_fire_at_opportunity): Add u_ai_tactical_range to range.
	* plan.c (fire_at_opportunity): Add u_ai_tactical_range to range.

	Fix suicide by self-capture bug for units that sieze their transport.
	* combat.c (capture_unit): Don't recurse into occs that belong to a
	trusted_side including our own.

	Only report that an occupant escaped if the escape was successful.
	* combat.c (capture_occupant): Test if retreat_unit returned true
	before calling report_combat.

	Fix bug that prevented the killing of a self unit inside a transport
	from triggering the self unit handling code. Rewrite and improve 
	the notification code associated with self unit capture or loss.
	* unit.c (change_unit_side): Rewrite and improve notification code.
	(kill_unit): Move the self unit code to kill_unit_aux so that it also
	is executed recursively for occupants.
	(kill_unit_aux): Move self unit code here. Rewrite and improve the
	notification code.

	Change unit descriptions so that self unit status (leader or capital)
	replaces unit type instead of being added in parenthesis at the end.
	* nlang.c (apparent_unit_handle): Rewrite and move self unit code.
	(medium_long_unit_handle): Rewrite and move self unit code.

	Fix so that the first instead of the last potential self-unit is selected.
	* side.c (init_self_unit): Break when a self-unit has been found.

	Fix display glitch in the MacPPC interface due to grouping boxes 
	for moving transports being too big in case big_unit_images.
	* macmap.c (draw_selected_unit): Don't add 1 extra pixel to the 
	right if big_unit_images is true.
	(draw_selection_animation): Don't add 1 extra pixel to the 
	right if big_unit_images is true.
	* macrow.c (draw_units): Don't add 1 extra pixel to the 
	right if big_unit_images is true.
	(draw_unit_and_occs): Don't add 1 extra pixel to the 
	right if big_unit_images is true.
	(draw_unit_view_and_occs): Don't add 1 extra pixel to the 
	right if big_unit_images is true.

	Fix bugs in the MacPPC interface that would permit resignation 
	to sides no longer in the game.
	* maccmd.c (get_command_and_do): Test for side->ingame.
	* macwins.c (hit_alert_dialog): Test for side->ingame.

	Fix detonation movie in the MacPPC interface so that the entire
	map is inverted instead of just a part of it.
	* macmap.c (invert_map): Comment out offscreen code and just
	invert map->contentrect instead.

	Fix bug that sometimes would cause the MacPPC startup dialogs to 
	remain open after game launch.
	* mecmenus.c (do_menu_command): In case miFileOpen first 
	dismiss splashwin and newgamewin if either one is open.

	Fix bug in SDL grok_side checkin from 2003-07-18 so 
	that the code compiles again.
	* sdlmain.c (grok_side): Change map to screen.

2003-07-20  Hans Ronne <hronne@telia.com>

	Enable drawing of terrain transitions on Windows.
	* tkinit.c (init_other_images): Always init generic_transition.
	* tkmap.c (maskmap, colormap): Declare static Pixmaps.
	(draw_terrain_transitions): Rewrite and simplify. Then add
	code that does the necessary pixmap gymnastics on Windows,
	where we cannot use clip masks.

	Enable drawing of unseen fuzz on Windows.
	* tkinit.c (init_other_images): Init generic_fuzz on Windows.
	* tkmap.c (draw_unseen_fuzz): Add code that uses generic_fuzz
	images instead of the fuzzpics bitmaps on Windows (code ported 
	from draw_unseen_fuzz in the MacPPC interface).
	
	Fix long-standing "black-is-transparent" bug on Windows.
	* gif.c (get_gif_from_file): Remove Windows-specific code
	that unnecessarily turned black into a transparent color (sic!).

	Fix drawing of edge cells on Windows so that they no longer 
	appear half solid and half transparent.
	* tkmap.c (draw_terrain_row): Always draw tkimg->mask 
	as background if !inside_area on Windows.

	Enable drawing of correctly shaped overlays on Windows.
	* tkmap.c (draw_terrain_row): Call draw_hex_polygon instead
	of XFillRectangle if use_clip_mask is false.

2003-07-18  Hans Ronne <hronne@telia.com>

	Update BWidget code from version 1.4.1 to 1.6.0.
	* tcltk/BWidget: Update content of the folder using the sourceforge
	release after removing the BWman, demo and tests folders.

	Simplify the advances help code so that only those advances that are
	acutally needed for another advance are reported. Add code that lists
	what new unit types an advance enables. Note: should follow up this
	by removing all the aa_table_x functions and doing everything in
	describe_atype instead.
	* help.c (describe_atype): Rewrite. Add code that calculates and
	reports enabled utypes.
	(aa_table_rowcol_desc): Simplify by removing code that reports
	unneeded advances.
	* tkconq.tcl (update_help): Configure .help.bot.t.txt -background 
	$bgcolor for clickable links. Add "Needed for: " to text parsing code. 
	Set xy $tmp instead so that the string search works with the new 
	describe_atype code.

	Add separators to the help system, as suggested by Richard Hunt.
	* help.c (help_system_node): New help node.
	(init_help): Make "--- BASIC HELP ---" the first_help_node. 
	Move the help system info to help_system_node.
	(create_game_help_nodes): Add suitable separator nodes.
	(get_help_text): Handle the separator nodes correctly.
	* machelp.c (warranty_help_node): Declare extern help node.
	(create_help_window): Insert topics_help_node after
	warranty_help_node instead.
	* tkmain.c (help_system_node): Declare extern help node.
	(tk_help_goto): Change first_help_node to help_system_node.

	Fix bug in the tcltk help dialog that prevented correct drawing
	of the advances tree widget under MacTCL.
	* tkconq.tcl (update_help): Call update idletasks after deleting
	the root node of the advances tree. 
	
	Fix minor selectable text glitch in the tcltk help dialog.
	* tkconq.tcl (popup_help_dialog): Disable .help.bot.t.txt at the end.

	Simplify platform-specific handling of text boxes in the tcltk code.
	Set textb to 2 for all platforms and set all text boxes to -relief flat.
	* tkconq.tcl (textb): Set to 2 also for Unix and Windows.
	(add_new_game_dialog_items): Set .newgame.top.right.blurb.t to
	-relief flat.
	(add_variants_dialog_items): Set .newgame.top.vhelp.text to
	-relief flat.
	(popup_chat): Set .chat.mid.right.t to -relief flat.
	(create_agreements_window): Set .agreements.top.termsf.terms to 
	-relief flat.
	(popup_scores): Set .scores.main.text to -relief flat.
	(add_fonts_prefs_items): Set .prefs.main.v.fonts.sampf.sample to 
	-relief flat.
	(popup_help_dialog): Set .help.bot.t.txt to -relief flat.

	Improve appearance of the the help text and advances tree in the
	tcltk help dialog.
	* tkconq.tcl (popup_help_dialog): Set .help.bot.t.txt -padx 10.
	Set .help.bot.t.txt.tree -padx 4 -relief ridge -borderwidth 1 
	-bg $bgcolor -deltax 30 -deltay 20.
	(update_help): Add tag all for .help.bot.t.txt and configure it to
	-spacing1 1 -spacing2 2 -spacing3 1. Configure -window 
	.help.bot.t.txt.tree -pady 10. Configure .help.bot.t.txt.tree
	-width 40.

	Tweak the tcltk help dialog so that the BASIC HELP line also is 
	shown when the dialog first appears.
	* tkconq.tcl (popup_help_dialog): Set .help.bot.topics.list see 0.

	Remove redundant title label from the tcltk help nodes.
	* tkconq.tcl (popup_help_dialog): Remove .help.top.title.
	(update_help): Don't config .help.top.title.

	Fix bug in the Mac PPC help system that made the first node in 
	the topics list unclickable.
	* machelp.c (do_mouse_down_help): Test for cr1 != (*chars).

	Tweak Mac PPC help dialog so that the title never is wrapped.
	* machelp.c (create_help_window): Increase the width of 
	helptopicrect to 200 pixels.

	Fix a bug in the interface resignation code that would cause a failure 
	to recognize pluralnouns as side names.
	* maccmd.c (get_command_and_do): Also handle pluralnoun for case
	forcedtoresign. Use the same order (name adjective pluralnoun noun)
	as in side_name to ensure consistent behaviour.
	* sdlmain.c (grok_side): Same changes as above.
	* tkmain.c (grok_side): Same changes as above.

	Simplify resignation for 2 player games in the Mac PPC interface.
	* macwins.c (hit_alert_dialog): Call net_resign_game directly if
	numsides is 2 in case resignalert.

2003-07-13  Hans Ronne <hronne@telia.com>

	Improve the behaviour of the research dialog and fix bug that would stall
	the game at end-of-turn if the research dialog had been dismissed. Make 
	it possible to dismiss it only as long as units still are moving. Make sure 
	the dialog always is popped up when a research task has been completed, 
	and at the beginning and end of the turn if there is no current advance and 
	the side's research is not resting. Fix the tcltk code so that the research
	dialog always is brought to front when a research topic needs to be selected. 
	Expurgate research_popped_up from the kernel and move it to the interface 
	code where it really belongs.
	* macconq.c (research_popped_up): Declare extern int.
	(close_window): Set research_popped_up to false.
	(update_research_display): Only call show_research_dialog if
	research_popped_up is false.
	* macwins.c (research_popped_up): Declare and initialize to FALSE.
	(show_research_dialog): Set research_popped_up to true.
	* run.c (research_popped_up): Don't declare or initialize here.
	(run_game): Call update_research_display for all sides with a
	display at the start of each trun.
	(units_still_acting): Call update_research_display if the research topic
	is NOADVANCE and no units are still acting.
	(run_side_research): Don't call update_research_display if research_topic
	already is NOADVANCE. Do call update_research_display when the current
	topic first is completed.
	* tkmain.c (research_popped_up): Declare static and initialize to FALSE.
	(idle_research_notified): Declare static and initialize to FALSE.
	(update_research_display): Rewrite to handle all possible situations.
	(tk_set_side_research): Don't set research_popped_up here.
	* tkconq.tcl (popup_research_dialog): Call set_research_popped_up before
	testing if .research exists. Call wm protocol .research with the argument 
	WM_DELETE_WINDOW close_research to ensure that research_popped_up
	is reset to FALSE when .research is destroyed.  Call close_research instead of 
	withdraw_window .research when the Close button is pressed.
	(ok_research): Call close_research instead of withdraw_window .research.
	(rest_research): Call close_research instead of withdraw_window .research.
	(close_research): New procedure that calls set_research_popped_up 0.
	(bring_to_front): New procedure that brings window to the front.

	Fix emblem glitch bug for the tcltk interface under Debian Linux.
	* tkmap.c (draw_current): Return if uview does not exist. Remove
	meaningless test for rslt.
	
	Remove "Unused" label from disabled tcltk variant checkboxes.
	* tkmain.c (interpret_variants): Pass empty string instead.

2003-07-13  Eric McDonald <emcdonal@cps.cmich.edu>

        Do a partial rewrite of Language Syntax section of the Game Design
        Manual. Include more examples and try to be somewhat clearer about 
        what is being said for the sake of non-programmers.
        * refman.texi: Make changes to nodes on Lexical Elements and 
        Conventions Used.

2003-07-10  Eric McDonald <emcdonal@cps.cmich.edu>

        Fix incorrect default values and value types in Game Design Manual.
        Add a new note.
        * refman.texi: Change defaults for occupant-can-construct and 
        occupant-can-have-occupants from false to true, and 
        road-into-chance from 100 to 0. Mention that the default for 
        capacity-negation was false, for the sake of completeness. Change 
        the value type for river-chance from n% to .01n%. Note the 
        ramifications of using can-enter-independent.

2003-07-07  Eric McDonald <emcdonal@cps.cmich.edu>

        Add malloc protection to yesterday's fix.
        * lisp.c (safe_escaped_string): Check for failed malloc and exit 
        with an error, if true. This behavior is identical to that of 
        xmalloc.

2003-07-06  Eric McDonald <emcdonal@cps.cmich.edu>

        Prevent segfaults caused by writing past the end of a string buffer
        used by the GDL interpreter. Add a new funcion, safe_escaped_string, 
        and use it when necessary.
        * lisp.h (safe_escaped_string): New function prototype.
        * lisp.c (safe_escaped_string): New function.
        * write.c (write_str_prop): Use existing escaped_string when it
        is safe to do so (when string full of double quotes would be 
        escaped to less than BUFSIZE), else use safe_escaped_string.

        Properly close out a comment so that an agreements macro can be 
        found by the preprocessor, and to prevent compiler warnings about 
        a nested comment.
        * side.h (side_knows_about_agreement): Rescue this macro from 
        unclosed (Doxygen?) comment.

2003-07-01  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to July 2003.

	Fix dead self-unit null pointer bug in the save game code.
	* side.c (side_desig): Only report self-unit if in_play.

2003-06-30  Hans Ronne <hronne@telia.com>

	Fix one more array out-of-bounds bug reported by Eric McDonald. 
	Remove the ActionRecord structure latest_action and replace it with 
	a real Action. Use the latter instead of the current Action argument in 
	the execute_action debugging code.
	* actions.c (latest_action): Declare extern Action.
	(execute_action): Use latest_action instead of the Action argument
	after execution when the latter may have been blasted.
	* run.c (a_action_record): Remove struct typedef.
	(latest_action): Change type from ActionRecord to Action.
	(run_game): xmalloc latest_action as an Action instead.
	(move_one_unit_multiple): Store a complete copy of the 
	Action to be executed in latest_action.

2003-06-30  Hans Ronne <hronne@telia.com>

	One more go at the dead unit bug in do_move_action.
	* move.c (do_move_action): Use interior_point_in_dir
	instead of point_in_dir and check type_can_occupy_cell
	before proceeding with the next move_unit call in the
	multiple move while loop.

	Fix so that the bold font works again in the tcltk interface.
	* tkconq.tcl (boldfont): Define it for all platforms.
	(ok_preferences): Set boldfont for various items.

2003-06-29  Hans Ronne <hronne@telia.com>

	Fix crashes in action debug code reported by Eric McDonald.
	* move.c (do_move_action): Return either A_MOVE_UNIT_GONE or
	A_ANY_DONE in the multiple move branch.

2003-06-28  Hans Ronne <hronne@telia.com>

	Patches from Eric McDonald that fix BadWindow warnings from
	the wm withdraw command on Unix.
	* tkconq.tcl (set_players): Call withdraw_window instead.
	(popup_contour_interval_dialog): Call withdraw_window instead.
	(ok_contour_interval): Call withdraw_window instead.
	(popup_meridian_interval_dialog): Call withdraw_window instead.
	(ask_bool_done): Call withdraw_window instead.
	(popup_find_dialog): Call withdraw_window instead.
	(popup_research_dialog): Call withdraw_window instead.
	(ok_research): Call withdraw_window instead.
	(rest_research): Call withdraw_window instead.
	(close_agreements_window): Call withdraw_window instead.
	(dismiss_scores): Call withdraw_window instead.
	(popup_preferences_dialog): Call withdraw_window instead.
	(dismiss_help_dialog): Call withdraw_window instead.
	(dismiss_game_over_dialog): Call withdraw_window instead.
	(popup_contour_interval_dialog): Call withdraw_window instead.
	* tkmain.c (withdraw_window): New function and prototype.
	(tk_withdraw_window): New TclCmdFn and prototype.
	* tkmap.c (draw_map_outline): Fix compiler warning.	

	Fix save/restore bug for type 0 current advances.
	* write.c (write_side_properties): Pass NOADVANCE instead of 0 
	as dflt to write_num_prop for key K_CURRENT_ADVANCE.

	Fix yet another dead unit bug reported by Eric McDonald.
	* move.c (do_move_action): Exit while loop for multiple moves
	in one direction if the unit dies before it reaches its destination.
	
	Check that there is room for the new unit after change-type actions.
	* combat.c (model_1_attack): Check that unit is still alive after
	change_unit_type call.
	* unit.c (change_unit_type): Kill unit after letting occupants
	escape if the new type cannot sit in the cell.
	(type_can_occupy_cell): Compute space before return.
	(wreck_unit): Check that unit is alive after change_unit_type 
	call.

2003-06-27  Hans Ronne <hronne@telia.com>

	Fix crash in combat code (thanks Eric McDonald for reporting it).
	* combat.c (maybe_hit_unit): Don't recurse into occupants if the
	unit died while trying to retreat into hostile terrain.

2003-06-23  Jim Kingdon  <kingdon@panix.com>

	* doc/refman.texi: Check in patch from Eric McDonald to say
	capacity-negation is gone, to clarify unit-size-in-terrain, and
	remove duplicate entry for size.

2003-06-22  Hans Ronne <hronne@telia.com>

	Fix construction/occupancy bug for self-building transports. Add 
	some code to facilitate future debugging.
	* unit.c (can_occupy_cell_without): Compute space before return.
	(type_can_occupy_cell_without): Compute space before return.
	(can_occupy): Also permit occupancy of incomplete transport if 
	the latter is self-building. Compute space before return.
	(type_can_occupy_empty_type): Compute space before return.

2003-06-22  Hans Ronne <hronne@telia.com>

	Fix several problems with the connection code by removing the
	never fully implemented scheme where a unit's altitude would tell
	if it was resting on a connection or on the ground. Also remove the
	possibility of having more units in the cell than normally allowed
	by putting them in the connection (this made it impossible to restore 
	saved games correctly since patch_object_references could not tell 
	how to pack units into a cell and its connections in the absence of the 
	never implemented altitude code). Only use connections to permit 
	units to sit on terrain types where they would perish, but not to 
	provide extra space. Merge the test for this with the test for
	vanisihing or wrecking a unit into type_survives_in_cell.

	* actions.c (do_create_at_action): Call type_survives_in_cell
	instead. Remove separate call to type_can_occupy_conn.
	(check_create_at_action): Call type_survives_in_cell instead. 
	Remove separate call to type_can_occupy_conn.
	(garrison_unit): Call type_survives_in_cell.
	(do_transfer_part_action): Call type_survives_in_cell.
	* cmd.c (do_one_disembark): Don't call type_can_occupy_conn.
	* combat.c (do_overrun_action): Add comment.
	* init.c (patch_object_references): Call type_survives_in_cell
	instead. Remove separate call to type_can_occupy_conn.
	* mkunits.c (valid_unit_place): Call type_survives_in_cell.
	(make_independent_units): Call type_survives_in_cell instead.
	* move.c (check_move_action): Remove altitude-dependent call
	to type_can_occupy_conn.
	* run2.c (run_appearances): Call type_survives_in_cell.
	* unit.c (ut_dies_on): Remove unused macro.
	(conn_num_types): Remove unused static int.
	(type_can_occupy_conn): Remove unused function.
	(type_can_occupy_conn_1): Remove unused function.
	(type_survives_in_cell): New function and prototype.
	(eject_occupant): Check type_survives_in_cell instead.
	(enter_cell): Don't call type_can_occupy_conn.
	(designer_create_unit): Also test for type_survives_in_cell.
	Consolidate all tests att the beginning and remove redundant
	second call to type_can_occupy_cell.
	(designer_teleport): Call type_survives_in_cell.
	* unit.h (type_can_occupy_conn): Remove prototype.
	(type_survives_in_cell): Add new prototype.
	* world.c (change_terrain_type): Call type_survives_in_cell
	followed by a test for either ut_vanishes_on or ut_wrecks_on
	if it returns false to determine what happens.

	Remove the capacity-negation GDL table (currently unused)
	which manipulated available space within connections.
	* help.c (describe_utype): Remove ut_capacity_neg code.
	* table.def (ut_capacity_neg): Remove table.

	Remove some obsolete functions that were called by the serial
	network code for the Mac interface.
	* kpublic.h (init_file_port): Remove obsolete prototype.
	(low_file_send): Remove obsolete prototype.
	(close_file_port): Remove obsolete prototype.
	(download_to_player): Remove obsolete prototype.
	* tp.c (inport_filename): Remove unused static char.
	(outport_filename): Remove unused static char.
	(inport): Remove unused static FILE.
	(outport): Remove unused static FILE.
	(sendbuf): Remove unused static char.
	(send_assignment): Remove obsolete function and prototype.
	(send_randstate): Remove obsolete function and prototype.
	(init_file_port): Remove obsolete function.
	(low_file_send): Remove obsolete function.
	(close_file_port): Remove obsolete function.
	(download_to_player): Remove obsolete function.
	
	Fix failure to assign player to the last side in MAXSIDES limited
	games. Note: this also fixed some other strange bugs in these games 
	that were caused by unallocated memory being stomped on.
	* side.c (create_side): xmalloc MAXSIDES + 1 elements in the
	assignments array.

	Add some checks for null pointers in the Mac interface.	
	* macconq.c (maybe_select_next_unit): Add checks that unit
	exists. Not required right now but still a good idea.

	Fix failure of the tcltk player setup dialog to list the last side 
	in MAXSIDES limited games.
	* tkconq.tcl (add_player_dialog_items): Add 1 to maxs.
	
	Fix strange bug due to a unit but not its controlling side being 
	able to build a particular unit type.
	* unit.c (can_build): Call unit_can_build_type instead so that 
	we also check that side_can_build is true. 

2003-06-19  Hans Ronne <hronne@telia.com>

	Fix bug in build code that would allow units to be built on connections
	even if there was no room for the unit (thanks Eric McDonald). Clean
	up the volume code after fixing the bug.
	* actions.c (check_create_at_action): Call type_can_occupy_conn 
	instead of type_can_sit_on_conn. Rearrange code.
	(do_create_at_action): Rewrite as for check_create_at_action.
	* cmd.c (do_one_disembark): Call type_can_occupy_conn instead.
	* init.c (patch_object_references): Call type_can_occupy_conn instead.
	* move.c (check_move_action): Call type_can_occupy_conn instead.
	* unit.c (enter_cell): Call type_can_occupy_conn instead.
	(can_occupy_conn): Just pass the unit type as argument and rename 
	function to type_can_occupy_conn.
	(can_occupy_conn_1): Just pass the unit type as argument and 
	rename function and prototype to type_can_occupy_conn_1.
	(type_can_sit_on_conn): Remove obsolete function.
	* unit.h (can_occupy_conn): Just pass the unit type as argument
	and rename prototype to type_can_occupy_conn.
	(type_can_sit_on_conn): Remove obsolete prototype.
	* world.c (change_terrain_type): Call type_can_occupy_conn instead.

	Continued cleanup of the volume code. Call type_can_occupy_cell 
	instead of can_occupy cell.
	* actions.c (garrison_unit): Call type_can_occupy_cell instead.
	(do_create_at_action): Call type_can_occupy_cell instead.
	(do_transfer_part_action): Call type_can_occupy_cell instead.
	* cmd.c (do_one_disembark): Call type_can_occupy_cell instead.
	* combat.c (do_overrun_action): Call type_can_occupy_cell instead.
	* init.c (patch_object_references): Call type_can_occupy_cell instead.
	* move.c (check_move_action): Call type_can_occupy_cell instead.
	* run2.c (run_appearances): Call type_can_occupy_cell instead.
	* unit.c (eject_occupant): Call type_can_occupy_cell instead.
	(change_cell): Call type_can_occupy_cell instead.
	(designer_teleport): Call type_can_occupy_cell instead.
	(designer_create_unit): Call type_can_occupy_cell instead.
	(enter_cell): Call type_can_occupy_cell instead.
	(can_occupy_cell): Remove obsolete function.
	(oc_numtypes): Remove obsolete static int.
	* unit.h (can_occupy_cell): Remove.
	
	Fix init warnings due to TABLO error in fire-terrain-effect tables 
	(thanks Eric McDonald).
	* table.def (ut_fire_attack_terrain_effect): Set TABLO to -1.
	(ut_fire_defend_terrain_effect): Set TABLO to -1.

2003-06-18  Hans Ronne <hronne@telia.com>

	Fix major bug in the unit view code (thanks Eric McDonald). The bug
	caused restored unit views to get null sides assigned, since some views
	were read before the controlling side. The fix is to store side numbers
	instead of side pointers in the unit view objects and modify the code
	accordingly. This fix is compatible with existing saved games.

	* ai.c (enemies_present): Change uv->side to side_n(uv->siden).
	(check_current_target): Change uview->side to side_n(uview->siden).
	(preferred_build_type): Change uview->side to side_n(uview->siden).
	* mplayer.c (review_theaters): Change uview->side to 
	side_n(uview->siden).
	(estimate_strengths): Change uview->side to side_n(uview->siden).
	* plan.c (victim_here): Change uview->side to side_n(uview->siden).
	(alternate_target_here): Change uview->side to uview->siden.
	(target_here): Change uview->side to side_n(uview->siden).
	(indep_captureable_here): Change uview->side to side_n(uview->siden).
	(useful_captureable_here): Change uview->side to side_n(uview->siden).
	(can_capture_neighbor): Change uview->side to side_n(uview->siden).
	* ps.c (sideno_of_seen_unit_at): Change uview->side->id to uview->siden.
	* read.c (interp_unit_views): Change uview->side to uview->siden.
	* side.c (side_sees_image): Change uview->side to side_n(uview->siden).
	(unit_view_at): Change tmp_unit_view.side to tmp_unit_view.siden.
	(unit_view_next): Change tmp_unit_view.side to tmp_unit_view.siden.
	(add_unit_view): Change uview->side to uview->siden.
	(all_see_leave): Change uview->side to uview->siden.
	(reset_view): Change uview->side to uview->siden.
	(react_to_seen_unit): Change uview->side to side_n(uview->siden).
	* task.c (target_visible): Change uview->side to side_n(uview->siden).
	(do_hit_unit_task): Change uview->side to side_n(uview->siden).
	* ui.c (nearest_unit_view): Change side->id to siden.
	(oneliner): Change uview->side to uview->siden. Change uview->side 
	to side_n(uview->siden).
	(dump_text_view): Change side->id to siden.
	* unit.h (a_unit_view): Change Side *side to short siden.
	* write.c (write_side_view): Change side->id to siden.
	
	* macmap.c (draw_unit_names_only): Change uview2->side to
	side_n(uview2->siden). Change side_number(uview->side) to
	uview->siden (2 times).
	* macrow.c (draw_units): Change uview2->side to
	side_n(uview2->siden). Change side_number(uview->side) to
	uview->siden.
	(draw_unit_view_and_occs): Change uview->side->id to 
	uview->siden. Change uview->side to side_n(uview->siden). Change 
	uview->transport->side to side_n(uview->transport->siden).

	* tkmain.c (update_mouseover): Change uview->side to 
	side_n(uview->siden).
	* tkmap.c (draw_units): Change uview->side to uview->siden.
	Change uview->side->id to uview->siden.
	(draw_unit_view_and_occs): Change side_number(uview->side) 
	to uview->siden. Change side->id to siden.

	* sdlmain.c (update_mouseover_x): Change uview->side to 
	side_n(uview->siden).
	* sdlmap.c (draw_units): Change uview->side to uview->siden.
	Change uview->side->id to uview->siden.
	(draw_unit_view_and_occs): Change side_number(uview->side) 
	to uview->siden. Change side->id to siden.
	
	* xdraw.c (draw_units): Change uview->side->id to uview->siden.
	Change uview->side->id to uview->siden.
	(draw_unit_view_and_occs): Change side_number(uview->side) 
	to uview->siden.	Change side->id to siden.
	(draw_map_info): Change uview->side to side_n(uview->siden).

	* cdraw.c (draw_units): Change uview->side->id to uview->siden.
	(show_closeup):  Change uview->side to side_n(uview->siden).

	Fix crashes in Mac OS9 when loading huge game files. Note: this
	was first seen after the above unit view fixes. Should figure out
	why, and why it only affects Mac OS9.
	* macimf.c (convert_ctab): Don't lock and unlock ctabhandle.

2003-06-17  Jim Kingdon  <kingdon@panix.com>

	Check in change from Eric McDonald:
	* doc/design.texi, doc/refman.texi, doc/syntax.texi: Change cp-max
	to cp.  Note that occupant-can-have-occupants is gone.

2003-06-17  Stan Shebs <shebs@apple.com>

	* macimf.c: Include QT framework if OS X.

2003-06-17  Hans Ronne <hronne@telia.com>

	Fix Apple menu problem so that IMFAppTCL builds also with 
	dynamic linkage on the Mac. Note: clip masks etc. do not work 
	with dynamic instead of static linkage since the improved tcltk
	functions in tkxmac.c then are bypassed by the shared libs.
	* iappmac.c (main): Remove apple menu code.
	* imfapp.tcl: Add apple menu code for the Mac.

	Tweak the Apple menu in XconqTCL for the Mac.
	* tkconq.tcl: Set state normal for about item in apple menu
	and change label to XconqTCL.

	Fix so that two tcl scripts that are missing from MacTcl 8.4 
	instead are provided in the resource fork of xconq.
	* tkmac.r (TEXT 3018 "spinbox"): Add tcl script.
	(TEXT 3019 "panedwindow"): Add tcl script.
	(vers 2): Change Xconq to XconqTCL.

	Add a separate resource file for the MacTcl IMFApp. 
	* iappmac.r: New resource file in the tcltk directory.
	
	Tweaks to the IMFApp (Mac PPC) resources.
	* IMFApp.r (cicn 12345 ""): Remove unused cicn.
	(vers 1): Update version numbers to 7.5pre.
	(vers 2): Update version numbers to 7.5pre.
	
	Further platform/compatibility fixes to the time code.
	* socket.c (low_receive): Declare start_time and now as 
	time_t instead of long.
	* tp.c (send_packet): Declare start_time and now as
	time_t instead of long.

2003-06-17  Hans Ronne <hronne@telia.com>

	Add config patches for Cygwin (thanks Stanley Sutton).
	* aclocal.m4 (CY_AC_LOAD_TCLCONFIG): Add AC_SUBST for
	TCL_UNSHARED_LIB_SUFFIX and TCL_EXTRA_CFLAGS.
	* configure.in (AC_CANONICAL_HOST): Add macro.
	(HFLAGS): Set to -mwin32 for CONFIGTARGET="wconq".
	* configure: Regenerate.

	Minor cleanups in the tcltk code.
	* tkxmac.c (USE_NON_CONST): Define for 8.4 source 
	compatibility. Bracket it and the tcltk includes with 
	ifdef cplusplus extern "C" clause.
	
2003-06-16  Hans Ronne <hronne@telia.com>

	Fix gettimeofday confusion once and for all by relegating the
	fake definitions to the platform-specific code, where they 
	really belong.
	* mac.c (timeval): Define if _SYS_TIME_H_ is not defined.
	(gettimeofday): Move fake definition for Mac OS here.
	* sdlconq.h: Remove complex platform-specific defines needed 
	to support the use of timeval and gettimeofday in autoscroll.
	(time.h): Don't include it here.
	(a_screen): Remove timeval autoscroll_start_time.
	* sdlmain.c (autoscroll): Use record_ms and n_ms_elapsed
	instead of gettimeofday to compute the autoscroll delay. Also
	remove commented out debugging code.
	* tkconq.h: Remove complex platform-specific defines needed 
	to support the use of timeval and gettimeofday in autoscroll.
	(time.h): Don't include it here.
	(a_map): Remove timeval autoscroll_start_time.	
	* tkimf.h (gettimeofday): Don't prototype ifdef WIN32 here.
	* tkmain.c (autoscroll): Use record_ms and n_ms_elapsed
	instead of gettimeofday to compute the autoscroll delay. Also
	remove commented out debugging code.
	* util.c (time.h): Don't include it here.
	(timeval): Remove conditional defintion for Windows.
	(gettimeofday): Remove fake definitions for Windows and Mac.
	Prototype extern for non-Unix like systems.
	* win32.c (timeval): Define for Visual C++.
	(gettimeofday): Move fake definition for CodeWarrior and 
	Visual C++ here.
	
	Make the Cygwin version of the time code, which uses
	gettimeofday, the only version on Windows systems.
	* win32.c (reallasttime): Remove non-Cygwin version.
	(realcurtime): Remove non-Cygwin version.
	(n_seconds_elapsed): Remove non-Cygwin version.
	(reallastmstime): Remove non-Cygwin version.
	(n_ms_elapsed): Remove non-Cygwin version.
	(record_ms): Remove non-Cygwin version.

	Fix splash picture crashes and redraw problem in Mac OS.
	* macinit (draw_splash_dialog): Check if splashpicture exists
	before calling make_pict_from_gif.
	(hit_splash_dialog): Check that the dialog still exists before
	trying to redraw it.

	Fix network code so that joining a game works also for Mac OSX.
	* tp.c (try_join_game): Add pause ifdef MACOSX before calling 
	send_join. Note: should figure out why this hack is needed.
	
	Finally fix fake definition problems between Mac OS9 and OSX.
	* util.c (timeval): Only define if _SYS_TIME_H_ is false.

	Fix Mac OSX crashes when hosting after trying to join a game.
	* tp.c (try_join_game): Call close_remote_connection also if
	open_remote_connection fails.

	Use a scaled down version of the old splash picture as default 
	image for games without a preview.
	* macinit.c (draw_newgame_dialog): Also look for default.gif.
	* tkconq.tcl (select_game): Also look for default.gif.
	* default.gif: New scaled version of oldsplash.gif.
	
	Fix crashes in Mac OSX due to KillPicture being called for a
	resource.
	* macinit.c (hit_splash_dialog): Call ReleaseResource first,
	and then KillPicture but only if ResError.
	(draw_newgame_dialog): Call ReleaseResource first, and 
	then KillPicture but only if ResError.

	Fix Mac OSX crashes due to null pointer in the prefs dialog.
	* macprefs.c (set_preferences): Remove unused itemnum.
	(save_preferences_settings): Null intemnum instead of the
	pointer to itemnum.

	Back out of some of the recent fixes to the Mac code.
	* util.c (sys/time.h): Don't include it.
	(timeval): Put back fake definition.

2003-06-10  Hans Ronne <hronne@telia.com>

	Fix prototype error in the Mac specific code.
	* util.c (gettimeofday): Don't declare it static.

2003-06-08  Hans Ronne <hronne@telia.com>

	Fix Mac OSX problem with fake timeval definition and 
	argument type for gettimeofday.
	* util.c (timeval): Remove fake definition.
	(OSUtils.h): Don't include ifdef MAC.
	(sys/time.h): Include instead ifdef MAC.
	(gettimeofday): Change second argument type from void
	to struct timezone.

	Make sure the game picture always has 240 x 160 pixels
	available both in the tcltk and Mac PPC interfaces.
	* tkconq.tcl (add_new_game_dialog_items): Reorder the
	packing of frames so that the width of the right frame is
	fixed to 240 pixels and does not depend on the list font.
	* Xconq.r (DITL 129 "New Game Items"): Make the game
	module picture field 240 x 160 pixels.

	Add support for Show All Games check box in the Mac PPC
	interface.
	* macdefs.h (diNewGameCheckBox): Add new check box.
	* macinit.c (listallgames): New static int.
	(fill_newgame_list): New function and prototype.
	(create_newgame_dialog): Call fill_newgame_list instead.
	(hit_newgame_dialog): Toggle the check box and listallgames.
	Call fill_newgame_list and draw_newgame_dialog.
	(module_from_cell): Skip over unseen game modules when
	computing the selected module.
	(select_game): Skip test for game_already_loaded. 
	* Xconq.r (DITL 129 "New Game Items"): Add new check box.
	Tweak various item sizes and positions.

	Consolidate image handling by adding code to the Mac PPC
	interface that can read gifs from files and convert them into 
	PICT resources for use in dialogs etc.
	* macinit.c (splashpicture): New PicHandle.
	(lastmainmodule): New static Module.
	(draw_splash_dialog): Call make_pict_from_gif before
	looking for a named PICT resource. Do this both for defined
	picture names and for the main module name. Then do the
	same for the base module. Use GetDItem to get the image 
	rect for framing.
	(hit_splash_dialog): Simplify by removing short done. Call
	close_window(splashwin) amd KillPicture(splashpicture)
	directly instead.
	(draw_newgame_dialog): Call make_pict_from_gif before
	looking for a named PICT resource.
	* macimf.h (make_pict_from_gif): Add new prototype.
	* macimf.c (ImageCompression.h): Include it.
	(make_pathname): Prototype extern.
	(initial_vrefnum): Declare extern short.
	(initial_dirid): Declare extern long.
	(make_pict_from_gif): Add new function.
	* Xconq.r (DITL 128 "Splash Items"): Unlink the PICT and
	make it 240 x 160 pixels in size.
	(DITL 133 "About Items"): Link to PICT 2001 instead of
	2000.

	Add support for game image previews to tcltk new game dialog.
	* tkconq.tcl (add_new_game_dialog_items): Reduce height of
	canvas to 20 pixels. Tweak label position. set -expand true
	instead of -fill x. Reorder items so that the image canvas is 
	added last of all.
	(select_game): Rewrite and add support for preview image
	display if images are available.
	* tkmain.c (tk_game_info): Set game_picturename,
	game_basemodule and game_basemodule_picturename. 
	* ancient.g: Change file name to ancient-days.g and module 
	name to ancient-days in order to resolve name conflict with 
	ancient.gif.
	* game.dir: Change ancient to ancient-days.
	* galaxy2.g: Change title to "Galaxy 2" to avoid confusion.

2003-06-07  Hans Ronne <hronne@telia.com>

	Make bigger splash images that fit the splash dialogs in both
	the Mac PPC and tcltk interfaces.
	* oldsplash.gif: Old splash image.
	* splash.gif: New splash image.
	* macinit.c (draw_splash_dialog): Frame the splash image.
	* Xconq.r (DITL 128 "Splash Items"): Tweak image size.
	(DLOG 128 "Splash"): Increase width to 500 pixels.
	(PICT 2000 "Splash"): New splash image.
	(PICT 2001 "Old Splash"): Old splash image.

	Fix so that the tcltk splash screen is the same size as the other
	startup screens and stays on screen until the new game list is
	displayed.
	* tkconq.tcl (popup_splash_screen): Increase the size of the
	.newgame.top frame to 500 x 370 pixels.
	(add_splash_screen_dialog_items): Anchor the splash canvas
	at nw instead of n. Tweak canvas size. Add solid relief border 
	and padding to canvas. Make image 500 x 320 pixels.
	(popup_game_dialog): Don't resize .newgame.top or withdraw 
	.newgame.

2003-06-05  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to June 2003.

	Fix tcltk code for 8.4 source compatibility.
	* tkconq.h (USE_NON_CONST): Define.
	* tkiapp.c (USE_NON_CONST): Define.
	* tkiasmp.c (USE_NON_CONST): Define.

	Fix so that terrain transitions work both with solid colors and 
	with patterns in the Mac PPC interface.
	* macdraw.c (draw_terrain_transitions): Rewrite and add 
	support for patterns and solid colors. Fix 1-pixel overlap
	bugs both for normal terrain and for coatings and overlays.
	(draw_hex_region): Minor cleanups in the code.
	* macrow.c (draw_row): Test for map->draw_transitions.
	
	Make drawing of terrain transitions user-settable for maps
	and also add support for global default preference in the Mac
	PPC interface.
	* macconq.h (default_draw_transitions): New extern int.
	(m_xform_occupant_view): Add missing prototype.
	* maccolors.c (default_draw_transitions): Initialize to true.
	* macdefs.h (miTerrainTransitions): New menu item.
	(diPrefsTerrainTransitions): New dialog item.
	* macmap.c (create_map): Set map->draw_transitions form
	default_draw_transitions
	* macmenus.c (toggle_map_draw_transitions): New function 
	and prototype.
	* macprefs.c (ui_update_state): Update default_draw_transitions.
	(interp_mac_ui_data): Set default_draw_transitions.
	(set_preferences): Handle case diPrefsTerrainTransitions.
	(add_preferences_topic_items): Set default_draw_transitions.
	(do_menu_command): Handle case miTerrainTransitions.
	(adjust_menus): Enable and check miTerrainTransitions.
	* Xconq.r (DLOG 700 "Preferences"): Increase height. Move
	the OK and Cancel buttons accordingly.
	(DITL 702 "Preferences Map Items"): Add new check button.
	(MENU 217 "Colors & Masks Popup): Add new menu item.

	Fix yet another bug in the tcltk terrain transition code.
	* tkmap.c (draw_terrain_transitions): Call XSetForeground
	also for case mapw->draw_terrain_patterns (2 times).

	Fix wrecked unit occupant bug (thanks Lincoln Peters) and
	consolidate the code so that wreck_unit always is called.
	* combat.c (damage_unit): Call wreck_unit instead, with
	hevttype as argument.
	* kernel.h (wreck_unit): Add hevttype argument.
	(eject_excess_occupants): Remove extern prototype.
	* move.c (do_move_action): Pass H_UNIT_WRECKED in call
	to wreck_unit (2 times).
	(do_move_action): Pass H_UNIT_WRECKED to wreck_unit.
	* run2.c (run_unit_fates): Pass H_UNIT_WRECKED in call
	to wreck_unit.
	* unit.c (eject_excess_occupants): Add static prototype.
	(wreck_unit): Add hevttype argument and pass it on to 
	change_unit_type.
	(change_unit_side): Don't iterate for occupants if the unit
	changed side due to being wrecked.
	* world.c (change_terrain_type): Call wreck_unit instead, 
	with hevttype as argument.

	Fix MacOS crashes if certain image files were missing.
	* macdraw.c (draw_unseen_fuzz): Test if timg != NULL.
	(draw_shore_images): Test if timg != NULL.
	(draw_border_images): Test if timg != NULL.

	Clean out obsolete console support in the Mac apps (this
	stuff was required when linking against MSL_C_PPC.Lib and
	MSL_C_Carbon.Lib, but is not needed with the modern
	MSL_All_PPC.Lib and MSL_All_Carbon.Lib.
	* imfapp.c (console.h): Dont include it.
	(InstallConsole): Remove dummy function.
	(RemoveConsole): Remove dummy function.
	(WriteCharsToConsole): Remove dummy function.
	(ReadCharsFromConsole): Remove dummy function.
	(__ttyname): Remove dummy function.
	* macconq.c (console.h): Dont include it.
	(InstallConsole): Remove dummy function.
	(RemoveConsole): Remove dummy function.
	(WriteCharsToConsole): Remove dummy function.
	(ReadCharsFromConsole): Remove dummy function.
	(__ttyname): Remove dummy function.

2003-05-25  Hans Ronne <hronne@telia.com>

	Tweak canvas size and selection boxes for all interfaces.
	* tkisamp.c (imfsample_display): Add 2 pixels to the imfsample
	height. Reduce selection box width & height by 1 pixel ifdef MAC. 

2003-05-25  Jim Kingdon  <kingdon@panix.com>

	* kernel/imf.c (best_image): Check whether we got back NULL from
	the first call to add_shrunken_image before dereferencing.

2003-05-25  Hans Ronne <hronne@telia.com>

	Fix so that file locations are read correctly when opening imf files,
	and so that pathnames are removed before saving imf directories.
	* imf.h (interp_imf_form): Add new argument for the filename. 
	* imf.c (load_imf_file): Pass filename to interp_imf_form.
	(interp_imf_form): Add new argument for the filename. Call
	get_image_file. Set imf->location and imf->location->loaded.
	(write_imf_dir): Remove any pathnames before saving the
	image family location into an imf directory.

	Add code for reading & saving imf directories in the tcltk imfapp.
	* tkiapp.c (tk_open_imf_dir_file): New function and prototype.
	(tk_save_imf_dir_file): New function and prototype.
	(ui_init): Create the Tcl commands "open_imf_dir_file" and 
	"save_imf_dir_file".
	* imfapp.tcl (.menubar.file): Enable the menu items for
	open_imf_dir_cmd and save_imf_dir_cmd.
	(open_imf_dir_cmd): Add content to dummy cmd.
	(save_imf_dir_cmd): Add content to dummy cmd.

	Remove obsolete limits on the number of image families 
	in the tcltk code and use MAXIMAGEFAMILIES instead.
	* imf.c (MAXIMAGEFAMILIES): Don't define here.
	* imf.h (MAXIMAGEFAMILIES): Define here instead.
	* tkisamp.c (MAXROWS, MAXCOLS, MINROWS, MINCOLS,
	MAXFAMS): Remove obsolete macros.
	(imfsample_cmd): Allocate imfsample->imf_lis using
	MAXIMAGEFAMILIES instead of MAXFAMS.
	* tkimf.c (tkimages): Size to MAXIMAGEFAMILIES 
	instead of 1000.
	(numtkimages): Initialize to 0.
	
	Fix null pointer bug in the tcltk code (thanks Jim Kingdon).
	* tkmap.c (draw_unit_image): Check that uimg exists.

2003-05-24  Hans Ronne <hronne@telia.com>

	Fix search for sibling images directory so that it works
	correctly also under Unix and Windows (already fixed
	for the Mac). Consolidate the code.
	* gif.c (get_gif): Dont add library paths here.

	Fix so that ximfapp can be run also from the top directory.
	* tkiapp.c (ui_init): Fix alternative path bug.

	Clean out some obsolete X11 stuff from the tcltk code
	and consolidate some functions.
	* tkiapp.c (ui_init): Remove unused argc and argv args.
	(add_library_path): Enable also ifdef UNIX.
	(outdirname): Remove commented out code.
	* ximfapp.c (ui_init): Remove argc and argv arguments.
	(main): Remove argc and argv arguments in ui_init call.
	(last_user_xconq_lib): Remove LibraryPath.
	(add_library_path): Remove function.
	* iappmac.c (ui_init): Remove argc and argv arguments.
	(main): Remove argc and argv arguments in ui_init call.
	* iappwin32.c (ui_init): Remove argc and argv arguments.
	(WinMain): Remove argc and argv args in ui_init call.

	Fix strange bug that prevented imf files from being loaded
	in the tcltk imfapp for unix.
	* keywords.def: Restore all keywords that were commented 
	out on 2003-02-26. Note: should figure out which keyword
	was the important one.

	Fix failure to generate certain small or large closeup
	images in the tcltk imfapps.
	* imf.c (best_image): Call add_shrunken_image twice.
	(add_shrunken_image): Remove commented out ban on
	shrinking synthetic images.
	(add_magnified_image): Remove ban on magnifying 
	synthetic images.

	Init signal handlers when available in the tcltk imfapps.
	* tkiapp.c (init_signal_handlers): Prototype extern.
	(imfapp_main): Call init_signal_handlers.

	Fix bug in x positions of unit images under the grid option.
	* tkisamp.c (imfsample_display): Dont use imfsample->pad
	if imfsample->show_grid is true. Tweak position and size of
	the selection box.

	Fix the tcltk imfapp menu bug. Note: .menubar.file crashes 
	if declared before use. Should figure out why, even if it does 
	not matter here.
	* imfapp.tcl (.menubar.view.fg): Declare it before using it.
	(.menubar.view.bg): Declare it before using it.
	(.menubar.view): Declare it before using it.
	(.menubar.file): Move it back to before .menubar.view.
	
	Simplify the closeups in the tcltk amfapp. Only use box sizes 
	that can accomodate big images, but rename them to the size of 
	the corresponding unit box. Add big unit compatible box for
	the smallest magnification (12 x 13 instead of 8 x 8).
	* imfapp.tcl (mag): Set it to 32.
	(.menubar.view): Remove some radios, rename the rest.
	(add_closeup): Only call for size 12, 24, 44 and 88.
	(set_bg_color): Remove some closeups, rename the rest.
	(set_fg_color): Remove some closeups, rename the rest.
	(select_imf): Remove some closeups, rename the rest.

	Tweak some interface settings in the tcltk imfapps. 
	Use fgcolor to draw the background in the closeups.
	* imfapp.tcl (fgcolor): Set it to green.
	(bgcolor): Set it to magenta.
	(winbgcolor): Remove it.
	(add_closeup): Use -bg fgcolor instead of -bg winbgcolor.
	(sx): Set it to 10.
	(.images.canvas): Use -bg -bgcolor.
	(set_bg_color): Dont config .closeup.content -bg bgcolor.
	(set_fg_color):  Config .closeup.content -bg fgcolor.
	
	Increase the default image sizes in the mac IMFApp.
	* imfapp.c (iw & ih): Initialize to 32 instead of 16.

	Change some tcltk defaults so that the world map looks better.
	* tkmap.c (config_specs): Config FeatureNames, TerrainImages,
	TerrainPatterns, Transitions and UnitNames to 1 instead of 0.

	Fix path string in the tcltk Windows code. Note: using / instead
	of \ works on Windows, but we change it for consistency with
	the rest of the win32.c code anyway.
	* win32.c (make_pathname): Change / to \\ in the string.

	Fix some typos in the xconq Doxygen comments.
	* actions.c: Change independant to independent.

	Fix so that big unit images are drawn at the correct size when
	using image samples within tcltk xconq.
	* tkconq.tcl (list_icon_size): Set to 44 instead of 32.
	(create_map_window): Change imfsample width & iwidth to 44 and 
	iheight to 48 for the unitinfo.pic and set col1 permanently to 44 + 6. 
	Remove code that adjusts col1 depending on ypos. Tweak y position.
	(popup_help_dialog): Change imfsample width & iwidth to 44 and 
	height & iheight to 48 to accomodate big images.
	(fill_in_unit_type_list): Change imfsample width & iwidth to 44 
	and height & iheight to 48 instead of list_icon_size.
	
	Fix tcltk terrain transition code so that it works correctly with 
	tiled images. Also fix transition code for case !use_clip_mask.
	* tkmap.c (draw_terrain_transitions): Add special cases to handle
	tiled images if mapw->draw_terrain_patterns is true. Also add
	conditional calls to XSetFunction before and after XCopyArea.

	Fix wimfapp link error when built under C++.
	* tkiapp.c (imfsample_cmd): Change last arg in the prototype
	from char **argv to char *argv[].

	Improve image handling and scrolling support in the tcltk 
	imfapps by drawing the images on a canvas background.
	* tkiapp.c (get_numimages_cmd): New function and prototype.
	(ui_init): Create get_numimages Tcl command.
	(imfapp_main): Change .images.content to .images.canvas.content.
	* imfapp.tcl (.images.canvas): Add new canvas. Set yview to 0 0.
	(.images.scroll): Scroll images.canvas instead of images.content.
	(.images.canvas.content): Replaces images.content.
	(new_cmd): Use .images.canvas.content instead of images.content.
	(add_imf_file_cmd): Use .images.canvas.content. Set w and h.
	(toggle_show_color): Use .images.canvas.content. 
	(toggle_show_names): Use .images.canvas.content.
	(toggle_show_masks): Use .images.canvas.content.
	(toggle_show_bbox): Use .images.canvas.content.
	(toggle_show_solid): Use .images.canvas.content.
	(toggle_show_grid): Use .images.canvas.content.
	(set_bg_color): Use .images.canvas.content.
	(set_fg_color): Use .images.canvas.content.
	(toggle_with_unit): Use .images.canvas.content.
	(toggle_with_terrain): Use .images.canvas.content.
	(toggle_with_emblem): Use .images.canvas.content.
	(select_imf): Use .images.canvas.content.
	
	Add code that initializes xconq_libs correctly also in the tcltk
	imfapps so that the images files always are found.
	* iappmac.c (xconq_libs): Dont declare here.
	(add_library_path): Remove dummy function.
	* tkiapp.c (xconq_libs): Declare here.
	(last_user_xconq_lib): Declare here.
	(default_library_pathname): Prototype extern.
	(default_images_pathname): Prototype extern.
	(init_library_path): New static function copied from init.c. 
	Remove XCONQSTANDARDGAME and STANDARD_GAME code.
	(add_library_path): New extern function copied from init.c.
	Comment out ifdef UNIX (also defined in ximfapp.c).
	(imfapp_main): Call init_library_path.

	Clean up the use of includes in the Mac tcltk interface.
	* iappmac.c (kpublic.h, cmdline.h): Dont include them here.
	(Gestalt.h, ToolUitls.h, Fonts.h, Dialogs.h, SegLoad.h, Traps.h,
	Appearance.h): Dont include them here.
	* tkconq.h (XSetTile): Prototype extern here ifndef UNIX etc.
	* tkimf.h (XSetTile): Dont prototype here ifdef MAC.
	* tkisamp.c (XSetTile): Prototype extern here ifndef UNIX etc.
	(tkint.h, tkMacInt.h, tclInt.h, tclMac.h): Dont include them here.
	* tkmac.c (Gestalt.h, ToolUitls.h, Fonts.h, Dialogs.h, SegLoad.h, 
	Traps.h, Appearance.h): Dont include them here.
	* tkxmac.c (XSetTile): Prototype extern here.

	Consolidate the improved X TclTk code for MacOS into one file.
	* tkxmac.c: New file with all the hacked X drawing functions.
	* iappmac.c (gPenPat): Move to tkxmac.c
	(XCopyArea): Move to tkxmac.c.
	(XFillRectangles): Move to tkxmac.c.
	(XSetTile): Move to tkxmac.c.
	* tkmac.c (tkMacInt.h): Don't include it.
	(QDPat): Dont define it here.
	(gPenPat): Move to tkxmac.c
	(XCopyArea): Move to tkxmac.c.
	(XFillRectangles): Move to tkxmac.c.
	(XFillArc): Move to tkxmac.c.
	(XMapWindow): Move to tkxmac.c.
	(XSetTile): Move to tkxmac.c.

	Generalize the stippling code in the mac tcltk interface by using 
	the four predefined Tk stipple types instead of dside->ui->grays.
	Add support for Tk stipple type "gray12" and use it in the cloud
	drawing code. Add support for B/W images in iappmac. Also add
	support for tiled drawing in the improved mac tcltk code.
	* iappmac.c (XFillRectangles): Add the new dside independent
	version to permit display of old-style B/W unit images. Add
	support for tiled drawing.
	* tkconq.h (grayshade): Add verylightgray.
	* tkinit.c (init_bitmaps): Init dside->ui->grays[verylightgray]
	with the predefined TK stipple "gray12".
	* tkmac.c (XFillRectangles): Use predefined stipple types instead
	of dside->ui->grays. Rewrite the grays[black] option. Add support
	for tiled drawing.
	(XFillArc): Use predefined stipple types. Rewrite grays[black].
	Add support for tiled drawing
	* tkmap.c (draw_clouds_row): Remove grays[black] and add
	grays[verylightgray] instead.

	Fix so that the imfsample window size is adjusted to accomodate all
	images in the tcltk imfapp without interfering with xconq, where 
	the window size should remain fixed due to hidden emblem images.
	* tkisamp.c (Imfsample): Add int imfapp.
	(config_specs): Add TK_CONFIG_INT for imfapp.
	(imfsample_cmd): Initialize imfsample->imfapp to false.
	(imfsample_display): Adjust window if imfapp is true.
	* imfapp.tcl (.images.canvas.content): Set imfapp to 1.

	Fix bug in the tcltk image sample code that prevented images
	from being loaded properly in the imfapp images pane.
	* tkisamp.c (imfsample_add_imf): Also call tk_find_imf for
	each image that is loaded.

	Fix crashing bug in the tcltk image sample code due to negative
	row numbers being permitted.
	* tkisamp.c (imfsample_display): Continue if row < 0.
	
	Fix out of bounds scrolling bug in the tcltk image sample code.
	* tkisamp.c (imfsample_widget_cmd): Limit the nrow value
	to a non-negative number.

	Fix so that the tcltk imfapp builds under MacOS.
	* tkiapp.c (tcl.h): Don't include it ifdef MAC.
	(tk.h): Don't include it ifdef MAC.
	(tclMacCommonPch.h): Include it ifdef MAC.
	(tclMac.h): Include it ifdef MAC.
	(tkMac.h): Include it ifdef MAC.
	(ui_init): Use : instead of / for paths ifdef MAC.
	* iappmap.c: New file in the tcltk directory.
	
	Fix so that the tcltk imfapp builds natively under Windows
	and clean out stuff in the obsolete win directory.
	* iappwin32.c: New file with Windows native (WinMain) 
	version of the main file for tcltk imfapp.
	* Xconq.RC: Move from win to tcltk directory.
	* Xconq.ico: Move from win to tcltk directory.
	* wimfapp.c: Delete file.
	
2003-05-07  Hans Ronne <hronne@telia.com>

	Speed up resignation by eliminating redundant updates.
	* unit.c (change_unit_side): Disable all screen updates 
	if reason == H_SIDE_LOST.

	Fix run warning in the mac ppc interface when resigning 
	to the default side (indepside) in a non-indepside game.
	* maccmd.c (get_command_and_do): Add code that tests for
	"NOBODY" and resigns to indepside if true. 
	* macwins.c (hit_alert_dialog): Add new code that tests for
	indepside->ingame before writing "NOBODY" to spbuf.
	
	Fix so that preferences are saved when you switch between
	different preferences panes in the mac ppc interface.
	* macprefs.c (save_preferences_settings): New function
	and prototype with content from case diPrefsOK.
	(set_preferences): Call save_preferences_settings also
	when switching panes.
	
	Fix so that the event loop in the mac cconq app works again.
	* cconq.c (console.h): Don't include it (getch conflict).
	(ccommand): Define as _MSL_IMP_EXP_C extern int (from
	console.h) so that argc and argv work without console.h.
	* curses.h (getch): Enable this macro again on the mac.
	
	Fix so that saving of files works in the carbonized IMFApp.
	* imfapp.c (save_imf_file): Pass 'XCNQ' instead of '????' 
	to NavPutFile.
	(save_imf_dir_file): Pass 'XCNQ' instead of '????' to 
	NavPutFile. 
	(save_resource_file): Pass 'rsrc' and 'XCNQ' instead of
	'TEXT' and '????' to NavPutFile. 
	
	Fix so that big icons are drawn correctly in IMFApp.
	* imfapp.c (update_image_window): Tweak w and h.
	(draw_one_image): Tweak w and h.
	
	Draw image names below the images if iw > 16.
	* imfapp.c (update_image_window): Tweak elth if ih > 16.
	(draw_one_image): Tweak namex and namey if iw > 16.

	Fix so that names do not overwrite the next column.
	* imfapp.c (draw_one_image): Limit maskrect to the
	current column and clip DrawString to maskrect.

	Fix so that the scrollbars are not erased or overwritten
	when the IMFApp image window is updated on the mac.
	* imfapp.c (update_image_window): Draw the scrollbars
	first, then clip to the content. Restore cliprect when done.
	
	Fix drawing of the top line in the mac IMFApp window.
	* imfapp.c (update_image_window): Call draw_topline
	first, then inset cliprect by toplineh.
	(draw_topline): Move tmprect.bottom and dividing line 
	position 1 pixel upwards.
	
	Improve font handling in the mac IMFApp image window.
	* imfapp.c (draw_topline): Use 12 point System instead.
	(draw_one_image): Set TextFont and TextSize.
	
	Redraw the image window in the mac IMFApp after the 
	open file and save file dialogs have been dismissed.
	* imfapp.c (open_imf_file): Call update_image_window.
	(open_imf_dir_file): Call update_image_window.
	(open_resource_file): Call update_image_window.
	(save_imf_dir_file): Call update_image_window.
	(save_imf_file): Call update_image_window.
	(save_resource_file): Call update_image_window.
	
	Fix error in mac IMFApp column width calculation.
	* imfapp.c (update_image_window): Substract sbarwid
	from winwidth and winheight.
	
	Fix so that only those images that are drawn in the 
	images window can be selected in the mac IMFApp.
	* imfapp.c (handle_mouse_click): Don't select an
	image if row > numvisrows + firstvisrow -1.
	
	Fix random crashes in the carbonized IMFApp due to fake
	handles for xmalloced blocks being locked and unlocked.
	* macimf.c (mac_interp_image_1): Lock handles before
	calling mac_copy_bytes and unlock when done (5 times).
	(mac_create_ppat): Lock handle before mac_copy_bytes
	and unlock when done.
	(mac_create_cicn): Don't lock and unlock cicnhandle.
	(mac_copy_bytes): Don't lock and unlock desthandle.
	(interp_ctab): Don't lock and unlock ctabhandle.
	
	Replace the two PlotCIcon calls in IMFApp that caused
	random crashes in the carbonized app.
	* imfapp.c (draw_as_unit_image): Get the PixMap 
	and use CopyBits + CopyMaks instead of PlotCIcon.
	(draw_as_emblem_image): Get the PixMap and
	use CopyBits + CopyMaks instead of PlotCIcon.

	Tweak scrollbar and topline positions in mac IMFApp.
	* imfapp.c (toplineh): Change it to 30.
	(main): Don't add toplineh to vscrollrect.top.
	(grow_scrollbar): Don't add and substract toplineh.
	(draw_topline): Inset tmprect.right by sbarwid. Tweak 
	position of the second text line.

	Add pink background and use it by default in IMFApp.
	* imfapp.c (bg_pink) Add to enumeration.
	(miBackgroundPink): Define as 4, adjust others.
	(show_bg_color): Set it to bg_pink.
	(do_menu_command): Add case miBackgroundPink.
	(adjust_menus): Add case miBackgroundPink.
	(update_image_window): Add case bg_pink.
	* IMFApp.r (MENU 132 "Background"): Add menu
	item "Pink".

	Recompile & decompile IMFApp.r and fix errors.
	* IMFApp.r (MENU 129 "File"): Add Cmd-Keys.
	(MENU 131 "View"): Fix array size and zap the 
	extra comma at the end.
	(WIND 128 "Images"): Make it  size 900 x 600 
	and add centerMainScreen.
	(vers 1 and 2): Change 7.3.2 to 7.5.0.
	
2003-05-01  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to May 2003.

	Add garbage collection for unit view objects.
	* side.c (INITMAXVIEWS): Define as 200.
	(freeviews): New unit view list.
	(allocate_unit_view_block): New function and prototype.
	(create_bare_unit_view): New function and prototype.
	(add_unit_view): Add support for garbage collection.
	(remove_unit_view): Add support for garbage collection.	
	
	Fix so that saving and reading of unit views works again.
	* read.c (interp_unit_views): Add reading of name, size,
	complete and date.
	* unit.h (a_unit_view): Switch date and complete.
	* write.c (write_side_view): Add writing if name, size,
	complete and date.
	
	Add full support for unit views in cell updates on the mac.
	* macmap.c (update_cell): Add separate code for unit views.
	(draw_unit_names_only): Add separate code for unit views.

	Fix bug in mac draw_row involving extra unit redraws.
	* macrow.c (draw_row): Change x -1 to x in draw_units.
	
	Add basic support for unit view code in the x11 interface.
	* xdraw.c (draw_units): Rewrite for new unit view code.
	(x_xform_unit_view): New function and prototype.
	(x_xform_occupant_view): New function and prototype.
	(x_xform_unit_self_view): Add prototype and change arg.
	(draw_unit_view_and_occs): New function and prototype.
	(draw_unit_and_occs): Rewrite for new unit view code.

	Add support for new unit view code in the sdl interface.
	* sdlmap.c (draw_units): Rewrite for new unit view code.
	(x_xform_occupant_view): New function and prototype.
	(x_xform_unit_self_view): Add prototype and change arg.
	(draw_unit_view_and_occs): New function and prototype.
	(draw_unit_and_occs): Rewrite for new unit view code.
	(draw_current): Add unit view branch for the bounding box.
	Note: should add unit view code for the rest of the function.
	* sdlscreen.c (update_cell): Always draw erasing row for 
	unit views.

	Add support for new unit view code in the tcltk interface.
	* tkmap.c (draw_units): Rewrite for new unit view code.
	(x_xform_occupant_view): New function and prototype.
	(x_xform_unit_self_view): Add prototype and change arg.
	(draw_unit_view_and_occs): New function and prototype.
	(draw_unit_and_occs): Rewrite for new unit view code.
	(draw_current): Add unit view branch for the bounding box.
	Note: should add unit view code for the rest of the function.
	(update_cell): Always draw erasing row for unit views.
	* ui.c (xform_unit_self_view): Rewrite for new code.
	* ui.h (xform_unit_self_view): Change argument.
	
	Remove tweak in the tcltk and sdl update code that added
	1 cell to the left side of advanced units.
	* sdlscreen.c (update_cell): Remove extra cell.
	* tkmap.c (update_cell): Remove extra cell.

2003-04-27  Hans Ronne <hronne@telia.com>

	Fix bug that caused occupants in see-always see-occupants units
	to be invisible until they moved.
	* side.c (all_see_occupy): Call see_cell if cover(side, x, y) > 0.
	(all_see_leave): Call see_cell if cover(side, x, y) > 0.
	* run.c (run_advanced_units): Add test for cover(side, x, y) > 0
	and rearraneg so that it work like all_see_occupy.

	Fix bug that caused views of dead occupants to persist after capture 
	of a transport by another side.
	* side.c (see_cell): Blast all unit views, not just those belonging
	to units that disappeared or moved out of the cell. 

	Add support for occupant-transport relationships in the unit
	view code.
	* side.c (add_unit_view): Also test if an existing view is in the
	same cell before using it. Don't remove views of the same unit
	in other cells. Set occupant, transport and nexthere to NULL for
	new unit views. Comment out code that removes obsolete unit
	views in the wrong location. Add recursive code that creates 
	views for all visible occupants as well.
	(remove_unit_view): Add recursive code that also removes 
	all occupant views.
	(see_exact): Add code that removes any old unit views and
	triggers an update in that case.
	* side.h (for_all_occupant_views): New macro.
	* ui.c (xform_unit_view): Rewrite so that it works just 
	like xform_unit, but with a UnitView argument instead.
	(xform_occupant_view): New function.
	* ui.h (xform_occupant_view): New prototype.
	* macconq.h (m_xform_occupant_view): New prototype.
	* macmap.c (m_xform_occupant_view): New function.
	* macrow.c (draw_units): Rewrite entire unit view part to 
	make use of draw_unit_view_and_occs. Remove all use of 
	view_unit to obtain a pointer to the underlying unit.
	(draw_unit_view_and_occs): New function and prototype.
	
	Make the test for occupant visibility viewport independent.
	* macrow.c (draw_units): Remove call to occupants_visible in
	case vp->show_all. Remove vp arg in occupants_visible.
	(draw_unit_and_occs): Remove vp arg in occupants_visible.
	* sdlmap.c (draw_units): Remove call to occupants_visible in
	case vp->show_all. Remove vp arg in occupants_visible.
	(draw_unit_and_occs): Remove vp arg in occupants_visible.
	* tkmap.c (draw_units): Remove call to occupants_visible in
	case vp->show_all. Remove vp arg in occupants_visible.
	(draw_unit_and_occs): Remove vp arg in occupants_visible.
	* side.h (occupants_visible): Move prototype here.
	* side.c (occupants_visible): Move function here.
	* ui.h (occupants_visible): Remove vp arg. Move to side.h.
	* ui.c (occupants_visible): Remove vp arg. Test side->see_all 
	instead of vp->show_all. Move function to side.c.

	Clean up old fix of missing unit pointer problem. 
	* side.c (add_unit_view): Move setting of uview->unit to the 
	new UnitView xmalloc code and remove associated comments.

2003-04-26  Hans Ronne <hronne@telia.com>

	Improve the UnitView structure in preparation for bug fixes.
	* unit.h (a_unit_view): Add char *name, UnitView *nexthere,
	UnitView *transport, UnitView *occupant and int complete with
	same meanings as in the Unit structure. Rename the old UnitView 
	*nexthere to UnitView * nextinhash since this is what it really
	stands for (unlike Unit *nexthere). Replace side_id by a real
	side pointer.
	* side.c (unit_view_at): Change nexthere to nextinhash. Set name,
	complete, transport, occupant and nexthere for tmp_unit_view.
	(unit_view_next): Change nexthere to nextinhash. Set name,
	complete, transport, occupant and nexthere for tmp_unit_view.
	(add_unit_view): Change nexthere to nextinhash. Set name and
	complete from the underlying unit.
	(add_unit_view_raw): Change nexthere to nextinhash. 
	(remove_unit_view): Change nexthere to nextinhash.

	Clean out the obsolete macros previously used to access the
	properties of the underlying unit for a unit view.
	* side.h (view_type, view_side, view_size): Remove macros.
	* cdraw.c (draw_units): Replace macros by real values.
	(draw_legend): Replace macros by real values.
	(show_closeup): Replace macros by real values.
	* macrow.c (draw_units): Replace macros by real values.
	Remove test for named immobile unit matching the unit view.
	* tkmain.c (update_mouseover_x): Replace macros by real values.
	* tkmap.c (draw_units): Replace macros by real values.
	Remove test for named immobile unit matching the unit view.
	* sdlmain.c (update_mouseover): Replace macros by real values.
	* tkmap.c (draw_units): Replace macros by real values.
	Remove test for named immobile unit matching the unit view.
	* xdraw.c (draw_units): Replace macros by real values.
	(draw_map_info): Replace macros by real values.
	* ai.c (enemies_present): Replace macros by real values.
	(check_current_target): Replace macros by real values.
	(preferred_build_type): Replace macros by real values.
	* mplayer.c (review_theaters): Replace macros by real values.
	(estimate_strengths): Replace macros by real values.
	* plan.c (alternate_target_here): Replace macros by real values.
	(victim_here): Replace macros by real values.
	(target_here): Replace macros by real values.
	(indep_captureable_here): Replace macros by real values.
	(can_capture_neighbor): Replace macros by real values.
	(useful_captureable_here): Replace macros by real values.
	(usable_cell): Replace macros by real values.
	(no_possible_moves): Replace macros by real values.
	* ps.c (sideno_of_seen_unit_at): Replace macros by real values.
	* read.c (interp_unit_views): Replace macros by real values.
	* side.c (side_sees_image): Replace macros by real values.
	(unit_view_at): Replace side_id by side.
	(add_unit_view): Replace side_id by side.
	(unit_view_next): Replace side_id by side.
	(all_see_leave): Replace macros by real values.
	(reset_view): Replace macros by real values.
	(react_to_seen_unit): Replace macros by real values.
	* task.c (do_hit_unit_task): Replace macros by real values.
	(target_visible): Replace macros by real values.
	* ui.c (nearest_unit_view): Replace side_id by side.
	(oneliner): Replace macros by real values.
	(dump_text_view): Replace macros by real values.
	(utype_seen_at): Replace macros by real values.
	* write.c (write_side_view): Replace side_id by side.
	
2003-04-24  Hans Ronne <hronne@telia.com>

	Fix file path problem for the Mac OSX application package.
	* macconq.c (get_files): Climb out of the application package before
	setting initial_vrefnum and initial_dirid if compiling for OSX.

	Comment out code that draws advanced units as boxes with 
	default colors and no emblems at 8 pixels resolution for now.
	* macdraw.c (draw_unit_image): Comment out code.
	* macrow.c (draw_units): Comment out code (twice).
	* tkmap.c (draw_unit_image): Comment out code.
	(draw_units): Comment out code (twice).
	* sdlmap.c (draw_unit_image): Comment out code.
	(draw_units): Comment out code (twice).
		
	Tweak positions of unit names and sizes in all interfaces.
	* macdraw.c (draw_unit_size): Tweak text positions.
	(draw_name): Add 1 pixel to justified text margins.
	* macmap.c (draw_selected_unit): Simplify size position.
	* tkmap.c (draw_unit_and_occs): Tweak size positions.
	(draw_unit_name): Tweak name position.
	(draw_unit_size): Tweak size position.
	* sdlmap.c (draw_unit_and_occs): Tweak size positions.
	(draw_unit_name): Tweak name position.
	(draw_unit_size): Tweak size position. Dont return if sw < 20.

	Fix wrong offset position, wrong box size for big_unit_images and 
	several other bugs in the image drawing code.
	* macdraw.c (draw_unit_image): Remove tweaking of box sizes if
	big_unit_images is true (no longer needed).
	* macmap.c (draw_unit_names_only): Rewrite to work more like
	draw_units. First find one named unit, then look for one belonging
	to dside and draw the latter at small magnifications. Set sw and sh to 
	map->vp->hw if big_unit_images is true. Note: should also write
	separate code for unit views, like in draw_units.
	(draw_selected_unit): Set both sw and sh to map->vp->hw if 
	big_unit_images is true. 
	(draw_selection_animation): Set sw and sh to map->vp->hw if 
	big_unit_images is true. 
	* macrow.c (draw_units): Set both sw and sh to map->vp->hw if
	big_unit_images is true. Don't test for map->vp->show_all in the
	unt view code (bug imported from the tcltk interface).
	* tkmap.c (draw_units): Rewrite to conform with the above fixes.
	Set sw and sh to vp->hw if big_unit_images is true. Use sw and sh 
	everywhere instead of uw and uh. Don't test for vp->show_all in the
	unit view code.
	(draw_current): Set sw and sh to vp->hw if big_unit_images is true.
	(draw_unit_image): Don't call draw_side_emblem for advanced units
	at low magnification.
	(update_cell): Add 1 pixel to the top if big_unit_images is true in
	order to cover the health bar completely.
	* sdlmap.c (draw_units): Rewrite to conform with the above fixes.
	Set sw and sh to vp->hw if big_unit_images is true. Use sw and sh 
	everywhere instead of uw and uh. Don't test for vp->show_all in the
	unit view code.
	(draw_current): Set sw and sh to vp->hw if big_unit_images is true.
	(draw_unit_image): Don't call draw_side_emblem for advanced units
	at low magnification.
	sdlscreen.c (update_cell): Add 1 pixel to the top if big_unit_images 
	is true in order to cover the health bar completely. Add name-erasing
	code from tcltk interface.

	Various tweaks and fixes to the mac interface image drawing code.
	* macdraw.c (draw_unit_image): Use sidecolors only if sw > 4.
	Draw emblems for advanced units only if sw >= 16.
	(draw_name): Use same font sizes as in draw_unit_size.
	* macrow.c (draw_units): Always draw advanced units with boxes if
	sw < 16. Always draw the unit image, even in that case.

	Rewrite draw_units on the mac so that it handles unit views in the 
	same way as in the tcltk and sdl interfaces.
	* macconq.h (m_xform_unit_view): New prototype.
	* macmap.c (m_xform_unit_view): New function.
	* macrow.c (draw_units): Use unit views even if units_visible is
	true (enables spotting probabilities). Prefer to display one of our
	own units. Call draw_dots. Only draw unit name and size of sw > 4.
	 Draw unit size last. Rewrite entire unit view section using code
	 from the tcltk interface.
	(draw_dots): New function and prototype.
	
	Remove unit argument from draw_unit_size in the mac interface
	(unit view adaptation). Pass unit size and unit side instead.
	* macconq.h (draw_unit_size): Change arguments in prototype.
	* macdraw.c (draw_unit_size): Rewrite without unit pointer.
	* maclist.c (draw_unit_list_entry): Change args in draw_unit_size.
	* macmap.c (draw_selected_unit): Change args in draw_unit_size.
	* macrow.c (draw_units): Change args in draw_unit_size.
	(draw_unit_and_occs): Change args in draw_unit_size.
	* macunit.c (draw_unit_size): Move function to macdraw.c
	(draw_simple_closeup): Change args in draw_unit_size.
	(draw_advanced_content): Change args in draw_unit_size.
	
	Remove unit argument from draw_unit_name in the mac interface
	(unit view adaptation). Pass unit name and unit side instead.
	* macconq.h (draw_unit_name): Change arguments in prototype.
	* macdraw.c (draw_unit_name): Rewrite without unit pointer.
	(draw_unit_names_only): Change args in draw_unit_name.
	* macrow.c (draw_units): Change args in draw_unit_name.
	(draw_unit_and_occs): Change args in draw_unit_name.
	
	Remove unit argument from draw_unit_name in the tcltk interface
	(unit view adaptation). Pass unit name instead.
	* tkmap.c (draw_unit_size): Rewrite without unit pointer. Remove
	call to name_or_number. Change args in prototype.
	(draw_units): Change args in draw_unit_size.
	(draw_unit_and_occs): Change args in draw_unit_size.
	(draw_current): Change args in draw_unit_size.

	Remove unit argument from draw_unit_name in the sdl interface
	(unit view adaptation). Pass unit name instead.
	* sdlmap.c (draw_unit_size): Rewrite without unit pointer. Remove
	call to name_or_number. Change args in prototype.
	(draw_units): Change args in draw_unit_size.
	(draw_unit_and_occs): Change args in draw_unit_size.
	(draw_current): Change args in draw_unit_size.

	Fix bug in the mac interface that prevented map->vp->show_all 
	from working correctly.
	* macmap.c (create_map): Initialize map->vp->show_all from
	dside->show_all.
	
	Fix bug in the mac interface that made it possible to see the task of
	enemy units in the unit list.
	* maclist.c (draw_unit_list_entry): Test for side_sees_unit before
	drawing the unit task info.

	Make the tcltk and sdl interfaces more similar to the mac interface 
	in how advanced units at low magnifications are drawn.
	* tkmap.c (draw_units): Always draw a grouping box if the unit is
	advanced. Test for occupants_visible before drawing a box. Handle
	colors of grouping boxes as in the mac interface. Increase the size
	of grouping boxes by 1 pixel in each direction.
	(draw_unit_size): Dont return if sw < 20.

2003-04-17  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to April 2003.

	Fix error in doxygen comments for the view_unit macro.
	* side.h (view_unit): Change unit type to unit in the comments.

	Enable draw_unit_and_occs and associated xform functions in the 
	sdl interface. Note: should figure out why many emblem colors now
	appear transparent in the sdl interface. Should also enable drawing
	of grouping boxes.
	* sdlmap.c (xform): Declare explicitly extern.
	(xform_fractional): New function and prototype.
	(xform_top): New function and prototype.
	(x_xform_unit): New function and prototype.
	(x_xform_unit_view): New function and prototype.
	(x_xform_unit_self): New function and prototype.
	(x_xform_unit_self_view): New function and prototype.
	(x_xform_occupant): New function and prototype.
	(x_nearest_cell): New function and prototype.
	(x_find_unit_or_occ): New function and prototype.
	(x_find_unit_at): New function and prototype.
	(x_nearest_unit): New function and prototype.
	(draw_units): Enable everything except grouping boxes.
	(draw_unit_and_occs): Enable except grouping boxes.

	Move box tweaking code for big units from draw_units down to 
	draw_unit_image in the tcltk and sdl interfaces.
	* sdlmap.c (draw_units): Remove box tweaking code (2 times).
	(draw_unit_image): Add box tweaking code.
	* tkmap.c (draw_units): Remove box tweaking code (2 times).
	(draw_unit_image): Add box tweaking code.

2003-04-12  Hans Ronne <hronne@telia.com>

	Fix null pointer bug in the player exchange code (thanks Michele 
	Bini).
	* init.c (exchange_players): Test that indepside->player exists.

2003-03-02  Hans Ronne <hronne@telia.com>

	Add ability to pick what side to resign to in the mac ppc interface.
	* maccmd.c (forcedtoresign): Initialize to zero.
	(do_key_down_command): Only call close_window in case
	get_command_and_do returned TRUE.
	(get_command_and_do): Rewrite with support for forcedtoresign
	option for picking side or side number to resign to. Return int 
	which is TRUE if a valid name or number was picked.
	* macmenus.c (forcedtoresign): Don't declare here.
	* macwins.c (forcedtoresign): Declare extern int.
	(hit_alert_dialog): Rewrite case resignalert. Set forcedtoresign
	to true and call show_command_window.

	Fix failure of the BackSpace and Delete keys to work normally in 
	the mac tcltk interface.
	* tkconq.tcl (make_normal_bindings): Test for "%K" == "Delete"
	and "%K" == "BackSpace" in order to catch them in MacTCL.
	* ui.h (DELETE_CHAR): Define as 0x7B ifdef MAC_TCL.
	(BACKSPACE_CHAR): Define as 0x7B ifdef MAC_TCL.

	Add more attempts to fix broken OSX control background color.
	* macwins.c (show_alert_dialog): Add commented out code.

	Fix various bugs due to incorrect use of strstr (which returns 
	0 when no match was found, unlike strcmp).
	* macmenus.c (find_something): Test for strstr != 0 instead.
	* sdlmain.c (grok_side): Test for strstr != 0 instead (3 times).
	* tkmain.c (grok_side): Test for strstr != 0 instead (3 times).

2003-03-02  Hans Ronne <hronne@telia.com>

	Fix so that feature legends and their positions are updated each
	turn in non-see-all games, as new terrain comes into view. Also
	make handling of legends consistent for all interfaces by passing
	a side (usually dside) to place_legends.
	* cdraw.c (place_legends): Add dummy function.
	* conq.h (place_legends): Prototype extern.
	* macmap.c (create_map): Pass dside to place_legends.
	(place_legends): Don't declare static. Add side argument. 
	Return if side != dside.
	(draw_feature_names): Pass dside to place_legends.
	* run2.c (run_turn_start): Call place_legends followed by
	update_area_display for each side.
	* sdlcmd.c (do_refresh): Pass dside to place_legends.
	* sdlconq.h (place_legends): Remove prototype.
	* sdlmain.c (launch_game): Pass dside to place_legends.
	(place_legends): Add side argument. Return if side != dside.
	* skelconq.c (place_legends): Add dummy function.
	* tkcmd.c (do_refresh): Pass dside to place_legends.
	* tkconq.h (place_legends): Remove prototype.
	* tkmain.c (launch_game): Pass dside to place_legends.
	(place_legends): Add side argument. Return if side != dside.
	* xmap.c (place_legends): Return if side->ui == NULL. Note:
	only legends for one-cell features are now drawn in the x11
	interface. Should figure out why.

	Fix so that the curses interface compiles again.
	* cdraw.c (hexagon_adjust): Define macro previously defined in
	ui.h. Note: should figure out if it is still correct to use the macro 
	here.

	Fix bug that caused unit views and units at low power to be drawn
	at half-size when using big_unit_images on the mac.
	* macdraw.c (draw_unit_image): Add box tweaking code from the 
	tcltk interface. Restore box sizes before drawing emblems. Note: 
	should move this code from draw_units down to draw_unit_image 
	also in the tcltk and sdl interfaces in order to prevent problems 
	with unit name and unit size code.
	
	Minor fixes to the mac unit drawing code.
	* macrow.c (draw_units): Change sw to sh. Put all statements
	om separate lines.

2003-03-01  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to March 2003.

	Fix pointer bug in the mac ppc color table code.
	* macimf.c (interp_ctab): Don't pass &ctdata[i].value to
	parse_lisp_palette_entry. Just pass &value instead.

	Fix error in the emblem size for advanced units on the mac.
	* macdraw.c (draw_unit_image): Change sw > 16 to sw > 8.

2003-02-26  Hans Ronne <hronne@telia.com>

	Fix hexagon_adjust related bugs in the x11 interface.
	* xmap.c (create_map): Remove hexagon_adjust term in 
	calculation of sx and map->panner creation.
	(set_map_power): Remove hexagon_adjust term.
	(x_center_on_focus): Remove hexagon_adjust term.

	Fix long-standing problem with distorted x11 world map.
	* xmap.c (USEIMAGE): Define to 0 instead of 1. Note: should
	figure out why USEIMAGE code did not work and fix it.

	Fix problem with cells west of the dateline not being 
	drawn in the x11 world map for wrapped worlds.
	* xmap.c (draw_view_in_panner): Enable wrapx that was
	commented out (twice).

	Fix failure to draw the x11 world map at game start.
	* xmap.c (create_map): Call draw_view_in_panner at the end.

	Remove the shadow under the x11 world map panner box.
	* xmap.c (create_map): Set XtNshadowThickness to 0.

	Remove use of New York font in the MacOS classic New Game list.
	* macinit.c (draw_newgame_dialog): Remove font setting code.
	(do_key_down_newgame): Remove font setting code.
	(hit_newgame_dialog): Remove font setting code.

2003-02-26  Hans Ronne <hronne@telia.com>

	Comment out partly unimplemented agreements code.
	* cmd.c (do_agreement_draft, do_agreement_drafter,
	do_agreement_propose, do_agreement_proposer, do_agreement_sign,
	do_agreement_signer, do_agreement_term): Comment out functions.
	* cmd.def (agreement-draft, agreement-drafter, agreement-propose,
	agreement-proposer, agreement-sign, agreement-signer,
	agreement-term): Comment out commands.
	* init.c (init_data_structures): Comment out init_agreements call.
	* keyword.def (K_AGREEMENT, K_TYPE_NAME, K_STATE, K_TERMS, 
	K_DRAFTERS, K_PROPOSERS, K_SIGNERS, K_WILLING_TO_SIGN, 
	K_ENFORCEMENT): Comment out keywords. Note: K_NAME and
	K_KNOWN_TO are keywords with multiple meanings.
	* module.h (Module): Comment out def_agreements.
	* read.c (interp_agreement): Comment out function and prototype.
	(interp_form): Comment out case K_AGREEMENT.
	* run2.c (test_agreements); Comment out function and prototype.
	(run_turn_end): Comment out call to test_agreements.
	* side.c (agreement_list, last_agreement, num_agreements,
	next_agreement_id, agreement_desig_buf): Comment out.
	(init_agreements, create_agreement, find_agreement,
	agreement_desig, ): Comment out functions.
	* side.h (a_agreement): Comment out.
	(draft, proposed, in_force, moribund): Comment out enum.
	(for_all_agreements, any_agreements, side_signed_agreement,
	side_willing_agreement): Comment out macros.
	(num_agreements, agreement_list, last_agreement): Comment out.
	(init_agreements, create_agreement, find_agreement,
	agreement_desig, ): Comment out prototypes.
	* skelconq.c (list_sides): Comment out num_agreements etc.
	* tkmain.c (tk_agreements): Comment out function and prototype.
	(initial_ui_init): Comment out call to tk_agreements.
	(tk_designer_save): Comment out case "agreements".
	* write.c (write_agreements, write_agreement): Comment out
	functions and prototypes.
	(write_game_module): Comment out call to write_agreements.
	* tkconq.tcl (dsave): Don't set dsave(agreements).
	(popup_designer_save): Comment out agreements checkbox.
	(save_design): Comment out dsave(agreements) code.

	Fix so that the x11 interface compiles again.
	* xmap.c (hexagon_adjust): Define macro that was removed from
	ui.h here instead. Note: x11 world map still bugged.

	Fix save and restore bug by enabling saving of unit ids in the 
	mac designer save dialog.
	* macdesign.c (defunitids): Remove unused dummy int. 
	(designer_save_dialog): Set module->def_unit_ids instead of 
	setting defunitids.
	
	Fix so that the mac designer reshape world dialog works again.
	* macdesign.c (designer_reshape_dialog): Call ShowWin. Pass
	diDesignerReshapeOK to SetDialogDefaultItem.
	
	Enable the Save All option in the mac designer save dialog.
	* macdesign.c (designer_save_dialog): Add case diDesignerSaveAll.
	Also reorder all cases to agree with the tcltk interface and remove 
	unused cases. Comment out case diDesignerSaveModule.
	
	Make the two designer save dialogs more similar to each other.
	* macdefs.h (dDesignerSave): Renumber all items and delete
	some unused items.
	* Xconq.r (DITL 501 "Designer Save Items"): Rearrange and 
	renumber all items. Delete some unsued items.
	(DITL 502 "Designer Reshape Items"): Tweak button positions.
	(DLOG 501 "Designer Save"): Tweak size.
	* tkconq.tcl (popup_designer_save): Shorten some labels to 
	agree with the mac designer save dialog.

2003-02-23  Hans Ronne <hronne@telia.com>

	Improve the behaviour and layout of the tcltk designer save dialog.
	* tkconq.tcl (popup_designer_save): Withdraw the window after
	creation and call center_above_curmap when done. Tweak button
	and checkbox positions. Set relief -sunken for text entry. Make
	Save button -default active.

	Fix several bugs so that the Mac designer save dialog works again.
	* macdesign.c (designer_save_dialog): Call ShowWindow before
	ModalDialog. Pass 'XCNQ' instead of '????' to NavPutFile. Pass
	diDesignerSaveOK to SetDialogDefaultItem. Remove the incorrect 
	second break that prevented exit from the loop after hitting the 
	Save button.
	
	Enable saving of side doctrines in the Mac designer save dialog.
	* macdesign.c (designer_save_dialog): Call set_flag_from_ditem
	for diDesignerSaveDoctrine under case diDesignerSaveOK. Handle 
	case diDesignerSaveDoctrine.

2003-02-23  Hans Ronne <hronne@telia.com>

	Fix tcltk help topic list so that the current selection is updated 
	correctly and scrolled into view.
	* tkconq.tcl (update_help): Add update code for the topic list.

	Fix problem with the help node tree rectangle extending beyond 
	the window border in some cases.
	* tkconq.tcl (update_help): Reduce the width from 55 to 35.
	
	Fix problem with the help node text field being selected and
	outlined when opening or closing a node. 
	* tkconq.tcl (popup_help_dialog): Set -highlightthickness 0
	for .help.bot.t.txt.

	Set the help node text field cursor to a standard arrow. 
	* tkconq.tcl (popup_help_dialog): Set -cursor arrow 
	for .help.bot.t.txt.

2003-02-20  Hans Ronne <hronne@telia.com>

	Fix scrolling bug for certain isometric directions.
	* sdlmap.c (draw_map_isometric): Shift the row to the left and
	add 1 cell in case SOUTHEAST or NORTHWEST.
	* tkmap.c (draw_map_isometric): Shift the row to the left and
	add 1 cell in case SOUTHEAST or NORTHWEST.

	Fix so that the whole map is drawn for all six directions.
	* sdlmap.c (draw_map_isometric): Adjust start position and
	number of rows depending on the isometric direction. 
	* tkmap.c (draw_map_isometric): Adjust start position and
	number of rows depending on the isometric direction. 

	Fix failure to draw cells in isometric maps for x values outside 
	the wrapped bounds in wrapped worlds.
	* sdlmap.c (draw_map_isometric): Don't call point_in_dir_n
	and point_in_dir since they wrap x. Calculate cell coordinates
	without wrapping x instead. 
	* tkmap.c (draw_map_isometric): Don't call point_in_dir_n
	and point_in_dir since they wrap x. Calculate cell coordinates
	without wrapping x instead. 

2003-02-19  Hans Ronne <hronne@telia.com>

	Fix drawing bug that would cause half-hexes to be drawn when 
	scrolling west of the dateline (tcltk interface) or moving the 
	cursor (sdl interface).
	* sdlmap.c (draw_map_overhead): Add back 1 to vylo before 
	computing vx.
	* tkmap.c (draw_map_overhead): Add back 1 to vylo before 
	computing vx.
	* ui.c (compute_x1_len): Add 1 to x2 in order to compensate 
	for the above changes in vx. Note: should try to limit this to
	those cases where it really is needed in order to save on the 
	drawing.
	
	Fix minor errors in the classic build code debugging messages.
	* plan.c (plan_offense_support): Change colonization to offense.
	(plan_explorer_support): Change colonization to exploration.
	
2003-02-15  Hans Ronne <hronne@telia.com>

	Make the classic (non-advanced) build code more intelligent
	for offensive and explorer support. Thus, use a tmp_u_array 
	instead of flip_coin to pick utypes to build, similar to colonizing 
	support, since the flip_coin code is biased towards low utypes. 
	However, don't retry with all possible utypes like the colonizer 
	support code used to do. Just replan instead. And always push the
	build task instead of setting it.
	* plan.c (plan_offense_support): Rewrite using tmp_u_array
	and u_offensive_worth. Push the build task.
	(plan_colonize_support): Don't retry with all possible utypes.
	(plan_explorer_support): Rewrite using tmp_u_array and
	u_explorer_worth.

	Fix display bug that sneaked into rewriting of calc_view_misc.
	Note: this fixes the misaligned update bug on the mac and the
	striped world map bug in the tcltk interface, but reintroduces
	the failure to draw half-hexes close to the date-line bug in the
	tcltk interface. Should fix the latter as well.
	* ui.c (calc_view_misc): Test for area.xwrap before setting
	vp->sxmin.

2003-02-14  Hans Ronne <hronne@telia.com>

	Fix kernel bug that would cause bad build tasks to be set for 
	non-building units with resulting crashes in the build code.
	* plan.c (plan_explorer_support): Initialize u2 and backup 
	to NONUTYPE.

2003-02-12  Hans Ronne <hronne@telia.com>

	Simplify the tcltk map outline and world map code. Use a single call
	to XDrawLines instead of multiple calls to XDrawLine. Comment out
	all map outline drawing ifdef MAC since even the XDrawRectangle
	approach causes an interface freeze in MacTCL. Also remove the 
	mac-specific calls to toggle_map_outline in do_map since there is 
	no point in turning off the map outline only in the isometric case 
	(the freeze now comes after 35 turns in either case).
	* tkcmd.c (do_map): Remove ifdef MAC calls to toggle_map_outline.
	* tkmap.c (toggle_map_outline): Remove function and prototype.
	(draw_map_outline): Rewrite and simplify. Remove "changed" code.
	Don't set line width 2 for case i = 2. Call XDrawLines once instead 
	of multiple calls to XDrawLine. Only draw the box ifndef MAC.
	
	Fix bug that caused only every second row to be drawn when using
	isometric images in the tcltk interface.
	* tkmap.c (draw_map_isometric): Normalize dx and dy before use.

	Fix so that incomplete unit stippling in the tcltk interface clips
	to the unit image instead of being drawn as a box.
	* tkmap.c (draw_unit_image): Add code that clips any stippled
	overlay to the unit mask or mono image.
	
	Fix problem with missing advanced swamp terrain images.
	* pgu.g (adv-swamp): Change to swamp.

2003-02-03  Hans Ronne <hronne@telia.com>

	Fix viewport calculations so that isometric maps always fit within 
	the scrolling limits.
	* ui.h (hexagon_adjust): Remove macro.
	* ui.c (calc_view_misc): Rewrite so that all isometric directions
	are handled correctly. Simplify the code and remove the obsolete
	hexagon_adjust macro.

	Fix bug in the tcltk interface that caused garbage to be drawn at
	the map edges when using terrain images in isometric maps.
	* tkmap.c (draw_terrain_iso): Set sh1 to hw - hw/4.

        Don't write out the storage space if it is set to 99 or 999.
        * nlang.c (supply_desc): Apply special case also if um_storage_x
        equals 999 or 99.
        
2003-02-02  Hans Ronne <hronne@telia.com>

	Make 8-bit palette colors work in the mac ppc interface.
	* macimf.c (interp_ctab): Call parse_lisp_palette_entry instead
	of using interface-specific code that fails to convert 8-bit colors.

	Add hex8 bitmaps and support for their use to the tcltk interface.
	* bitmaps/hex8.b: New file.
	* bitmaps/hex8b.b: New file.
	* bitmaps/hex8iso.b: New file.
	* tkinit.c (bitmaps/hex8.b): Include it.
	(bitmaps/hex8b.b): Include it.
	(bitmaps/hex8iso.b): Include it.
	(init_bitmaps): Init hexpics[3], bhexpics[3] and hexisopics[3].
	* tkmap.c (cell_drawing_info): Remove hack that forced the use
	of usepolygons for power 3.

2003-02-01  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to February 2003.
	
	Fix zooming in the tcltk interface so that the map no longer jumps
	around when zoomed in or out.
	* tkmap.c (mapw_display): Add new code that tests for zooming and 
	delays re-drawing until the geometry request has kicked in. 

	Fix scrolling bug in the tcltk interface world map.
	* tkmap.c (mapw_widget_cmd): Call draw_map_outline before 
	and after scrolling the world map.

	Fix garbage in the tcltk world map under MacTCL by toggling the
	other map outline box off during isometric drawing.
	* tkcmd.c (toggle_map_outline): Prototype extern.
	(do_map): Call toggle_map_outline for case iso ifdef MAC and if
	vp->isometric is false. Do this both before and after the call to 
	set_isometric in order to catch both cases.
	* tkmap.c (toggle_map_outline): New function and prototype.
	 
2003-01-29  Hans Ronne <hronne@telia.com>

	Fix problems with civ2 images.
	* imf.dir: Restore image families that were accidentally deleted.

2003-01-28  Hans Ronne <hronne@telia.com>

	Fix image problems for advanced terrain.
	* terrain.imf: Restore correct subimages count for adv terrain.

2003-01-27  Hans Ronne <hronne@telia.com>

	Fix failure of the tcltk map to center when zooming out due to the
	mysterious hexagon_adjust term being included in totsw. Move this
	term to sxmax instead, where it really belongs, if anywhere. Clean 
	up the interface code and use totsw in those cases where area.width
	had to be used explicitly instead due to the hexagon_adjust term.
	* ui.c (calc_view_misc): Add hexagon_adjust to sxmax instead.
	(xform_cell_flat): Use totsw instead of area.width * vp->hw.
	(nearest_cell): Use totsw instead of area.width * vp->hw.
	* macgworld.c (update_gworld): Ditto.
	(handle_numeric_keypad): Ditto.
	* macmap.c (draw_window_background): Ditto.
	(draw_area_background): Ditto.
	 
	Fix tcltk update offset bug at the right end of the map for named units.
	* tkmap.c (update_cell): Adjust for big_unit_images only after the
	number of cells has been factored into the update rect. Clip the result
	so that sx + sw never exceeds totsw. Note: should still fix so that names 
	outside the area can be erased, as on the mac.
	
	Fix incorrect position of the entire map after zooming out and then
	in in the tcltk interface (offset 1/2 cell to the left of where it should
	be, with subsequent cell updates scrambling the map).
	* ui.c (calc_view_misc): Remove old hack that allowed sx to exceed
	sxmax. The 8x8 resolution update bug it was supposed to fix could 
	no longer be reproduced.
	
	Fix failure to turn off AI control for sides when toggling AI off 
	during startup of saved games (applies to all interfaces).
	* init.c (set_ai_for_player): Call set_side_ai when done.

	Fix imaging problems for advanced terrain.
	* advt12x13.gif: Add missing file.
	* imf.dir (adv-swamp): Remove missing image family.
	(adv-shallows): Remove missing image family.
	(adv-salt-marsh): Remove missing image family.
	
2003-01-26  Hans Ronne <hronne@telia.com>

	Use the emtpy quarter of the grouping box for unit size on the mac.
	* macmap.c (draw_selected_unit): Tweak parameters in the call
	to draw_unit_size.
	* macrow.c (draw_unit_and_occs): Tweak parameters in the call
	to draw_unit_size.
	
	Use default hard-coded side colors to draw the grouping boxes of
	advanced units at low magnifications if sidecolors are not used.
	* macrow.c (draw_units): Set RGBBackColor to default_sideColor[s]
	for advanced units.
	
	Eliminate emblems when grouping boxes are drawn in side colors.
	* macdraw.c (draw_unit_image): Don't draw emblems for advanced
	units at low magnifications.

	Eliminate unit image when unit size is drawn at low magnifications.
	* macrow.c (draw_units): Don't call draw_unit_image for advanced
	units if size is drawn.

	Only use side colors for the content but not for the outline of unit sizes.
	* macunit.c (draw_unit_size): Comment out main_icon_color branch.

	Fix crashes in the mac unit name drawing code.
	* macmap.c (update_cell): Add 3 tests for inside_area.
	
	Clean out some obsolete stuff and update the image library files.
	* advances.g: Remove arrows, sheaf and shield image families.
	* civ2.g: Move all civ2-specific images to misc.imf, terrain.imf 
	and trident.imf.
	* imf.dir: Update with new image families in misc.imf, terrain.imf 
	and trident.imf.
	* misc.imf: Move arrows, hut, sheaf and shield image families here.
	* terrain.imf: Update and clean out advanced terrain image families.
	Move all civ2 terrain image families here.
	* trident.imf: New file with Freeciv trident image families from 
	civ2.g.

2003-01-25  Hans Ronne <hronne@telia.com>

	Add automatic scaling of map font sizes in the tcltk interface.
	* tkmap.c (MapW): Add Tk_Font feature_font.
	(config_specs): Change "-font" to "-mainfont". Add feature_font.
	(mapw_cmd): Initialize mapw->feature_font.
	(mapw_destroy): Call Tk_FreeFont for mapw->feature_font.
	(draw_feature_name): Rewrite. Add support for adjustable font sizes. 
	(draw_unit_name): Rewrite. Add support for adjustable font sizes. 
	(draw_unit_size): Rewrite. Add support for adjustable font sizes. 
	* tkconq.tcl (bigfont): Set to -size 9 on Windows.
	(create_map): Replace map -font by -mainfont and -featurefont.
	Call adjust_map_font_sizes.
	(zoom_in_out): Call adjust_map_font_sizes.
	(adjust_map_font_sizes): New procedure.
	(ok_preferences): Don't config the map font.
	
	Fix segfaults in the tcltk unit name drawing code.
	* tkmap.c (draw_row): Add test for inside_area.

2003-01-22  Hans Ronne <hronne@telia.com>

	Fix serious bug in the build task code that would cause a unit to resume 
	building the same unit that another unit was building, thus leaving the
	first unit in limbo when the build target had been completed.
	* unit.c (incomplete_build_target): Rewrite and fix bugs. Check if any
	other unit is building the potential target. Use uu_build_range instead 
	of u_reach. Precompute how far out we actually need to search.

	Fix bug in the unit creation code that failed to take into account the
	possibility that a unit may die when it creates a new unit, thus
	leaving room in the cell for the latter.
	* actions.c (creator_always_dies_on_creation): New function and 
	prototype.
	(check_create_at_action): Call creator_always_dies_on_creation
	when checking for space.

	Fix null side crashes in the xtconq people drawing code.
	* xdraw.c (draw_people): Return if side2 is null.

	Tweak the build task code to make debugging a little easier.
	* task.c (do_build_task): First check if a create-in action is possible
	in principle before calling check_create_in_action. If not, proceed
	directly to check_create_at_action.

	Fix drawing on the mac so that big unit images with grouping boxes
	are updated and erased correctly. Also fix drawing of feature names.
	* macmap.c (draw_feature_names): Increase left boundary by 100
	pixels for triggered re-drawing.
	(update_cell): Rewrite. Reduce destRect to enclose only the current 
	cell. Call draw_row for 2 extra cells above and 2 below the current 
	cell when big_unit_images and draw_occupants are true. Similarly
	call draw_unit_names_only twice.
	* macrow.c (draw_row): Call draw_units for adjacent rows if 
	big_unit_images and draw_occupants are true.

	Make drawing of occupants in grouping boxes a user-settable vp
	flag in those interfaces (mac ppc) where occupants also can be
	accessed through the unit closeup. Untangle this option from the
	g_bigicons and wide_viewport stuff. Clean up use of the latter
	and rename it to scroll_beyond_dateline.
	* macmap.c (create_map): Change wide_viewport to
	scroll_beyond_dateline.
	(draw_selected_unit): Test for draw_occupants instead of 
	g_bigicons, and fix a bug by reversing the test.
	(draw_unit_names_only): Don't test for either g_bigicons or
	draw_occupants here. 
	* macrow.c (draw_units): Test for draw_occupants instead of 
	g_bigicons (and do it in the right place).
	(draw_unit_and_occs): Use draw_occupants instead of g_bigicons.
	* ui.h (a_vp): Add short draw_occupants. Change wide_viewport 
	to scroll_beyond_dateline.
	* ui.c (new_vp): Set draw_occupants to true.
	(xform_cell_flat): Remove obsolete wide_viewport branch.
	(xform_occupant): Test for draw_occupants instead of g_bigicons
	and vp->wide_viewport.
	(find_unit_or_occ): Test for draw_occupants instead of g_bigicons
	and vp->wide_viewport.
	(find_unit_or_occ_view): Test for draw_occupants instead of 
	g_bigicons and vp->wide_viewport.
	(calc_view_misc): Change wide_viewport to scroll_beyond_dateline.
	Add explanation about scrolling in different interfaces.

	Simplify handling of big civ2-type unit images by testing for their
	presence and setting big_unit_images to true. Remove g_bigicons 
	from the code and game files.
	* 3rd-age.g (bigicons): Remove.
	* advances.g (bigicons): Remove.
	* pgu.g (bigicons): Remove.
	* gvar.def (g_bigicons): Remove gvar.
	* sdlmap.c (draw_units): Use big_unit_images instead of g_bigicons.
	* tkmap.c (draw_units): Use big_unit_images instead of g_bigicons.
	(update_cell): Use big_unit_images instead of g_bigicons.
	* ui.h (big_unit_images): New extern int.
	* ui.c (big_unit_images): Initialize to false.
	(xform_unit): Use big_unit_images instead of g_bigicons.
	(xform_unit_view): Use big_unit_images instead of g_bigicons.
	(get_unit_type_images): Test for width > 32 pixels and set
	big_unit_images to true in that case.
	
	Various other game module fixes.
	* 3rd-age.g (acp-to-capture): Comment out unused table.
	* advances.g (unit-consumption-to-grow): Reduce to 15.

	Fix drawing of multiple units in one cell so that everything always 
	stays within the cell boundary, in order to prevent garbage from
	being left in adjacent cells.
	* macdraw.c (draw_unit_image): Tweak emblem positions.
	* sdlmap.c (draw_unit_image): Tweak emblem positions.
	* tkmap.c (draw_unit_image): Tweak emblem positions.
	* ui.c (xform_unit): Reduce vertical offset to 2/3 instead of 3/4
	for multiple rows of big icons in one cell.
	(xform_unit_view): Reduce vertical offset to 2/3 instead of 3/4
	for multiple rows of big icons in one cell.
	
	Fix image viewing bug in tcltk unit drawing code.
	* tkmap.c (draw_units): Skip redundant test for vp->show_all.

	Enable stippling of incomplete units in MacTCL and prune the size
	of the stippling rect so that it fits within a standard grouping box.
	Stipple in the same color as the grouping box.
	* tkmap.c (draw_unit_image): Remove ifndef MAC. Shrink the
	stippling rectangle by 2 pixels in each direction. Use mask_color
	instead of whitecolor.
	
	Change the default window background color used by the mac ppc 
	interface to sandy brown, similar to the tcltk interface.
	* gvar.def (g_window_color): Set it to sandy-brown.

2003-01-18  Hans Ronne <hronne@telia.com>

	Update Doxygen comments in the kernel headers (from Stanley Sutton).
	* (autotest.h, cmdline.h, conq.h, dir.h, game.h, history.h, imf.h, lisp.h,
	module.h, side.h, unit.h, world.h): Update.
	
	Add Stanley Sutton's Doxygen comments to actions.c and fix some bugs.
	* actions.c: Add Dogygen comments, rename unit pointers etc. everywhere.
	(do_create_in_action): Rewrite code for adding a colonizer to a city.
	(check_create_in_action): Ditto for the check.
	(set_created_unit_props): Pass the creator itself instead of various 
	creator properties as an argument.

	Fix compiler prototype warning on the Mac platform.
	* macunit.c (unit_plan_dialog): Add missing prototype.

2003-01-14  Hans Ronne <hronne@telia.com>

	New attempt at fixing the "Tank sitting in water" bug, this time so that it 
	is still possible to use connections (roads) to move units through terrain
	that is impassable (mountains).
	* move.c (do_move_action): Add code that causes unit to vanish or wreck
	also if it disembarks into hostile terrain within the same cell.
	(check_move_action): Remove check for terrain_always_impassable.
	
2003-01-13  Hans Ronne <hronne@telia.com>

	Fix typo in email address.
	* ChangeLog: Fix the typo.
	* ChangeLog-2002: Ditto.

2003-01-12  Hans Ronne <hronne@telia.com>

	Add ability to draw clouds to the tcltk interface.
	* tkmac.c (XFillArc): Hacked version of function from tkMacDraw.c
	with added support for stippled drawing.
	(XFillRectangles): Add support for black stippled style.
	* tkmap.c (draw_clouds_row): Rewrite so that it draws clouds using
	different white stippled patterns instead of just numbers. 	

	Fix bug that prevented the drawing of clouds in the tcltk interface.
	* tkconq.tcl (create_map_menus): Change map_clouds call in the
	weather submenu to default_map_options(clouds).
	
	Fix design tool for drawing clouds in the tcltk interface.
	* tkconq.tcl (cloudtype, cloudbottom, cloudheight): New globals.
	(make_clouds_paint_frame): Add cloudtype menu and Set button
	that calls set_clouds.
	(set_clouds): New procedure.
	(dbg_set_design_data): Handle case curcloudtype.
	
	Make the Mac interface draw all 4 cloudtypes differently.
	* macdraw.c (draw_clouds): Use black_pat for cloudtype 4.
	* macdesign.c (do_mouse_down_design): Add 1 to upper limit in
	OPTION_CYCLE call for case cloudstool.
	
2003-01-12  Hans Ronne <hronne@telia.com>

	Update the pre-release version date.
	* version.h (VERSION): Change to January 2003.
	
	Fix the Mac design window so that works correctly under Mac OSX.
	Also improve the layout and fix various bugs. Move the feature New
	and Remove buttons to the Feature Edit Dialog. Make sure frontmap
	is updated correctly as tools are turned on or off.
	* macconq.h (brushsizetool): Move to the end of enum tooltype.
	* macdefs.h (dFeatureRename): Rename to dFeatureEdit with items.
	Add diFeatureEditNew and diFeatureEditRemove.
	(cFeatureAddButton): Remove.
	(cFeatureRemoveButton): Remove.
	(cFeatureEditButton): Change to 401.
	* macdesign.c (dtoolw): Increase to 150.
	(dtoolh): Increase to 40.
	(feature_add_button): Remove.
	(feature_remove_button): Remove.
	(create_design_window): Remove support for feature_add_button 
	and feature_remove_button. Set the featuremenu selected item to the
	first menu item and check it.
	(draw_design_window): Don't call DrawControls.
	(draw_design_window_tool): Use green background for tmprect. Call
	Draw1Control for all controls. Change "(no feature)" to "No Feature".
	Change "Brush" to "Brush Size". Draw the cloud image on top of the 
	terrain image. Fix bug with uninitialized tmpstr. Increase truncated
	string lengths. Draw dividing lines in graycolor instead of gray_pat.
	Don't draw a highlight rectangle for the selected tooltype.
	(do_mouse_down_design): Add workaround for case featurepopup to
	handle Mac OSX bug in TrackControl. Remove case feature_add_button
	and feature_remove_button. Set the featuremenu selected item and
	check it in case feature_edit_button. Make it possible to select the
	brushsizetool. Call force_map_update(frontmap) for elevationtool,
	temperaturetool, cloudstool and windstool. Turn special drawing of 
	the side view on and off for viewtool. Don't call DrawControls.
	(feature_rename_dialog): Rewrite from scratch. Add support for
	"New" and "Remove" buttons. Change dFeatureRemove and its items
	to dFeatureEdit everywhere.

	* Xconq.r (CNTL 200 "Sides Popup"): Tweak size and position.
	(CNTL 204 "Terrain Types Popup"): Tweak size and position.
	(CNTL 205 "Unit Types Popup"): Tweak size and position.
	(CNTL 212 "Features Popup"): Tweak size and position.
	(CNTL 401 "Feature Add Button"): Remove.	
	(CNTL 402 "Feature Remove Button"): Remove.
	(CNTL 403 "Feature Edit Button"): Change CNTL number to 401.
	Tweak size and position.
	(DITL 203 "Feature Rename Items"): Rename to "Feature Edit Items".
	Add "New" and "Rename" buttons. Tweak item sizes and positions.
	(DLOG 203 "Feature Rename"): Rename to "Feature Edit". Tweak 
	size and position.
	
	Fix kernel bug in elevation code by making sure the elevation area layer
	is allocated and contour intervals computed if any_elev_variation is true.
	Also replace the redundant world_is_flat macro by !any_elev_variation 
	everywhere in the code.
	* macdesign.c (create_design_window): Change world_is_flat to 
	!any_elev_variation.
	* mkterr.c (compose_area): Change !world_is_flat to any_elev_variation.
	(make_random_terrain): Change !world_is_flat to any_elev_variation.
	(make_earthlike_terrain): Change !world_is_flat to any_elev_variation.
	(compose_earthlike_area): Change !world_is_flat to any_elev_variation.
	(name_highest_peaks): Change world_is_flat to !any_elev_variation.
	(flatten_liquid_terrain): Change world_is_flat to !any_elev_variation.
	* world.c (final_init_world): Call allocate_area_elevations if necessary
	before calling compute_elevation_bounds. Also test for any_temp_variation
	instead of maxtemp != mintemp.
	* world.h (world_is_flat): Remove macro.
	
	Fix Mac OSX crashes when drawing the wind design tool.
	* macdraw.c (draw_winds): Don't allow negative swforce.
	
	Fix port setting error in the Mac SICN plotting code.
	* macdraw.c (plot_sicn): Call my_GetPortBitMap(port) instead.
	
	Fix Mac OSX crashes in feature legend drawing code.
	* macmap.c (draw_feature_names): Call place_legends if legends
	have not yet been allocated.
	
2003-01-10  Hans Ronne <hronne@telia.com>

	Fix bug that prevented the tcltk Weather menu from working correctly.
	* run2.c (run_environment): Don't allocate area.temperature, area.winds,
	area.clouds, area.cloudbottoms and area.cloadheights here, it is too late.
	* world.c (final_init_world): Allocate these area layers here instead.
	
	Fix bug that prevented clouds from working correctly in the absence of 
	winds and temperature.
	* run2.c (run_environment): Don't return if any_clouds is true.
	
	Add the ability to paint temperature and clouds to the tcltk interface.
	* tkmain.c (tk_set_design_data): Add temperature and cloud code.
	* tkmap.c (paint_on_drag): Add temperature and cloud code.
	(handle_designer_mouse_down): Add temperature and cloud code.
	
	Rewrite portions of the tcltk design popup dialog. Fix several bugs.
	* tkconq.tcl (ask_bool_mode): Tweak button positions.
	(popup_design_palette): Reposition the Stop button and make it active 
	by default. Add key binding for Return.
	(make_normal_frame): Change label to bigfont.
	(make_terrain_paint_frame): Change label to bigfont.
	(make_unit_paint_frame): Change label to bigfont. Add -pady 4.
	(make_people_paint_frame): Change label to bigfont.
	(make_control_paint_frame): Change label to bigfont.
	(make_feature_paint_frame): Change label to bigfont. Rewrite. Make 
	text entries sunken. Use grids to pack labels and entries.
	(update_feature_name_entry). Initialize the text entries with empty 
	strings instead of garbage info.
	(make_material_paint_frame): Change label to bigfont.
	(make_elev_paint_frame): Change label to bigfont. Rewrite. Make 
	text entries sunken. Use grids to pack labels and entries. Rearrange
	and relabel buttons and entries. 
	(make_temp_paint_frame): Change label to bigfont. Make text entry 
	sunken. Rearrange items. Add label. Fix bug by calling set_temperature 
	instead of passing $tempvar to dbg_set_design_data.
	(set_temperature): New tcl procedure.
	(make_clouds_paint_frame): Change label to bigfont. Make text entries 
	sunken. Use grids to pack labels and entries. 
	(make_winds_paint_frame): Change label to bigfont. Make text entries 
	sunken. Use grids to pack labels and entries. 
	(make_view_paint_frame): Change label to bigfont.
	(dbg_set_design_data): Fix bugs in wind menu update code.

2003-01-10  MA Dunzi <tadalunch@s5.xrea.com>

	* tcltk/tkconq.tcl(popup_help_dialog): Add tree widget.
	(update_help): Add tree code for civ games.
	(tree_node_clicked): Mouse binding for tree nodes.
	(add_tree_node): New function.

2003-01-08  MA Dunzi <tadalunch@s5.xrea.com>

	* kernel/move.c (check_move_action): Fix "Tank sitting in water" bug
	(thanks Richard Hunt, Hans Ronne).

2003-01-07  Hans Ronne <hronne@telia.com>

	Change the tcltk interface back to using non-modal alert dialogs like
	the Mac interface. However, do this consistently for all messages this
	time. Don't use the command line at all. Rewrite and improve the tcltk
	.bool alert code and add key bindings for Return, Escape, Yes and No.
	* tkconq.tcl (ask_bool_mode): Rewrite. Add back .bool window code 
	and remove the command line code.
	(ask_bool_done): Withdraw and destroy .bool instead of clearing the 
	command line.

2003-01-06  Hans Ronne <hronne@telia.com>

	Complete previous work on Mac non-modal alert dialogs. Use them instead
	of the GROK_MODAL code for the notices window, but keep support for the 
	latter in do_keyboard_command, which may be useful in the future.
	* maccmd.c (do_quit): Comment out GROK_MODAL notices code and call
	show_alert_dialog(quitalert) instead.
	(do_resign):  Comment out GROK_MODAL notices code and call
	show_alert_dialog(resignalert) instead.
	(do_design):  Comment out GROK_MODAL notices code and call
	show_alert_dialog(designalert) instead.
	* macdefs.h (dGameOver): Move it and items to correct position.
	(dTwoButtonAlert): Add new dialog.
	* macconq.h (alerts): New enum: designalert, quitalert, resignalert.
	* macwins.c (alerttype): New static int.
	(show_alert_dialog): Use dTwoButtonAlert in GetNewDialog.
	(show_alert_dialog): Call ParamText for different alerts.
	(do_key_down_alert): Add support for Yes and No shortcuts.
	(hit_alert_dialog): Rewrite and add support for different alerts.
	* Xconq.r (dctb 4000 "Two Button Alert"): New dialog color 
	table. Set the background color to pink.
	(DITL 900 "Game Over Items"): Tweak item positions.
	(DITL 4000 "Two Button Alert"): Tweak dialog items.
	(DLOG 900 "Game Over"): Tweak size and autoposition as alert.
	(DLOG 4000 "Two Button Alert"): Tweak dialog position and size.
	(ictb 4000 "Two Button Alert"): New item color table. Set the
	EditText field to pink. Note: should figure out how to make the
	white rectangles around buttons disappear under Mac OSX.
	
	Don't write out the storage space if it is set to arbitrarily large (9999).
	* nlang.c (supply_desc): Add special case for um_storage_x == 9999.
	
	Fix so that saving of files works under Mac OS9/Carbon. Note: should
	also figure out how to make the creator propagate to the saved file.
	* macmenus.c (save_the_game): Pass 'XCNQ' instead of '????' to
	NavPutFile.

	Fix problem with AI control info not updating correctly in the Mac 
	game window when the AI is turned on or off.
	* maccmd.c (get_command_and_do): Call draw_game in case "ai".
	* macmenus.c (do_menu_command): Call draw_game in case mAITypes.
	* macwins.c (draw_game_side): Call EraseRect 3 times for AI info.
	
	Fix garbage being left in the game progress field in Mac OSX.
	* macwins.c (draw_game_progress): Tweak tmprect size.
	
	Fix garbage in drawing of the help window under Mac OSX.
	* machelp.c (draw_help): Tweak tmprect and line position.
	(create_help_window): Tweak helptopicrect & viewrect.
	* Xconq.r (CNTL 130 "Close Button"): Tweak position.
	
	Fix crashes in Mac OSX if a key is hit repeatedly during launch.
	* macconq.c(handle_keystroke): Don't call do_keyboard_command
	while beforestart is true.
	
	Fix buttons in advanced popup so that the text fits in Mac OSX.
	* Xconq.r (DITL 803 "Advanced Popup"): Tweak button widths.

2003-01-01  Hans Ronne <hronne@telia.com>

	Split the ChangeLog file.
	* ChangeLog: Move old content to ChangeLog-2002.
	* ChangeLog-2002: New file.
	
	Fix the CVS modules so that checkouts no longer produce error messages.
	* CVSROOT/modules: Don't check out the tcltk directory more than once.
	Make sdl, tcltk, bitmaps and curses all part of xconq-base. Make libcurses
	part of xconq-mac and xconq-win. Add ChangeLog-2002. Remove obsolete
	mpw files.
