2004-12-29  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix terrain drawing bug on wraparound map on Windows Tkconq.
	* tkmap.c (draw_terrain_row): For the 'draw_polygons' case, we must 
	always lay down background matting, and not just at the supposed 
	edges of the map. There is apparently a bug in 'inside_area' 
	(mirabile dictu), and one sees "edge effects" if one relies on 
	it to accureately determine when something is inside the area or no.
	Obviously, this "marvelous" bug must be investigated further.
	  (draw_map_widget): Since we are now drawing the background piece 
	by piece for platforms that cannot properly use a clip mask (read 
	Windows), let's just skip drawing the area background as a whole.

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Updates to Opal and AWLS families of games. 
	(Changes from Elijah Meeks.)
	* images/korea.gif
	* lib/awls-rules.g, lib/korea-2006.g, lib/opal.g, lib/opal-heroes.g

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Change some message in action description.
	* nlang.c (action_desc): Remove "(error!)" from descriptions; 
	often the pruported error condition occurs just because the 
	recipient of the action has moved on or passed away.

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix 'see-mistake-chance' bug. (Reported by Elijah Meeks.)
	Also document 'see-mistake-range-min' now that the stuff works.
	* doc/refman.texi (see-mistake-range-min): New entry.
	* side.c (set_unit_image): Copy prototype from 'ui.h'.
	  (set_unit_view_image): Likewise.
	  (side_occs_see_unit): Fix the @$#! bug. Units from other sides 
	were acting as seers because we were recursing before filtering 
	out those units.
	  (side_ustack_see_unit): Likewise.
	  (mistake_view): Set the new unit view image as soon as the mistake 
	is determined.

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix a unit view initialization bug. (Reported by Elijah Meeks.)
	* ui.c (init_unit_images): If the image name of the unit view is 
	NULL, it may be that the image name of the associated unit was 
	NULL during initialization. However, the unit would then get 
	an image name when 'init_unit_images' is run. After units have 
	been assigned image names, their associated unit views would still 
	have NULL image names. Unit view processing happens after unit 
	processing in this function. In the case where the image name is 
	randomly chosen from a list, this would allow an unit view to get a 
	different image name than the associated unit. The fix is to check 
	if the image name is NULL, and then assign the image name of the 
	associated unit to it, if so.

	Clean out some more junk from Sdlconq drawing code.
	* sdlmap.cc (x_xform_unit_view): Delete prototype.
	  (x_xform_unit_self): Likewise.
	  (x_xform_unit_self_view): Likewise.
	  (x_xform_occupant): Likewise.
	  (x_xform_occupant_view): Likewise.

	Tweak Sdlconq unit display.
	* sdlmap.cc (draw_unit_completeness): Only show this indicator 
	for view widths >= 16 pixels.
	  (draw_uimg_as_side_color): At low zooms, draw the appropriate 
	side color in rectangles, instead of black.

	Fix bugs in selection indicator and health bar for oversized unit 
	images in Tcl/Tk and SDL interfaces.
	* sdlmap.cc (draw_uview_selection_rectangle): Only "outdent" selection 
	rect, if the unit view image width permits. If it is too wide, it 
	will fall outside the cell redraw region.
	  (draw_uview_health_bar): If health bar position would exceed bounds 
	of unit view image region, then pull it back down inside.
	* tkmap.c (draw_uview_selection_rectangle): Same as Sdlconq changes.
	  (draw_uview_health_bar): Same as Sdlconq changes.

	Slightly increase efficiency of unit view code.
	* side.c (add_unit_view): If the view of an unit's transport is 
	to be rebuilt, then return after adding the transport's view 
	because the process of doing so added all occ views including our 
	own.

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Add documentation for construction box color customization.
	* refman.texi (construction-border-color): New entry.
	  (construction-fill-color): New entry.

	Make alpha blending of fill rects work in SDL interface.
	* sdlconq.h (alpha_blend_fill_rect): New prototype.
	* sdlmap.cc (draw_unit_completeness): Fix to use alpha blending by 
	calling 'alpha_blend_fill_rect'.
	* sdlscreen.cc (alpha_blend_fill_rect): New function. Create a 
	temporary surface that has a complete alpha mask and is marked as 
	an alpha source. Dump fill rect data into surface (without blending). 
	Blit temp surface into dest surface. Free temp surface. (Easy and 
	makes sense once you read the docs, particularly the part about 
	'SDL_FillRect' not performing alpha blending.)

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Add customizable colors to Tkconq grouping box.
	New Sdlconq feature: unit construction boxes with customizable colors.
	* utype.def (u_construction_border_color): New property. Controls 
	border color around an unit under construction.
	  (u_construction_fill_color): New property. Controls fill color 
	behind an unit under construction.
	* sdl/sdlcltbl.cc (find_sdl_color_by_name): Steal and adapt IMF 
	color lookup code from 'request_color' in Tkconq.
	* sdl/sdlmap.cc (draw_unit_completeness): Draw an unit completeness 
	box under and around the unit image if the unit is under 
	construction. (Note that I attempted to support alpha blending so 
	that the box would fade as the unit neared completion, but that does 
	not seem to be working out. Need to investigate further.)
	  (draw_unit_view): If the unit is under construction, then call 
	'draw_unit_completeness'.
	* tcltk/tkconq.h (request_color): Move prototype here from 'tkinit.c'.
	* tcltk/tkinit.c (request_color): Move prototype to 'tkconq.h'.
	* tcltk/tkmap.c (draw_uimg_gbox): Add support for designer-
	customizable colors for border and fill.

2004-12-27  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Major simplification/improvement to the Sdlconq unit drawing code.
	New Sdlconq feature: unit grouping boxes with customizable colors.
	Cleanup of unused functions in Tkconq and Sdlconq.
	* doc/refman.texi (unit-gbox-border-color): New entry.
	  (unit-gbox-fill-color): New entry.
	  (bigicons): Delete entry. No longer in use.
	* gvar.def (g_unit_gbox_border_color): New GDL global. Controls 
	border color around a transport's grouping box in interfaces that 
	support it.
	  (g_unit_gbox_fill_color): New GDL global. Controls fill color 
	inside a transport's grouping box in interfaces that support it.
	* ui.c (xform_unit_view): Remove commented out assertions.
	* sdl/Makefile.in (OBJS): Add 'sdlcltbl.o' to list.
	* sdl/sdlconq.h (RGBColorTableEntry): New struct. Color lookup 
	table entry. Has color name plus RGB triplet.
	  (stdcolors): New extern var.
	  (find_sdl_color_by_name): New prototype.
	  (find_rgb_triplet_by_name): New prototype.
	* sdl/sdlmap.cc (draw_units): Delete function.
	  (draw_unit_and_occs): Delete function.
	  (draw_uviews_in_cell): New function.
	  (x_xform_unit_view): Delete function.
	  (x_xform_unit_self): Delete function.
	  (x_xform_unit_self_view): Delete function.
	  (x_xform_occupant): Delete function.
	  (x_xform_occupant_view): Delete function.
	  (draw_unit_view): New function.
	  (draw_uimg_gbox): New function.
	  (draw_unit_view_and_occs): Rewrite function.
	  (draw_uimg_as_side_color): New function.
	  (draw_uimg_emblem): New function.
	  (draw_uview_selection_rectangle): New function.
	  (draw_uview_health_bar): New function.
	* tcltk/tkmap.c (x_xform_unit_self_view): Delete function.
	  (x_xform_occupant): Delete function.
	  (x_xform_occupant_view): Delete function.
	  (x_xform_unit_view): Delete function.

	New Sdlconq hacking feature: lookup colors by name from fairly 
	large color database.
	* sdlcltbl.cc: New file.
	  (stdcolors): An extensive color lookup table.
	  (find_sdl_color_by_name): New function. Finds a color by name and 
	passes it back as a 'SDL_Color'.
	  (find_rgb_triplet_by_name): New function. Finds a color by name 
	and passes it back as red, green, and blue bytes.

	New documentation.
	* doc/colors.txt: Names of colors available for game designers to 
	use in the SDL and Tcl/Tk interfaces.

2004-12-25  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Major changes to the UI API, and major simplification/improvement 
	to the Tkconq unit drawing code. Hundreds of lines of duplicated/
	redundant code eliminated.
	* conq.h (find_unit_view): Make available here instead of local to 
	'side.c'.
	* imf.h (emblem_position): New parameters.
	* imf.c (size_match_score): Circumvent divide-by-zero problems.
	  (emblem_position): New paramters: standard viewport widths for 
	hexagons and units. Integrate emblem code from Tcl/Tk interface.
	* side.c (find_unit_view): Delete static prototype. Now in 'conq.h'.
	  (see_cell): Delete some commented out code, since its replacement 
	code has been shown to work at least as well.
	* ui.h: New 'XFORM_UVIEW_*' family of flags used by the rewritten 
	'xform_unit_view' function.
	  (xform_unit_view): Backward-compatible prototype with new 
	parameters which have default values.
	* ui.c (uw_trad): Table of traditional unit widths. Dimensions are 
	based on diplay square widths and number of unit views. (Note that 
	this table could be dynamically calculated.)
	  (uw_elli): Table of "ellipsisized" unit widths; not yet used. 
	Dimensions are the same as for 'uw_trad'. (Note that this table could 
	be dynamically calculated.)
	  (max_uviews_in_rect): New function. Return the maximum number 
	of unit views in a display rectangle given a certain set of conditions.
	  (uview_width_in_rect): New function. Return the width of an unit 
	view in a display rectangle given a certain number of other views in 
	it and a certain set of conditions.
	  (can_use_oversized_img): New function. Somewhat crude test to 
	determine if an oversized unit image is available at the current 
	view power.
	  (xform_unit_view): Totally rewritten function. Now handles 
	trnasport, occupant, and stack transformations all from a single 
	function. Also has support for "piling" and "ellipsisizing" 
	features, which are not yet used by the UI's.
	* sdl/sdlmap.cc (draw_unit_image): Adjust to the revised 
	'emblem_position' function.
	  (draw_current): Start to simplify as with Tkconq. Also, adjust to 
	the rewritten 'xform_unit_view' function.
	* tcltk/tkisamp.c (draw_one_main_image): Adjust to the revised 
	'emblem_position' function.
	* tcltk/tkmap.c (draw_units): Delete function; replace with 
	'draw_uviews_in_cell'.
	  (draw_uviews_in_cell): New function; replaces 'draw_units'.
	Much, much cleaner.
	  (draw_rectangle): New function. Platform indep way of drawing 
	rects with X11 calls.
	  (draw_unit_and_occs): Delete function.
	  (draw_unit_view_and_occs): Rewritten function. Much, much cleaner.
	  (draw_unit_view): New function. Handles the drawing of an 
	individual unit view. Much, much cleaner.
	  (draw_row): Replace calls to 'draw_units' with 
	'draw_uviews_in_cell'.
	  (draw_uimg_gbox): New function. Handle the drawing of a grouping 
	box for transports in sufficiently high mag overhead views.
	  (draw_current): Rewritten function. Much, much cleaner.
	  (draw_uview_rsrc_usage): New function. Handle the drawing of 
	advanced unit resource usage.
	  (draw_uview_selection_rectangle): New function. Handle the drawing 
	of the current unit's selection rect.
	  (draw_uview_health_bar): New function. Handle the drawing of the 
	current unit's health bar.
	  (draw_uimg_as_side_color): New function. Draw an unit image as the 
	side color, if the mag is sufficiently low.
	  (draw_uimg_fadeout): New function. Handle the "fadeout" effect. 
	Currently used to indicate units under construction.
	  (draw_uimg_emblem): New function. Handle the drawing of an emblem 
	associated with an unit image.

2004-12-16  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Delete two of the biggest space hogs in the repository.
	These are Mac resource files for Tkconq, and they seem to 
	contain much extraneous garbage. (I believe Hans once told me that 
	he was keeping the common Tcl and Tk scripts in the resource 
	fork of the Mac Tkconq. My reply is, why should the repository 
	suffer a 3+ MB penalty for the sake of one platform, a platform 
	that can use the scripts as files and does not need to have them 
	stuffed in the resource fork, unless I am mistaken?)
	* tkmac.r: Delete file.
	* iappmac.r: Delete file.

2004-12-16  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix segfault caused by recent addition of 'action_desc' feature.
	* nlang.c (action_desc): For 'create-at' action, convert the 
	utype to its name rather than trying to pass the raw type number 
	as a char pointer.

	Ignore auto-versioned files recently taken out of CVS.
	* kernel/.cvsignore: Ignore 'kernel.h'.
	* pkg/.cvsignore: New file. Ignore 'xconq.spec' and 'xconq.nsi'.

2004-12-13  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Start to fix some of the problems caused by games which use 
	mixed bags of 44x44 and 32x32 icons. (TODO: Clean up some of the 
	'draw_unit_*' family of functions. There is much duplicated code 
	amongst the, and some of it problem belongs in 'ui.c' as it should 
	not be interface specific.)
	* imf.h (best_image_in_range): New prototype.
	  (best_image): Delete prototype. Replace with macro that calls 
	'best_image_in_range'. (Patch from Matthew Skala.)
	* imf.c (best_image_in_range): Convert 'best_image' to a function 
	that will return best image out of a range of sizes. (Patch from 
	Matthew Skala with a couple of modifications by me.)
	* ui.c (get_generic_utype_images): Comment out the weak-minded 
	logic that sets the 'big_unit_images' flag. (TODO: Improve logic 
	to set a flag at each resolution, and then only if ALL images are 
	big.) This effectively means that all images will be scaled 
	32x32 until better logic is in place.
	* tcltk/tkmap.c (draw_unit_image): Keep track of specified width 
	and height which function was originally called with. Call 
	'best_image_in_range' instead of 'best_image'.

2004-12-11  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	New function to describe actions. Use it in Tkconq's unit info 
	display. (Implemented in response to a bug report from Paul Crespy.)
	* conq.h (action_desc): New prototype.
	* nlang.c (action_desc): New function. Describes an action.
	* tcltk/tkmain.c (draw_unit_info): Call 'action_desc' if there is 
	a pending action and no task is being drawn (because we have limited 
	space).

2004-12-11  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix Starfleet Battles family so that blank side emblems can be 
	used again.
	* battles.g: Add IMF entry for blank emblem.

2004-12-11  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Tweak CPU usage in the Tcl/Tk interface some more.
	* tkmain.c (ui_mainloop): Increase wait time back to 50ms for now. 
	(The 5ms interval still was causing too much "idle" CPU load, 
	about 20%, on Windows.)

	Improve the default graphics for the Default game.
	* stdunit.g: Change default graphics for all units but the nuke to 
	the Trident graphics.
	* standard.g: Make a "Classic" variant to replace the 'trident' 
	variant.

2004-12-10  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Tweak CPU usage in the Tcl/Tk interface some more.
	(Networking Note: I now begin to suspect that timing in the Tcl/Tk 
	interface is responsible for some networking problems. Increasing 
	the timeout window to ensure that 'run_game_cmd' is run before the 
	timeout window closes may help things. Also, Hans' changes which 
	caused "extraneous" packets to be ignored when expecting an ACK 
	may be wrong.)
	* tkconq.tcl (run_game_cmd): Make the timer for 'run_game_cmd' 
	only fire once every 5 ms instead of every 1 ms.
	  (run_game_idle_cmd): Make the timer for 'run_game_idle_cmd' only 
	fire once every 50 ms instead of every 2 ms.
	* tkmain.c (ui_mainloop): Instead of using sleep in between event 
	pollings, use 'Tcl_WaitEvent'. This will allow many events to restart 
	the polling/handling as soon as the event occurs. Change the 
	rest time between pollings to 5 ms instead of 50 ms. This does not 
	cause a CPU rampage as previously, because of the decreased 
	frequency of 'run_game_cmd' and 'run_game_idle_cmd' timer events. 
	This does imply that a larger network timeout window may needed or 
	that we must guarantee that retransmits are handled properly 
	(see comment about Hans' changes).

	Minor tweak to network code to make things more maintainable.
	* tp.c: Change the 'remote_player_specs' and 'online' arrays to 
	hold 'MAXSIDES' entries instead of a hardcoded number (100) entries.

2004-12-10  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Updates from Elijah Meeks for his various games.
	* images/korea.gif, images/spec1.gif: Updates.
	* images/spec2.gif: Delete. No longer used?
	* lib/awls-rules.g: Change world generation parameters. Various 
	other changes.
	* lib/battles.g: Decrease vision range of sensors.
	* lib/opal-rules.g: Various changes.

	Modifications to the games library.
	* beirut.g: Comment out version number.
	* future.g: Likewise.
	* galaxy.g: Likewise.
	* game.dir: Add 'opal-heroes' to list of games.
	* imf.dir: Remove references to images in 'spec.imf'.
	* insects.g: Comment out version number.
	* mars.g: Likewise.
	* mormon.g: Likewise.

2004-12-07  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Further lay the groundwork for inlined map images, and fix a 
	scaling problem at low magnifications. (Patch from Matthew Skala.)
	* imf.c (scale_image): Inherit 'hexgridx' and 'hexgridy'. 
	Recognize and apply flat colors at low resolution.

2004-12-06  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Some hacks to accomodate recent changes in the 'best_image' 
	function as a result of Matthew's scaler work. (TODO: Extend UI 
	API so that the "natural" image sizes can be queried and 
	requested.)
	* sdl/sdlscreen.cc (draw_button): Force image in button to be 
	scaled to 32x32.
	* tcltk/tkconq.tcl (create_map_window): Force image in unit info 
	panel to be scaled to 32x32.
	  (popup_help_dialog): Force image in help dialog window to be 
	scaled to 32x32.

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix game restoration bug which ignored saved ACP values of units 
	that would normally be ACP-less. These units have ACP values 
	because their occs (or time of day, etc...) confer ACP upon them. 
	However, their occs may not yet be read in yet, so it best to 
	take whatever 'acp' and 'acp0' (initacp) say. (Bug reported by 
	Elijah Meeks.)
	* kernel.h (init_unit_actorstate): Allow the passing of an 
	optional argument that tells the function how to treat units that 
	normally be ACP-less.
	* read.c (interp_unit): Use the parsed value for 'K_ACP' or 'K_ACP0' 
	as a flag to 'init_unit_actorstate'.
	* unit.c (init_unit_actorstate): If optional flag >0, then go 
	ahead and initialize an actor state struct, even if we would not do 
	so under normal circumstances.

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix crashing bugs in Xconq. (Bug reports from Matthew Skala.)
	* move.c (check_move_action): If the unit is ACP-less, then it 
	cannot move. Do not attempt to access its action struct, as it is 
	NULL. (Fixes crash in Beruit 1982).
	* side.c (see_weather): Check to make sure that cloud bottoms and 
	cloud heights layers are defined before accessing them. (Fixes 
	crash in Napoleon.)

	Fix warning in Space Civilization. (Bug report from Matthew Skala.)
	* space-civ.g (variant last-side-wins): Make sure that the default 
	variant state comes after the variant description and not before.

	Some more tweaking of the Tcl/Tk event handling.
	* tkmain.c (ui_mainloop): Increase sleep time to 50ms (1/20 s) 
	between event servicings. This does not seem to cause any 
	perceptible UI or run_game delays.
	  (run_ui_idler): Service all events, not just window events. 
	(Hopefully this will be harmless during AI runs. In an ideal 
	wold it would be.)

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix crashing bug in Tkconq when attempting to access the image 
	of an unit, which has no explicit image name. Resurrect the legacy 
	behavior of looking up image name by internal unit name when the 
	image name list is nil. (Thanks to Matthew Skala for reporting this 
	bug.)
	* tkmain.c (tk_u_image_name): Since Hans' multiple image patch 
	allows for a list of image names rather than just a string, the 
	check for empty string is meaningless; one must now check for 
	lispnil, and assign the unit type's internal name accordingly.

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Improve the appearance of most checkboxes in the new color scheme 
	for Tkconq.
	* tkconq.tcl: For every instance of checkboxes, except for 
	"Show unfinished games", set the hilighted background color to 
	the background color.

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Drop CPU usage some more. (Testing on Windows indicated that it 
	was still too high at game time.)
	* tkmain.c (ui_mainloop): Increase sleep time from 5ms to 15ms.

	Fix glitch in new Tkconq color scheme on Windows.
	* tkconq.tcl (scolor): Change from 'MediumBlue' on all platforms to 
	'white' on Windows. This allows checkboxes to be filled with a color 
	with which the check can be seen.

2004-12-05  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix heavy CPU usage bug. (Bug reports by Jon Leach, Elijah Meeks, 
	and probably others.) (If I would have realized how simple the 
	problem was, I would have fixed it ages ago.)
	* tkmain.c (ui_mainloop): As long as we're in an infinite loop, 
	we might want to sleep once in a while, so that we are not 
	constantly polling for events. (Sadly enough, I may have caused 
	the CPU usage massacre back when I fixed the bug that prevented 
	Xconq from being used with multithreaded Tcl. The 'TCL_DONT_WAIT' 
	flag tells 'Tcl_DoOneEvent' not to block on an empty event queue.
	The blocking call was causing problems with MT Tcl, so I changed it. 
	The consequence was that non-MT Tcl looped infinitely without 
	pausing to catch its breath. The polling of the queue was driving 
	the CPU usage up between 95% and 99%. The solution is to let 
	Tkconq catch its breath; a call to Tcl_Sleep for 5ms proves to be 
	quite sufficient.)
	
	Make the Tcl/Tk interface less "colorful", more "solemn", yet 
	"pleasant" (at the behest of Elijah Meeks and myself).
	* tkconq.tcl (bgcolor): Change from 'LemonChiffon' to 'LightGray'.
	  (hbcolor): Change from 'LemonChiffon' to 'DarkGray'.
	  (abcolor): Change from 'LemonChiffon' to 'LightGray'.
	  (tcolor): Change from 'LemonChiffon2' to 'Gray'.
	  (mbcolor): Change from 'SandyBrown' to 'DarkGray'.
	  (lcolor): Change from 'azure' to 'AntiqueWhite'.
	  (scolor): Change to 'MediumBlue' on all platforms.
	  (afcolor): Change from 'black' to 'SandyBrown'.
	  (ncolor): New variable, for notices panel. Set to 'LightSkyBlue1'.
	  (add_variants_dialog_items): Use 'bgcolor' for highlighted 
	background color as well as normal background color. This gets rid of 
	ugly frames around the checkboxes.
	  (create_map_window): Access the new global 'ncolor'. Set the 
	highlighted background of the notices panel to 'ncolor' instead of 
	'lcolor'.
	  (ask_bool_mode): Change the yes-no dialog's color scheme from an 
	"effeminate" pink to a Rich Golden Hue of Prompting (tm).

	Rename several menus in the Tcl/Tk interface (at the behest of 
	veteran Xconqueror Andreas Bringedal).
	* tkconq.tcl (create_map_menus): Change the title of the "Play" menu 
	to "Orders". Change the title of the "More" menu to "More Orders".

	Make the yes-no dialog in the Tcl/Tk interface wide enough to support 
	the large prompting text in Unix/Linux Tkconq.
	* tkconq.tcl (ask_bool_mode): Change the width of the dialog from 
	240 pixels wide to 340 pixels wide.

2004-12-04  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix for isometric terrain display. (Patch from Matthew Skala.)
	* imf.c (best_image): Check geometry of image. If height-to-width 
	ratio is a certain way, then perhaps we are dealing with an isometric 
	image, and need to be careful.
	  (add_hex_mask): Likewise.
	  (remove_hex_mask): Likewise.

2004-12-04  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Fix building if the keywords-in-context program with a C++ 
	compiler.
	* doc/Makefile.in: Assign 'CC' and 'CFLAGS' to their 
	respective C++ macro expanders.

	Refine and expand the "parambox" system for passing parameter 
	boxen to the search functions.
	* parambox.h: New header file for paramboxes.
	* Makefile.in (ALL_H): Add 'parambox.h' to list of includes.
	* aiutil.c: Fix copyright notice.
	  (can_be_blocked_by_any_known_enemy_at_if_at): Use 'ParamBoxUnitAt' 
	instead of overly-specialized 'BlockingZOCParamBox'.
	  (can_be_blocked_by_any_known_enemy_if_at): Likewise.
	* aiutil.h: Fix copyright notice.
	  (can_be_blocked_by_any_known_enemy_at_if_at): Fix prototype.
	  (can_be_blocked_by_any_known_enemy_if_at): Fix prototype.
	  (struct a_blocking_zoc_param_box): Delete.
	* conq.h: Include 'parambox.h'.
	* unit.h: Include 'parambox.h'.
	  (struct ParamBoxUnit): New struct. Subclassed from 'ParamBox'. 
	Contains an unit pointer.
	  (struct ParamBoxUnitAt): New struct. Subclassed from 'ParamBoxUnit'. 
	Contains a coordinate pair.
	  (struct ParamBoxUnitUnit): New struct. Subclassed from 'ParamBox'. 
	Contains two unit pointers.
	  (struct ParamBoxUnitSide): New struct. Subclassed from 
	'ParamBoxUnit'. Contains a side pointer.

	Two new versions of the popular 'search_around' function.
	* world.c (limited_search_around): New function that takes a 
	counter variable and parambox as arguments. Logic is very similar 
	to existing 'limited_search_around'.
	  (search_around): New function that calls the new 
	'limited_search_around' function with appropriate arguments. 
	Takes a parambox as one of its arguments.
	* world.h (limited_search_around): Additional prototype.
	  (search_around): Likewise.

	Begin developing a namespace for Xconq globals and other variables 
	outside of function scope. (The intent is to more clearly identify 
	globals. Once Xconq is being "Doxygenated" again, we should be 
	able to get a list of everything belonging to a namespace in one 
	place. Programming convenience.... Also, by placing vars in a 
	namespace, we can provide more naming opportunities for local 
	variables.)
	* conq.h (namespace Xconq): New namespace.
	* side.c (namespace Xconq): Add declarations/definitions for 
	'people_always_see', 'any_people_see_chances', 'any_see_chances', 
	'max_see_chance_range', 'any_see_mistake_chances', and 
	'max_see_mistake_range' to namespace.
	  (compute_see_chances): Use 'namespace Xconq' within function scope.

	Revise 'see_cell' code. (NOTE: This code still has a bug regarding 
	advanced usage of 'see-mistake-chance', but other aspects of the 
	revision appear to be correct. Other, higher piority bugs need to 
	be attended to at the time of this checkin. The behavior in 
	Elijah's 'vision.g' bug sample is no worse than before.)
	* side.c (see_unit): New helper function. Rolls the dice on 
	whether one unit can see another based on the appropriately calculated 
	see chance. Also rolls the dice one whether the type of a seen unit 
	is mistaken. (Intended as an arbiter function, and not a client 
	function.)
	  (side_occs_see_unit): New helper function. Iterates 'see_cell' over 
	a transport's occs. Also recurses into suboccs. (Declared as a 
	function that can be used with certain area search functions.) 
	(Intended as an arbiter function, and not a client function.) 
	  (side_ustack_see_unit): New helper function. Iterates 'see_cell' 
	over a cell's stack. Recurses into occs. (Declared as a function 
	that can be used with certain area search functions.) (Intended as 
	an arbiter function, and not a client function.)
	  (n_units_on_side): New function. Since the side struct does not 
	keep a total side units tally, unfortunately, one must do some work 
	to get such a tally. This implementation is inefficient as it 
	iterates through the side units list to count. (TODO: Add an 
	overall unit count to the side struct, and increment/decrement this 
	tally where appropriate.)
	  (side_sees_unit): Check more cases where the side definitely 
	sees the unit with total certainty. Also, if a blind occupant 
	owned by one side is in the transport of another side, that occupant 
	should not be able to see the transport.
	  (see_cell): Get rid of extra tests on whether side people view 
	an unit, since these tests are now integrated into 'sides_sees_unit'.
	Rewrite code dealing with possible sightings. Comment out code 
	dealing with cover > 0, but no possible viewers. (When is this ever 
	used and why?)
	  (mistake_view): Do not roll the dice on the mistake chance; this 
	is already done for each mistaken viewer. Just randomly select a 
	mistaken type from the list of mistake types for the given unit.
	* side.h (n_units_on_side): New prototype.
	* table.def (see-mistake-range-min): New TableUU. Minimum distance 
	at which a 'see-mistake-chance' will apply. Less than this range, 
	no mistaken sighting may happen.
	* ui.c (find_unit_or_occ): Call 'side_owns_occupant_of_unit' rather 
	than 'side_owns_occupant'.
	  (find_unit_or_occ_view): Likewise.
	* unit.c (side_owns_occupant): Rename to 'side_owns_occupant_of_unit'.
	  (side_owns_occupant_of_unit): Restructure to be more efficient 
	about whether a side owns an occupant of an unit.
	  (side_owns_viewer_in_unit): New function. Tests if a side owns 
	an unit that can see things in a given unit.
	  (see_chance): New function. An unified, centralized piece of code 
	that calculates the chance of one type of unit seeing another type 
	of unit at a given distance.
	  (see_chance): New function. Calculates the chance of one unit 
	seeing another unit. Considers many things, such as terrain, range, 
	lighting, and occupancy.
	* unit.h (struct SeerNode): New struct. Used for tracking units that 
	can see a particular unit, and whether such seeing may be mistaken.
	  (struct ParamBoxUnitSideSeers): New struct. Subclassed from 
	'ParamBoxUnitSide'. Contains a list of seer nodes.
	  (struct ParamBoxUnitUnitSeers): New struct. Subclassed from 
	'ParamBoxUnitUnit'. Contains a list of seer nodes.
	  (side_owns_occupant): Rename prototype to 
	'side_owns_occupant_of_unit'.
	  (side_owns_viewer_in_unit): New prototype.
	  (see_chance): New prototypes.
	* sdl/sdlmap.cc (x_find_unit_or_occ): Call 
	'side_owns_occupant_of_unit' instead of 'side_owns_occupant'.
	* tcltk/tkmap.c (x_find_unit_or_occ): Likewise.

	Fix for the 3rd Age game so that ships can return to harbors and 
	cities once they have left such places. (Thanks to Kevin O'Gorman 
	for reporting this bug (with 7.4.1, no less)).
	* 3rd-age.g (ferry-on-entry): Ferry 'naval' over border of cell 
	when destination belongs to 'places' or is a 'harbor'.

2004-12-04  Eric McDonald  <eric_mcdonald@users.sourceforge.net>

	Improve image scaling (including the scaling of subimages).
	Plus, groundwork for inlining map images into Xconq maps.
	(Patch from Matthew Skala; thanks Matthew!)
	* keyword.def (K_HEXGRID): New keyword.
	* imf.h (Image): New 'hexgridx' and 'hexgridy' fields.
	* imf.c (MFEntry): New struct for use in mode filter code.
	  (ModeFilter): Typedeffed pointer to 'MFEntry'.
	  (new_mf): New function. Create new 'ModeFilter'.
	  (add_to_mf): New function. Add a value to a mode filter.
	  (mode_of_mf): New function. Find mode of a mode filter.
	  (zero_mf): New function. Zero a mode filter.
	  (delete_mf): New function. Delete a mode filter.
	  (add_shrunken_image): Delete function. Replaced by generic 
	function, 'add_scaled_image'.
	  (add_magnified_image): Likewise.
	  (add_hex_mask): New function. Add a hex mask to an image.
	  (remove_hex_mask): New function. Remove hex mask from an image.
	  (scale_image_layer): New function. Scale a layer of an image.
	  (scale_image): New function. Scale an image.
	  (add_scaled_image): New function. Add a scaled image to an image 
	family.
	  (size_match_score): New function. Try to find best basis image for 
	doing scaling to a given resolution upon.
	  (calculate_hch): New function. Height of triangular masks for the 4 
	triangular regions that form the hex mask.
	  (interp_image): Interpret new 'K_HEXGRID' keyword.
	  (set_image_pixel_at): Apply a mask dependent on pixel size and 
	horizontal position.
	  (best_image): Use 'size_match_score' to help find the best image or 
	tiling.
	  (write_imf): Handle new hexgrid variables.
	  (make_image_from_file_image): Use 'calculate_hch' to determine 
	border placement. Also, handle 'hexgridx' and 'hexgridy' variables.
	If image is any sort of terrain, add a hex mask, and get rid of old 
	mask data.
	* tcltk/tkconq.tcl (utype_icon_size): Force to 32 instead of 44 
	for now. (TODO: Should make this more dynamic.)
	  (fill_in_utype_list): Force unit type list images to be scaled to 
	32x32, even if that is not their natural size. (TODO: Should revise 
	API to be more dynamic and flexible.)

2004-11-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Make the RPM package prep stage enter the proper directory 
	now that the name of the archive's dir has changed to match the 
	full version.
	* xconq.spec.in, xconq.spec

2004-11-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Stop referring to 'missing' dir and its contents in Windows installer 
	script. Also, restructure name of installer.
	* xconq.nsi.in, xconq.nsi

2004-11-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Refer to the output archive of 'make dist' for 'Source0' field 
	when building RPM packages.
	* xconq.spec.in, xconq.spec

2004-11-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve the 'dist' target of the top-level makefile to use a CVS 
	export instead of a time-consuming sed filter.
	* Makefile.in (check-cvs): New target. Check for the existence of 
	the 'CVS' directory, and the 'CVS/Root' file.
	  (dist): Total rewrite of target. Use CVS export instead of 'find' 
	and 'sed'. Add 'check-cvs' to target list. Use contents of 'CVS/Root' 
	to guide the export process, which is done in a subshell working in 
	the directory above the Xconq top-level.

	Make or update config templates for files which contain version 
	information.
	* configure.in: Define new macro expanders: 'XCONQ_VERSION_MAJOR', 
	'XCONQ_VERSION_MINOR', 'XCONQ_VERSION_REVISION', 
	'XCONQ_VERSION_RELEASELVL', 'XCONQ_VERSION_PRERELEASELVL', 
	'XCONQ_VERSION_DATE', 'XCONQ_VERSION_MAIN', 'XCONQ_VERSION_RELEASE', 
	'XCONQ_VERSION_FULL', and 'XCONQ_VERSION_FULL_UNDERSCORED'. 
	  (versioned_files): New variable. Lists off all the versioned files 
	in which macro expansion must occur during the output phase of 
	configuration.
	* Makefile.in: Use 'XCONQ_VERSION_FULL' macro expander in 
	conjunction with the rewritten 'dist' target.
	* kernel/version.h.in: New file. Template for 'version.h'.
	* pkg/xconq.nsi.in: New file. Template for 'xconq.nsi'.
	* pkg/xconq.spec.in: New file. Template for 'xconq.spec'.

2004-11-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	Make sure original image's palette is calculated before passing it 
	off to the shrunken image. (Patch from Matthew Skala; 
	thanks Matthew.)
	* imf.c (add_shrunken_image): Move palette inheritance code to after 
	palette has been calculated.

	Fix typo in Advances game.
	* advances.g

2004-11-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	Free some space used by image files with duplicated content.
	(Thanks to Elijah for cleaning this up.)
	* battles1.gif: Remove content that overlapped with other image 
	files.
	* kob-wreck.gif: Likewise.

	Finally get around to updating some of the stale pieces of 
	documentation.
	* NEWS: Mention that a 7.5 prerelease is in the works.
	* README: Significant updates. Mention all the new Xconq resources 
	that have sprung up recently. Mention the new locations of certain 
	other documentation files.

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

	Fix bug in the delay command which would cause delayed units not 
	to be selected by the UI once other units had moved. (Thanks to 
	Paul Crespy for reporting this bug.)
	* ui.c (autonext_unit): Keep track of units which could act but 
	are delayed. If no unit was selected to be current, and some units 
	were able to act, but were delayed, then undelay all units on the 
	side, and try again to find an unit to be current.

	Make use of unused flag with the 'delay_unit' function. Setting this 
	flag was already supported using 'net_delay_unit'.
	* plan.c (dealy_unit): Set the delay value of an unit's plan to the 
	flag rather than always assume that it is going to be set to true.

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

	Fix segmentation fault caused by recent change to Lisp printer.
	* lisp.c (fprintlisp): Do not evaluate symbols down to their basic 
	form. In the case of pointer objects this can lead to segmentation 
	faults.

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

	Merge the contents of the 'missing' directory into the 'kernel' 
	directory.
	* Makefile.in: Remove 'missing' from list of subdirs to iterate 
	over.
	* configure.in (makefiles): Remove the makefiles in the 'missing' 
	dir and its subdirs from the list of makefiles to produce.
	* curses/Makefile.in: Remove all references to the headers and 
	library in the 'missing' dir.
	* sdl/Makefile.in: Likewise.
	* tcltk/Makefile.in: Likewise.
	* x11/Makefile.in: Likewise.
	* kernel/snprintf.h: New file. From 'missing' directory.
	* kernel/snprintf.c: Likewise.
	* kernel/timestuff.h: Likewise.
	* kernel/timestuff.c: Likewise.
	* kernel/Makefile.in: Likewise. Also, add necessary make vars and 
	targets for 'snprintf' and 'timestuff'.
	* missing/snprintf: Delete directory and its contents.
	* missing/util: Delete directory and its contents.
	* missing: Delete directory and its contents.
	* doc/INSTALL-snprintf: New file. From 'missing/snprintf' directory.
	* doc/LICENSE-snprintf.txt: Likewise.
	* doc/README-snprintf: Likewise.

	Fix an autotest failure that came about as a result of fairly recent 
	changes to the packed boolean tables implementation.
	* autotest.c (test_packed_bool_tables): Assert correct dimension 
	size of packed boolean tables.

	Make Skelconq and Xcscribe link again.
	* skelconq.c (run_ui_idler): Provide dummy implementation of 
	'run_ui_idler', which is a required UI API function.
	  (make_generic_image_data): Make the function use an ImageFamily 
	pointer instead of a char pointer.
	* xcscribe.c (run_ui_idler): Provide dummy implementation of 
	'run_ui_idler', which is a required UI API function.

	Update RPM spec.
	* misc/xconq.spec: Delete the 'xtxaw' package. Remove X11 app 
	defaults directory from configuration. Disable Freetype2 and 
	ParaGUI tests in configuration stage. Handle new structure of 
	documentation files layout.

	Start to hook ParaGUI into the SDL interface code.
	* sdlconq.h: Include all of the ParaGUI headers. Ifdef out their 
	inclusion for now, until a compilation issue is resolved.

2004-11-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Hook ParaGUI into the Xconq configure/make process. Cleanup and fix 
	some small details in the configure template.
	* aclocal.m4 (AM_PATH_SDL): Look for 'sdl-config', check version, 
	and make sure that a SDL program would actually compile and link.
	Transplanted from 'sdl.m4' in the SDL distribution.
	  (AC_CHECK_FT2): Look for 'freetype-config', check version, and 
	make sure that a Freetype2 program would actually compile and link.
	Transplanted from 'freetype.m4' in the Freetype2 distribution.
	  (AM_PATH_PARAGUI): Look for 'paragui-config', check version, and 
	makre sure that a ParaGUI program would actually compile and link.
	Transplanted from 'paragui.m4' in the ParaGUI distribution.
	* configure.in (AC_CANONICAL_TARGET): New test. Place it before 
	'AC_ARG_PROGRAM'.
	  (AM_PATH_SDL): New test. Replace custom SDL tests.
	  (AC_CHECK_FT2): New test.
	  (AM_PATH_PARAGUI): New test.
	* sdl/Makefile.in (FT2_CFLAGS): New variable. Equate to 'FT2_CFLAGS' 
	macro expander.
	  (FT2_LIBS): New variable. Equate to 'FT2_LIBS' macro expander.
	  (PARAGUI_CFLAGS): New variable. Equate to 'PARAGUI_CFLAGS' macro 
	expander.
	  (PARAGUI_LIBS): New variable. Equate to 'PARAGUI_LIBS' macro 
	expander.
	  (ALL_COMMON_CFLAGS): Replace reference to 'SDL_CFLAGS' with 
	reference to 'PARAGUI_CFLAGS', since 'SDL_CFLAGS' is usually a 
	subset of that.
	  (ALL_COMMON_LIBS): Replace reference to 'SDL_LIBS' with 
	reference to 'PARAGUI_LIBS', since 'SDL_LIBS' is usually a subset of 
	that.

	Help MinGW32 properly configure/build with ParaGUI.
	* aclocal.m4 (AC_CHECK_FT2): Explicitly make sure that 
	'disable-freetypetest' works.
	  (AM_PATH_PARAGUI): Likewise, but for 'disable-paraguitest'.

	Clean out old SDL config stuff in configure template.
	* configure.in: Delete all explicit tests involving 'sdl-config'. 
	Do not set 'SDL_CFLAGS' and 'SDL_LIBS' directly; they are set 
	from 'aclocal.m4'.

2004-11-13  Eric McDonald  <mcdonald@phy.cmich.edu>

	Temporarily allow compilation without strict ANSI compliance. 
	This is a workaround for some C header conditional definition 
	issues. (NOTE: This is not intended to be a permanent fix. Strict 
	ANSI compliance will again be required (for GNU compilers) at the 
	earliest convenience.)
	* configure.in: Do not add "-ansi" to 'CFLAGS' for GNU compilers.

	Fix some C++ compilation issues under MinGW32.
	* help.c: Make sure that 'fcntl.h' is included in an extern C 
	wrapper.
	* win32.c (extract_dirname): New prototype to match defined function.
	* missing/timestuff.h: Get rid of hacks to ignore substitute 
	definitions under C++.

	Updates to Elijah's Opal game. Thanks Elijah.
	* opal-rules.g: Many updates.
	* opal.g: Small updates.
	* t-opal.g: Updates to map.
	* u-opal.g: Small updates.
	* opal-88x88.imf: References into new image set.
	* images/opal-88x88-1.gif: New image set.

	Update Windows packager script.
	* xconq.nsi: Update 'CVS_SNAPSHOT_DATE'. In the "Sources" section, 
	include 'sdl\*.cc' rather than 'sdl\*.c'.

	Update Xconq version file.
	* version.h: Change from October to November. (Question: Should we 
	use snapshot date instead? This could be set automatically using the 
	configure script against 'version.h.in'.)

	Add support for printing the contents of tables when using the 
	'print' form. (Note; There is some bad hackery needed to get 
	things such as 'imfapp', which depend on 'libconqlow.a' to link. 
	This is because tables are not all the way supported at the lower 
	levels of Xconq. This needs to be fixed.) (Feature request from 
	"ryuuguu".)
	* lisp.h (fprint_num_or_dice): New prototype.
	  (fprinttable): New prototype.
	* lisp.c: Include 'game.h' so that the definition of 'TABDICE' 
	can be used.
	  (fprint_num_or_dice): New function. Writes out a plain integer 
	or dice spec as appropriate.
	  (fprinttable): New function. Prints out the contents of a table.
	  (fprintlisp): Evaluate all bound symbols to their values.
	For unbound symbols, print out their names, as before, but also 
	check to see if they correspond to table names. If so, then print 
	out the contents of the tables.
	* tcltk/tkiapp.c (TableDefn): Define struct as part of linkage hack.
	  (tabledefns): Define global variable as part of linkage hack.
	  (numtypes_from_index_type): Define function as part of linkage hack.
	* x11/x2imf.c (TableDefn, tabledefns, numtypes_from_index_type): 
	Likewise.
	* x11/imf2x.c (TableDefn, tabledefns, numtypes_from_index_type):
	Likewise.

	Remove Bellum Aeternum from list of "finished" game in Tcl/Tk 
	interface.
	* lib/bellum.g (version): Comment out since version number is >0.

	Add support for redirecting some output intended for stdout to a 
	file on non-Unix platforms. (Thanks to "ryuuguu" for reporting this 
	problem.)
	* conq.h (xcq_fstdout): 'FILE *' for a 'stdout' alternative.
	* win32.c (xcq_fstdout): Initialize to NULL.
	* tcltk/tkmain.c (print_form): Conditionally compile so that 
	on non-Unix platforms, 'print_form_and_value' will be called with 
	'xcq_fstdout' instead of 'stdout'.
	* tcltk/tkwin32.c (WinMain): Initialize 'fstdout' to point to a 
	file named 'Xconq_Output.txt'.

2004-11-06  Eric McDonald  <mcdonald@phy.cmich.edu>

	Updates to Elijah's AWLS and Opal games.
	* lib/awls-rules.g: Change the 'mostly-land' variant to be almost 
	entirely land.
	* lib/opal.g: Small update.

	Force Xconq to compile under C++ exclusively. Sever the Xt/Xaw 
	interface from the configure/make system.
	* Makefile.in: Replace the 'CC' macro expander with the 'CXX' one, 
	and the 'CFLAGS' macro expander with the 'CXXFLAGS' one.
	  (all-xtconq): Remove target.
	  (install-xtconq): Remove target.
	* configure.in: Remove tests for C compiler and preprocessor. Remove 
	test for whether C compiler is C++ compiler in disguise. Remove all 
	things pertaining to configuration of C flags. Set language to C++ 
	for trial compilation and preprocessing. Replace references to the 
	'GCC' variable with references to the 'GXX' variable. Remove 
	vestigial piece of code. Get rid of build warnings flags that 
	cannot be used with C++. Get rid of the 'xtconq' build target and 
	'x11_app_defaults_dir' variable.
	* curses/Makefile.in: Replace the 'CC' macro expander with the 'CXX' 
	one, and the 'CFLAGS' macro expander with the 'CXXFLAGS' one.
	* sdl/Makefile.in: Likewise.
	* tcltk/Makefile.in: Likewise.

	Change extension of SDL source files from ".c" to ".cc" to indicate 
	that they are actually going to use C++-specific stuff.
	* sdlcmd, sdlimf, sdlinit, sdlmac, sdlmain, sdlmap, sdlscreen, 
	sdluact, sdlunix, sdlwin32

2004-10-31  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add more unit action buttons to the SDL interface.
	* sdlconq.h (add_delay_button): New prototype.
	  (add_skip_button): New prototype.
	  (add_sleep_button): Likewise.
	  (add_wake_button): Likewise.
	* sdlscreen.c (update_unit_info): Call 'add_delay_button', 
	'add_skip_button', 'add_sleep_button', and 'add_wake_button'.
	* sdluact.c (at_turn_start): Remove extern reference.
	  (net_set_unit_reserve): Add extern reference. (Temporary hack.)
	  (net_delay_unit): Likewise.
	  (delay_button_fn): New static function. Click handler for Delay 
	button.
	  (skip_button_fn): New static function. Click handler for Skip 
	button.
	  (wake_function_fn): New static function. Click handler for Wake 
	button.
	  (add_delay_button): New function. Adds Delay button if 
	appropriate.
	  (add_skip_button): New function. Adds Skip button if appropriate.
	  (add_sleep_button): Handle multiple selected units and not just 
	the current unit.
	  (add_wake_button): New function. Adds Wake button if appropriate.

2004-10-30  Eric McDonald  <mcdonald@phy.cmich.edu>

	Updates to Elijah's Starfleet Battles collection of games.
	* images/kob-wreck.gif: Update.
	* images/korea.gif: Update.
	* lib/battles.g: Update.
	* lib/conquest.g: Update.

	Updates to Elijah's Opal game.
	* images/tolk-terrain.gif: New terrain images.
	* images/tolk-terrain24x26.gif: Likewise.
	* images/tolk-terrain32x32.gif: Likewise.
	* lib/opal-rules.g: Base game is now playable. New units. Revised 
	advances system. Plus many other changes.
	* lib/opal.g: Update. Tolkien map-style variant.
	* lib/u-opal.g: Update.

2004-10-10  Eric McDonald  <mcdonald@phy.cmich.edu>

	Updates to Elijah's Starfleet Battles collection of games.
	* images/battles1.gif: Updated images. Now easier to see at lower 
	magnifications.
	* images/kob-wreck.gif: Likewise.
	* images/kobayashi.gif: Likewise.
	* battles.g: Add 'Oberth' class research vessels. Add Klingon Birds 
	of Prey. Add transport vessels. Add Outposts. Change Research 
	Stations to be weaker now that Outposts are available. Changes to 
	generic ship marker. Add Victory Points. Tweaks to various vessel 
	classes. Add Heavy Shields. Add Heavy Disruptors. Add Construction 
	Bays. Add Genesis Device. Limit decloaks/recloaks of cloakable 
	vessels. Use the new 'match-tansport-side' property to make sure 
	that item untis change side along with the transport.
	* u-battles-2.g: Changes.
	* wrath-khan.g: Changes.
	* conquest.g: New game.
	* game.dir: Add Conquest to games directory.

	Partially address a bug in occupant capture. (Thanks to Elijah for 
	mentioning the bug.)
	* utype.def (u_match_transport_side): New property, 
	"match-transport-side".
	* doc/refman.texi (match-transport-side): New entry.
	* combat.c (capture_occupant): Do not require a capture chance or 
	ACP if the occupant is marked to automatically acquiesce to the 
	capture of its transport. Mention that the capturing unit should be 
	charged ACP for each occupant captured, if the occupants do not 
	acquiesce.

	Fix bug in mistaken unit views code. (Thanks to Elijah for the bug 
	report.)
	* side.c (mistake_view): Not only change the unit view's type but 
	also reset its image name so that the correct one gets looked up 
	for display.

	Possibly fix bug where an unit which had changed type would remain 
	a self unit even though it could not be such anymore. (Reported 
	by Elijah.) (Fix needs to be verified.)
	* unit.c (resurrect_self_unit): New function. Unify and generalize 
	the resurrection code in one place, so that there are not near 
	duplicates in use in various places.
	  (change_unit_type): Consider the possibility that the new unit type 
	cannot be a self unit. Call 'resurrect_self_unit' in such case.
	  (change_unit_side): Remove custom self resurrection logic. Call 
	'resurrect_self_unit' instead.
	  (kill_self_unit): Comment out custom self resurrection logic. Call 
	'resurrect_self_unit' instead.

	Possibly fix bug where an unit would not keep those of its old 
	materials which it could keep after changing type. (Reported by 
	Lincoln Peters.) (Fix needs to be verified.)
	* unit.c (change_unit_type): Do not call 'init_supply'. Instead, 
	just iterate through the materials clipping them down to the new 
	type's capacity.

	Prep the SDL interface for the possibility of multiple selected units.
	* sdlconq.h (struct a_screen_type): Add 'selunits' Unit array pointer.

	Add the possibility of a "Sleep" button to the unit action buttons.
	* sdluact.c (sleep_button_fn): Action to take upon the sleep button 
	being clicked.
	  (add_sleep_button): Add sleep button to unit action buttons.

	Change title of the Standard game.
	* standard.g (title): "Default Game".

2004-10-02  Eric McDonald  <mcdonald@phy.cmich.edu>

	* .cvsignore: Exclude 'Makefile'.

	Update to Starfleet Battles from Elijah Meeks. (Thanks Elijah.)
	* images/scifit12x13.gif: New file. Nebula images.
	* images/scifit24x26.gif: New file. Nebula images.
	* images/scifit32x32.gif: New file. Nebula images.
	* images/scifit44x48.gif: New file. Nebula images.
	* images/kob-wreck.gif: New file. Wrecked hulk images.
	* lib/kob-wreck.imf: New file. References to wrecked hulk images.

	Fix bug in automatic upgrade code.
	* run2.c (run_auto_change_types): Handle the case where an unit is 
	an occupant of a transport rather than sitting directly in a cell.

	Set release version.
	* version.h: Set to "October".

	Attempt an improvement of the Advances game.
	* advances.g: Make 'joinery' a required advance for having 
	Elephants. Improve research goal hints for the AI accordingly.

2004-09-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Alter Windows packager script for new directory structure.
	* pkg/xconq.nsi: Was 'xconq.nsi' in top-level directory.
	Handle the various changelogs, doc files, and packager files in 
	their new locations.

	Add new testbed game module from Lincoln Peters.
	* lib/omniterr.g: Experiment using coatings to emulate certain kinds 
	of data.

	Update CVS ignore files.
	* .cvsignore: New file in top-level. Ignore autoconf cache, log 
	files, DLL files, and stdout/stderr redirect files.
	* lib/.cvsignore: Ignore Zip files.

	Improve automatic research of advances. More efficient cycle-
	checking of the advances graph. More efficient advance scoring.
	Implement designer-specified initial research goals.
	* doc/refman.texi (current-advance): New entry.
	  (advance-goal): New entry.
	  (advances): Delete entry. Replace with 'advances-done'.
	  (advances-done): New entry.
	  (ai-initial-research-goals): New entry.
	* gvar.def (ai-initial-research-goals): New global variable. A 
	weighted list of goals that a side's AI may choose if no other 
	research goals are specified (via 'ai-next-goal').
	* conq.h (choose_side_research_goal_from_weighted_list): New 
	prototype. Moved from 'kernel.h'.
	* kernel.h (choose_side_research_goal_from_weighted_list): Delete 
	prototype.
	* ai.c (ai_pick_side_research_goal): Choose a new research goal 
	from the 'ai-initial-research-goals' list, if it is not nil. Do 
	not check if an unit type is available before using it to score an 
	advance; this check consumes way too much CPU in its present form.
	Only remove intermediate advances from acyclic graphs; with cyclic 
	graphs, we are only looking one ahead and so this is pointless.
	  (advance_leads_to_goal): Get rid of iterative-recursive 
	computation. Always return false for cyclic graphs since they are 
	supposed to be handled via other means anyway; look up answer in 
	precomputed table for acyclic graphs, instead of recomputing it 
	everytime.
	  (ai_pick_side_research): If a research goal is already in place, 
	make sure that it did not get precluded by research; if so, then 
	reset it so that a new goal can be picked. If a graph is cyclic, 
	then only match the research goal when selecting a research topic.
	If a topic cannot be picked based on the given research goal, then 
	reset the research goal so that a new one can be picked later on.
	* init.c (init_advances_synopsis): Improved cycle detector. Also 
	creates a packed boolean table which indicates which advances are 
	related to one another (by any distance walk).
	  (check_game_validity): Do not error out if a cycle is found. 
	Simply provide a warning and continue. The rest of the research 
	goal code has been ruggedized to deal with the existence of cyclic 
	graphs.
	* run.c (run_side_research): Squash potential bug regarding symbol 
	expansion, and simplify the code at the same time.

	Showcase some of the new research goal implementation in Advances.
	Also, help balance the game further.
	* lib/advances.g: Use 'ai-initial-research-goals' and 
	'ai-next-goal'. Reduce the ACP per turn of Elephants from 4 to 3.

	Fix bug in the packed boolean tables implementation.
	* util.c (create_packed_boolean_table): If the longer dimension is 
	not evenly divisible by the size of the table's natural data cells, 
	then add 1 to it so that the remainder is not truncated.

	Improve Opal's performance slightly.
	* lib/opal-rules.g: Make sure that the indepside does not attempt 
	research.

2004-09-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve automatic research of advances. Check games with advances 
	for cycles in the advances graph during game validation. 
	Add concept of side research goals. Add research preclusion 
	mechanism. Add the possibility of AI research hints.
	* doc/refman.texi (ai-next-goal): New entry.
	  (advance-precludes-advance): New entry.
	* atype.def (ai-next-goal): New advance property.
	* keyword.def (advance-goal): New keyword, enumerated as 
	'K_ADVANCE_GOAL'.
	* table.def (advance-precludes-advance): New TableAA.
	* conq.h (G_advances_graph_has_cycles): New global variable.
	* kernel.h (set_side_research_topic): New prototype. Replaces 
	'set_side_research'.
	  (set_side_research): Delete prototype.
	  (set_side_research_goal): New prototype.
	  (choose_side_research_goal_from_weighted_list): New prototype.
	* kpublic.h (net_set_side_research): Delete prototype.
	  (net_set_side_research_topic): New prototype. Replaces 
	'net_set_side_research'.
	  (net_set_side_research_goal): New prototype.
	* side.h (research_goal): New field of 'Side' struct. The research 
	goal that the side is currently pursuing.
	  (research_precluded): New field of 'Side' struct. The advances 
	which can no longer be researched by the side.
	* ai.c (ai_integrate_advance_worth): New function. Determine the 
	worth of an advance based on its own worth and that of all the 
	advances leading up to it.
	  (ai_pick_side_research_goal): New function. Try to choose a 
	suitable research goal for a side to pursue.
	  (advance_leads_to_goal): New function. Test to see if an advance 
	leads to a stated research goal.
	  (set_ai_research_worth): Delete function; no longer used.
	* cmd.c (do_research): Call 'net_set_side_research_topic' instead of 
	'net_set_side_research'.
	* init.c (advance_is_part_of_advance_cycle): New game validation 
	test which checks for cycles in the advances graph, if there is one.
	* read.c (fill_in_side): New case, 'K_ADVANCE_GOAL'.
	* run.c (run_side_research): Handle research goal updates when 
	relevant.
	  (update_side_research_goal_availability): New function. Update 
	vector of side research goals that are still available.
	* side.c (create_side): Init new side fields: 'research_precluded' 
	and 'research_goal'.
	  (set_side_research): Delete function.
	  (set_side_research_topic): New function. Replaces 
	'set_side_research'.
	  (set_side_research_goal): New function.
	  (choose_side_research_goal_from_weighted_list): New function. 
	Pick out a new side research goal from a weighted list, such as the 
	'ai-next-goal' property. Already researched advances are ignored.
	* tp.c (net_set_side_research): Delete function.
	  (net_set_side_research_topic): New function. Replaces 
	'net_set_side_research'.
	  (net_set_side_research_goal): New function.
	* write.c (write_side_properties): Handle the write-out of the 
	side research goal.

	Add game menu images for interfaces that support game selection 
	menus. (Thanks to Elijah Meeks.)
	* 3rd-age.gif, advances.gif, anc-near-east.gif, awls-rules.gif, 
	beruit.gif, bellum.gif, cherbourg.gif, civ2,gif, classic.gif, 
	cobra.gif, coral-sea-th.gif, coral-sea.gif, crater-lake.gif, 
	dukla.gif, empire.gif, flattop.gif, future,gif, galaxy.gif, 
	galaxy2.gif, gazala.gif, gettysburg.gif, greek.gif, insects,gif, 
	intro.gif, korea-2006.gif, lhs.gif, log.gif, lord-rings.gif, 
	magnuszew.gif, mars.gif, metz-1994.gif, midway.gif, monster.gif, 
	mormon.gif, napoleon.gif, normandy.gif, opal-rules.gif, opal.gif, 
	overlord.gif, panzer.gif, pearl.gif, pelops.gif, pg.gif, 
	rom-civ-war.gif, roman.gif, russian-rev.gif, standard.gif, 
	steppes.gif, tailhook.gif, time.gif, tokyo.gif, wizard.gif, 
	ww2-38.gif, ww2-39.gif, ww2-42.gif, ww2-adv.gif, ww2-bn.gif, 
	ww2-div-eur.gif, ww2-div-pac.gif, ww2-pac-41.gif, ww2s-eur.gif, 
	ww2s-pac.gif

	Improved images for the Galaxy and Galaxy II games. (Thanks to 
	Elijah Meeks).
	* images/kobayashi.gif: New images set.
	* lib/kobayashi.imf: Reference images in 'kobayashi.gif'.
	* lib/galaxy.g: Use new images from 'kobayashi.gif'.
	* lib/galaxy2.g: Use new images from 'kobayashi.gif'.

	Experiemental new game: Star Fleet Battles. A Star Trek-style battles 
	game from Elijah Meeks. (Thanks Elijah.)
	* images/battle-test.gif: Menu image for Star Fleet Battles test game.
	* images/battles.gif: Menu image for Star Fleet Battles base game.
	* images/battles1.gif: Item unit images for Star Fleet Battles games.
	* images/wrath-khan.gif: Menu image for Wrath of Khan scenario.
	* lib/battles.g: Base game module.
	* lib/t-battles.g: Terrain for Star Fleet Battles.
	* lib/u-battles.g: Units for Star Fleet Battles.
	* lib/u-battles-2.g: More units for Star Fleet Battles. 
	* lib/battle-test.g: Tester for base game.
	* lib/kob-maru.g: Kobayashi Maru scenario.
	* lib/u-kmaru.g: Units for Kobayashi Maru.
	* lib/u-kmaru2.g: More units for Kobayashi Maru.
	* lib/wrath-khan.g: Wrath of Khan scenario.
	* lib/t-khan.g: Terrain for Wrath of Khan.
	* lib/u-khan.g: Units for Wrath of Khan.
	* lib/u-khan-2.g: More units for Wrath of Khan.

	Map of Antarctica from Matthew Skala. (Thanks Matthew.)
	* lib/antar-map-50km.g: Map of Antarctica, 50 km per hex.
	* lib/antar-stdgame.g: Standard game superimposed on Antarctica.
	* lib/antar-stdterr.g: Merge of standard terrain with Antarctic map.

2004-09-12  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve AI and automatic planning wrt research topics.
	* conq.h (ai_pick_side_research): New prototype.
	* game.h (tmp_m_array): New global.
	  (tmp_a_array): New global.
	  (disallow_more_material_types): New prototype.
	  (disallow_more_advance_types): New prototype.
	* ai.c (set_ai_research_worth): New function. Produces a reasonable 
	estimate on the worth of an advance.
	  (ai_pick_side_research): New function. Randomly chooses the next 
	advance to study; preference is given to advances with higher 
	worth.
	* generic.c (tmp_m_array): New global. Scratch space for materials.
	  (tmp_a_array): New global. Scratch space for advances.
	  (allocate_table): Call 'disallow_more_material_types' and 
	'disallow_more_advance_types' where appropriate.
	  (disallow_more_material_types): New function. Allocate the scratch 
	space for materials and flag that no more material types can be 
	defined.
	  (disallow_more_advance_types): Likewise, but for advances.
	* init.c (disallow_more_types): Call 'disallow_more_material_types' 
	and 'disallow_more_advance_types' rather than simply setting their 
	respective disallowment flags.
	* run.c (auto_pick_side_research): Call 'ai_pick_side_research' 
	rather than doing a totally random pick.
	* unit.c (type_ever_available): Test if an unit type can become 
	available to a side as a result of researching an advance.

	Allow development of technology to take place independently of 
	unit construction.
	* tp.c (net_set_develop_task): New function. Set the develop task 
	explicitly and broadcast it.

	Check if an unit can change into a specific unit type.
	* unit.c (can_change_type_to): New function. Checks to see if the 
	'change-type' action would be valid with the given unit.

	Many improvements to the SDL interface.
	* Makefile.in (OBJS): Add 'sdluact.o' to list.
	* sdlconq.h (BOTTOM_PANEL_X_MARGIN): New constant macro.
	  (BOTTOM_PANEL_Y_MARGIN): Likewise.
	  (MINIMAP_WIDTH_DEFAULT): Likewise.
	  (MINIMAP_BORDER_SIZE): Likewise.
	  (UNIT_ACTION_PANEL_BORDER_SIZE): Likewise.
	  (SIDE_RESEARCH_PANEL_BORDER_SIZE): Likewise.
	  (struct a_screen): New fields: 'mouseover_panel_locked', 
	'unit_action_panel_visible', and 'side_research_panel_visible'.
	  (struct a_protobutton): New struct. Moved from 'sdlscreen.c'.
	  (G_uact_button_offset): New global.
	  (G_protobuttons): Likewise.
	  (G_num_protobuttons): Likewise.
	  (maybe_ask_construction_location): New prototype.
	  (reset_screen_input): Likewise.
	  (reset_panel_buttons): Likewise.
	  (draw_panel): Likewise.
	  (update_unit_info): Likewise.
	  (add_research_buttons): Likewise.
	  (add_construct_buttons): Likewise.
	  (add_develop_buttons): Likewise.
	  (add_change_type_buttons): Likewise.
	* sdlcmd.c (do_build): Call 'maybe_ask_construction_location' for 
	the case where only one unit type can be built, instead of executing 
	custom logic.
	  (maybe_ask_construction_location): Handle prompting automatic 
	construction or prompting for a construction location.
	* sdlmain.c (update_unit_info); Delete prototype. Move to 'sdlconq.h'.
	  (side_research_fn): New static function.
	  (set_current_unit): If a modal panel is not up, make sure that the 
	unit action panel is visible, and reset the index of its buttons to 
	zero.
	  (ui_mainloop): Take a small break after processing events.
	  (handle_event): On 'VIDEORESIZE', limit the resize to minimum 
	dimensions to prevent odd problems, and questions about how to best 
	present the UI.
	  (interp_key): Reset screen input if the modal handler was 
	cancelled. If the escape key was pressed, then make sure that a 
	redraw of relevant panels is done (because state may be affected by 
	pending screen input). Reset the prefix arg if the unit action panel 
	is visible and no modal handler is in effect.
	  (handle_mouse_down): Set the 'inpx' and 'inpy' fields of the 
	screen when mouse outside of panel. This fixes a bug whereby 
	construction sites could not be chosen, etc....
	  (screen_oneliner): Unlock the mouseover panel if no modal handler 
	is in effect. Immediately return if the panel is locked and a modal 
	handler is in effect.
	  (update_side_display): Set window title with information on 
	the game title, side name, and turn number, since we do not yet have 
	a good side or turn display. Also set the taskbar (iconified) title 
	with the game title.
	  (previous_srsch_button_fn): Display previous set of side research 
	buttons.
	  (next_srsch_button_fn): Display next set of side research buttons.
	  (side_research_button_fn): Research the chosen the topic.
	  (side_auto_research_button_fn): Automatically pick a good research 
	topic.
	  (G_srsch_button_offset): New variable.
	  (add_side_research_buttons): New function. Prepare side research 
	buttons for display.
	  (update_research_display): Display side research buttons if any 
	to display.
	  (ask_position, ask_bool, ask_string, ask_side): Use the mouseover 
	panel for prompting rather than stdout.
	  (unit_research_dialog): Provide empty implementation for this 
	currently unused function.
	* sdlscreen.c (calculate_minimap_view_power): New function.
	  (calculate_minimap_width): New function.
	  (calculate_minimap_height): Likewise.
	  (calculate_minimap_sx): Likewise.
	  (calculate_minimap_sy): Likewise.
	  (calculate_unit_action_panel_width): Likewise.
	  (calculate_unit_action_panel_height): Likewise.
	  (hide_unit_action_panel_fn): Likewise.
	  (prev_uact_button_fn): Likewise.
	  (next_uact_button_fn): Likewise.
	  (reset_screen_input): Likewise.
	  (open_screen): Set the initial state for the visibility and locking 
	of the screen panels.
	  (create_panel): Simplify to use calls to 'reset_panel_buttons', 
	'calculate_minimap_width', and 'calculate_minimap_height'.
	  (set_panel_position): Call 'reset_panel_buttons' after the panel 
	position has been modified.
	  (redraw_screen): Make sure that anything associated with unit info 
	gets redrawn.
	  (draw_bottom_panel): Draw the bottom panel in a mode-appropriate 
	manner.
	  (draw_side_research_info): Fill out the bottom panel buttons with 
	side research topics.
	  (struct a_protobutton): Delete. Move to 'sdlconq.h'.
	  (protobuttons): Delete. Replace with 'G_protobuttons'.
	  (num_protobuttons): Delete. Replace with 'G_num_protobuttons'.
	  (update_unit_info): Rewrite to use calls to the unit action 
	button adding functions in 'sdluact.c'.
	  (draw_string): Handle newlines and horizontal tabs. (Now I know 
	what it feels like to be a typewriter or a terminal.)

2004-08-29  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve UI responsiveness during periods of AI activity.
	* conq.h (run_ui_idler): New function. Mandatory implementation in 
	each UI.
	* curses/cconq.c (run_ui_idler): New function. Call 
	'maybe_handle_input'.
	* ai.c (ai_go_after_victim): Call 'run_ui_idler' after doing a 
	victim search.
	* plan.c (execute_plan): Call 'run_ui_idler' after a plan execution.
	* run2.c (run_turn_start): Call 'run_ui_idler' at various intervals.
	* sdl/sdlmain.c (run_ui_idler): New function. Call 'handle_event' 
	and 'ui_idle' if an event is queued.
	* tcltk/tkmain.c (run_ui_idler): New function. Call 
	'Tcl_DoOneEvent' with the 'TCL_WINDOW_EVENTS' flag to handle any 
	window-related events.

	Improve scheduler efficiency and fix delay command bug. (Thanks to 
	Jim Kingdon for reporting the bug.) (TODO: Eliminate buzzing from 
	ACP-indep construction.)
	* run.c (side_move_some_units): Count number of units that could 
	possibly act (including delayed units), but did not. Compare 
	count of possible actors to count of delayed units; only if the 
	difference is 0 should the delayed units be rescheduled. 
	Shortcircuit any units which have exhausted their ACP from  
	the scheduler loop.

	Fix bug in combat experience calculation. (Thanks to Elijah Meeks 
	for discovering the bug.)
	* combat.c (maybe_hit_unit): New variable 'retrchance' to calculate 
	the retreat chance rather than overriding 'chance', the hit chance. 
	Awarding of combat experience depends on 'chance' being hit chance.

	Distinguish between the ability to build, and the need to develop 
	before building.
	* unit.h (can_build_type): New prototype.
	  (can_develop_or_build_type): New prototype.
	* unit.c (can_build_type): Only check to see if an unit can build 
	a given type. Do not check to see if development would be possible.
	  (can_develop_or_build_type): Rename 'unit_can_build' to this.
	  (unit_can_build_type): Legacy function. Calls 
	'can_develop_or_build_type'.

	Many fixes and improvements to the SDL interface.
	* sdlcmd.c (do_save): Lie about having saved the game for now. This 
	allows a player to quit without the humiliation of resigning or the 
	hassle of "kill-minus-nining" the process.
	  (do_zoom_in, do_zoom_out): Hack in some half-working 
	recentering logic. (Note: There is likely a better way to 
	accomplish this; I am still familiarizing myself with all the various 
	x, y, w, and h vars out there.) (Zoom bug reported by Lincoln 
	Peters.)
	* sdlconq.h (struct a_panel): Add 'redraw_pending' variable from 
	a semi-successful screen update experiment that I tried earlier. This 
	variable may be useful later on.
	* sdlmain.c (initial_ui_init): Set the window and iconified captions.
	(TODO: Add game title, side name, and turn number to title bar.)
	  (handle_event): Do updates based on cursor position rather than 
	cursor position shifted by cursor hot spot position. Handle 'SDL_QUIT' 
	by calling 'do_quit' so that clicking on the close box does the 
	right thing.
	  (ask_bool): Prompt with the chars 'y' and 'n' rather than the 
	integers '1' and '0'.
	* sdlscreen.c (open_screen): Initialize screen to be in move mode 
	rather than survey mode, and turn on autoselection of next units by 
	default. (Thanks to Lincoln Peters for pointing out the clumsiness of 
	the old behavior.)
	  (create_panel): Instead of putting two rows of buttons in the 
	bottom panel, put one longer row along the very bottom of the 
	bottom panel. This obscures less text and generally looks nicer.
	(TODO: Create a subpanel for the buttons, which can be interchanged 
	with a notices subpanel, or that can be torn off and placed 
	independently along one of the other edges of the screen.)
	  (update_screen): Blit the cursor directly to the display buffer 
	after all the update rectangles have been processed.
	  (draw_panel): Do not choose a random color as a "dye marker" for 
	screen updates. At this point, we can fairly well trust that the 
	updates are firing when they should. Choosing the random color 
	causes a "multi-colored cursor wake" to appear where the cursor 
	crosses a boundary. This occurs because an update rect intersects 
	the panel, which causes 'draw_panel' to be called on the compose 
	buffer (and a new random color is picked at that time); however, 
	only the update rect is blitted from the compose buffer to the 
	display buffer, and not the rect of the entire affected panel. 
	Hence the problem.
	  (update_unit_info): Declare new variable 'unit' and use it as an 
	alias for 'screen->curunit'. Label buttons according to whether an 
	unit can be built, needs to be developed before being built, or 
	can change type, in that order. Fix improper listing of develop 
	buttons. (Bug reported by Lincoln).
	  (draw_world_map): For the same reasons as with 'draw_panel', 
	disable the selection of random colors for the border of the 
	minimap.
	  (draw_button): For the same reasons as with 'draw_panel', disable 
	the selection of random colors for the border of a button.

	Fix crashing bug in Tcl/Tk help system when dealing with a list of 
	possible images for an unit type. (Thanks to Elijah for diagnosing 
	the problem.)
	* tkmain.c (tk_u_image_name): Handle lists of image names and not 
	just individual strings.

2004-08-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Reduce buzzing when formations are in use. Also, improve previous 
	fix.
	* run.c (side_move_some_units): Be more selective about what plans 
	get executed by making sure that there is either a pending action 
	or a task list. Only set the 'waitingfortask' flag on plans with 
	formations if their are actually tasks present.

	Fix display bug that appeared in 'change-type' sometime in the past 
	few months, probably as a result of hacking the image loading or 
	unit views.
	* unit.c (change_unit_type): Upon changing type, set the unit's 
	image name to an empty string (to force loading of a new image), 
	and then call 'set_unit_image'. (A call to 'update_side_display' 
	used to do the right thing, but apparently not anymore.)

2004-08-21  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix scheduling bug caused by the use of formations. Also, 
	slightly streamline the formations code.
	* kernel.h (is_in_formation): New prototype.
	* plan.c (is_in_formation): New function. Is the given unit 
	presently in a formation and at the correct distance with respect 
	to the formation leader?
	* run.c (side_move_some_units): Count number of units in formation. 
	Only move an unit that is attempting to maintain formation if that 
	unit is out of formation. Do not claim that an unit has been found 
	to move, when that unit has not been moved; making the claim causes 
	problems when formation movement is in effect. Ensure that the 
	'waitingfortasks' flag is set on any formation units so that the 
	"auto next unit" UI code will be sure to pick them up and let the 
	player move them if they have leftover ACP after moving in formation.

	Fix crash from attempting to update a display before the display is 
	ready or its side has been set.
	* tkmain.c (update_unit_display): If 'dside' is NULL, then 
	immediately return.

2004-08-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update to Wreckreation unit images.
	* lib/wreckreation.imf: Reference new images.
	* images/wreckr_88x88.gif, images/wreckr_44x44.gif: New images of 
	Goblins and Hobbits.

2004-08-16 Hans Ronne <hronne@comhem.se>

	Make it possible to specify in the game files whether or not terrain
	transitions should be drawn. The purpose of this is to override user 
	preferences in cases where drawing terrain transitions is known to 
	produce an inferior result. Note: the override only applies on map 
	creation. It is still possible to toggle the setting for an existing map.
	* gvar.def (g_terrain_transitions): New gvar. Initialize to -1.
	* macmap.c (create_map): Use g_terrain_transitions to set 
	map->draw_transitions if it differs from -1.
	* tkmap.c (mapw_configure): Use the g_terrain_transitions to set 
	mapw->draw_transitions if it differs from -1 and the map widget is 
	being created (flags != TK_CONFIG_ARGV_ONLY). 
	
	Fix g_meridians and g_feature_boundaries so that they work again in
	the tcltk interface (this code apparently broke with the changes in the
	map view option setting code that were checked in on 2004-05-10).
	* tkmap.c (mapw_configure): Rewrite meridian and feature boundaries
	config code so that set map_options is passed to eval_tcl_cmd instead of 
	set default_map_options. Remove redundant config of draw_meridians 
	that served no purpose even in the old code.

	Fix occasional glitches with the Mac interface animated cursors.
	* macinit.c (announce_read_progress): Call HideCursor and 
	ShowCursor before and after calling SetCursor.
	(announce_progress): Call HideCursor and ShowCursor before 
	and after calling SetCursor.

2004-08-15  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix Windows icon file for IMFApp. Plus add 24-bit color versions 
	of icons to all Windows Xconq icon files for Windows < XP.
	* tcltk/Imfapp.ico: Fix icons and add 24-bit color versions of them.
	* tcltk/Xconq.ico: Add 24-bit color versions of icons.
	* tcltk/Xcdoc.ico: Likewise.
	* sdl/Xconq.ico: Likewise.
	* sdl/Xcdoc.ico: Likewise.
	* curses/Xconq.ico: Likewise.
	* curses/Xcdoc.ico: Likewise.

2004-08-15  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update to Wreckreation unit images.
	* lib/wreckreation.imf: Reference 88x88 and 44x44 images instead 
	of 64x64 and 32x32 images.
	* images/wreckreation.gif: Delete. (Some folks had copyright 
	concerns about one of the images contained in it. I think my 
	legal argumentation was quite strong, but nevertheless....)
	* images/wreckr_64x64.gif: Delete. Larger icons are now used.
	* images/wreckr_32x32.gif: Likewise.
	* images/wreckr_88x88.gif: New. Larger icons (and more of them).
	* images/wreckr_44x44.gif: Likewise.

2004-08-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix Windows icon files so that they can be used properly by 
	resource compilers.
	* tcltk/Xconq.ico: Fill out the icon struct properly.
	* tcltk/Xcdoc.ico: Likewise.
	* sdl/Xconq.ico: Likewise.
	* sdl/Xcdoc.ico: Likewise.
	* curses/Xconq.ico: Likewise.
	* curses/Xcdoc.ico: Likewise.

2004-08-12 Hans Ronne <hronne@comhem.se>

	Fix click-in-unseen exploit and re-enable border slides.
	* ui.c (impl_move_to): Comment out pre-flight command
	check through call to choose_move_direction.
	
	Fix a related problem in setting far-away build tasks.
	* unit.c (unit_can_build_type_at): Comment out pre-flight 
	command check through call to choose_move_direction.
	
	Fix apparent inconsistency in how collect tasks are treated and
	also make it possible to collect from the same cell.
	* ui.c (advance_into_cell): Check can_extract_at before instead
	of after calling check_move_action also if the destination is in an 
	adjacent cells. Furthermore, check can_load_at as well. Add code
	at the end that sets a collect task if this is possible also when we 
	click in the same cell.
	
	Enable generic command feedback in the Mac interface. Also make
	command processing in the tcltk and Mac interface more similar
	to facilitate future interface consolidation.
	* maccmd.c (do_one_dir_move): Rewrite to resemble the code
	in move_the_selected_unit.
	* macmouse.c (move_the_selected_unit): Check rslt and call
	advance_failure_desc if false (copied from the same function
	in the tcltk interface). Add check that the unit has a plan and
	an actorstate from the tcltk function.
	(do_mouse_down_map_content): Beep and return if the call
	to m_nearest_cell returns false (like handle_mouse_down in
	the tcltk interface).
	* tkcmd.c (aux_move_dir): Rewrite to resemble the code in
	move_the_selected_unit.
	* tkmap.c (move_the_selected_unit): Add command feedback 
	if we click outside the map (copied from the same function in 
	the Mac interface). Add check that the unit is mobile from the 
	Mac function.
	
2004-08-08  Eric McDonald  <mcdonald@phy.cmich.edu>

	Changes to the Wreckreation image collection.
	* lib/wreckreation.imf: Delete references to 'wreckr-piper' and 
	'wreckr-braveheart'. New references to 'wreckr-piper-1', 
	'wreckr-caedmon-1', 'wreckr64-piper-1', and 'wreckr64-caedmon-1'. 
	No longer refer to anything in 'wreckreation.gif', which will be 
	used for the banner/splash screen for the Wreckreation game at a 
	later point.
	* images/wreckr_32x32.gif: New file. Images scaled directly to 32x32.
	* images/wreckr_64x64.gif: New file. Images scaled directly to 64x64. 
	(These ones are fairly nice looking, actually....)

2004-08-07  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improvements to and new image in Wreckreation image collection.
	* lib/wreckration.imf: Add 'wreckr-piper' after 'wreckr-braveheart'.
	* images/wreckreation.gif: Add image of an Argyll Piper. Improve 
	coloring of Braveheart to minimize lighting effects on his clothing 
	and edge of his shield.

2004-08-07  Eric McDonald  <mcdonald@phy.cmich.edu>

	New IMF collection and GIF image set.
	* lib/wreckreation.imf: New file. (Currently references only one 
	image, but more are on the way.)
	* images/wreckreation.gif: New file. (Currently contains only one 
	image, but more are on the way.)

2004-08-07 Hans Ronne <hronne@comhem.se>

	Fix so that sound play works under Mac OS X/Carbon.
	* macconq.c (QuickTimeComponents.h): Include it ifdef
	TARGET_API_MAC_CARBON.
	(init_toolbox): Call EnterMovies to init QuickTime ifdef
	TARGET_API_MAC_CARBON.
	(play_sound): Add TARGET_API_MAC_CARBON code that
	uses QuickTime instead of the Sound Manager.

2004-08-06 Hans Ronne <hronne@comhem.se>

	Fix so that the indepside is shown in the side list if it has a
	human player or an AI.
	* tkconq.tcl (indepside_player): New global, set to "".
	(create_map_window): Add code that checks if indepside is
	ingame and has a human or AI player. Set indepside_player
	to its name in that case, and increase game_win_height by 
	game_entry_height.
	(fill_in_side_list): Set firstside to 0 if indepside_player
	exists. Start with firstside instead of 1 in the side loop.

	Fix so that the indepside is revealed from start in the 
	player setup list if it has a human or ai player.
	* tkconq.tcl (indepside_ai): Remove unused global.
	(add_player_dialog_items): Don't declare indepside_ai.
	(set_indepside): Don't declare indepside_ai. Add code that 
	checks if indepside is ingame and has a human or AI player. 
	Set indepside_player and indepside_up in that case.

2004-08-06 Hans Ronne <hronne@comhem.se>

	Fix so that the indepside player (if it exists) is saved and
	restored correctly (thanks to Henry Cobb for reporting
	this bug).
	* init.c (patch_object_references): Also look up player
	if side->playerid is 0.
	(make_trial_assignments): Rewrite the indepside code
	so that any read-in assignment is respected.
	* read.c (interp_player): Call fill_in_player also if
	player->id is 0.
	* side.c (create_side): Set newside->playerid to -1.
	* write.c (write_side_properties): Use -1 instead of 0 
	as default in case K_PLAYER if side->player is NULL.

	Handle the (unlikely) case that indepside controls another
	side correctly.
	* init.c (patch_object_references): Also look up controlling
	side if side->controlled_by_id is 0. 
	* side.c (create_side): Set newside->controlled_by_id to -1.
	* write.c (write_side_properties): Use -1 instead of 0 as
	default in case K_CONTROLLED_BY if side->controlled_by
	 is NULL.

2004-08-06 Hans Ronne <hronne@comhem.se>

	Remove the ugly white borders from the tcltk canvases. Note:
	for some bizarre reason, the border width of tcltk canvases is
	not controlled by -borderwidth, which would be logical, but by 
	-highlightthickness, which has nothing to do with highlighting.
	* imfapp.tcl (.closeup.content): Set -highlightthickness 0.
	(.images.canvas.content): Set -highlightthickness 0.

	Add a left margin between the window and the selection box.
	* imfapp.tcl (.images.canvas.content): Put window at 6 0.

	Fix bug that prevents drawing of black and white images in 
	the Mac closeup, which sneaked in during final debugging of
	the code on Linux.
	* tkisamp.c (draw_one_image): Use the XFillRectangle code
	both on Unix and for offscreen drawing on the Mac. Only use 
	the XCopyArea code when drawing directly to the screen on 
	the Mac.

	Colorize the imfapp tcltk interface similar to Xconq.
	* imfapp.tcl (hbcolor): Set to LemonChiffon.
	(abcolor): Set to LemonChiffon.
	(tcolor): Set to LemonChiffon2.
	(scolor): Set to MediumBlue.
	(afcolor): Set to black.
	(:menubar): Set -bg LemonChiffon and other colors from
	the globals.
	(.): Configure -bg LemonChiffon.
	(.menubar.file): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	(.menubar.view): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	(.menubar.view.fg): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	(.menubar.view.bg): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	(.menubar.view.cu): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	(.closeup):  Set -bg LemonChiffon
	(.closeup.content):  Set -bg LemonChiffon
	(.images.scroll): Set -bg LemonChiffon -fg black and other 
	colors from the globals.
	
	Make the closeup top frame sunken to offset it against the 
	images canvas.
	* imfapp.tcl (.closeup): Set -borderwidth 2 -relief sunken.
	
	Tweak the image name font family and size so that it looks 
	good on all three platforms.
	* tkisamp.c (imfsample_display): Pass -family arial -size 8 
	to Tk_GetFont ifdef WIN32, -family helvetica -size 11 ifdef 
	MAC and else -family helvetica -size 12.

	Tweak positions of the closeups.
	* imfapp.tcl (y): Set it to 28.
	
	Remove background color of images top frame.
	* imfapp.tcl (.images): Don't set -bg magenta.

	Improvements to the Time game from Henry J. Cobb.
	* time.g (world-size): Increase to 90 x 60.
	(country-separation-min): Increase to 30.
	(country-separation-max): Increase to 100.
	(cp): Reduce to 6 for infantry.
	(acp-to-create etc): Allow metropolis to build cavalry 
	and post-modern city to build infantry.
	(ammo): Reduce to 3 for blimp.
	(size-as-occupant): Reduce to 4 for helicopter.
	(occupant-max): Don't limit transports to 8 helicopters.
	(hit-chance): Increase infantry hit-chance against bombers
	and helicopters to 20%. Don't allow cavalry to hit battleships,
	transports, carriers, bombers and flying saucers. Reduce its
	hit-chance against fighters, armor and bombers to 1%, 2% 
	and 1% respectively.
	(consumption-per-attack): Make blimps use ammo.

	Make the Xconq AI menu and design menu items initialize 
	correctly and also behave correctly when AI and designer 
	mode are toggled from the command line instead of from
	the menu.
	* tkconq.tcl (dside_ai): New global, set to "none".
	(create_map_menus): Declare globals designer and 
	dside_ai. Use dside_ai as vbariable in the AI menu.
	(update_game_side_info): Add code that updates dside_ai.
	(dismiss_design_palette): Set designer 0.

	Make menu item checkmarks work again in the Xconq tcltk
	version for Windows (the problem here is that Windows is 
	inconsistent in how it uses the select color for checkboxes
	and menu items, so they have to be treated separately).
	* tkconq.tcl (micolor): New global, set to MediumBlue.
	(create_map_menus): Declare micolor and use it 
	everywhere instead of scolor.
	(add_show_all_item): Declare micolor and use it 
	instead of scolor.

2004-08-04 Hans Ronne <hronne@comhem.se>

	Fix so that the imfapp window size is scaled to the screen.
	* imfapp.tcl (geomspec): Calculate and use it in the wm 
	geometry call.

	Remove unused and non-functional imfapp menu items.
	* imfapp.tcl (.menubar.file): Comment out the "Add Other 
	File" menu command.
	(.menubar.view): Comment out the "BBox", "Solid Color", 
	"As Unit", "As Terrain", "As Emblem" and "With Unit" menu 
	commands.

	Fix the "Save Selected Only" menu option so that it works.
	Also propose the name of the selected image + imf as initial
	file name in that case.
	* tkiapp.c (tk_save_imf_file): Save the imf whose number
	is passed in argv[2], or all images if numimages is passed.
	* imfapp.tcl (save_selected_only): New global, set to 0.
	(save_imf_file_cmd): Rewrite so that it saves only the
	selected image if save_selected_only is set. Pass the image
	number as second arg to save_imf_file in that case, else
	pass numimages. Add code that gets the selected image name
	and uses it to init filename. Use images.imf if as default
	filename.

	Rename the old foreground color to closeup color since that
	is what it is used for. Add a foreground color for using with
	the text labels and the selection box.
	* imfapp.tcl (fgcolor): Set to black instead.
	(cucolor): New global, set to green.
	(.menubar.view.cu): New tearoff menu with items.
	(.menubar.view): Add cascade menubar.view.cu.
	(add_closeup): Set the imfsamples to -bg cucolor.
	(.images.canvas.content): Set -closeup to cucolor.
	(set_fg_color): Don't set the closeup foreground here.
	(set_cu_color): New tcl procedure.
	* tkiasmp.c (Imfsample): Add new Tk_3DBorder cu_border.
	(config_specs): Add TK_CONFIG_BORDER entry for closeup.
	Remove duplicate entries for foreground and background.
	(imfsample_cmd): Initialize cu_border to NULL.
	(imfsample_configure): Call Tk_SetWindowBackground
	for cu_border.
	(imfsample_display): Use fg_border to draw the text and
	the selction box. Use cu_border to draw the grid boxes.
	
	Fix color mismatch between the canvas and its content.
	* imfapp.tcl (set_bg_color): Also set the canvas color.

2004-08-04 Hans Ronne <hronne@comhem.se>

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

	Improve the performance of IMFApp on all platforms. Don't
	try to create and maintain an offscreen pixmap the size of a
	football field. Use direct drawing instead. Fix and enable the
	never-working yview scrolling command for the imfsample
	widget, so that it is no longer necessary to redraw the entire
	imfsample each time it is updated. Fix various glitches which 
	become visible during direct drawing. Improve the positioning 
	of text and images. Make it possible to toggle image selections 
	on and off by clicking on the image. Also deselect the selected 
	image when clicking in an empty region. Add a redraw command
	that forces a redraw of the imfsample widget and bind it to 
	Configure and Expose events for the top window to ensure
	that the canvas always is updated correctly on all platforms.
	Fix the "Selected as Terrain" and "Selected as Emblem" menu
	options so that they work as intended. Fix numerous other
	interface problems and bugs.
		
	Turn off double buffering of the tcltk IMFApp images canvas.
	* imfapp.tcl (imfsample .images.canvas.content): Set -dbl 0.

	Fix the scrolling command for the imfsample widget so that 
	it works as originally intended.
	* tkisamp.c (imfsample_widget_cmd): Compute fraction and
	fraction2 correctly for the yview command. Also compute nrow
	in case TK_SCROLL_MOVETO. Delete printf and sprintf output
	for debugging purposes. Call Tcl_Eval with .images.scroll set 
	fraction fraction2 to update the scrollbar (this must be done
	here instead of in the tcl code since the imfsample widget does 
	not have a built-in yscrollcommand). Delete special case for
	argc == 2 that made it possible to continue scrolling past the 
	end of the scrollbar on the Mac.
	
	Use the new imfsample yview command to scroll the images
	canvas content in imfapp.
	* imfapp.tcl (.images.scroll): Set -command to scroll the 
	images canvas imfsample content instead of the canvas itself.
	(.images.canvas): Remove unused yscrollcommand.

	Speed up the response to mouse button clicks on images.
	(.images.canvas.content): Bind { select_imf %x %y } to
	ButtonPress-1 instead of ButtonRelease-1.
	
	Improve the display of selected image text.
	* imfapp.tcl (.closeup.content): Tweak selname text.
	(new_cmd): Set selname to "Nothing selected".
	(select_imf): Set header text before replacing imfs.
	
	Provide some feedback when loading images so that the user
	understands what is going on.
	* imfapp.tcl (.closeup.content): Set the status text tag to
	"No image families loaded" on creation.
	(new_cmd): Set the status tag to "No image families loaded".
	* tkiapp.c (get_imf_status_cmd): Tweak the text string.
	* tkisamp.c (imfsample_add_imf): Add call to Tcl_Eval that
	sets the status tag to the name of the image currently being
	loaded in case -all. Add call to update idletasks so that the 
	status tag is updated.

	Make windows and widgets redraw both before and after the 
	lengthy image loading procedure.
	* imfapp.tcl (open_imf_dir_cmd): Call update unconditionally
	after the call to tk_getOpenFile. Then redraw the canvas content
	and call update idletasks. Call update idletasks and redraw the 
	canvas content when done.
	(add_imf_file_cmd): Call update unconditionally after the call 
	to tk_getOpenFile. Then redraw the canvas content and call 
	update idletasks. Call update idletasks and redraw the canvas 
	content when done.

	Improve the appearance by hiding the window during startup.
	* imfapp.tcl (.): Call wm withdraw first of all. Call wm
	deiconify, focus -force and update idletasks when the setup
	is complete.
	
	Make the partly implemented "Selected as Terrain" and 
	"Selected as Emblem" menu options work as intended.
	* imfapp.tcl (with_terrain): New global, set to 0.
	(.menubar.view): Tweak with_terrain and with_emblem labels.
	(toggle_as_terrain): Fill empty procedure with content that
	toggles the terrain.
	(toggle_as_emblem): Fill empty procedure with content that
	toggles the emblem.
	(toggle_with_terrain): Rewrite. Add check of the new global
	with_terrain. Toggle terrain to -1 if it is off. Redraw the
	canvas content when done.
	(toggle_with_emblem): Redraw the canvas content when done.
	(select_imf): Save the old selection before selecting a new
	one. Call toggle_as_emblem and toggle_as_terrain if the
	selected image changed.
	* tkisamp.c (config_specs): Add -emblem config that sets
	with_emblem and -terrain config that sets with_terrain.
	Initialize both to -1.
	(imfsample_display): Check that tkimg->colr exists before 
	dereferencing it. Use Tk_Fill3DRectangle as a backup if the 
	terrain drawing code fails. Add code for using the terrain 
	background when updating the previously selected image 
	field.
	
	Add a redraw command to the imfsample widget and use 
	it to fix a number of unrelated window update problems 
	on different platforms.
	* tkisamp.c (Imfsample): Add redraw flag.
	(imfsample_cmd): Initialize the redraw flag to 0.
	(imfsample_widget_cmd): Add a "redraw" command that sets 
	the redraw flag and schedules an imfsample_display update. 
	(imfsample_configure): Add code that sets the redraw flag 
	and schedules an imfsample_display update after the calls to
	Tk_GeometryRequest and Tk_SetInternalBorder.
	(imfsample_display): Add an update flag and set it to true
	if imfsample->redraw is true, if firstvisrow differs from
	oldfirst, or if double_buffer is true. Redraw the background
	if update is true. Also execute the scrollregion setup code if the 
	redraw flag (but not only update) is set. Add code that either 
	does a dummy scroll or inactivates the scrollbar, depending on 
	numimages. Reset the redraw flag. Note: the dummy yview scroll 
	0 units command makes sure the scrollbar is reset after being
	resized.
	* imfapp.tcl (.): Bind <Configure> and <Expose> of the toplevel
	to .images.canvas.content redraw (fixes update problems under
	Linux). Add .images.canvas.content redraw in several places, 
	together with update idletasks (fixes update problems under
	MacOS and Windows).

	Fix scrollbar problem on startup and clearing of all images 
	when selecting "New" from the  menu.
	* tkisamp.c (imfsample_widget_cmd): Call Tcl_Eval to turn
	off the scrollbar in case "remove all".
	* imfapp.tcl (.images.canvas.content): Remove premature setup
	of the scrollbar that caused interface problems (clicking in it 
	before the images had been loaded would generate tcl errors).
	(new_cmd): Also remove all closeup imfsamples and set the
	text to "Nothing selected".
	
	Clean out unused image initializing code in imfapp_main. 
	Also remove the unused set_initial_view procedure.
	* tkiapp.c (imfapp_main): Remove calls to sort_all_images 
	and Tk_MakeWindowExist. Don't define tmp_root_window or
	tmp_valid here. Remove code that inits images[i] since images
	have not been loaded yet. Remove call to Tcl_Eval that adds
	images to the canvas for the same reason. Remove call to
	Tcl_Eval that sets the initial view.
	* imfapp.tcl (set_initial_view): Remove procedure.

	Fix so that only the previous image and not the whole window 
	is redrawn when a new image is selected.
	* tkisamp.c (Imfsample): Add int previous.
	(imfsample_cmd): Initialize previous to -1.
	(imfsample_widget_cmd): Add code that sets both previous and
	selected images in case "select" so that that the selected image
	can be toggled and deselected by clicking in an empty region.
	(imfsample_display): Don't redraw the entire widget background
	if just updating the selection. Redraw the background and image
	of the previous selection instead. Don't draw any other images.
	Reset previous to selected when done. 
	
	Fix so that only the visible part of the canvas is drawn.
	* tkisamp.c (imfsample_display): Use Tk_Width(Tk_Parent)
	and Tk_Height(Tk_Parent) to get winwidth and winheight, so
	that drawing is limited to the screen.

	Fix so that the widget is redrawn if the first line is changed.
	* tkisamp.c (Imfsample): Add int oldfirst.
	(imfsample_cmd): Initialize oldfirst to 0.
	(imfsample_display): Check oldfirst and set the update
	flag if it differs from firstvisrow. Reset oldfirst.

	Fix crashes due to dereferencing non-existing image names.
	* tkiapp.c (get_imf_name_cmd): Check that n is between 0 and 
	numimages - 1. Return an empty string if not.
	
	Increase the default window size and center it on the screen.
	* imfapp.tcl (.images): Boost it to 900 by 600 pixels.
	(.): Add wm geometry request that centers the toplevel on the
	screen.

	Rearrange image names and increase padding so that names
	are drawn under images instead of to the right, and do not clash 
	with other names or images.
	* imfapp.tcl (.images.canvas.content): Increase -pad to 7.
	* tkisamp.c (imfsample_display): Tweak positions of images
	and image names.

	Draw one extra partly visible row so that it is clear to the 
	user that the canvas extends below the bottom of the window.
	* tkisamp.c (imfsample_display): Also draw the last row
	(imfsample->firstvisrow + imfsample->numvisrows) on
	the screen.

	Fix null pointer crashes in the image replacing code.
	* tkisamp.c (imfsample_replace_imf): Check if imfname is
	and empty string and set imfsample->imf_list[0] to NULL
	in that case.
	
	Fix the "New" command so that it actually deletes the 
	old images and starts a clean session with new ones.
	* tkisamp.c (numtkimages): Declare extern int.
	(imfsample_remove_imf): Set both numtkimages and
	numimages to 0 if "-all" was passed as imfname.
	
	Fix so that display of old style black and white images with 
	masks works on the Mac also when drawing directly to the 
	screen.
	* tkisamp.c (black_border): Declare static Tk_3DBorder
	and initialize to NULL.
	(white_border): Declare static Tk_3DBorder and initialize 
	to NULL.
	(imfsample_display): Call Tk_Get3DBorder if black_border 
	or white_border is NULL.
	(draw_one_image): Add special code that uses a small colored
	offscreen pixmap and XCopyArea instead of XFillRectangle on
	the Mac. Note: this code does not work under Unix, and the
	Unix code does not work on the Mac, unless double_buffer
	is true, in which case the big offscreen pixmap does the job.

	Fix problem with scrollbar elements remaining active on 
	the Mac even after releasing the mouse button.
	* imfapp.tcl (.images.scroll): Bind <ButtonRelease-1> to
	{ .images.canvas.content yview scroll 0 units } on the Mac.

	Various other interface tweaks and bug fixes.
	* tkisamp.c (black_color): Initialize to NULL.
	(white_color): Initialize to NULL.
	(config_specs): Set width and height to 0 by default.
	(imfsample_widget_cmd): Only do the "select" command if
	numimages > 0. Set the selected unit to -1 if we clicked in
	the margin (col >= imfsample->cols).
	(imfsample_display): Add code that handles the fact that a
	box is 1 pixel smaller on the Mac than on other platforms.

2004-08-03  Eric McDonald  <mcdonald@phy.cmich.edu>

        Update and changes to Opal. (From Elijah.)
        * lib/s-opal.g: Delete. Contents now part of 'opal.g'.
        * lib/ChangeLog-opal: Notes on some of the changes.
        * lib/opal.g: Add 'classic' variant which loads the predefined map 
        and fixed sides.

2004-08-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        New version of Specula from Elijah Meeks. Now called Opal.
        * lib/opal-rules.g: New ruleset and base game for Opal.
        * lib/opal.g: Main scenario for Opal.
        * lib/s-opal.g: Opal sides.
        * lib/t-opal.g: Opal map.
        * lib/u-opal.g: Opal units.

2004-07-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improvements to Xcscribe and help output.
	* help.c (prep_help_toc_cc): If a game module is loaded and it has 
	a blurb, then print that blurb near the top of the TOC page.
	* xcscribe.c (parse_xcscribe_command_line): Make the default output 
	mode be HTML instead of plain text.

2004-07-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add missing help blurb to a Wreckreation terrain type.
	lib/wreckr-t.g: Add help blurb to 'tanglewood'.

2004-07-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	[htdocs]/gamedoc: New directory with a subdirectory for each game.
	Each subdir contains complete HTML docs for a game.
	[htdocs]/gamedoc/index.html: Game index.
	[htdocs]/index.html: Add link, "Games Library", to game index.

	Convert the entire help system to use format-independent 
	indentation and line terminators. (Lots of work; don't let this 
	compact changelog entry fool you.)
	* help.c (describe_utype, describe_utype_movement, 
	describe_utype_actions, describe_utype_side_attributes, 
	describe_utype_ai_attributes, dump_material_unit_summary, 
	describe_mtype, describe_ttype, describe_atype, append_number, 
	append_help_phrase)

	New help output functions.
	* help.h (tbcat_si): New prototype.
	  (tbcatline_si): New prototype.
	* help.c (tbcat_si): Concatenates a given string to the given 
	text buffer, after a small indent.
	  (tbcatline_si): Concatenates a properly terminated line to the 
	given text buffer, after a small indent.

	Improve formatting of help system display.
	* help.c (describe_ttype): Use integer rather than floating point 
	output for describing 'ut_*_terrain_effect' tables.

	Improve help file output.
	* help.c (write_help_file_navbar): Get rid of indents before 
	navbar lines in plain text output.
	* xcscribe.c (write_game_index_aux): Write out module's game title 
	rather than the module name.

2004-07-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	New Xcscribe feature, plus improvements. Write out master game index.
	* help.h (set_help_toc_filep): New prototype.
	  (prep_help_file): New prototype.
	  (finish_help_file): New prototype.
	  (write_help_file_header): New prototype.
	  (write_help_file_footer): New prototype.
	  (write_help_toc_entry): New prototype.
	  (help_file_brand): New prototype.
	  (get_help_file_extension): New prototype.
	* help.c (write_help_toc_entry): Move to 'help.h' as an extern. 
	Delete here.
	  (help_file_brand): Likewise.
	  (get_help_file_extension): Likewise.
	  (write_help_file_footer): Likewise.
	  (write_help_file_header): Likewise. Only put mainmodule name in 
	help title, if mainmodule is available.
	  (prep_help_cc): Rename to 'prep_help_file' and move to 'help.h' 
	as an extern.
	  (finish_help_cc): Rename to 'finish_help_file' and move to 'help.h' 
	as an extern.
	  (set_help_toc_filep): New function. Assign a file stream pointer 
	to use for TOC entry writing.
	  (prep_help_cc_toc): Call 'prep_help_file' instead of 'prep_help_cc'.
	  (prep_help_cc_any): Likewise.
	  (finish_help_cc_toc): Call 'finish_help_file' instead of 
	'finish_help_cc'.
	  (meta_finish_help_cc): Likewise.
	* xcscribe.c (struct game_tree_node): Typedef to 'GameTreeNode'.
	  (write_game_index): New function. Add all desired game modules to 
	the game tree, and then write out the tree hierarchy to a game 
	index file.
	  (add_to_game_tree): New function. Place a game module in a game 
	tree node in the proper location in the hierarchy.
	  (create_game_tree_node): New function. Allocate and initialize a 
	game tree node.
	  (find_game_in_tree): New function. Find a game in the game tree. 
	Return 'NULL' if not found.
	  (write_game_index_aux): New function. Actually write out a tree 
	node to the game index file with proper indentation.
	  (main): Initialize help system very soon after command line 
	arguments have been processed. Call 'write_game_index' if the 
	'CLI_FLAG_INDEX_GAMES' flag is set. Use 'make_pathname' to 
	generate the doc directory path in an OS-indep manner.
	  (parse_xcscribe_command_line): Remove warning about the game index 
	option being unimplemented. Make sure that any output gets flushed so 
	that it doesn't linger in the file stream buffers of forked processes.
	  (write_help_files): Don't configure help system here (aside from 
	the doc dir); this is now done in 'main'.

	Fix bug in module includes processing. Prevents crash in Quest 
	game, when attempting to access includes tree.
	* module.c (add_game_module): Prevent cycles from forming when 
	a parent module is about to include a child module, which already 
	has the parent somewhere in its 'nextinclude' list, due to the 
	parent's parent including both the parent and the child directly.
	The cycle must be prevented to avoid infinite recursion when 
	attempting to traverse the 'nextinclude' list in a recursive 
	manner, such as is done by 'describe_game_module_aux'.

2004-07-24  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve help system. Change Xcscribe from a "relay race" process 
	model to the more typical "master-worker" process model. Improve 
	Xcscribe command line parsing and report usage.
	* help.c (describe_game_module_aux): Fix segmentation fault 
	caused by writing too many HTML indents to the indent buffer.
	* xcscribe.c: Include the 'wait.h' system header since the master 
	process waits for each child to complete before starting the next.
	  (struct param_box_cli): Typedef to CLIParamBox. Use to ferry the 
	results of command line parsing between 'main' and 
	'parse_xcscribe_command_line'.
	  (CLI_FLAG_DOCUMENT_GAMES): New macro definition.
	  (CLI_FLAG_DOCUMENT_COMMANDS): Likewise.
	  (CLI_FLAG_DOCUMENT_SYMBOLS): Likewise.
	  (CLI_FLAG_MULTIPLE_GAMES): Likewise.
	  (CLI_FLAG_ALL_GAMES): Likewise.
	  (CLI_FLAG_INDEX_GAMES): Likewise.
	  (parse_xcscribe_command_line): New static function. Parses the 
	Xcscribe command line, storing the results in a parameter box to 
	be passed back to the caller.
	  (show_xcscribe_help_usage): New static function. Displays usage of 
	the 'xcscribe' command.
	  (main): Remove the pipelined relay race; replace with master-worker. 
	Redesign with the implementation of future capabilities in mind.
	  (write_help_files): Report the fully form game dir path here, 
	instead of in two pieces in 'main'.
	  (low_init_warning): Only report main module name, if 'mainmodule' 
	is set, so that we don't segfault while trying to display a message.
	  (low_init_error): Likewise.
	  (low_run_warning): Likewise.
	  (low_run_error): Likewise.

	Fix init warning and typo in Galaxy game.
	* galaxy.g (game-module notes): Escape quoted word so that the 
	containing string is not disrupted. Change "writter" to "writer".

2004-07-24  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve the help system. Rearrange the order of the help files.
	* help.h (HelpPage): Delete 'HELP_PAGE_FORWARD' from enum. New 
	'HELP_PAGE_COPYRIGHT', 'HELP_PAGE_WARRANTY', 'HELP_PAGE_NEWS', and 
	'HELP_PAGE_CONCEPTS' in enum.
	* help.c (hpagedefns): Change the prev and next help page handles to 
	'HELP_PAGE_NONE' for the "Table of Contents" section. Delete 
	definition for 'HELP_PAGE_FORWARD'. New definitions for 
	'HELP_PAGE_COPYRIGHT', 'HELP_PAGE_WARRANTY', 'HELP_PAGE_NEWS', and 
	'HELP_PAGE_CONCEPTS'. Make 'HELP_PAGE_CONCEPTS' nominally follow 
	'HELP_PAGE_ATYPE' and then wrap around to 'HELP_PAGE_COPYRIGHT'. 
	  (HELP_PAGE_LAST): New macro. Define to 'HELP_PAGE_CONCEPTS'.
	  (init_help): Replace the "Forward" section and its individually 
	flushed subsections with individual pages: 'HELP_PAGE_COPYRIGHT', 
	'HELP_PAGE_WARRANTY', and 'HELP_PAGE_NEWS'.
	  (create_game_help_nodes): Prep and finish "Game Concepts" section.
	  (describe_concepts): Call 'tbcatline' instead of 'tbcat' in some 
	places. Quit lying about games that have morale or combat 
	experience.
	  (finish_help_cc_forward): Delete function and prototype.
	  (init_help_pages): Edit next page for ttype or mtype cluster to be 
	'HELP_PAGE_LAST'. Edit prev page for 'HELP_PAGE_LAST' to be an atype, 
	mtype, or ttype, as appropriate.
	  (write_help_file_navbar): Edit prev page index for 'HELP_PAGE_LAST' 
	according to available atype, mtype, or ttype pages.

2004-07-24  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve the help system. Write out all files for utypes, ttypes, 
        mtypes, and atypes.
        * help.c (write_help_toc_entry): Add 'indentlvl' parameter for 
        controlling the indentation level of the TOC entry. Allow NULL 
        help files to be specified, indicating that a hyperlink or file 
        lookup should not be written, __only the section name should.
          (create_game_help_nodes): Write out all help files and TOC 
        entries for utypes, ttypes, mtypes, and atypes.
          (help_indent): Return empty string if the indentation requested 
        in the 'spaces' parameter is 0. Also, change 'spaces' type from 
        'int' to 'unsigned int'.
          (meta_prep_help_cc): Call 'write_help_toc_entry' with an indent 
        level of 0 by default, but 1 for help page clusters.
          (write_help_file_navbar): Perform proper help page handle editing, 
        so that navigation past ttypes works correctly.

2004-07-23 Hans Ronne <hronne@comhem.se>

	Add a version string with game title to the Mac interface. 
	Improve the tcltk version string by adding the game title.
	* macdefs.h (diNewGameString): Define as 7.
	* macinit.c (draw_newgame_dialog): Add code that writes title
	and version into diNewGameString.
	* Xconq.r (DITL 129 "New Game"): Change item 7 from Picture
	to Static Text. Rearrange items so that the preview is on top.
	* tkconq.tcl (select_game): Set version to $game_title($i)
	$game_version($i) instead of just the latter.

	Minor cleanups in the kernel code.
	* task.c (can_repair_from_here): Remove unused i.
	* side.c (cover_area_1): Align indents.

2004-07-23  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve help system.
        * help.c (meta_prep_help_cc): New static function. Replaces 
        the prep functions for most individual sections.
          (prep_help_cc_forward): Delete function. Replaced by a generic 
        function, which uses the 'hpagedefns' array.
          (prep_help_cc_instructions): Likewise.
          (prep_help_cc_overview): Likewise.
          (prep_help_cc_scoring): Likewise.
          (prep_help_cc_modules): Likewise.
          (prep_help_cc_config): Likewise.
          (prep_help_cc_world): Likewise.
          (meta_finish_help_cc): New static function. Replaces the 
        finish functions for most individual sections.
          (finish_help_cc_instructions): Delete function. Replaced by a 
        generic function, which uses the 'hpagedefns' array.
          (finish_help_cc_overview): Likewise.
          (finish_help_cc_scoring): Likewise.
          (finish_help_cc_modules): Likewise.
          (finish_help_cc_config): Likewise.
          (finish_help_cc_world): Likewise.
          (init_help): Call 'meta_prep_help_cc' instead of prep function 
        for the "Forward" section.
          (create_game_help_nodes): Call 'meta_prep_help_cc' and 
        'meta_finish_help_cc' instead of the deleted prep and finish 
        functions for sections.
          (write_help_file_navbar): For the plain text output mode, write 
        each navbar entry on a separate line.
        * xcscribe.c (low_init_warning): Place module name before message.
        Useful for debugging.
          (low_init_error): Likewise.
          (low_run_warning): Likewise.
          (low_run_error): Likewise.

2004-07-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve help system. Add navbars to some help files.
	* help.h (enum help_page): Typedef to 'HelpPage'. List off all 
	possible help pages or page clusters.
	  (struct help_page_defn): Typedef to 'HelpPageDefn'. Contain the 
	help file basename, help page name, handle to TOC page for the 
	page, handle to previous page for the page, and handle to next page 
	for the page.
	* help.c (hpagedefns): New static array of HelpPageDefn structs. 
	Contains file names, page titles, and navigation handles.
	  (tprop_i_default): New static prototype. Fix return type for 
	function definition from 'int' to 'short'.
	  (tprop_s_default): Likewise.
	  (tprop_l_default): Likewise.
	  (init_help_pages): New static function. Does editing of the 
	master index file basename based on output format, and edits 
	navigation handles according to the availability of materials and 
	advances.
	  (write_help_file_navbar): New static function. Writes out a 
	navbar appropriate to the help file format, using 'hpagedefns' as 
	its guide.
	  (init_help): Call 'init_help_pages' first thing.
	  (prep_help_cc_toc): Write out top navbar for TOC section. 
	  (prep_help_cc_forward): Write out top navbar for "Forward" section.
	  (write_help_toc_entry): Cosmetic touchup on 'Href' argument to 
	HTML anchor tag.
	  (finish_help_cc_toc): Write out bottom navbar for TOC section.
	  (finish_help_cc_forward): Write out bottom navbar for "Forward" 
	section.

2004-07-20 Hans Ronne <hronne@comhem.se>

	Fix annoying bug in the X11 interface that would cause recycled
	dead units to inherit the map->curunit pointer, thus eventually
	producing a current unit that belonged to the enemy side (which 
	in turn caused various interface problems).
	* xtmain.c (run_game_idle): Call clear_current if the call to
	autonext_unit_inbox returns NULL. Also call clear_current in
	survey mode if map->curunit is no longer valid.
	
2004-07-19 Hans Ronne <hronne@comhem.se>

	Rewrite the rearmament and repair code so that they work like the 
	new resupply code.
	* kernel.h (can_repair_from_here): New prototype.
	* plan.c (low_on_ammo_one): Rewrite with full support for ammo
	used to fire and special materials (weapons & tools) needed to attack
	or fire. Also handle the fact that um_consumption_per_attack may
	be used by the firing code instead of um_consumption_per_fire.
	(plan_resupply): New function and prototype. Content of recently
	rewritten resupply_if_low, now also called by rearm_if_low.
	(resupply_if_low): Break out the body of the function as the 
	new function plan_resupply.
	(rearm_if_low): Replace with shell function that calls
	low_on_ammo_one and then plan_resupply.
	(can_be_resupplied): Remove unused function and prototype.
	(supplies_here): Remove unused function and prototype.
	(plan_repair): New function and prototype based in the content 
	of repair_if_damaged, analogous to plan_resupply. However, call
	search_around with can_repair_from_here as argument instead
	of calling can_be_auto_repaired.
	(repairs_here): Remove unused function and prototype.
	(can_be_auto_repaired): Remove unused function and prototype.
	(repair_if_damaged): Break out the body of the function as the 
	new function plan_repair.
	* task.c (can_repair_from_here): New function. Clone of 
	can_resupply_from_here but adapted for repair purposes. Calls 
	search_around using the new improved repair_here function as 
	argument.
	(do_repair_task): Call search_around with can_repair_from_here
	as argument instead of auto_repair_at.
	(auto_repair_at): Remove unused function and prototype.
	(repair_test): Remove unused function and prototype.
	(repair_here): Rewrite using content from the old auto_repair_at 
	so that it can be used by can_repair_from_here.
	(can_resupply_from_here): Add test from can_repair_from_here
	that tmpunit can sit in (tmpx, tmpy).
	(resupply_here): Include code form can_provide_supply.
	(can_provide_supply): Remove function and prototype.
	
	Fix init warning when loading the Modern Game.
	* lhsunit.g (radar): Set image-name to "radar".

	Use the TABHI macro instead of hard-coded number.
	* table.def (fire-damage): Change 32767 to TABHI.

2004-07-19  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve the way that default lists for GDL globals are set.
	* game.h (VarDefn): Make 'dfltfn' return 'Obj *' like its 
	'objgetter' counterpart.
	  (set_g_synth_methods_default): Delete prototype.
	  (g_synth_methods_default): New prototype. Returns 'Obj *' instead 
	of 'void'.
	* generic.c (init_globals): Use the 'objsetter' for the variable 
	in conjunction with the return result of 'dfltfn' for list globals.
	* gvar.def (g_synth_methods): Change the default function from 
	'set_g_synth_methods_default' to 'g_synth_methods_default'.
	* init.c (set_g_synth_methods_default): Change to 
	'g_synth_methods_default'.
	  (g_synth_methods_default): Returns 'Obj *' to default synth 
	methods list, rather than setting them as 
	'set_g_synth_methods_default' did.

	More improvements to the help system.
	* help.c (uprop_i_default): Use 'intgetter' instead of 'offset' to 
	lookup default integer.
	  (uprop_s_default): Use 'strgetter' instead of 'offset' to lookup 
	default string.
	  (UPROP_I_DEFAULT): Delete macro.
	  (UPROP_S_DEFAULT): Delete macro.
	  (UPROP_L_DEFAULT): Delete macro.
	  (uprop_l_default): New function. Return 'lispnil'. Accept dummy 
	argument of 'objgetter' in case we start using functions to return 
	default lists at some point (like the GDL globals case).
	  (tprop_i_default): New function. Return default integer value of 
	a terrain property.
	  (tprop_s_default): New function. Return default string value of a 
	terrain property.
	  (tprop_l_default): New function. Return 'lispnil'. Accept dummy 
	argument of 'objgetter'.
	  (gvar_i_default): New function. Return default integer value of 
	a global variable.
	  (gvar_s_default): New function. Return default string value of 
	a global variable.
	  (gvar_l_default): New function. Return default list value of a 
	global variable.
	  (help_indent): New function. Fill and return a buffer with 
	indentation strings appropriate to the help output format.
	  (help_newline): New function. Return a literal string containing 
	a line terminator appropriate to the help output format.
	  (describe_game_design): Use 'help_newline' or 'tbcatline' instead 
	of '\n' as appropriate. Use 'gvar_i_default' instead of hard-coded 
	literals as appropriate. Use 'help_indent' in conjunction with 
	'tbprintf' instead of hard-coded filler spaces as appropriate.
	  (describe_game_module_aux): Fill out 'indentbuf' with 
	'help_indent' instead of filler spaces. Use 'help_newline' and 
	'tbcatline' as appropriate. Improve line spacing.
	  (describe_utype_movement): Use 'uprop_*' default value functions 
	with getters instead of macros with offsets.
	  (describe_utype_actions): Likewise.
	  (describe_setup): Use 'help_newline' and 'tbcatline' as appropriate. 
	Improve reporting of country radii and separation distances. Use 
	'help_indent' instead of filler spaces as appropriate. Use 
	'uprop_*', 'tprop_*', and 'gvar_*' default value functions as 
	necessary, instead of hard-coded literals. Use percentages when 
	describing percentiles (imagine that!). Filter out non-border, 
	non-river terrain, when describing adjacent terrain effects on 
	rivers. Use commas to separate list items of the river adjacent 
	terrain effects description.
	  (describe_world): Use 'help_newline' and 'tbcatline' as 
	appropriate. Use 'help_indent' instead of filler spaces as 
	appropriate.

2004-07-18 Hans Ronne <hronne@comhem.se>

	Extend the unit image drawing code so that multiple images for 
	one unit type and unique images for individual units are supported. 
	Generalize some of the code and move it from the interfaces to ui.c. 
	Fix some bugs relating to saving and restoring of unit views.
	
	* help.c (describe_game_design): Use get_string to get image
	name from the u_image_name(u) Obj.
	* imf.h (a_image_family): Add struct a_image_family next.
	* init.c (patch_object_references): Patch uview->unit links.
	* lisp.h (get_string): New prototype.
	* lisp.c (get_string): New function. Used to get the first available
	string from a list Obj.
	* ps.c (ps_cook_imf): Use get_string to get image name from 
	the utypes[i].imagename Obj.
	* read.c (interp_unit_views): Change argument from viewlist to 
	vlist in function and prototype. Insert the new uview into viewlist.
	Read the image name if provided.
	(interp_unit): Read the image name if provided.
	* side.c (viewlist): Initialize to NULL.
	(numunitviews): New static int, initialize to 0.
	(init_sides): Don't initialize viewlist here.
	(add_unit_view): Increment numunitviews and set observer to
	side->id. Also set type, size, imf, image_name and complete from
	the unit. Update uview->imf and uview->image_name if necessary.
	(flush_stale_views): Add remaining numunitviews in Debug message.
	(flush_one_view): Decrement numunitviews.
	(calc_coverage): Add comment about code being inefficient in that 
	it adds and removes each unit view about 50 times.
	(cover_area_1): Call flush_stale_views if anychanges is true.
	* ui.h (min_w_for_unit_image): Declare global int here instead.
	(min_h_for_unit_image): Declare global int here instead.
	(numuimages): Declare global int here instead.
	(uimages): Declare pointer to global image families here instead.
	(set_unit_image): New prototype.
	(set_unit_view_image): New prototype.
	(init_unit_images): Prototype here instead.
	* ui.c (uimages): Initialize to NULL.
	(numuimages): Initialize to NULL.
	(min_w_for_unit_image): Initialize to 16.
	(min_h_for_unit_image): Initialize to 16.
	(get_generic_utype_images): New function and prototype.
	(set_unit_image): New function.
	(set_unit_view_image): New function.
	(get_unit_type_images): Rewrite so that multiple images for each
	unit type are loaded into a linked list.
	(init_unit_images): Rewrite so that both unit and unit view images
	are loaded if necessary and move function from interfaces to here.
	* unit.h (viewlist): Declare extern here instead.
	(a_unit): Add struct a_image_family imf and char image_name.
	(a_unit_view): Add short observer, struct a_image_family imf 
	and char image_name.
	* unit.c (set_unit_image): Prototype extern.
	(numuimages): Declare extern.
	(create_unit): Call set_unit_image if numuimages > 0.
	(flush_one_unit): Set imf and image_name to NULL.
	* utype.def (u_image_name): Make it a lisp Obj instead of a string.
	* write.c (write_side_view): Write uview->image_name.
	(write_unit_properties): Write unit->image_name.

	* macconq.h (uimages): Don't declare here.
	(draw_unit_image): Add ImageFamily imf argument and 
	remove int u.
	(init_unit_images): Don't prototype here.
	(dispose_unit_images): Prototype extern.
	* macdesign.c (draw_design_window_tool): Pass uimages[curutype]
	instead of curutype to draw_unit_image.	
	* macdraw.c (draw_unit_image): Add ImageFamily imf argument 
	and remove int u. Pass imf instead of uimages[u] to best_image.
	* machelp.c (draw_help): Pass uimages[cur_help_node->arg]
	instead of cur_help_node->arg to draw_unit_image.
	* macinit.c (dispose_unit_images): Don't prototype here.
	(uimages): Don't initialize here.
	(create_player_setup_dialog): Move image initializing code 
	here so that launching games by double-clicking and using the 
	Open game dialog both work. Pass dside to init_unit_images.
	(launch_game): Remove image initializing code.
	(init_unit_images): Remove function now in ui.c.
	(dispose_material_images): Also set mimages to NULL.
	(dispose_unit_images): Also set mimages to NULL.
	(dispose_emblem_images): Also set mimages to NULL.
	(dispose_terrain_images): Also set mimages to NULL.
	* maclist.c (draw_unit_list_entry): Pass unit->imf instead 
	of unit->type to draw_unit_image.
	* macmap.c (draw_selected_unit): Pass unit->imf instead of 
	unit->type to draw_unit_image (2 times).
	* macprefs.c (set_preferences): Call dispose_unit_images
	before calling init_unit_images. Pass dside to init_unit_images.
	* macrow.c (draw_units): Pass unit->imf instead of unit->type
	to draw_unit_image. Pass uview->imf instead of uview->type
	to draw_unit_image.
	(draw_unit_and_occs): Pass unit->imf instead of unit->type
	to draw_unit_image (2 times).
	(draw_unit_view_and_occs): Pass uview->imf instead of 
	uview->type to draw_unit_image (2 times).
	* macunit.c (draw_simple_closeup): Pass unit->imf instead of 
	unit->type to draw_unit_image (3 times).
	(draw_advanced_content): Pass unit->imf instead of unit->type 
	to draw_unit_image (3 times).

	* tkconq.h (a_ui): Remove ImageFamily uimages.
	* tkinit.c (min_w_for_unit_image): Don't initialize here.
	(min_h_for_unit_image): Don't initialize here.
	(init_display): Pass dside to init_unit_images.
	(init_unit_images): Remove static function and prototype.
	(report_missing_images): Change dside->ui->uimages[u]
	to uimages[u].
	* tkmain.c (tk_u_image_name): Use get_string to get the
	image name from Obj u_image_name(u).
	(draw_unit_info): Set uimf to unit->imf instead.
	* tkmap.c (draw_unit_image): Add ImageFamily imf argument 
	to function and prototype and remove int u. Pass imf instead of 
	uimages[u] to best_image.
	(draw_units): Pass unit->imf instead of unit->type to 
	draw_unit_image. Pass uview->imf instead of uview->type
	to draw_unit_image.
	(draw_unit_and_occs): Pass unit->imf instead of unit->type
	to draw_unit_image (2 times).
	(draw_unit_view_and_occs): Pass uview->imf instead of 
	uview->type to draw_unit_image (2 times).
	(draw_current): Pass unit->imf instead of unit->type
	to draw_unit_image.

	* sdlconq.h (a_real_ui): Remove ImageFamily uimages.
	* sdlinit.c (min_w_for_unit_image): Don't initialize here.
	(min_h_for_unit_image): Don't initialize here.
	(init_display): Pass dside to init_unit_images.
	(init_unit_images): Remove static function and prototype.
	(report_missing_images): Change ui->uimages[u]
	to uimages[u].
	* sdlmain.c (init_unit_images): Don't prototype here.
	* sdlmap.c (draw_unit_image): Add ImageFamily imf argument 
	to function and prototype and remove int u. Pass imf instead of 
	uimages[u] to best_image.
	(draw_units): Pass unit->imf instead of unit->type to 
	draw_unit_image. Pass uview->imf instead of uview->type
	to draw_unit_image.
	(draw_unit_and_occs): Pass unit->imf instead of unit->type
	to draw_unit_image (2 times).
	(draw_unit_view_and_occs): Pass uview->imf instead of 
	uview->type to draw_unit_image (2 times).
	(draw_current): Pass unit->imf instead of unit->type
	to draw_unit_image.
	* sdlscreen.c (draw_unit_info): Set uimf to unit->imf instead.
	(update_unit_info): Use uimages[u] instead of ui->uimages[u].

	* xtconq.h (a_ui): Remove ImageFamily uimages.
	(min_w_for_unit_image): Don't declare here.
	(min_h_for_unit_image): Don't declare here.
	(draw_unit_image): Add ImageFamily imf argument to prototype
	and remove int u.
	* xdesign.c (update_curutype): Pass uimages[side->ui->curutype]
	instead of side->ui->curutype to draw_unit_image.
	* xdesign.c (get_unit_picture): Pass uimages[u] instead of u to 
	draw_unit_image.
	* xinit.c (init_unit_images): Remove function and prototype.
	(min_w_for_unit_image): Don't initialize here.
	(min_h_for_unit_image): Don't initialize here.
	(report_missing_images): Change side->ui->uimages[u] to
	uimages[u].
	* xmap.c (create_map): Pass uimages[i - 1] instead of (i - 1)
	to draw_unit_image.
	* xdraw.c 	(draw_units): Pass unit->imf instead of unit->type 
	to draw_unit_image. Pass uview->imf instead of uview->type
	to draw_unit_image.
	(draw_unit_and_occs): Pass unit->imf instead of unit->type
	to draw_unit_image (2 times).
	(draw_unit_view_and_occs): Pass uview->imf instead of 
	uview->type to draw_unit_image (2 times).
	(draw_current): Pass unit->imf instead of unit->type
	to draw_unit_image (2 times).
	(draw_unit_image): Add ImageFamily imf argument 
	to function and remove int u. Pass imf instead of 
	side->ui->uimages[u] to best_image.

	Various bug fixes to the X11 interface. Note: things that still
	need to be fixed: Enemy units (even invisible ones) can become
	the current unit. No unit images are drawn in the utype list.
	* xcmd.c (aux_move_dir): Change dside to side.
	* xinit.c (popup_game_dialog): Test for module->blurb
	!= lispnil instead of empty_string. Call append_blurb_strings
	and load the blurb into char blurb[BLURBSIZE].
	(popup_game): Test for module-> blurb != lispnil instead. 
	Call append_blurb_strings and load the blurb into char 
	blurb[BLURBSIZE].

	Bug fixes to the victim scoring code.
	* plan.c (ai_score_potential_victim): Remove debugging code
	that sneaked in. Fix bug in rating calculation so that it is always 
	positive. Comment out code that made it hard for the AI to focus 
	its attacks.

2004-07-16 Hans Ronne <hronne@comhem.se>

	Improve the game blurb processing by giving it more 
	space and making it safe from buffer overflow. Also make
	it a lisp Obj instead of a string, so that it can be written
	on several lines in the game file.
	* cmdline.c (parse_command_line): Get the blurb by 
	calling append_blurb_strings.
	* config.h (BLURBSIZE): Define as 480.
	* help.c (append_blurb_strings): New function.
	(describe_game_module_aux): Get the blurb by calling
	append_notes (since buf is a TextBuffer).
	* help.h (append_blurb_strings): Prototype extern.
	* module.h (a_module): Make blurb an Obj instead of a char.
	* module.c (copy_module): Set generic blurb to lispnil.
	* read.c (interp_game_module): Handle module->blurb as
	a propval instead of a strval.
	* write.c (write_game_module): Call write_lisp_prop
	instead of write_str_prop for case K_BLURB.
	* macinit.c (draw_newgame_dialog): Get the blurb by calling
	append_blurb_strings. Hack up the newlines for TextEdit.
	* machelp.c (draw_instructions): Rewrite case no instructions
	so that the blurb is read in as a lisp Obj instead of a string.
	* tkmain.c (tk_game_info): Get the blurb by calling
	append_blurb_strings. Call Tcl_GlobalEval directly instead
	of through eval_tcl_cmd so that the Tcl command string size 
	is limited only by BLURBSIZE.

2004-07-15 Hans Ronne <hronne@comhem.se>

	Update Elijah Meeks' awls game to version 1.16. 
	See lib/ChangeLog-awls for details.

2004-07-14 Hans Ronne <hronne@comhem.se>

	Fix so that feature legends are drawn correctly in show_all
	situations such as is_designer mode and endofgame.
	* run.c (end_the_game): Call both place_legends and 
	update_area_display for all sides with a display. 
	* side.c (become_designer): Call place_legends.
	(become_nondesigner): Call place_legends.
	* ui.c (terrain_seen_at): Rewrite so that it returns BACKTTYPE 
	if not in_area. Always return terrain_at if side->see_all, 
	side->show_all or side->designer is true.
	(unit_seen_at): Also return unit_at if side->show_all is true.
	* macmap.c (draw_feature_names): Test for dside->show_all in
	addition to terrain_visible. Note: should perhaps redefine this 
	and other visibility macros to also include side->show_all.

	Speed up cell updates in the Mac native interface.
	* macmap.c (update_cell_display): Don't draw adjacent cells if
	draw_lighting is on. This is not done in the tcltk interface, since 
	daylight unlike coverage doesn't come in patches. Also remove the
	commented out draw_feature_boundaries code.

	Clean up some stuff in the planning code.
	* plan.c (resupply_if_low): Remove unused m.
	(ai_victim_here): Remove debugging code.

2004-07-13 Hans Ronne <hronne@comhem.se>

	Bug fix to awls game from Elijah Meeks.
	* awls-rules.g: Fix armor bug.

2004-07-13 Hans Ronne <hronne@comhem.se>

	Improve the resupply planning code so that it supports 
	inlengths and outlengths, and works together with the new 
	resupply task code.
	* kernel.h (lowm): Declare extern pointer.
	(numlow): Declare extern int.
	(can_resupply_from_here): Prototype extern.
	* plan.c (resupply_if_low): Rename static lowm to firtslowm 
	in order not to confuse with global pointer lowm. Set lowm[0] 
	to firstlowm and numlow to 1. Call search_around passing
	can_resupply_from_here as argument instead of calling
	can_be_resupplied to ensure an exhaustive search for 
	possible resupply points. Also use can_resupply_from_here 
	to find out if we are already at a resupply point. Improve
	the debugging messages so that we know if we succeeded or 
	failed to set a resupply task, and where the resupply point is.
	* task.c (can_resupply_from_here): Don't prototype here.
	(numlow): Don't declare static. Initialize to 0.
	(lowm): Don't declare static.
	
	Improve victim finding code so that cities can be attacked
	again by the AI in non-see-all games.
	* plan.c (ai_victim_here): Rewrite and simplify code that 
	considers attacks on transports depending on OccStatus. Call
	n_planning_to_hit_type_at to get the total number of side
	units assigned to attack and adjust so that 1 attacker always
	is assigned to the target if MAYBE_HAS_OCCS is true and 2 if 
	DEFINITELY_HAS_OCCS is true. Test indepside units for both
	no AI and no auto-build instead of either one.
	(ai_consider_shaking): Always attack transports that we 
	cannot damage, on the assumption that they are building 
	occs that we can damage (this code is called only when
	type_can_build or u_advanced is true).

	Fix AI problem with inability to target high-value 
	targets some distance away.
	* plan.c (ai_score_potential_victim): Cap the linear 
	turn-based penalty so that it never exceeds the inverse 
	square distance.

	Fix build problem in the new help code.
	* help.c (set_help_output_dir): Don't call access
	ifdef MAC.
	
	Fix some minor compile warnings.
	* task.c (do_hit_position_task): Remove u2.
	(can_resupply_from_here): Remove resupplier.
	* side.c (add_unit_view): Delete ostack and ustack.

2004-07-12 Hans Ronne <hronne@comhem.se>

	Fix unit view bug for good this time.
	* side.c (remove_unit_view): Return true if done.
	* tkmain.c (update_cell_display): Remove temporary
	hack. Note: Should resolve differences with the Mac
	interface here, which made it behave differently with 
	respect to this bug.
	
2004-07-12  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improvements to help system.
	(TODO: Add function that generates navbar with next, prev, and index.)
	(TODO: Use 'tbcatline' and other formatters to better present the 
	 files which can now be output in HTML.)
	* help.c (help_output_forward_filep): Delete static variable.
	  (help_output_tmp_filep): New static variable.
	  (flush_help_cc_toc): Delete static function.
	  (prep_help_cc_instructions): New static function.
	  (prep_help_cc_overview): Likewise.
	  (prep_help_cc_scoring): Likewise.
	  (prep_help_cc_modules): Likewise.
	  (prep_help_cc_config): Likewise.
	  (prep_help_cc_world): Likewise.
	  (prep_help_cc_any): Likewise. Generic core function called by 
	the above prep functions.
	  (write_help_toc_entry): New static function. Add an index/lookup 
	pair to the table of contents file. Pretty-print the plain text 
	output. Provide hyperlinked HTML output.
	  (flush_help_cc_tmp): New static function. Flush the stream 
	associated with 'help_output_tmp_filep'.
	  (finish_help_cc_forward): New static function.
	  (finish_help_cc_instructions): Likewise.
	  (finish_help_cc_overview): Likewise.
	  (finish_help_cc_scoring): Likewise.
	  (finish_help_cc_modules): Likewise.
	  (finish_help_cc_config): Likewise.
	  (finish_help_cc_world): Likewise.
	  (get_help_file_extension): Likewise. Returns the extension 
	associated with the help output format.
	  (init_help): Initialize the TOC help file before we get down to 
	business. Change calls to 'flush_help_cc_forward' to 
	'flush_help_cc_tmp'. Use 'help_output_tmp_filep' instead of 
	'help_output_forward_filep'. Fix bug involving the use of 
	'help_last_node'; always use the node just added instead.
	  (create_game_help_nodes): Support writing of nodes on the game 
	instructions, overview, scoring, modules, setup, and world 
	configuration. Close out the table of contents help file before 
	leaving the function.

2004-07-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	More output functionality for the help system.
	* copying.awk: Modify to produce 'copying.c' with 'tbcatline' 
	instead of 'tbcat' and linefeeds.
	* copying.c: Regenerated from 'COPYING' using 'copying.awk'.
	* help.h (tbcatline): New prototype.
	* help.c (write_help_subsection_header): New static function. 
	Writes header for an help subsection.
	  (write_help_subsection_footer): New static function. Writes 
	footer for an help subsection.
	  (write_help_subsection_break): New static function. Writes a 
	break between help subsections.
	  (init_help): Write subsection headers, and place a break between 
	the "Warranty" subsection and the "News" subsection.
	  (tbcatline): New function. Does a 'tbcat' on its string argument, 
	and then appends a line terminator appropriate to the help output 
	format.
	* .cvsignore: Add 'xcscribe' and 'xcscribe.exe' to list.

	Make help system safer.
	* help.c (tbprintf): Use 'vsnprintf' with buffer size, instead of 
	just 'vsprintf'.

2004-07-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	Cleanup of Xcscribe source file.
	* xcscribe.c: Rip out all unnecessary function declarations and 
	definitions, and variables.

2004-07-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	Quick hack to get Xconq to compile under MinGW32 again.
	* help.c: Include 'fcntl.h' system header. (Thanks to Robert 
	Goulding for reporting the compilation problem.)

2004-07-11 Hans Ronne <hronne@comhem.se>

	Temporary fix to the tcltk display update problem.
	* tkmain.c (update_cell_display): Disable checks for the
	UPDATE_ADJ flag and that side->terrview exists (both
	hacks were necessary to restore updates of adjacent
	cells).

2004-07-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	New program, Xcscribe, to automatically generate help files for 
	each game in a variety of formats.
	(TODO: Finish producing output files for all nodes.)
	(TODO: Finish adding HTML output support. This includes adding some 
	new functions such as 'tbcatline', which will produce correct line 
	terminators according to the help output format.)
	(TODO: Generalize pipe I/O and filepath handling so that 
	 'xcscribe' can be supported on Win32 and possibly the Mac.)
	(TODO: Add functionality for writing a master index file of all the 
	games. In the case of HTML output, this involves creating hyperlinks 
	to the index/TOC file in each game directory.)
	(TODO: Put autogenerated docs on Xconq Web site.)
	(TODO: Improve command line parsing.)
	(USAGE: For all games in plain text: "./xcscribe"
		For all games in HTML: "./xcscribe --all --html"
		For Wreckreation in plain text: "./xcscribe wreckreation"
		For Bellum Aeternum in HTML: "./xcscribe --html bellum")
	* Makefile.in (xcscribe): New target. Builds the 'xcscribe' 
	program.
	  (xcscribe.o): New dependency rule.
	* help.c: Add support for creating and writing help files in a 
	variety of formats.
	  (help_output_cc): New static variable. Toggle for carbon-copying 
	help node texts to files.
	  (help_output_mode): New static variable. Which output format to 
	use?
	  (help_output_dir): New static variable. Where to create the 
	help files?
	  (help_output_forward_filep): New static variable. Pointer to 
	file stream for the "Forward" section.
	  (help_output_toc_filep): New static variable. Pointer to file 
	stream for the "Table of Contents" section.
	  (prep_help_cc_forward): New static function. Prepare the file 
	containing the "Forward" section; write any headers.
	  (flush_help_cc_forward): New static function. Flush the contents 
	of a help node to the file containing the "Forward" section.
	  (finish_help_cc_forward): New static function. Write any footers 
	in the file containing the "Forward" section, and then finish the 
	help file stream.
	  (prep_help_cc_toc): New static function. Not yet implemented.
	  (flush_help_cc_toc): Likewise.
	  (finish_help_cc_toc): Likewise.
	  (prep_help_cc): New static function. Open an help file for 
	writing.
	  (flush_help_cc): New static function. Dump an help node's text 
	onto an help file stream and flush it.
	  (finish_help_cc): New static function. Do a final flush on the 
	help file stream and then close it.
	  (write_help_file_header): New static function. Write an header 
	for the help file, depending on the help output mode.
	  (write_help_file_footer): New static function. Write a footer 
	for the help file, depending on the help output mode.
	  (help_file_brand): Produce a branding mark for the output file, 
	depending on help output mode.
	  (write_help_section_header): New static function. Write an 
	header for an help section, depending on the help output mode.
	  (write_help_section_footer): New static function. Write a 
	footer for an help section, depending on the help output mode.
	  (set_help_output_cc): New function. Set the 'help_output_cc' 
	toggle.
	  (set_help_output_mode): New function. Set the 'help_output_mode' 
	variable.
	  (set_help_output_dir): New function. Set the 'help_output_dir' 
	for the game being written out.
	  (init_help): Proof of concept. Write out a "Forward" file in 
	either plain text or HTML.
	* help.h (HELP_OUTPUT_CC_NONE): New macro definition. "Off" 
	position for 'help_output_cc' toggle.
	  (HELP_OUTPUT_CC_FILES): New macro definition. "On" position 
	for 'help_output_cc' toggle.
	  (enum help_output_mode): Typedef to 'HelpOutputMode'. Possible 
	values: 'HELP_OUTPUT_PLAIN_TEXT', 'HELP_OUTPUT_HTML', 
	'HELP_OUTPUT_TEXI', 'HELP_OUTPUT_XML', 'HELP_OUTPUT_LATEX', and 
	'HELP_OUTPUT_MAGIC_TEXT'.
	  (struct a_help_node): Source formatting improvements to make it 
	more readable. Reduce excessive line-wrapping whitespace.
	  (set_help_output_cc): New prototype.
	  (set_help_output_mode): New prototype.
	  (set_help_output_dir): New prototype.
	* xcscribe.c: New file. Copied from 'skelconq.c' and hacked.
	(TODO: Rip out all of the unneeded 'skelconq' stuff.)
	  (main): Parse special command line args. Load complete list of 
	all games. Write documentation for specified game or for all games. 
	In case of all games, fork a child for each next module. Have child 
	wait until parent gets done writing current module.
	  (write_help_files): Prepare the output directory, configure the 
	help system to use file carbon-copies and a particular output 
	format, and then run the help system.

2004-07-10  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update the config helper scripts.
	* config.sub: Latest version from 'http://ftp.gnu.org/gnu/config/'.
	* config.guess: Likewise.

2004-07-10  Eric McDonald  <mcdonald@phy.cmich.edu>

	Potential fix for bug where a wrecked incomplete unit would become 
	its fully complete wrecked type. (Reported by Elijah Meeks.)
	* kernel/combat.c (determine_destruction_result): Return 'K_VANISH' 
	if the unit being wrecked is incomplete. 

2004-07-10  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix compilation of the SDL app on systems which do not have the 
	Tcl/Tk headers in a standard search location. (Patch from Tom 
	Low-Shang with a modification by me. Thanks, Tom.)
	* sdl/sdlconq.h (init_x_signal_handlers): Delete prototype for 
	'init_x_signal_handlers'.
	* sdl/sdlmain.c (launch_game): Delete call to 
	'init_x_signal_handlers'.
	* sdl/sdlunix.c: Include 'sdlconq.h' instead of 'tcltk/tkconq.h'. 
	Rip out 'handle_x_error', 'handle_xio_error', and 
	'init_x_signal_handlers'.

	Rip some unncessary SDL stuff out of the Tcl/Tk interface.
	* tcltk/tkunix.c: Get rid of the 'using_sdl' variable and usage of 
	it.

2004-07-10 Hans Ronne <hronne@comhem.se>

	Improve the resupply task code so that inlengths and outlengths 
	also are considered when looking for supplies.
	* task.c (tmpx, tmpy): New static ints.
	(foundm): New static int pointer.
	(aux_resupply_here): Remove function and prototype.
	(can_provide_supply): New function and prototype. 
	Replaces aux_resupply_here.
	(resupply_here): Iterate over for_all_stack_with_occs instead.
	(resupply_test): Remove function and prototype.
	(can_resupply_from_here): New function and prototype. Uses 
	search_around to look for supplies in cells adjacent to a given
	point. Replaces resupply_test.	
	(do_resupply_task): Always return TASK_IS_INCOMPLETE when 
	doing autoresupply or when waiting at a valid resupply poin. Rewrite 
	code that handles the unit if already at a valid resupply point.
	
	Fix so that units who don't need a material are more generous 
	in sharing it.
	* run2.c (run_economy): Give away everything the other unit 
	needs if will_not_move and !needs_material_to_survive both 
	are true.

	Fix a crashing bug in the Mac interface.
	* macrow.c (draw_units): Return if inside_area(x, y) is false.

2004-07-09  Hans Ronne <hronne@comhem.se>

	Update from Elijah Meeks to the A World Lost Slowly (formerly 
	Second Korean War) game.
	* ChangeLog-awls: New file.
	* awls-rules.g: New file. Replaces korea-rules.g.
	* korea.gif: See ChangeLog.awls for changes.
	* korea.imf: See ChangeLog.awls for changes.
	* korea-2006.g: See ChangeLog.awls for changes.
	* u-korea.g: See ChangeLog.awls for changes.
	* u-korea-2.g: New file.

2004-07-08  Hans Ronne <hronne@comhem.se>

	Further improvements and bug fixes to the unit view code. Add a global
	unit view list and improved garbage collection that uses it. Don't try to
	flush views while traversing an occupant list. Provide a temp fix to the
	bug that caused the roman and russian revolution games to hang by
	disabling the stack order code for unit views.
	* kernel.h (flush_stale_views): New prototype.
	* side.h (for_all_unit_views): New macro. Iterate over viewlist.
	* unit.h (a_unit_view): Add  struct a_unit_view *vnext.
	* run2.c (run_turn_end): Call flush_stale_views.
	* side.c (viewlist): New UnitView pointer.
	(init_sides): Init viewlist to NULL.
	(add_unit_view): Change nextview to nextuv. Set nextinhash to NULL
	for the new uview and insert it into the global list. Comment out stack
	order code for now and replace with simpler variant that does not hang
	the came. Add comment about this.
	(remove_unit_view): Rewrite so that the links are untouched during
	list traversal. First splice uview out of occupant list or hash table.
	Then call remove_unit_view on occupants. Finally set the id to -1.
	Don't hit the links - leave that to flush_stale_views.
	(flush_one_view): New function and prototype.
	(flush_stale_views): New function.
	
2004-07-06  Hans Ronne <hronne@comhem.se>

	Rewrite and simplify do_hit_unit_task so that it works better with
	unit views. Move some AI stuff formerly used by do_hit_unit_task
	but now exclusively used in ai.c to the latter. Clean up prototypes.
	* ai.c (fire_can_damage): Move function and prototype here.
	(attack_can_damage_or_capture): Move function and prototype here.
	(fire_can_damage_or_capture): Move function and prototype here.
	(real_capture_chance): Move function and prototype here.
	* conq.h (attack_can_damage_or_capture): Move prototype to ai.c.
	(fire_can_damage_or_capture): Move prototype to ai.c.
	(real_capture_chance): Move prototype to ai.c.
	* task.c (do_hit_unit_task): Remove code that checks for danger to
	a firing unit and tells it to move in and capture a defenseless unit.
	Reason: this code was cheating (looking at real units). Without doing
	so, firing units would be exposed to unnecessary danger from hidden
	occupants. Better to have a consistent policy of always firing from a
	distance, if possible. Leave it to the planner to set any capture tasks.
	Test for the real target side, task->args[3] instead of trusted_side.
	Remove test for NONUTYPE since all calls to do_hit_unit_task set
	the utype explicitly. Remove calls to fire_can_damage_or_capture,
	attack_can_damage_or_capture and fire_can_damage since we don't
	want to secondguess the AI, who maybe wants to fire at a unit that it 
	cannot damage in order to hit a vulnerable occupant.
	(attack_can_damage_or_capture): Move function to ai.c.
	(fire_can_damage_or_capture): Move function to ai.c.
	(fire_can_damage): Move function and prototype to ai.c.
	(real_capture_chance): Move function to ai.c.
	(target_visible): Test for the real target side, task->args[3] 
	instead of trusted_side.

	Fix comments that break parsing in CodeWarrior.
	* plan.c (ai_victim_here): Remove square parentheses (sorry, 
	just as bad as normal parentheses) inside multi-line comments.
	(ai_score_potential_victim): Ditto.
	
	Fix build problems for the Mac tcltk interface.
	* tkconq.h (xlibstuff.h): Don't include it ifdef MAC.
	* tkisamp.c (xlibstuff.h): Don't include it ifdef MAC.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Disable another compiler warning.
	* configure.in (build-warnings): Comment out the 'Wshadow' switch; 
	it produces copious output that is probably of minimal helpfulness 
	(though I think it is ultimately a good idea to enforce, which is 
	why I added it in the first place).

	Clean up a "zillion" (to quote Hans) warnings.
	* conq.h (time_desc): Change parameter name from 'time' to 
	'seconds' to unshadow 'time'.
	* help.c (describe_synth_run): Break up trigraph.
	* imf.c (write_imf_dir): Change parameter name from 'images' to 
	'imfimages' to unshadow the global var 'images'.
	* lisp.c (remove_from_list): Change argument name from 'elt' to 
	'element' to unshadow the function 'elt'.
	  (evaluate_arithmetic_expression): Add a default case to the 
	operation evaluation so that compiler doesn't complain about 
	all the zillions of cases not addressed.
	* lisp.h (remove_from_list): Change parameter name from 'elt' to 
	'element' to unshadow the function 'elt'.
	* nlang.c (time_desc): Change argument name from 'time' to 
	'seconds' to unshadow 'time'.
	* ps.c (dump_ps_view): Change variable names 'tmpbuf' and 
	'length' to 'tmppsbuf' and 'dlength', respectively, to unshadow 
	the global var 'tmpbuf' and the function 'length' respectively.
	* read.c (merge_unit_namers): Change variable name from 'elt' to 
	'element' to unshadow the function 'elt'.
	* ui.c (get_emblem_images): Change variable name from 'tmpbuf' to 
	'tmpembuf' to unshadow the global variable 'tmpbuf'.
	* tcltk/tkcmd.c (do_name): Change variable name from 'tmpbuf' to 
	'tmpnamebuf' to unshadow the global variable 'tmpbuf'.
	* tcltk/tkinit.c (init_cursors): Cast the bitmaps in all the calls 
	to 'make_cursor' from 'BMAP_TYPE *' to 'char *'.
	  (init_bitmaps): Cast the bitmaps in all the calls to 
	'Tk_DefineBitmap' from 'BMAP_TYPE *' to 'char *'.
	* tcltk/tkisamp.c (imfsample_widget_cmd): Change variable name 
	from 'length' to 'cmdlength' to unshadow the function 'length'.
	* tcltk/tkmain.c (tk_map_size_at_power): Change variable name 
	from 'pow' to 'viewpow' to unshadow the function 'pow'.
	* tcltk/tkmap.c (mapw_widget_cmd): Change variable name from 
	'length' to 'cmdlength' to unshadow the function 'length'.
	  (mapw_configure): Change variable name from 'pow' to 'viewpow' 
	to unshadow the function 'pow'.
	  (draw_terrain_iso): Likewise.
	  (draw_cliff): Likewise.
	  (draw_terrain_grid): Likewise.
	  (draw_borders_iso): Likewise.
	  (draw_country_border_line): Likewise.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix new bug in configure/build system.
	* configure.in (build-warnings): Comment out the 
	'Wdeclaration-after-statement' switch; it is apparently too new, 
	and the MinGW32 C++ compiler chokes on it.
	* configure: Regenerated.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	More improvements to the configure/build system.
	* configure.in: Make some comments clearer.
	  (build-warnings): Add new warning switches, including 
	'Wdeclaration-after-statement' and 
	'Werror-implicit-function-declaration', which will help mimic 
	CodeWarrior better.
	  (debugging): New option. Turn debugging on or off for GNU 
	compilers.
	  (build-optimizations): New option. Enable optimizations 
	for GNU compilers.
	  (release-build): New option. Enable optimizations and 
	executable stripping for GNU compilers.
	* configure: Regenerated.

2004-07-05  Jim Kingdon  <kingdon@panix.com>

	* kernel/actions.c: Fix typo in comment (delarce -> declare).

2004-07-05  Hans Ronne <hronne@comhem.se>

	Fix crashes in MacOS X due to bug in the common interface code.
	* ui.c (autonext_unit): Don't assume that the input unit is active. 
	Test for !is_active(unit) instead of unit == NULL.
	
	Fix minor inconsistencies in the unit closeup closing code.
	* macconq.c (close_window): Move code for deselection of unit
	here, so that it works also when Escape is used to close the unit
	closeup.
	* macunit.c (do_key_down_closeup): Call hit_closeup_dialog
	in all cases so that the same code always executes in closure.
	(hit_closeup_dialog): Move deselection code to close_window.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	More improvements to the configure/build system.
	* configure.in: Add protection to the assignment of the 'XLIBS' 
	variable, in case 'x_libraries' is 'NONE'. Only configure Xtconq-
	related dirs on Win32, if 'x_libraries' is not 'NONE'.
	* configure: Regenerated.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Make Xtconq build on Cygwin/X11. (Making it actually display a 
	map is another story, but at least "xtconq.exe -x" does show the 
	game setup dialog window, provided you are running an X server 
	at wherever your DISPLAY envvar is pointing. And 
	"xtconq.exe -g module" does all the loading up to the point of 
	actually opening the map window on a display, and then freezes.)
	* configure.in: Conditionally enable the configuration of the 
	Xtconq-related directories if X11 libs are found on the Win32 
	system.
	* configure: Regenerated.
	* SelFile/Dir.c: Make sure that 'dirent.h' gets included, so 
	that 'DIR' pointers can be used.
	* kernel/acdefs.h.in: New definition placeholders: 
	'HAVE_DIRENT_H', 'HAVE_SYS_NDIR_H', 'HAVE_SYS_DIR_H', and 
	'HAVE_NDIR_H'. These can be set by the 'AC_DIRENT' macro in 
	the configure script.
	* x11/xcutil.c: Do not include 'X11/Xos.h' on Win32. It provides 
	conflicting definitions of 'struct timeval'.
	* x11/ximf.c: Likewise.
	* x11/xtconq.h: Likewise.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Help Cygwin build Tkconq using ActiveTcl. (Note: I have decided 
	that any attempts to support the Cygwin Tcl/Tk implementation 
	are futile at this point. Either that implementation needs to 
	provide its own set of X11 headers and implementations, or else 
	the Tcl/Tk interface must have all explicit X11 dependence 
	removed from it.)
	* configure.in: If on a Win32 host being configured, then set 
	the 'NEED_XLIB_XSETTILE', 'NEED_XLIB_XFLUSH', and 
	'NEED_XLIB_XSYNCHRONIZE' definitions unconditionally.
	* configure.in: Regenerated.
	* tcltk/Makefile.in (WIN32_XCONQ_OBJS): Add 'xlibstuff.o'.
	  (WIN32_IMFAPP_OBJS): Add 'xlibstuff.o'.
	  (xlibstuff.o): New target. Depends on 'xlibstuff.h'.
	* tcltk/iappwin32.c: Include 'xlibstuff.h'. Rip out prototypes 
	and definitions for X11 functions.
	* tcltk/tkconq.h: Include 'xlibstuff.h'.
	* tcltk/tkisamp.c: Likewise.
	* tcltk/tkwin32.c: Rip out prototypes and definitions for X11 
	functions.
	* tcltk/xlibstuff.h: New header. Conditionally declare missing 
	X11 functions.
	* tcltk/xlibstuff.c: New source file. Conditionally implement 
	missing X11 functions.

	Remove last vestiges of multi-mode config.
	* missing/util/Makefile.in: Rip out all of the "*_mw32.*" stuff.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improvements to and remodeling of the configure/make system.
	* Makefile.in (dist): Chop out the inverse grep for the "*_mw32.*" 
	files used in the now obsolete multi-mode build.
	* configure.in: Clean out most of the remaining multi-mode config 
	stuff.
	  (W32API_LIBS): Define only for MinGW32 builds and not all 
	configure-driven Windows builds.
	  (WIN32_GUI_SUBSYS_FLAG): Substitute into all relevant makefiles.
	  (WIN32_CUI_SUBSYS_FLAG): Likewise.
	* configure: Regenerated.
	* curses/Makefile.in (NET_EXTRA_LIBS): Assign to 'W32API_LIBS' 
	macro expander.
	  (HFLAGS): Append 'WIN32_CUI_SUBSYS_FLAG' macro expander.
	* kernel/.cvsignore: Remove all "*_mw32.*" files from list.
	* kernel/Makefile.in: Rip out all of the "*_mw32.*" stuff.
	* missing/Makefile.in: Likewise.
	* missing/snprintf/Makefile.in: Likewise.
	* missing/util/timestuff.c: Fix bug introduced by the usage of 
	'acdefs.h' rather than command line defs. Include 'acdefs.h' if 
	'HAVE_ACDEFS_H' is defined.
	* sdl/Makefile.in: Rip out all of the "*_mw32.*" stuff.
	  (ALL_WIN32_CFLAGS): Assign to 'WIN32_GUI_SUBSYS_FLAG' macro 
	epxander.
	* tcltk/Makefile.in (ALL_WIN32_CFLAGS): Assign to 
	'WIN32_GUI_SUBSYS_FLAG'.
	* x11/Makefile.in (HFLAGS): Append 'WIN32_GUI_SUBSYS_FLAG' macro 
	expander.

2004-07-05  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improvements to and remodeling of the configure/make system. 
	(Part of them were actually done about 6 weeks ago....)
	* configure.in: Remove or comment out things pertaining to 
	dual-mode setup. Write clearer and more visible comments. Get 
	rid of the 'enable-sdl' flag. Change name of 'enable-ui' flag 
	to 'enable-default-ui'. Only add build warning flags to GNU C 
	compilers, and not others. Force GNU C compilers on platforms with 
	decent headers to always compile with strict ANSI compliance 
	settings. Add tests to determine which curses lib to use, and to 
	determine if curses is even available. Test for missing Xlib 
	functions, and report ones that are missing. Add some cache 
	checkpointing (still need to add restore points). Get the sizeof 
	various integers. Configure 'kernel/acdefs.h' from 
	'kernel/acdefs.h.in'. Comment out apparently unused 'unix' config.
	Make the 'tcl' and 'tk' configs more selective and use literals 
	rather than variables to make an annoying autoconf warning 
	disappear. Define results of many of the tests, as well as 
	important paths, inside 'kernel/acdefs.h'.
	  (WIN32_GUI_SUBSYS_FLAG): New variable. (Will be used with MinGW32 
	and possibly Cygwin.)
	  (WIN32_CUI_SUBSYS_FLAG): New variable. (Will be used with MinGW32 
	and possibly Cygwin.)
	  (CONFIGTARGET): Delete variable. No longer used.
	* configure: Regenerated.
	* curses/Makefile.in (CURSES_LIB): Set from 'CURSES_LIB' macro 
	expander rather than hard-code.
	  (CCONQ_PRECHECK): New variable. Set from 'CCONQ_PRECHECK' 
	macro expander.
	  (CCONQ_EXEC_NAME): Add 'CCONQ_PRECHECK' to target.
	  (cconq-fail): New target. Abort build if attempted on an 
	unconfigured curses interface. (TODO: Add these prechecks for the 
	other interfaces.)
	* sdl/Makefile.in (HFLAGS): Use the 'HFLAGS' macro expander instead 
	of the 'ALT_HFLAGS' one.
	* kernel/Makefile.in (ALL_CFLAGS): Do not pass compiler define 
	flags for 'XCONQSCORES' and 'XCONQDATA'. Files will rely on 
	the 'acdefs.h' instead.
	  (distclean): Delete 'acdefs.h' on cleanup.
	* kernel/config.h: Include 'acdefs.h', if 'HAVE_ACDEFS_H' is 
	defined.
	* kernel/acdefs.h.in: New file. Useful defines which are set by the 
	configure script.
	* kernel/.cvsignore: Add 'acdefs.h' to list.

2004-07-04  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve and update Web site documentation.
	[htdocs]/ftp.html: Briefly describe the various user interfaces.
	[htdocs]/changelog.html: Add new executive summary of changes 
	since 2004/05/23.

2004-07-04  Eric McDonald  <mcdonald@phy.cmich.edu>

	Revise and update some of the Windows build/install docs.
	* INSTALL-win.txt: Mention the avilability of a standard CVS 
	client for MSYS. Revise the procedure for dealing with the build 
	of the SDL interface under MSYS+MinGW32.

2004-07-04  Hans Ronne <hronne@comhem.se>

	Fix bungee paratrooper bug (modified after Henry Cobb).
	* combat.c (capture_unit): Try to move into the captured
	unit if possible, or else move into its cell.

2004-07-04  Hans Ronne <hronne@comhem.se>

	Make feature legends scale correctly also at low magnifications.
	* macconq.h (draw_name): Add int size argument.
	* macdraw.h (draw_unit_name): Pass 1 as size to draw_name.
	(draw_name): Set font sizes and styles accoridng to size.
	* macmap.c (draw_feature_names): Pass size as argument to
	draw_name instead of tweaking sh.

	* Use styled text to set the blurb font in the Mac interface.
	* macinit.c (draw_newgame_dialog): Call TESetSelect and
	TESetStyle with TextStyle argument. Set to System 12 ifdef
	MACOSX else Helvetica 12.
	
	* Rearrange the New Game window in order to make room for a 
	bigger blurb. Move the checkbox to a more logical position.
	* Xconq.r (DITL129 "New Game"): Move checkbox to a position
	under the game list. Increase the size of the blurb box. Move the
	right side items 1 pixel to the right.
	* tkconq.tcl (add_new_game_dialog_items): Comment out the
	banner label. Move checkbutton to the left side and tweak its 
	padding. Reorder packing of right side items and tweak padding.	

	Change "Variants" to "Setup Variants" in the variants dialogs.
	* macinit.c (create_variants_dialog): Add "Setup" to spbuf.
	* tkconq.tcl (add_variants_dialog_items): Add "Setup" to the
	label.

2004-07-04  Eric McDonald  <mcdonald@phy.cmich.edu>

	Minor tweaks to the installer setup script.
	* xconq.nsi: Disable the shortcut to Cconq; it is not desired at 
	this point. Include the Tcl/Tk DLL's in the file manifest so that 
	Xconq actually runs on the target machines.

2004-07-04  Eric McDonald  <mcdonald@phy.cmich.edu>

	Move the Windows installer setup script to the top-level directory 
	since it encompasses multiple interfaces. Update the installer 
	setup script for its new vantage point. Add Sdlconq. Place the 
	Tcl and Tk scripts in the 'tcltk' directory instead of a sibling 
	directory.
	* xconq.nsi: New file.
	* tcltk/xconq.nsi: Delete file.

	Clean the RPM setup file out of the 'tcltk' dir.
	* tcltk/xconq.spec: Delete file.

2004-07-04  Eric McDonald  <mcdonald@phy.cmich.edu>

	Get rid of console window for Windows apps. (This is known to 
	break Cconq built with Cygwin and MinGW32; I should be able to 
	address that issue in the next 24 hours.) (This probably also 
	breaks the Cygwin build outright. I will attempt to address that 
	in the next day as well; in the meanwhile, simply get rid of the 
	"-mwindows" flag in the makefiles, if it is causing build problems.)
	(The MinGW32 Cconq can be made to work by changing "-mwindows" to 
	"-mconsole" and "-lcurses" to "-lpdcurses", assuming that the 
	MinGW32 PDcurses lib is installed.)
	* configure.in: Compile with "-mwindows" everywhere.

	Look harder for a working definition of 'struct timeval'.
	* configure.in: Look for 'struct timeval' in 'winsock.h' if using 
	MinGW32 with strict ANSI C compliance, because the definition of 
	the struct will be preprocessed out of the usual suspects.
	* configure: Regenerated.

2004-07-04  Hans Ronne <hronne@comhem.se>

	Fix Open/Save game bug on the tcltk Windows platform.
	* tkconq.tcl (popup_open_dialog): Save and restore the working
	directory.

2004-07-03  Hans Ronne <hronne@comhem.se>

	Fix mouse position problems due to MacOS X messing around 
	with the current port. Note: only those GetMouse calls that are
	not called directly or indirectly from do_mouse_down were dealt
	with since the port is set by do_mouse_down.
	* macmd.c (get_a_position): Set the port to frontmap->window
	before calling GetMouse.
	(get_a_unit): Set the port to frontmap->window before calling 
	GetMouse.
	(get_a_visible_unit): Set the port to frontmap->window before 
	calling GetMouse.
	* macmenus.c (set_position_modally): Set the port to 
	frontmap->window before calling GetMouse.
	* macunit.c (find_unit_closeup): Return if unit does not exist.
	(create_unit_closeup): Rewrite positioning code. Set the port
	to transportcloseup->window before calling GetMouse.
	
	Improve the command error feedback in the Mac interface.
	* maccmd.c (get_a_visible_unit): Call notify with a message
	if no unit was found.

2004-07-03  Hans Ronne <hronne@comhem.se>

	Fix pointer bug that caused MacOS X crashes.
	* maccmd.c (get_a_visible_unit): Test if *unitp instead of
	unitp exists before proceeding.
	
	Restore the ability to fill up created units automatically until a 
	better solution has been implemented.
	* actions.c (make_unit_complete): Comment in the code again.

2004-07-03  Hans Ronne <hronne@comhem.se>

	Fix unit view macro iteration bug that would hang some games.
	* side.h (nextview): New macro. Return unit_view_next for 
	top units and uv->nexthere for occs.
	(for_all_view_stack): Remove obsolete comment about see-all.
	(for_all_view_stack_with_occs): Rewrite using nextview
	instead of uv->nexthere or unit_view_next everywhere.
	(for_all_occupant_views_with_occs): Add doxygen comments.
	* ai.c (enemies_present): Use for_all_view_stack_with_occs
	instead of for_all_view_stack now when it is safe.

2004-07-02  Hans Ronne <hronne@comhem.se>

	Remove some stuff that sneaked in with the latest checkin.
	* task.c (do_hit_unit_task): Remove hacks and debugging
	code.

2004-07-01  Hans Ronne <hronne@comhem.se>

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

	More fixes to the unit view code. Adapt handling of the hash table
	so that it works correctly with the new occupant-transport code.
	* side.c (unit_view_at): Check that uv has no transport.
	(unit_view_next): Check that uv has no transport.
	(find_unit_view): New function and prototype.
	(add_unit_view): Rewrite. First check if a transport exists, and
	create its unit view if necessary. Call remove_unit_view also if 
	there is a transport mismatch between unit and uview. Only splice 
	uview into the hash table by calling add_unit_view_raw if unit is 
	a top unit. Else splice uview into the occupant list of its transport.
	(add_unit_view_raw): Use wrapx in the hash table.
	(remove_unit_view): Use wrapx in the hash table. Splice uview
	out of either the occupant list of its transport or the hash table but 
	not both.
	(see_cell): Always call add_cover if side->see_all is true. 
	* side.h (for_all_view_stack_with_occs): Use unit_view_next
	instead of nexthere at the top level of the stack so that the hash
	table is handled correctly.
	(for_all_occupant_views_with_occs): New macro.
	
	Fix bug in the see-all unit view code that caused some independent 
	units to be invisible. Note: this is a temp fix. Should figure out why
	setting the coverage area layer to 1 does not work as expected.
	* side.c (calc_coverage): Call cover_area for all units if see-all
	is true for the side.

	Make sure that all unit view macros iterate also over occupants 
	if necessary. Note: some of these cases may have to be re-examined
	if bugs appear. One bug did appear in enemies_present.
	* ai.c (enemies_present): Add comment about hangs if using
	for_all_view_stack_with_occs instead of for_all_view_stack.
	(check_current_target): Use for_all_view_stack_with_occs
	instead of for_all_view_stack.
	(preferred_build_type): Use for_all_view_stack_with_occs
	instead of for_all_view_stack.
	* aiutil.c (can_be_blocked_by_any_known_enemy_at_if_at): Use
	for_all_view_stack_with_occs instead of for_all_view_stack.
	* mplayer.c (review_theaters): Use for_all_view_stack_with_occs
	instead of for_all_view_stack.
	(estimate_strengths): Use for_all_view_stack_with_occs instead 
	of for_all_view_stack.
	* plan.c (ai_score_potential_victim_occupants): Use
	for_all_occupant_views_with_occs instead of for_all_occupant_views.
	(alternate_target_here): Use for_all_view_stack_with_occs instead 
	of for_all_view_stack.
	(ai_victim_here): Add comment about iteration over occs.
	(indep_captureable_here): Add comment about iteration over occs.
	(useful_captureable_here): Add comment about iteration over occs.
	(can_capture_neighbor): Add comment about iteration over occs.
	(target_here): Use for_all_view_stack_with_occs instead of 
	for_all_view_stack.
	* side.c (side_sees_image): Use for_all_view_stack_with_occs
	instead of for_all_view_stack. Also test that uview->id equals
	unit->id.
	(reset_view): Use for_all_view_stack_with_occs instead of 
	for_all_view_stack.
	(all_see_leave): Use for_all_view_stack_with_occs instead of 
	for_all_view_stack.
	* task.c (do_build_task): Re-enable commented out unit view code.
	(do_hit_position_task): Use for_all_view_stack_with_occs instead 
	of for_all_view_stack.
	(target_visible): Use for_all_view_stack_with_occs instead of 
	for_all_view_stack.
	* ui.c (find_unit_view_at): Use for_all_view_stack_with_occs 
	instead of for_all_view_stack.
	* write.c (write_side_view): Use for_all_view_stack_with_occs 
	instead of for_all_view_stack.
	* tkcmd.c (common_fire_at): Use for_all_view_stack_with_occs 
	instead of for_all_view_stack.
	* tkmap.c (draw_current): Use for_all_view_stack_with_occs 
	instead of for_all_view_stack.

	Fix bug that would cause empty images to be written to saved games,
	which in turn would cause terrain without tiled images to be drawn
	as random color 1 x 1 boxes at low magnifications. 
	* imf.c (write_imf): Skip empty 1 x 1 images.

2004-06-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Updates to Wreckreation. New variants "Land of Lakes" and 
	"Iced Earth". Rivers and elevations now generated as well. 
	Some terrain image changes to make the game look better.
	* lib/wreckreation.g, lib/wreckr-t.g

2004-06-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Updates to Wreckreation to further showcase the new terrain 
	generation capabilities and to make it look better (maybe).
	* lib/wreckreation.g, lib/wreckr-t.g

2004-06-27  Hans Ronne <hronne@comhem.se>

	Fix image path problem in the MacOS Classic Imfapp.
	* imfapp.c (initial_vrefnum): Declare extern short.
	(initial_dirid): Declare extern long.
	(init_library_path): New function and prototype.
	(main): Set initial_vrefnum and initial_dirid. Call
	init_library_path.

	Add missing prototype in mkterr.c.
	* mkterr.c (any_borders_in_dir): Declare extern.

2004-06-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve terrain generation capabilities.
	* table.def (tt_adj_terr_effect_chance): New table, 
	'adjacent-terrain-effect-chance'.
	  (tt_adj_terr_effect_passes): New table, 
	'adjacent-terrain-effect-passes'.
	  (tt_adj_terr_border): New table, 'adjacent-terrain-border'.
	  (tt_adj_terr_border_chance): New table, 
	'adjacent-terrain-border-chance'.
	* mkterr.c (fix_adjacent_terrain): Keep track of the number of 
	terrain-change passes performed. Consider 
	'tt_adj_terr_effect_chance' and 'tt_adj_terr_effect_passes' before 
	performing a terrain change. Once the cell types are no longer 
	changing, then consider borders between the cells. Make any 
	necessary border adjustments in a single pass, as determined by 
	'tt_adj_terr_border' and 'tt_adj_terr_border_chance'. Also add some 
	warnings if the GDL specifies a terrain type that is incompatible 
	with either the cell terrain alteration or border terrain alteration.
	* doc/refman.texi (adjacent-terrain-effect): Rewrite entry, so that 
	it doesn't babble on about things that Xconq doesn't actually do.
	  (adjacent-terrain-effect-chance): New entry.
	  (adjacent-terrain-effect-passes): New entry.
	  (adjacent-terrain-border): New entry.
	  (adjacent-terrain-border-chance): New entry.

	New terrain generation configuration and variants for Wreckreation.
	* lib/wreckr-t.g: New file. Contains new terrain definitions and 
	relationships between terrain types.
	* lib/wreckreation.g: Include module 'wreckr-t'. Set terrain 
	generation paramters for default game and variants. Showcase how 
	islands of limited size can be made in the middle of oceans, 
	and how shoreline can be probabilistically added to select terrain 
	types. Also, show off the new GDL arithmetic being used in 
	practical (rather than contrived) situations.

2004-06-27  Hans Ronne <hronne@comhem.se>

	Improve the AI:s performance by extending its default tactical range.
	Make the enemy alert range a separate unit property with a smaller 
	default value, so that defensive reactions are not triggered too often
	due to the extended tactical range.
	* utype.def (u_ai_tactical_range): Increase default to 12 cells.
	(u_ai_enemy_alert_range): New unit property. Set default to 6.
	* ai.c (undefended_neighbour): Change u_ai_tactical_range to
	u_ai_enemy_alert_range.
	* combat.c (enough_to_garrison): Change u_ai_tactical_range to
	u_ai_enemy_alert_range.
	* help.c (describe_utype_ai_attributes): Add description of
	u_ai_enemy_alert_range. Set missing hasattribs to TRUE for
	u_ai_tactical_range.
	* plan.c (plan_offense): Don't multiply u_ai_tactical_range by 3 
	since its default value has been increased.
	* run.c (auto_pick_new_build_task): Change u_ai_tactical_range 
	to u_ai_enemy_alert_range.
	
	Fix bug that would cause a hit-unit target to be confused with a 
	named unit (usually its transport) in the same cell.
	* nlang.c (task_desc): Also check that unit2->type equals arg2 
	in case TASK_HIT_UNIT before using its name.
	
	Fix long-standing issue with weird combat reports of the type:
	"Your 1st ballista misses the Sumerian city Uruk - and destroys 
	occupant the Sumerian 22d spearmen!".
	* combat.c (reckon_damage): Pass fire on to report_damage.
	(report_damage): Add int fire argument. Pass either miss-fire 
	or miss-attack to report_combat.
	* nlang.c (report_combat): Report failed attempts to fire as
	"fires at" and failed attacks as "attacks". Successful hits are 
	still reported as "hits" irrespective of the method.

2004-06-26  Hans Ronne <hronne@comhem.se>

	Fix unit view code so that it works correctly also when see-all is
	true. Note: this was achieved by eliminating the special treatment 
	of see-all games which used the bogus tmp_unit_view instead of
	real unit views. A better (or at least more efficient) fix might be
	to make the bogus code work correctly. However, this requires
	additional copies of tmp_unit_view to be allocated for occupants
	and stacked units, so the gains are questionable. An advantage of
	using real unit views also in see-all games is that unit view bugs
	will become more transparent. Final note: the interface code still
	uses real units instead of unit views for drawing in see-all games. 
	Should consider always using unit views here as well. This would,
	however, require special kernel code for the designer and end of 
	game modes, both of which rely on drawing real units.
	* init.c (init_view): Don't pass through if side->see_all. Call
	init_view_cell for all cells also if g_see_all is true.
	* side.c (tmp_unit_view): Remove static UnitView.
	(unit_view_at): Remove see-all branch with tmp_unit_view.
	(unit_view_next): Remove see-all branch with tmp_unit_view.
	(cover_area): Don't return if side->see_all. Call cover_area_1 
	if side2->see_all.
	(all_see_occupy): Don't pass through if side->see_all. 
	(all_see_leave): Don't pass through if side->see_all. 
	(see_cell): Don't pass through if side->see_all. Break out of
	for_all_stack after the first call to add-cover.

2004-06-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Reinstate AI victim scoring penalty for being more than an 
	estimated one turn from an enemy unit. Also, specially mark 
	sidenote comments that were recently altered.
	* plan.c (ai_score_potential_victim): Calculate 'oprange' using 
	an unit's near maximal MP rather than 'real_operating_range_best'.
	Reinstate turns (was previously referred to as distance, which may 
	been confusing) penalty to enemy unit. Mark sidenote comments.
	  (ai_victim_here): Mark sidenote comments.

2004-06-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix crashing bug from recent checkin.
	* unit.c (will_not_move): Wrap inner logic in another pair of 
	parentheses to guard alternate test against using a null pointer 
	'unit->plan->maingoal'.

2004-06-26  Hans Ronne <hronne@comhem.se>

	Fix so that closer targets are hit before more distant ones.
	* plan.c (ai_score_potential_victim): Weigh in distance by 
	dividing rating by isqrt(dist) + 1. Add a 50% bonus if enemy 
	is within striking distance.

	Fix parsing problems in CodeWarrior.
	* ai.c (ai_go_after_victim): Remove parentheses within 
	multi-line comments.
	* plan.c (ai_victim_here): Remove parentheses within 
	multi-line comments.
	(ai_score_potential_victim): Remove parentheses within 
	multi-line comments.

	Make more intelligent decisions about whether or not to share
	materials with another unit.
	* actions.c (make_unit_complete): Comment out code that fills
	up the new unit. Let the economy code decide instead.
	* run2.c (try_transfer_aux): Don't transfer fuel to units that 
	have no plans to move. Always let such units give away fuel.

	Improve unit production and consumption calculations.
	* unit.h (total_production): New prototype. 
	(total_consumption): New prototype. 
	(base_consumption): New prototype.
	(survival_time): Prototype here instead.
	(will_not_move): New prototype.
	(needs_material_to_move): New prototype.
	(needs_material_to_survive): New prototype.
	* unit.c (total_production): New function. Add in production
	by advanced units and basic terrain productivity effect.
	(total_consumption): New function. Add in size-dependent
	consumption by advanced units.
	(base_consumption): New function. Consider only base
	consumption and occuplant effect, like base_production.
	(survival_time): Rewrite using total_production and
	total_consumption and move here for general use.
	(will_not_move): New function. Test if a unit is immobile 
	or plans to stay in the same place.
	(needs_material_to_move): New function.
	(needs_material_to_survive): New function.
	* run2.c (survival_time): Move static function and 
	prototype to unit.c and unit.h.

	Improve handling of materials generated by advanced units.
	* run2.c (run_turn_start): Call run_advanced_units before
	run_economy and run_supply so that materials are distributed
	in the same turn as they are generated.

	Make the dummy global g_people work for advanced units.
	* gvar.def (g_people): Set it to true by default.
	* run.c (run_population): Return if g_people is false.

	Improve doctrines for resupply and rearmament.
	* side.h (a_doctrine): Add resupply_complete, 
	rearm_complete, min_turns_food and min_distance_fuel. 
	* side.c (new_doctrine): Init resupply_complete and
	rearm_complete to 100, min_turns_food to 5 and
	min_distance_fuel to 20.
	
	Move 8-bit character conversion code to mac.c.
	* lisp.c (use_mac_charcodes): Don't declare here.
	(convert_mac_charcodes): Declare extern int ifdef MAC.
	(strmgetc): Remove 8-bit character conversion code. Call 
	convert_mac_charcodes instead.
	* mac.c (use_mac_charcodes): Declare extern int.
	(convert_mac_charcodes): New function and prototype.

	Fix bogus init warning for images without palette color info.
	* imf.c (parse_lisp_palette_entry): Return if colorcomp
	equals lispnil.

2004-06-26  Eric McDonald  <mcdonald@phy.cmich.edu>

	New section, new function definitions, and more examples in 
	game design manual.
	* doc/refman.texi (remove): Add a remark on a special case.
	  (remove-list): New entry. Describe the new 'remove-list' GDL 
	function. Add a few examples of this.
	  (Arithmetic Expressions): New node and subsection of "Language 
	Syntax". Add plenty of notes on arithmetic in GDL. Add plenty of 
	examples near the end.
	  (+): New entry. Describe the '+' GDL function.
	  (-): New entry. Describe the '-' GDL function.
	  (*): New entry. Describe the '*' GDL function.
	  (/): New entry. Describe the '/' GDL function.

	Add a small horde of new autotests for the GDL 'remove-list' and 
	arithmetic functions.
	* autotest.c (test_read_form): Make sure that 'remove-list' 
	properly handles the cases when either the list of items to 
	remove or the source list is nil. Test addition in many different 
	circumstances, including number-number, number-list. list-number, 
	and list-list. Test reflection, negation, subtraction, 
	multiplication, and division. Make sure that nil operands are 
	handled correctly.

2004-06-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add 'remove-list' GDL function. Add a simple test to make sure that 
	it works. Also, improve the output of the autotester slightly.
	* keyword.def (K_REMOVE_LIST): New keyword "remove-list".
	* lisp.c (remove_list_from_list): New function. Recursively 
	descends through the list of items to be removed, and removes them 
	from the source list during ascent, always returning the 
	modified result for the next higher level of removal.
	  (eval): Add a case for 'K_REMOVE_LIST' and have it call 
	'remove_list_from_list'.
	* lisp.h (remove_list_from_list): New prototype.
	* autotest.c (test_read_form): Split the list checker and 
	arithmetic evaluation test into two seaprate tests. Add new test 
	for 'remove-list'. Add a notification on test completion. 
	(Need more tests.)
	  (test_victim_here): Unmix code and data so that strict ANSI C 
	compiler will not complain.
	  (test_packed_boolean_tables): Add a notification on test 
	completion.
	  (autotest): Add a notification at the end of initialization and 
	beginning of test runs.

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

	* kernel/autotest.c (autotest): Disable test which is now failing
	(it would appear to be some kind of bug in the test code about
	whether we give tasks to the unit we set up).

	* kernel/autotest.c (test_read_form): New test, tests a simple
	case of reading (+ 5 6) and then evaluating it to 11.

2004-06-24  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update documentation on 'quote', 'append', and 'remove', and 
	include some examples of them and analysis of those examples.
	* doc/refman.texi: Add examples and analysis of those examples to 
	the end of the "Lists" subsection of the "Language Syntax" 
	section.
	  (append): Rewrite for greater clarity.
	  (remove): Likewise, and correct erroneous parameter list for 
	this function.

2004-06-24  Hans Ronne <hronne@comhem.se>

	Fix serious bug in the move code that allowed units to move 
	even if they lacked the necessary fuel for a move (sic).
	* move.c (check_move_action): Also check supply[m] against 
	um_consumption_per_move, not just against um_to_move.

2004-06-23  Hans Ronne <hronne@comhem.se>

	Add the ability to disable materials production and consumption
	for brainless indepside units (fixes problem with huge production 
	bursts from captured units due to accumulated materials).
	* gvar.def (g_indepside_has_economy): New global. Defaults
	to true.
	* run.c (run_advanced_units): Check indepside units for
	g_indepside_has_economy and continue if false.
	* macdefs.h (diConfigureSideEconomy): Add dialog item.
	* macinit.c (configure_indepside_dialog): Add code that 
	handles diConfigureSideEconomy.
	* Xconq.r (DITL 138 "Configure Indepside"): Add checkbox.
	(DLOG 138 "Configure Indepside"): Tweak size.
	* tkmain.c(tk_set_indepside_options): Handle setting of
	g_indepside_has_economy.
	(tk_start_player_setup_stage): Init indepside_economy.
	* tkconq.tcl (indepside_economy): New global. Set to 0.
	(popup_indepside_config): Add new checkbutton that sets
	new_indepside_economy.
	(ok_indepside): Set indepside_economy and add it as
	argument to set_indepside_options.

	Fix bug that would add one free cp to units that were created 
	by an advanced unit (failure to set args[1] would cause find_unit
	to fail in run_construction and thus give one build round without
	materials consumption if consumption-on-creation was 0).
	* actions.c (do_create_in_action): Set plan->tasks->args[1]
	to newunit->id.
	(do_create_at_action): Set plan->tasks->args[1] to 
	newunit->id.

2004-06-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix serious bug that was recently introduced into Lisp 
	tokenizer. Get rid of increment and decrement functionality 
	for now. Add negation functionality. Return identities when "+" 
	and "*" are called without operands.
	* lisp.c (read_form_aux): Make sure that the lookahead char 
	when deciding between the "+" and "-" operators and a number is 
	placed back on the stream, whether or not an operator is 
	detected. Otherwise, parsing of negative numbers will fail, 
	silently resulting in their replacement by the default quantity 
	of 0.
	  (eval_arithmetic_expression): Remove the increment/decrement 
	behavior of "+" and "-", respectively, when they encounter a 
	single operand. Instead, make "+" return the operand itself, 
	and make "-" return the negation of the operand. Also, make 
	"+" return the additive identity, "0", and "*" return the 
	multiplicative identity, "1", when called without operands; this 
	is done to be more consistent with the Lisp standard.

	Throw some more tests of the arithmetic expressions into 
	Wreckreation.
	* lib/wreckreation.g

2004-06-22  Hans Ronne <hronne@comhem.se>

	Fix compile error under C++ due to type mismatches.
	* lisp.c (eval_arithmetic_expression): Typecast return 
	of keyword_code to enum keywords.

	Fix so that the Mac and Windows tcltk apps compile again when
	using CodeWarrior and plain C.
	* ui.h (BMAP_BYTE): Always define as char ifdef MWERKS.

2004-06-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix commutativity problem for 'K_MINUS' and 'K_DIVIDE', when 
	the first operand is a list. Also, add increment and decrement 
	unary usages for 'K_PLUS' and 'K_MINUS' respectively.
	* lisp.c (eval_arithmetic_expression): Form new expression list 
	in its natural order rather than commuting operands of 
	non-communitive operators in a misguided attempt to avoid a 
	non-existent problem (I "outsmarted" myself yesterday). Also, 
	when only one operand is supplied and the operation is addition or 
	subtraction, for new expression list with "1" supplied as the 
	second operand, and then recursively evaluate; this handles 
	incrementing and decrementing.

	Add examples of increment and decrement, multiple divisors, and 
	division with a list as the first operand to Wreckreation.
	* lib/wreckreation.g: More fun with 'village' units and 'food' 
	and 'orc-food' materials.

2004-06-21  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add the four basic arithmetic operators to the GDL interpreter.
	* keyword.def (K_MULTIPLY): New keyword: "*".
	  (K_PLUS): New keyword: "+".
	  (K_MINUS): New keyword: "-".
	  (K_DIVIDE): New keyword: "/".
	* lisp.h (eval_arithmetic_expression): New prototype.
	* lisp.c (read_form_aux): Hack in an interception of the K_PLUS 
	and K_MINUS keywords during tokenization of numbers.
	  (eval): Add cases for 'K_PLUS', 'K_MINUS', 'K_MULTIPLY', and 
	'K_DIVIDE'. Call 'eval_arithmetic_expression'.
	  (eval_arithmetic_expression): New function. Handles arithmetic 
	operations on lists of values, lists of values and lists, and 
	lists of lists. Checks for divide-by-zero, in the case of 
	division. Performs list length matching when lists are being 
	used. (Note: Shortcuts for increment-by-one and decrement-by-one 
	still need to be implemented.) (Note: Common Lisp defines 
	"(/ n)" as meaning to take the reciprocal of "n". Since, GDL does 
	not have a rational number type, we obviously cannot follow suite.)
	(Note: This function has no explicit logic for dice specs; 
	probably best to avoid doing math with them, until a good way to 
	handle them can be figured out.)

	Update games library to remove any potential conflicts with the 
	new operators.
	* lib/classic.g: Change "*" to "T". Change "/" to "B".
	* lib/fantasy.g: Change "/" to "_". Change "*" to "~".
	* lib/flattop.g: Change "/" to "B".
	* lib/future.g: Change "/" to "B". Change "*" to "T".
	* lib/greek.g: Change "/" to "F". Change "*" to "~".
	* lib/lhs.g: Change "*" to "T".
	* lib/lhsunit.g: Change "/" to "B". Change "*" to "T".
	* lib/log.g: Change "/" to "B". Change "*" to "~".
	* lib/logunit.g: Change "/" to "B". Change "*" to "~".
	* lib/lord-rings.g: Change "*" to "V".
	* lib/napoleon.g: Change "/" to "E".
	* lib/neurope.g: Change "*" to "T".
	* lib/postmodern.g: Change "/" to "_". Change "*" to "T".
	* lib/rom-civ-war.g: Change "/" to "_".
	* lib/roman.g: Change "/" to "_". Change "*" to "C".
	* lib/russian-rev.g: Change "/" to "F". Change "*" to "~".
	* lib/standard.g: Change "/" to "B". Change "*" to "T".
	* lib/stdunit.g: Change "/" to "B". Change "*" to "T".
	* lib/time.g: Change "*" to "T". Change "/" to "_".
	* lib/wizard.g: Change "*" to "T".

	Throw together some crude illustrations and tests of the new 
	operators in Wreckreation.
	* lib/wreckreation.g: Calculate a Village's storage capacity for 
	food using the new operators. Leave some commented out examples.

2004-06-20  Hans Ronne <hronne@comhem.se>

	Fix image loading problems due to MAXIMAGEFAMILIES being 
	exceeded after addition of the korean war images.
	* imf.h (MAXIMAGEFAMILIES): Bump it to 3000.
	* imf.c (get_imf): Add init_warning when MAXIMAGEFAMILIES 
	has been exceeded. 

	Fix so that brainless building by indepside works again.
	* run.c (move_one_unit_multiple): Add test for indep(unit)
	&& g_indepside_can_build when calling run_construction.

2004-06-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	Cache results of recently added ACP and MP artithmetic 
	functions since the values do not change as the game progresses.
	Finish replacing 'u_acp' and 'u_speed' calls in the kernel, 
	where appropriate.
	* conq.h (type_max_speed_from_any_occs): New prototype. Move from 
	'kernel.h'.
	  (type_max_speed): Likewise.
	  (cache__type_max_night_acp_from_any_terrains): Declare new 
	extern variable.
	  (cache__type_max_acp_from_any_occs): Likewise.
	  (cache__type_max_acp): Likewise.
	  (cache__type_max_speed_from_any_occs): Likewise.
	  (cache__type_max_speed): Likewise.
	* kernel.h (type_max_speed_from_any_occs): Delete prototype. The 
	'help.c' and 'ai'c' files were not accessing this prototype, so 
	target a wider audience by moving it to 'conq.h' where its ACP 
	kindred reside.
	  (type_max_speed): Likewise.
	* actions.c (cache__type_max_night_acp_from_any_terrains): 
	Define new variable.
	  (cache__type_max_acp_from_any_occs): Likewise.
	  (cache__type_max_acp): Likewise.
	  (type_max_night_acp_from_any_terrains): Add caching of results.
	  (type_max_acp_from_any_occs): Likewise.
	  (type_max_acp): Likewise.
	* move.c (cache__type_max_speed_from_any_occs): Define new 
	variable.
	  (cache__type_max_speed): Likewise.
	  (type_max_speed_from_any_occs): Add caching of results.
	  (type_max_speed): Likewise.
	  (can_move_at_all): Call 'type_max_speed' instead of 'u_speed'.
	  (do_enter_action): Call 'unit_speed' instead of 'u_speed'.
	  (check_enter_action): Call 'unit_speed' instead of reinventing 
	it.
	  (type_can_have_enough_mp): Call 'type_max_speed' instead of 
	'u_speed'.
	* ai.c (accelerator): Call 'type_max_speed' instead of 'u_speed'.
	  (ai_init_shared): Likewise.
	  (basic_worth): Likewise.
	  (offensive_worth): Likewise.
	  (exploring_worth): Likewise.
	  (colonizing_worth): Likewise.
	  (is_base_for): Likewise.
	  (is_carrier_for): Likewise.
	* help.c (type_max_speed): Delete prototype.
	  (describe_utype): Call 'type_max_acp' instead of 'u_acp'.
	  (may_detonate): Likewise.
	  (describe_ttype): Likewise, and call 'type_max_speed' instead 
	of 'u_speed'.
	* init.c (calculate_globals): Initialize the type-based ACP and 
	MP calculation caches.
	* iplayer.c (iplayer_adjust_plan): Call 'type_max_acp' instead 
	of 'u_acp'.
	* mplayer.c (mplayer_adjust_plan): Likewise.
	  (mplayer_finish_movement): Likewise.
	* plan.c (find_alternate_hit_target): Likewise.
	  (range_left): Call 'type_max_speed' instead of 'u_speed'.
	* run2.c (try_transfer_aux): Likewise.
	* task.c (do_move_dir_task): Simplify logic for trying to figure 
	out whether to wait and gain more MP before attempting next move 
	or to abort the movement.
	  (do_collect_task): Call 'type_max_acp' instead of 'u_acp'.
	  (plausible_move_dir): Add comment about what really should be 
	done regarding the movement arithmetic in this function.
	* ui.c (oneliner): Call 'type_max_acp' instead of 'u_acp'.
	  (advance_into_cell): Likewise.
	* unit.c (can_load_at): Likewise.
	  (operating_range_best): Likewise, and call 'type_max_speed' 
	instead of 'u_speed'.
	  (real_operating_range_best): Likewise.

	Minor fix to help system.
	* help.c (describe_utype): Report fire damage with 'tb_dice_spec' 
	instead of nothing.
	* nlang.c (dice_desc): Handle the < 0 case by merely printing the 
	number instead of trying to decode it. This case is significant 
	because 'tb_dice_desc' can pass in -1 for those tables or 
	properties that allow it.

	New option for Wreckreation.
	* lib/wreckreation.g: New variant, "Wimp Mode". Sets 
	'docile-indepside', and turns off AI control of the indepside.

2004-06-20  Hans Ronne <hronne@comhem.se>

	Fix glitch in drawing of unit info in the Mac interface.
	* macmap.c (draw_unit_info): Adds back test for topunith > 0
	since not all functions that call draw_unit_info test for this.
	(draw_top_line): Test for toplineh > 0 just to make sure.

	Add the North Korean flag to the Second Korean War game.
	* korea-rules.g (side 1 nk): Use flag-north-korea instead 
	of flag-cambodia.

	Change the tcltk Variants Setup dialog so that only active
	variants are shown as checkbuttons.
	* tkconq.tcl (add_variants_dialog_items): Rewrite the
	checkbutton code. Set row and column individually for 
	each active variant.

	Fix compile errors.
	* help.c (type_max_speed): Add missing prototype.
	(describe_utype_movement): Ditto.

2004-06-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	More support and fixes for universal ACP and MP arithmetic.
	* kernel.h (has_enough_mp): New prototype.
	  (can_have_enough_mp): New prototype. From 'move.c'.
	  (type_max_speed_from_any_occs): New prototype.
	  (type_max_speed): Likewise.
	* move.c (can_have_enough_mp): Delete prototype.
	  (has_enough_mp): New function. Does the unit presently have 
	enough MP?
	  (can_have_enough_mp): If the unit cannot be an actor, then return 
	'FALSE'. Calculate the 'unit_speed' of the agent, not the actor.
	  (type_max_speed_from_any_occs): New function. What is the most 
	speed an occupant can contribute to the transport type?
	  (type_max_speed): New function. What is the most speed the unit 
	type can ever have?

	Bugfixes and improvements to the help system.
	* help.c (table_default): Find default value based on accessor 
	key rather than memory key. Memory key may be NULL if the table is 
	unused in the game.
	  (describe_utype): Put most of the movement-related scribes into a 
	new, separate function, 'describe_utype_movement', and call that 
	function instead.
	  (describe_utype_movement): New function. Reports on most things 
	pertaining to an unit type's movement abilities. Call 
	'type_max_speed' to determine unit type's ultimate mobility.
	  (describe_utype_actions): Make sure that the default value 
	macros are being used everywhere. Update the calls to 
	'table_default' to be keyed on table accessors rather than the 
	addresses of table memory arrays.
	  (describe_side_attributes): Make sure that the 'hasattribs' 
	flag is set whenever it should be. Remove extraneous newline.

	Minor improvements to Wreckreation.
	* lib/wreckreation.g: Set the AI peace and war garrisons for all 
	units.

2004-06-19  Eric McDonald  <mcdonald@phy.cmich.edu>

	Remove some debugging code accidentally left in the help system.
	* help.c (describe_utype_actions): Remove some offset calculation 
	code that was used to debug an erroneous macro.

2004-06-20  Hans Ronne <hronne@comhem.se>

	Fix compile errors due to type mismatches.
	* help.c (uprop_i_default): Remove "i <" from tested condition.
	(uprop_s_default): Remove "i <" from tested condition.

	Add survey and attack cursors to the Mac tcltk interface. Also 
	add the currently unused build cursor.
	* tkmac.r (CURS 139 "Lookglass"): New cursor.
	(CURS 140 "Attack"): New cursor.
	(CURS 141 "Build"): New cursor.
	* tkinit.c (init_cursors): Init the above cursors.

2004-06-19  Hans Ronne <hronne@comhem.se>

	Fix cursor adjustment after multiple build attempts by saving the
	old mode, entering build_mode, and restoring the old mode when done.
	* tkconq.h (a_map): Add enum mapmode prevmode.
	* tkcmd.c (do_build): Enter build_mode and save mode as prevmode.
	Reset mode to prevmode when done.
	(aux_build): Reset mode to prevmode when done.
	(aux_build_2): Reset mode to prevmode when done.
	* tkinit.c (init_cursors): Use the plus cursor instead of the build
	cursor on non-Mac systems.

	Fix so that the build_mode cursor is retained during multiple
	failed attempts to pick build sites.
	* tkcmd.c (aux_build_2): Don't call grok_position since it resets
	the cursor. Test in_area instead. Call ask_position_done instead of
	clear_command_line when done so that the cursor is restored.
	
	Reduce buzzing within the tcltk autoscrolling code.
	* tkmain.c (update_mouseover): Check the cursor position before
	calling autoscroll. Reset the scroll mode when done.
	(update_world_mouseover): Check the cursor position before
	calling autoscroll. Reset the scroll mode when done.

	Add native cursors to the Mac tcltk interface instead of the 
	non-working X bitmaps.
	* tkmac.r (CURS 138 "Shoot"): New cursor.
	(CURS 154 "OpenCross"): New cursor.
	(CURS 155 "AllMove"): New cursor.
	(CURS 156 "NoMove"): New cursor.
	(CURS 201 "Cell"): New cursor.
	(CURS 202 "Unit"): New cursor.
	(CURS 203 "People"): New cursor.
	(CURS 204 "Material"): New cursor.
	(CURS 205 "Feature"): New cursor.
	(CURS 206 "Elevation"): New cursor.
	(CURS 207 "Temperature"): New cursor.
	(CURS 208 "Clouds"): New cursor.
	(CURS 209 "Winds"): New cursor.
	(CURS 210 "View"): New cursor.
	(CURS 291 "Bord"): New cursor.
	(CURS 292 "Conn"): New cursor.
	(CURS 293 "Coat"): New cursor.
	(CURS 401 "Left"): New cursor.
	(CURS 402 "Right"): New cursor.
	(CURS 403 "Down"): New cursor.
	(CURS 404 "Up"): New cursor.
	* tkinit.c (init_cursors): Init the native Mac cursors by 
	calling Tk_GetCursor instead of Tk_GetCursorFromData.

	Fix so that a unit is unselected when its closeup is closed.
	* macunit.c (hit_closeup_dialog): Unselect the unit in 
	frontmap when done.

2004-06-19  Eric McDonald  <mcdonald@phy.cmich.edu>

	Transplant type-based ACP computations to a new home so that they 
	can be used by more functions.
	* conq.h (type_max_night_acp_from_any_terrains): New prototype
	from 'aiutil.h'.
	  (type_max_acp_from_any_occs): Likewise.
	  (type_max_acp): Likewise.
	* actions.c (type_max_night_acp_from_any_terrains): New function 
	from 'aiutil.c'.
	  (type_max_acp_from_any_occs): Likewise.
	  (type_max_acp): Likewise.
	* aiutil.h (type_max_night_acp_from_any_terrains): Move prototype
	to 'conq.h'.
	  (type_max_acp_from_any_occs): Likewise.
	  (type_max_acp): Likewise.
	* aiutil.c (type_max_night_acp_from_any_terrains): Move function 
	to 'actions.c'.
	  (type_max_acp_from_any_occs): Likewise.
	  (type_max_acp): Likewise.

	Make a substitute implementation of the 'offsetof' macro available 
	to more functions.
	* config.h (offsetof): Define, if not already defined. Borrow the 
	substitute definition from 'types.c'.
	* types.c (OFFS): Use the now preexisting definition of 'offsetof'.

	More improvements to the help system.
	* help.c (table_default): New function. Return the default value of 
	a given table. Lookup is done by memory tag.
	  (uprop_i_default): New function. Return the default value of an 
	integer property at the given offset in the 'Utype' struct. Lookup 
	is done by offset.
	  (uprop_s_default): New function. Return the default string of a 
	string property at the given offset in the 'Utype' struct. Lookup 
	is done by offset.
	  (UPROP_I_DEFAULT): New macro. Wraps 'uprop_i_default' so that 
	unit properties can be accessed by offset tag rather than offset.
	  (UPROP_S_DEFAULT): New macro. Wraps 'uprop_s_default' so that 
	unit properties can be accessed by offset tag rather than offset.
	  (UPROP_L_DEFAULT): New macro. Returns 'lispnil'.
	  (describe_utype): Continue to farm pieces out to smaller aux 
	functions, such as 'describe_utype_side_attributes' and 
	'describe_utype_actions'.
	  (describe_utype_actions): New function. Describe actions and 
	ACP limits for an unit type.
	  (describe_utype_side_attributes): New function. Describe what 
	sides the unit type can belong to, how many of the type can be on 
	a side, etc....

	Add a TODO note.
	* run2.c (new_acp_for_turn_if_at): Mention that it would be nice 
	to have experience effects on ACP.

2004-06-19  Eric McDonald  <mcdonald@phy.cmich.edu>

	More improvements and updates to the help system.
	* help.c (describe_utype_ai_attributes): New function; called on 
	behalf of 'describe_utype'. Describes the various AI settings for 
	the unit type.
	  (describe_utype): Start to break down into separate routines for 
	easier management of the code. Remove comment stating that the 
	defaults should come the *.def files; (obviously they should, and 
	I know how to address the issue and will do so soon). Format 
	some source code lines to fit in 80 cols. Call 
	'describe_utype_ai_attributes' after everything else has been 
	added to the text buffer.

2004-06-19  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix calls to 'choose_from_weighted_list'.
	* combat.c (model_1_attack): Do not use static variable, 
	'total_encounter_weights', which had the scope of the compilation 
	unit. The total weights must be recomputed every time, since 
	different units may have different encounter lists.
	  (determine_destruction_result): Do not use static variable 
	'total_encounter_weights', which had the scope of the compilation 
	unit. The total weights must be recomputed every time, since 
	different units may have different destruction results. Also, add 
	safeguard so that if the returned list entry is 'lispnil' (for 
	whatever arcane reason), then do not issue a warning, but assume 
	that table lookups should be performed instead.

	More progress to modularized, universal ACP and MP arithmetic. 
	(This is not a finished project. Further modularization can be 
	done by breaking down 'new_acp_for_turn'. Also, computation 
	functions should be available for unit views and not just units.)
	* move.c (can_have_enough_mp): New function. Checks to see if the 
	unit could ever have enough MP at its present position based on 
	whether it could ever have enough ACP at its present position.
	  (check_move_action): Call 'can_have_enough_mp' instead of 
	reinventing the MP artihmetic wheel.
	* run2.c (new_acp_for_turn_if_at): New function. Assume the code 
	of the 'new_acp_for_turn' function, except use generic coords 
	instead of the unit's position.
	  (new_acp_for_turn): Convert into a wrapper for 
	'new_acp_for_turn_if_at' that supplies the unit's coords as the 
	'x' and 'y' arguments to the function.

	Minor improvements to Wreckreation.
	* lib/wreckreation.g: Tweak some of the combat tables (ahead of a 
	complete overhaul of them).

2004-06-17  Hans Ronne <hronne@comhem.se>

	Fix so that tha Variants Setup dialog is bypassed if no variants 
	are available.
	*macinit.c (show_variants_dialog): Move mainmodule test and
	call to interpret_variants here. Add direct call to launch_game
	if any_variants is false.
	* tkmain.c (tk_any_variants): New TclCmdFn and prototype.
	(initial_ui_init): Define tcl_cmd "any_variants".
	* tkconq.tcl (popup_variants_dialog): Call interpret_variants
	already here instead. Check any_variants and call set_variants
	for the master program if false.
	(add_variants_dialog_items): Don't call interpret_variants 
	here.

2004-06-16  Hans Ronne <hronne@comhem.se>

	Bug fixes and upgrades to Second Korean War from Elijah Meeks.
	*korea-rules (withdraw-chance-to-attack): Commented out, 
	causes hangs.
	(unit-type): Added about 70 units to represent Regular, Veteran, 
	Crack and Elite units.
	(int-aid): New unit to represent international support.
	(brigade): New unit icon.
	(side): re-ordered the sides due to bug when an inactive side exists 
	at the start of the side list. This occurred with China as side 1, now 
	that a variant exists to disable it.
	(imf): New graphic - ko-advanced-tank.
	*u-korea: added two new cities to China, seems to help the AI.
	*korea-2006 (variant): "Eighteen Month War" 18 turn limit.
	(variant): "Three Year War" default, 36 turn limit.
	(variant): "Russian AI" a few changes to default AI
	settings, to make the computer a little more headstrong.
	(variant): "Varyag" makes the Chinese carrier an optional rather 
	than a default unit.
	(variant): "US Pacific Fleet" makes one US Carrier Group and three 
	US Surface Fleets optional rather than default units.
	(variant): "No China" removes the Chinese side and awards bonus 
	points to the North Korean side.
	(variant): "No Japan" removes the Japanese side and awards bonus 
	points to the South Korean side.
	(brigade): New unit icon.
	(side): updated the side properties to reflect new order.
	*korea.gif: New graphic added for 'ko-advanced-tank'.

2004-06-15  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update player documentation to reflect the existence of the 
	'change-type' command.
	* doc/commands.texi (change-type): New entry. Describe command.

	Replace ACP night and occupant effect tables with expanded 
	choices. Deal with the ACP computation issues raised by the 
	presence of tables which can add/subtract ACP.
	* table.def (ut_acp_night_effect): Delete entry.
	  (uu_acp_occ_effect): Likewise.
	  (ut_night_adds_acp): New entry.
	  (ut_night_multiplies_acp): New entry.
	  (uu_occ_adds_acp): New entry.
	  (uu_occ_multiplies_acp): New entry.
	* conq.h (compute_acp): Delete prototpe.
	  (set_unit_acp_for_turn): New prototype.
	* kernel.h (new_acp_for_turn): New prototype.
	  (total_acp_for_turn): New prototype.
	  (can_be_actor): New prototype.
	* aiutil.h (type_max_night_acp_from_terrains): New prototype.
	  (type_max_acp_from_occs): New prototype.
	  (type_max_acp): New prototype.
	* aiutil.c (type_max_night_acp_from_terrains): New function. 
	What is the maximum ACP that can be gained from being on any 
	terrain at night?
	  (type_max_acp_from_occs): New function. What is the maximum ACP 
	that be gained from having any occupant?
	  (type_max_acp): New function. What is the maximum ACP that an 
	unit can have?
	* actions.c (make_unit_complete): Call 'set_unit_acp_for_turn' 
	rather than 'compute_acp'.
	  (can_have_enough_acp): If the unit type could not generally have 
	enough ACP that does not preclude the particular unit from having 
	enough ACP. See whether 'new_acp_for_turn' can give the unit 
	enough ACP.
	* ai.c (can_develop_on): Call 'type_max_acp' rather than 'u_acp'.
	  (accelerator): Likewise.
	  (offensive_worth): Likewise.
	  (defensive_worth): Likewise.
	  (exploring_worth): Likewise.
	  (colonizing_worth); Likewise.
	  (siege_worth): Likewise.
	  (basic_capture_worth): Likewise.
	* move.c (check_move_action): Call 'new_acp_for_turn' instead of 
	'u_acp'.
	* nlang.c (acp_desc): Likewise.
	* plan.c (init_unit_plan): Call 'can_be_actor' instead of testing 
	'u_acp' and 'acp_indep'.
	  (plan_offense): Call 'type_max_acp' instead of 'u_acp'.
	  (plan_defense): Likewise.
	  (normal_completion_time): Likewise.
	  (est_completion_time): Likewise.
	* run2.c (compute_moves): Before assigning ACP to an unit, see 
	if its actor state needs to be updated. Also, if the unit does 
	not yet have a plan, then call 'init_unit_plan'; this is harmless 
	because that function will not give an unit a plan if it is not 
	supposed to have one.
	  (compute_acp): Delete function.
	  (new_acp_for_turn): New function. Calculate the new action 
	points that an unit would receive for a turn, given its present 
	situation, including things such as night and occupant ACP 
	addition.
	  (total_acp_for_turn): New function. Calculate the new action 
	points that an unit would receive for a turn, by taking into
	account 'new_acp_for_turn' plus the leftover ACP, all properly 
	clipped to be within upper and lower ACP limits for the unit.
	  (set_unit_acp_for_turn): New function. Do what 'compute_acp' 
	used to do. Rely upon 'total_acp_for_turn'.
	* task.c (do_move_dir_task): Call 'new_acp_for_turn' instead of 
	'u_acp'.
	  (plausible_move_dir): Likewise. And make sure that MP is being 
	compared to MP rather than ACP; we cannot assume an 1:1 
	correspondance between ACP and MP.
	* unit.c (can_be_actor): New function. Check if the unit is 
	ACP-independent or can have some ACP in its present condition.
	  (init_unit_actorstate): Call 'can_be_actor' instead of 'u_acp' 
	and 'acp_indep'.
	  (change_unit_type): Make sure that ACP of new type is 
	calculated after its HP, because damage effects are considered 
	by 'new_acp_for_turn'. Use 'new_acp_for_turn' and 
	'total_acp_for_turn' where appropriate.
	* help.c (describe_utype): Delete scribes for 'uu_acp_occ_effect' 
	and 'ut_acp_night_effect'. Add scribes for 'uu_occ_adds_acp', 
	'uu_occ_multiplies_acp', 'ut_night_adds_acp', and 
	'ut_night_multiplies_acp'.
	* doc/refman.texi (acp-night-effect): Delete entry.
	  (acp-occupant-effect): Likewise.
	  (night-adds-acp): New entry.
	  (night-multiplies-acp): New entry.
	  (occupant-adds-acp): New entry.
	  (occupant-multiplies-acp): New entry.
	* lib/bolodd2.g (acp-night-effect): Change to 
	'night-multiplies-acp'.
	* lib/bolodd3.g: Likewise.
	* lib/gettysburg.g: Likewise.
	* lib/panzer.g: Likewise.
	* lib/ww2-bn.g: Likewise.
	* lib/pgu.g: Likewise. Also, add newline to end of file.
	* lib/fred.g (acp-occupant-effect): Change to
	'occupant-multiplies-acp'.
	* lib/napoleon.g: Likewise.
	* lib/uu-bellum.g: Likewise.

	Provide an alternative to the combat protection tables as a means 
	of preventing/allowing capture.
	* gvar.def (prot_resists_capture): New GDL global variable:
	'protection-resists-capture'.
	* table.def (uu_any_neighbor_allows_capture_by): New entry.
	  (uu_any_neighbor_allows_capture_of): New entry.
	  (uu_stack_neighbor_allows_capture_by): New entry.
	  (uu_stack_neighbor_allows_capture_of): New entry.
	  (uu_occ_allows_capture_by): New entry.
	  (uu_occ_allows_capture_of): New entry.
	* combat.c (attempt_to_capture_unit): Conditionally use protection 
	tables. Unconditionally use new tables dedicated to determining 
	capture odds modifications.
	* doc/refman.texi (protection-resists-capture): New entry.
	  (occupant-allows-capture-by): New entry.
	  (stack-neighbor-allows-capture-by): New entry.
	  (any-neighbor-allows-capture-by): New entry.
	  (occupant-allows-capture-of): New entry.
	  (stack-neighbor-allows-capture-of): New entry.
	  (any-neighbor-allows-capture-of): New entry.

	Allow units to change type upon capture.
	* table.def (uu_changed_type_if_captured): New entry.
	* combat.c (capture_unit): Consider 'uu_changed_type_if_captured'. 
	If the table accessor returns a value other than NONUTYPE, then 
	attempt to change the prisoner's type, killing it if the type 
	change would be illegal.
	* doc/refman.texi (changed-type-if-captured): New entry.

	Improvements and modifications to the help system.
	* help.c (ua_table_row_not_default): New function. Checks to see 
	if any value in a row of a TableUA is not default.
	  (ua_table_row_desc): New function. Describe a row of a TableUA.
	  (describe_utype): Add scribes for 'uu_occ_adds_speed' and 
	'uu_occ_multiplies_speed'. Call 'tb_percent_desc' instead of 
	'tb_fraction_desc' for 'u_speed_min' and 'u_speed_max'. Change 
	formatter for the 'uu_detonation_damage_at' and 
	'uu_detonation_damage_adjacent' from NULL to 'tb_dice_spec'. Add 
	scribes for 'um_to_change_type', 'ua_to_change_type', 
	'uu_size_to_change_type', and 'uu_cxp_to_change_type'.

	Improvements to and comments for type changing code.
	* unit.c (budget_space_for_changed_type): New function. Find 
	space for changed type on behalf of 'change_unit_type'.
	  (try_changing_side_of_changed_type): New function. Try 
	changing an unit's side (if necessary) on behalf of 
	'change_unit_type'.
	  (desperately_try_changing_side_of_changed_type): New function. 
	Comment detailing why we don't try capturing a hostile transport. 
	Comment mentioning that the unit could attempt some sort of 
	escape. Kill unit.
	  (change_unit_type): Break parts of this function into the 
	aforementioned functions.
	  (wreck_unit): Add unused 'WreckType' values to the 'wrecktype' 
	switch to get rid of compiler warning.

	Some housekeeping of the table definitions.
	* table.def (uu_occ_adds_speed): Move entry to its correct 
	alphabetical position.

	Source formatting improvements.
	* ui.c (impl_move_to): Fit code to 80 cols so that it doesn't look like really, really, really, really, really, really, really, really long, unreadable crap.

	New version of Wreckreation.
	* wreckreation.g: Still not a full game, but not a simple testbed 
	either. Structure to be more like Bellum II in terms of 
	grouping related units and tables and properties, and in terms of 
	easily-searchable mnemonic tags. Demonstrate some of the new 
	capabilities just added to Xconq.

2004-06-14  Hans Ronne <hronne@comhem.se>

	Eliminate flicker of the line separating the unit info box and the
	map in the Mac interface.
	* macmap.c (draw_unit_info): Remove code that sets and restores
	the clipping region. Trim 1 pixel off the bottom of tmprect and move
	the separating line 1 pixel lower with respect to tmprect. Remove
	redundant test for topunit > 0.

	Fix buzzing in the acp-independent build code that contributed to
	the above flicker and also caused some other problems.
	* run.c (move_one_unit_multiple): Rewrite the acp-independent
	part so that run_construction is not called for human-controlled
	units that are waiting for tasks.

2004-06-12  Hans Ronne <hronne@comhem.se>

	Eliminate the need for a top level container directory also for
	the IMFApp application in the Windows tcltk installation.
	* iappwin32.c (extract_dirname): Prototype extern.
	(setargv): New function and prototype copied from tkwin32.c.
	(xcq_program_name): Declare extern char.
	(WinMain): Copy code from tkwin32.c that calls setargv, sets
	xcq_program_name and tells tcl to look for TCL_LIBRARY inside 
	xconq/tcltk unless explicitly set to another location by the user.

2004-06-12  Hans Ronne <hronne@comhem.se>

	Fix so that the Escape key works again for getting out of modal
	mode in the Mac interface.
	* macconq.c (handle_keystroke): Only capture Escape if we
	are in non-modal mode.

	Improve error feedback for commands in MOVE_TO_MODAL mode.
	* maccmd.c (do_move_to_command): Add error message if 
	get_a_position faisl and reset map_modal to MOVE_TO_MODAL.
	
	Add hints for getting out of BUILD_MODAL and MOVE_TO_MODAL
	when the command fails.
	* unit.c (unit_can_build_type_at): Add (or Escape to cancel)
	to all error notify messages.
	* ui.c (impl_move_to): Add (or Escape to cancel) to all error 
	notify messages.

	Fix so that build attempts outside the map gives a correct error
	message and retains BUILD_MODAL in the Mac interface.
	* maccmd.c (do_build_at): Add error message if get_a_position
	fails and restore BUILD_MODAL in that case.

	Reenable repeated command attempts in the Mac interface while 
	staying in modal mode for build and move-to commands.
	* macmouse.c (do_mouse_down_map_content): Reset map_modal
	to NO_MODAL only if not BUILD_MODAL or MOVE_TO_MODAL.

	Remove unnecessary updates of the build and change-type 
	dialogs in the Mac interface.
	* macconq.c (update_unit_acp_display): Comment out code
	that calls draw_unit_build_dialog and draw_change_type_dialog
	and add a short explanation.

	Fix bug in the Mac interface that would cause the P command
	to bring up the unit build dialog for the selected unit rather 
	than the current unit.
	* maccmd.c (do_build): Use frontmap->curunit instead of
	frontmap->selections[i].

	Fix update_unit_display buzzing for acp-independent units
	that were waiting for a build task.
	* plan.c (set_waiting_for_tasks): Return without calling
	update_unit_display if the flag already is set.

	Fix so that acp-independent building may resume in the same
	turn if we change the build task and thus may have enough
	material to build on the new unit type.
	* task.c (set_build_task): Call set_unit_buildingdone to reset
	the buildingdone flag to FALSE.
	(push_build_task): Call set_unit_buildingdone to reset the 
	buildingdone flag to FALSE.
	(resume_build_task): Call set_unit_buildingdone to reset the 
	buildingdone flag to FALSE.

	Make sure that the unit whose build tasks is being set in the
	BUILD_MODAL mode remains the current unit until the build
	location has been picked in the Mac interface.
	* maccmd.c (aux_build): Set frontmap->curunit to tmpcmdunit
	and unselect the old curunit if necessary.
	* macconq.c (maybe_select_next_unit): Go directly to blink 
	if in BUILD_MODAL mode.

	Fix bug that would cause graying out of old-style selection
	boxes and selection animations for acp-independent units in
	the Mac interface.
	* macmap.c (draw_selected_unit): Test for acp_indep(unit).
	(draw_selection_animation): Test for acp_indep(unit).

	Move checkboxes for the  currently unused global variants
	People, Economy and Supply to the right column in the Mac
	variants setup window.
	* Xconq.r (DITL 131 "Variants"): Rearrange checkboxes.
	Move title field and checkboxes. 

	Disable the ability to set the unit plan type and unit
	research topic in the Mac interface since these features
	are not fully supported in the kernel yet.
	* macmenus.c (enable_commands_for_unit): Disable
	the miMorePlanTypes item for now.
	* macunit.c (draw_advanced_content): Hide and disable
	diCityPlanCheck, diCityPlanPopup, diCityAdvanceCheck
	and diCityAdvancePopup for now.

	Remove drawing of inactive controls as grayed out items
	in the Mac interface.
	* macinit.c (create_variants_dialog): Call HideControl
	instead of HiliteControl for inactive checkboxes.
	(set_variant_item): Call HideControl instead of 
	HiliteControl for inactive items.

	Remove the frame around the Mac variant checkboxes. 
	* macdefs.h (diVariantsFrame): Remove constant.
	* macinit.c (draw_variants_dialog): Remove FrameRect
	call on diVariantsFrame.
	* Xconq.r (DITL 131 "Variants"): Remove framing box.
	Tweak positions of title and checkboxes.

	Remove the player setup window title since the other setup 
	windows lack titles in the Mac interface.
	* Xconq.r (DLOG 130 "Player Setup"): Remove the window 
	title. 

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

	Kill any changed type which has a side which is not compatible 
	with the transport it is in.
	* unit.c (change_unit_type): If the changing unit is in a 
	transport and is changing side, then see if the transport trusts 
	the new side. If not, then kill the unit.

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

	Hide the unused More Variants button in the Mac interface.
	* macinit.c (create_variants_dialog): Call HideDItem for
	diVariantsMoreVariants.
	
	Further improve handling of name fonts in MacOS X.
	* macdraw.c (draw_name): Handle Chicago, Gadget and 
	default case. Test for TARGET_API_MAC_CARBON instead
	of MACOSX. Add separate MACOSX branch for System font.
	
	Make application packages work correctly under MacOS 9.
	* macconq.c (main): Test for TARGET_API_MAC_CARBON
	instead of MACOSX when deciding if we need to climb out 
	of the application package.

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

	Add System font and more font sizes in the Mac interface.
	* macconq.h (System): New global.
	* macconq.c (System): Declare new global. 
	(init_fonts): Initialize System.
	* macdefs.h (mi11Points): New menu item.
	(mi13Points): New menu item.
	(miSystem): New menu item.
	* macprefs.c (set_preferences): Handle cases mi11Points,
	mi13Points and miSystem for all four font popup menus.
	(add_preferences_topic_items): Set miSystem for all
	four font popup menus.
	(save_preferences_settings): Handle case miSystem 
	for all four font popup menus.
	* Xconq.r (MENU 701 "Small Font Popup"): Add System.
	(MENU 702 "Small Size Popup"): Add 11 and 13 points.
	(MENU 703 "Large Font Popup"): Add System.
	(MENU 704 "Large Size Popup"): Add 11 and 13 points.
	(MENU 716 "Title Font Popup"): Add System.
	(MENU 717 "Title Size Popup"): Add 11 and 13 points.
	(MENU 718 "Name Font Popup"): Add System.
	(MENU 719 "Name Size Popup"): Add 11 and 13 points.
	
	Tweak name drawing code so that it works better with available
	fonts under MacOS X.
	* macconq.c (init_fonts): Use 13 points System as default large
	font and Helvetica as default name font ifdef MACOSX. Rearrange
	the code for clarity.
	* macdraw.c (draw_name): Rewrite with separate branches
	for MacOS X and Classic. Draw the core on top of the edge.

	Fix scrolling bug in the Mac find location command.
	* macmenus.c (do_find_location_mi): Rewrite using
	scroll_to_unit as template.
	
	Fix so that the world map does not overshadow the game 
	window under MacOS X.
	* macmap.c (create_map): Tweak MoveWindow arg.

2004-06-09  Hans Ronne <hronne@comhem.se>

	Fix so that the Open game dialog defaults to the save folder in
	both MacOS Classic and MacOS X.
	* macconq.h (DisplayGetFile): New prototype.
	* macconq.c (DisplayGetFile): New function.
	* macinit.c (open_game_dialog): Call FSMakeFSSpec to create
	fsspec before calling AECreateDesc in Carbon branch. Remove
	commented out setting of kNavSelectDefaultLocation. Rewrite
	Classic branch using DisplayGetFile instead of SFGetFile.

2004-06-09  Hans Ronne <hronne@comhem.se>

	Fix file format in recent checkin.
	* korea-2006.g: Nuke DOS linefeeds.
	* korea-rules.g: Nuke DOS linefeeds.
	* korea.imf: Nuke DOS linefeeds.

2004-06-09  Jim Kingdon  <kingdon@panix.com>

	* doc/refman.texi (Lexical Elements): Re-word text which might be
	(mis)interpreted to say that 99, 999, or 9999 are somehow magic.

2004-06-09  Hans Ronne <hronne@comhem.se>

	Updates from Elijah Meeks to the Second Korean War game.
	* korea.imf: Add trident type satellite and SAM image families.
	* korea.gif: Add trident type satellite and SAM images.
	* korea-rules.g (version): Bump to 1.11.
	(last-alliance-wins): Disable scorekeeper.
	(mostly-land): Set to true. Add ground-targets ai-tactical-range 8.
	(game-units): Set to true. Change spysat image-name to ko-sat and
	adn-types image-name to ko-sam.
	(use-zoc): Change name to enable-zoc. Set zoc-range to 0 for 
	u* miltran and u* civtran.
	(enable-supply): New variant.
	(spysat): Change acp-per-turn to 10.
	(port): Change acp-per-turn to 0.
	(smallport): Change acp-per-turn to 0.
	(milair): Change hp-max to 12.
	(wreckedcaf): Change acp-per-turn to 0.
	(heavydamagedcaf): Change acp-per-turn to 0.
	(damagedcaf): Change acp-per-turn to 0.
	(caf): Change acp-per-turn to 0.
	(wreckedcic): Change acp-per-turn to 0.
	(heavydamagedcic): Change acp-per-turn to 0.
	(damagedcic): Change acp-per-turn to 0.
	(cic): Change acp-per-turn to 0.
	(unit-size-as-occupant): Set to 1 for ship-types city.
	(unit-size-in-terrain): Set to 125 for ground-types sea-t*
	and ship-types land-t*.
	(supply): Change label to "Material".
	(unit-storage-x): Add supply storage for several unit types.
	(see-chance): Add u* u* 80 and satellite-types u* 70.
	(mp-to-enter-terrain): Set to 99 for several entries.
	(acp-to-create): Add city milair 10.
	(cp-on-creation): Add city milair 10.
	(acp-to-build): Add city milair 10.
	(cp_per-build): Add city milair 10.
	(consumption-on-creation): Add miltran points 20 and
	milair points 30.
	(create-range): Add city miltran 2, city coastal 2 and
	city coastsub 2.
	(base-consumption): Add transport-types points 1.
	(acp-to-attack): Add surface-types transport-types 3 and
	set sub-types air-types 99.
	(withdraw-chance-per-attack): Add several entries.
	(fire-hit-chance): Add several entries.
	(fire-damage): Add several entries.
	(damage): Add two entries.
	(capture-chance): Reduce from 100 for several entries.
	(protection): Add several entries.
	(occupant-escape-chance): New table.
	(ko-sat): Add image family.
	(ko-sam): Add image family.
	* korea-2006.g (version): Bump to 1.11.
	(game-units): Add new variant.
	(enable-zoc): Add new variant.
	(enable-supply): Add new variant.

	Make the Korean images generally available.
	* imf.dir: Add all unit image families from korean.imf.
	
2004-06-08  Hans Ronne <hronne@comhem.se>
	
	Add Elijah Meeks' new Second Korean War game.
	* korea-2006.g: New game module.
	* korea-rules.g: New base module.
	* t-korea.g: New terrain module.
	* u-korea.g: New unit module.
	* korea.imf: New image family file.
	* korea.gif: New unit image file.
	* game.dir: Add korea-2006.
	
	Add a North Korean flag to go with the game.
	* korea-rules (side nk): Use flag-north-korea.
	* flags16x16.gif: Add North Korean flag. Clean out some junk.
	* flags8x8.gif: Add North Korean flag. Clean out some junk.
	* flags.imf: Add flag-north-korea.
	* imf.dir: Add flag-north-korea.

	Fix drawing glitch at small magnifications in the Mac interface.
	* macrow.c (draw_row): Add 1 extra cell to the right if pwr < 3 
	in order to erase the shadow of a unit that just moved.

	Fix bug where the notification message for captured self-units 
	would use the new side's instead of the old side's unit numbers.
	* unit.c (change_unit_side): Save unitname before changing side.

2004-06-07  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix some poor judgement in the victim seeker.
	* plan.c (ai_consider_capturing): Do not bother preempting an 
	unit from the potential list of victims based on a crude 
	calculation of the complex criterion of whether it is worth the 
	risk of capturing. Instead, let the victim scoring (which contains 
	some similar logic) sort this out.

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

	Fix bug in change-type of occupant units. (Reported by Elijah 
	Meeks.)
	* unit.c (change_unit_type): Modify volume checking code to check if 
	a unit is on a transport. If so, then see if the changed type would 
	fit in the transport minus the unchanged type. If not, then see if 
	the changed type can coexist in the same cell as the transport. If 
	so, then place it there (with no ACP or MP charged).

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

	Improve filepath searching for the primary Tcl scripts for Tkconq 
	and Imfapp. (Note: We should consider making a common filepath 
	searching routine so that we do not have mostly duplicated code.)
	* tcltk/tkmain.c (initial_ui_init): Clear out accumulated filepath 
	searching spaghetti, and replace it with more compact and flexible 
	code that is common across all platforms.
	* tcltk/tkiapp.c (ui_init): Likewise.

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

	Fix bug that I accidentally introduced recently wrt model 1 combat 
	encounter results.
	* combat.c (model_1_attack): Explicitly call 'change_unit_side' 
	after an encounter, since the side passed to 'change_unit_type' is 
	not sufficient for the case where the new type can be on the old 
	type's side.

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

	Add new possibilities for unit wrecking behavior. This includes 
	a patch from Matthew Skala; thanks Matthew. Also, add new history 
	event types.
	* utype.def (u_destruction_result): New property. Works like 
	'u_encounter_result'; weighted list. Possible outcomes are 
	'vanish' and 'table'. Please see documentation for details.
	* table.def (ut_wrecked_type_if_attrited): New table. Wrecked utype 
	for an unit of a given type if it dies in terrain of a given type.
	  (uu_wrecked_type_if_killed): New table. Wrecked type for an unit 
	of a given type if it dies as a result of being killed by another 
	unit.
	  (um_wrecked_type_if_starved): New table. Wrecked type for an 
	unit of a given type if it dies for lack of a given material type.
	* history.def (unit-died-from-attrition): New event type.
	  (unit-wrecked-from-attrition): New event type.
	* history.h (enum loss_reasons): Add 'attrition_loss' to list of 
	possibilities.
	  (enum damage_reasons): Add 'starvation_dmg' to list of 
	possibilities.
	* history.c (record_unit_death): Handle the new event types as a 
	separate case.
	  (count_gain, count_loss): Add some sanity checks. (These came 
	about as a result of a long, fruitless debugging session. They are 
	worthwhile checks nonethless.)
	* kernel.h (enum WreckType): New enum used as a parameter for the 
	expanded 'wreck_unit' function. Has 'WRECK_TYPE_UNSPECIFIED', 
	'WRECK_TYPE_KILLED', 'WRECK_TYPE_STARVED', 'WRECK_TYPE_ACCIDENT', 
	'WRECK_TYPE_ATTRITED', 'WRECK_TYPE_TERRAIN', and 
	'WRECK_TYPE_SIDE_LOST' as possible values.
	  (wreck_unit): Modify prototype. Has 3 new paramters: 
	'wrecktype', 'wreckarg', and 'agent'.
	  (change_unit_type): Modify prototype. Has 1 new parameter: 
	'newside'.
	* nlang.c (historical_event_desc): Handle new event types.
	* actions.c (do_change_type_action): Pass a NULL new side argument 
	to 'change-unit-type'.
	* combat.c (DestructionResult): New enum. Has 'DESTRUCT_ORDINARY' 
	and 'DESTRUCT_VANISH' as possible values.
	  (determine_destruction_result): New function and prototype. 
	Parses a weighted list of possible destruction special outcomes.
	  (model_1_attack): Rearrange so that the call to 'change_unit_type' 
	is made after the new side has been determined, and pass that side 
	as the side argument to the function.
	  (damage_unit): Implement special destruction results. Implement 
	wrecking based on killer type, material the dying unit was 
	starved for, or terrain that proved fatal to the unit, in addition 
	to considering the normal general wrecked type (from 
	'u_wrecked_type'). Also, handle new history event types as part of 
	a case switch rather than an increasingly unwieldy chain of 
	conditionals. Supply appropriate arguments to 'wreck_unit'.
	* move.c (do_move_action): Call 'wreck-unit' with expanded 
	argument list when an unit wrecks on terrain.
	  (do_enter_action): Likewise.
	* run2.c (run_auto_change_types): Call 'change_unit_type' with 
	expanded argument list when an unit automatically changes type.
	  (run_unit_fates): Call 'change_unit_type' with expanded argument 
	list when an unit's fate is being decided when its side has lost.
	  (maybe_starve): Patch from Matthew Skala. Let 'damage_unit' 
	handle what happens to the starving unit rather than maintaining 
	separate logic in this function.
	* unit.c (change_unit_type): Add new parameter: 'newside'. Try to be 
	more intelligent wrt assigning a new side for a changed unit to 
	belong to. If the changed unit cannot belong on its current side, 
	then first try to assign it to side 'newside' if it is allowed 
	on that side. If not, then try to assign it to the independent side 
	if it is allowed on that side. If not, then kill it; there is no 
	other reasonable alternative. This supercedes the old behavior of 
	leaving the unit on a disallowed side.
	  (type_ever_available): Account for the new tables when 
	determining whether a side can ever possess a certain utype.
	  (wreck_unit): Three new parameters. Do not call 'change_unit_type' 
	immediately with the value of 'u_wrecked_type' for the given unit. 
	Instead, see if any of the more specific (new) wrecking tables 
	apply first.
	* world.c (change_terrain_type): Call 'wreck_unit' with expanded 
	argument list, if terrain becomes deadly under the unit's feet.
	* doc/refman.texi (destruction-result): New entry.
	  (wrecked-type-if-killed): New entry.
	  (wrecked-type-if-starved): New entry.
	  (wrecked-type-if-attrited): New entry.

	Fix serious bug with model 0 attack/fire hit damage computation.
	* combat.c (maybe_hit_unit): Only use 'fire_damage' function to 
	compute damage for firing, and use 'uu_damage' to compute damage 
	for melee attacks. This must be done because of the case where a 
	designer might set 'uu_fire_damage' to 0, which would cause melee 
	attacks to perpetually miss.

	Improve efficiency of attrition applicator at turn start.
	* run2.c (run_attrition): If the given unit cannot experience 
	attrition in the terrain that it is currently in, then do not 
	bother calling 'damage_unit'.

	Address nasty issue, capable of seriously challenging a game 
	designer's/Xconq hacker's sanity.
	* side.c (create_side): Do not try to do anything with a side if 
	no unit types have yet been defined. Attempting to manipulate a 
	side before unit types have been defined is the path to madness 
	and lost hours of Xconq productivity. Error-level feedback is quite 
	appropriate given that the alternative is segfaults from trying to 
	access unallocated memory when arrays of utype pointers are 
	involved. Bottom line: unit type forms _must_ precede side forms.

	Add simple, new game that showcases the new wrecking functionality.
	Warning: under development; may become a full-fledged game at some 
	point.
	* lib/wreckreation.g
	* lib/game.dir: Add 'wreckreation'.

2004-06-04  Hans Ronne <hronne@comhem.se>

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

	Another go at fixing the create/build bug reported by Jim.
	* task.c (do_build_task): Restore for_all_view_stack_with_occs
	since this macro was not the cause of the problem. Instead, comment 
	out the unit view code and replace it with direct access of units. 
	
	Improve diagonal keyboard scrolling in the tcltk interface.
	* tkconq.tcl (autoscroll): Call idletasks at the end instead if 
	either x or y was changed.
	
	Fix MacOS X specific background color glitch for the city map 
	in the advanced unit popup.
	* macunit.c (draw_city_map): Call RGBBackColor(&whitecolor)
	after setting the new port and RGBBackColor(&maincolor) when
	done.

	Fix MacOS X specific problem with setting the run length in the
	unit build dialog.
	* macunit.c (currunlength): New static pointer.
	(show_unit_build_dialog): Set currunlength to an empty string
	when creating the window. Set currunlength and diBuildEdit text
	to the unit's current build run length if empty.
	(draw_unit_build_dialog): Set diBuildEdit text to currunlength
	instead of checking the unit's run length.
	(do_key_down_build): Set currunlength from diBuildEdit text.
	(hit_unit_build_dialog): Set run from currunlength instead of
	diBuildEdit text before calling aux_build. Set currunlength to
	empty string when done.

2004-06-03  Jim Kingdon  <kingdon@panix.com>

	* test/.cvsignore: Add files written by "make cmds-diff" and "make
	syms-diff".

2004-05-29  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix another unit display list bug. (Reported by Lincoln Peters.)
	* unit.c (type_ever_available): Check 'u_auto_upgrade_to' for 
	another possible way a unit type may end up on a side.

2004-05-29  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve formation handling in the Tcl/Tk interface.
	* tcltk/tkconq.tcl (create_map_menus): Add "F" accelerator to the 
	"Set Formation" menu item.
	* tcltk/tkcmd.c (aux_set_formation): Give better feedback if a unit 
	attempts to form up around itself or an enemy unit. Add comment 
	about possibly allowing a unit to get into formation with an enemy 
	unit for the purpose of stalking it. Allow formation distances to 
	be set with the prefix argument.

	Fix memory leak in formation movement code.
	* plan.c (move_into_formation): Free goal object, since the reference 
	to it in the plan struct has already been set to NULL.

2004-05-27  Jim Kingdon  <kingdon@panix.com>

	* doc/design.texi (Buildings and Rubble Piles): Make a note that
	the example doesn't quite work in current xconq.  Anyone want to
	play with this more and contribute more of a real fix?

2004-05-25  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix yet another create/build bug. (Reported by Jim.)
	* task.c (do_build_task): The 'for_all_view_stack_with_occs' macro 
	appears not to handle the views of incomplete transports correctly.
	Use the 'for_all_view_stack' macro instead, until the other macro 
	is fixed.

2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	Make the Curses interface link against a complete PDCurses library 
	under MinGW32.
	* curses/cconq.c: 'COLS' and 'LINES' are defined in 'libpdcurses.a'. 
	Do not redefine them if the 'curses.h' header has defined 'PDCURSES'; 
	simply declare them extern instead.

2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	* aclocal.m4: Help the configure script find the Tcl/Tk config 
	files under MinGW32. Verify the Tcl/Tk directory paths specified 
	by the '{tcl,tk}Config.sh' files; under Cygwin they sometimes lie. 
	Filter out the raw names of static libs from the libs list; 
	the Cygwin 'tkConfig.sh' pretends that they are local files when 
	they are not. 
	* configure: Regenerated.

2004-05-23  Hans Ronne <hronne@comhem.se>

	Add the ability to do keyboard scrolling in the tcltk interface.
	* tkmain.c (tk_interp_key): Handle Left, Right, Up, Down, Home,
	End, Prior and Next keys by calling eval_tcl_cmd(autoscroll).
	* tkconq.tcl (make_normal_bindings): Add bypass for Left, Right, 
	Up, Down, Home, End, Prior and Next keys in the key binding.
	(autoscroll): Separate xview and yview calls so that diagonal
	scrolling is possible.
	
2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	* [htdocs]/ftp.html: Mention new RPM files which are avilable at 
	the FTP site.

2004-05-23  Hans Ronne <hronne@comhem.se>

	Eliminate the need for a top level container directory in the Windows
	tcltk installation.
	* tkwin32.c (WinMain): Set TCL_LIBRARY to look inside xconq/tcltk
	unless explicitly set to another location by the user.

2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	Reincarnate the old top-level RPM spec file as a multiple-package- 
	building monster. Support the building of all possible interfaces.
	* xconq.spec: Copy from 'tcltk/xconq.spec'. Heavily modify to 
	have multiple package sections: 'common', 'tcltk', 'curses', 'sdl', 
	and 'xtxaw'. Make 'xconq-common' conflict with older 'xconq' 
	packages. Make the UI packages require 'xconq-common'.

	Install the Xtconq man page in the correct location.
	* x11/Makefile.in (install-xtconq): Use 'man6dir' instead of 
	'mandir'.

	Add changelog page to Xconq Web site.
	* [htdocs]/changelog.html: New file. Contains a lightweight summary 
	of major changes and improvements between pre-releases.

2004-05-23  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve file path handling on the Unix platform.
	* unix.c (is_directory): New function. Tests if a given path 
	corresponds to a directory type filesystem entity.
	  (default_library_pathname): Do not simply return the value 
	from the environment or the compiled in one. Check to see if 
	the specified directory actually exists, and, if not, start 
	checking to see if the Xconq game library can be found in any 
	number of fairly standard locations.
	  (default_images_pathname): Likewise, but for the images 
	library.
	  (score_file_pathname): Likewise, but for the scorefiles location. 
	Also, attempt to create the scores directory if it does not exist.

	Improve the building of a dist tarball.
	* Makefile.in (DISTNAME): Change from date to version.
	  (dist): Wipe out any old tarballs. Automatically 
	use gzip compression. Insert 'DISTNAME' directory before all 
	file paths in the archive.

	Update and improve RPM spec file for Tcl/Tk interface.
	* tcltk/xconq.spec (Source0): Reflect the new name of the 
	dist tarball.

2004-05-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve handling of a changed unit's actor state.
	* actions.c (do_change_type_action): Make sure that ACP is only 
	deducted for units which have ACP and that it is deducted only down 
	to the minimum ACP the unit can have.
	* unit.h (type_acp_max): New macro. Determine the maximum ACP for a 
	unit type.
	* unit.c (change_unit_type): Carefully handle the various cases 
	that can occur when one unit is changing into another. Scale ACP 
	between old and new unit when both have ACP; make sure that new 
	unit does not have ACP if it cannot have or use ACP; give new unit 
	ACP a full serving of fresh ACP if it was formerly an unit type 
	which could not have or use ACP. Also, set the next action to 
	'ACTION_NONE' because it might be illegal with the new unit.

	Provide location for tests which have not been automated, and supply 
	the first unautomated test to it.
	* test/manual: New directory.
	* test/manual/change-type-acp-test.g: Make sure that the  
	actor state is set up correctly when a 'change-type' action 
	occurs. Permute through the various cases.

2004-05-22  Eric McDonald  <mcdonald@phy.cmich.edu>

	Restructure the Xconq main downloads Web page to more accurately 
	reflect the contents of the 'Unix' directory tree. Also add 
	HTML anchors to the various download sections by platform.
	* [htdocs]/ftp.html

2004-05-22  Hans Ronne <hronne@comhem.se>

	Update the Xconq web site with links to the 7.5 pre-release 
	packages for the Xconq Curses and SDL apps on the ftp site.
	* htdocs/ftp.html: Add links to the Curses and SDL apps.

2004-05-21  Hans Ronne <hronne@comhem.se>

	Make the curses interface build natively under Windows
	using curses.lib from the pdcurses 2.5 library.
	* cconq.c (MAC): Don't define it ifdef __MWERKS__
	(EXPORT): Define it ifdef WIN32 && ifndef __CYGWIN32__
	(COLS): Initialize to 0 ifdef WIN32 && ifndef __CYGWIN32__
	(LINES): Initialize to 0 ifdef WIN32 && ifndef __CYGWIN32__
	(stdscr): Declare ifdef WIN32 && ifndef __CYGWIN32__
	(main): Only set SIOUXSettings ifdef __MWERKS__ && ifdef MAC.
	(init_display): Set LINES to 24 and COLS to 80 and call newwin
	to get stdscr ifdef WIN32 && ifndef __CYGWIN32__
	* cdraw.c (draw_units): Remove unused int xw.
	* curses/Xconq.ico: Add Windows application icon file.
	* curses/Xcdoc.ico: Add Windows document icon file.
	* curses/Xconq.RC: Add Windows resource file.
	
	Don't assume that CodeWarrior always builds a Mac application.
	* libcurses/curses.h (MAC): Don't define it ifdef __MWERKS__
	(QD): Define it only ifdef MAC && ifdef __MWERKS__

	Fix compile problem in the Windows curses interface due 
	to the fullsized macro being passed a null pointer argument.
	* task.c (do_build_task): Test if view_unit(uview) exists
	before passing it to fullsized.

2004-05-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix crashing bug caused by damaged terrain attempting to convert 
        from a cell type to an auxiliary type. A cell type should always 
        be present in a cell. (Bug report and patch (with an addition 
        from me) from Matthew Skala.)
        * combat.c (damage_terrain): Downgrade an error to a warning and 
        make it more informative.
          (damaged_terrain_type): If the old terrain type was a cell type, 
        and the new one is not, then do not do anything.

2004-05-20  Hans Ronne <hronne@comhem.se>

	Update the Xconq web site with links to the 7.5 pre-release 
	packages on the ftp site.
	* htdocs/index.html: Update News and Links. Move old news 
	to older-news.
	* htdocs/older_news.html: Move old stuff here.
	* htdocs/ftp.html: Rewrite with 7.5 pre-release links.
	* htdocs/ftp-old.html: New page with 7.4 ftp links.

	Update the html manual from the texi sources.
	* htdocs/manual/*.html: Update all pages.
	
2004-05-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix serious flaw in the evaluation of the fire task. (Thanks to 
	Elijah Meeks for the bug report.)
	* task.c (fire_can_damage): Do not look at the 'uu_hit' and 
	'uu_damage' tables directly; instead, call 'fire_hit_chance' and 
	'fire_damage' respectively. Also, fix misplaced right parentheses 
	in the occupants loop, so that utypes other than 0 or 1 (booleans) 
	get compared with.
	  (fire_can_damage_or_capture): Rewrite in terms of 
	'fire_can_damage'; with the exception of the capture test and one 
	comment, the code was an exact duplicate of 'fire_can_damage'.

2004-05-20  Eric McDonald  <mcdonald@phy.cmich.edu>

	Improve top-level makefile template.
	* Makefile.in (html, clean-dvi, clean-html): Enable in the 
	top-level.
	  (dist): Build HTML docs in addition to the TexInfo docs. Also 
	filter out more developer-related directories when building a 
	tar file. (Note: Still need to think about prepending a path, 
	such as 'xconq' or 'xconq-$date' to the files in the archive.)

	Improve RPM spec file for the Tcl/Tk interface.
	* tcltk/xconq.spec (name, version, prereleaselvl, releaselvl, 
	releasedate, release): New user-defined macros for greater 
	flexibility.
	  (release): Compute macro from 'prereleaselvl', 'releaselvl', 
	'releasedate', and 'releaselvl' macros as appropriate. Please see 
	spec file's internal documentation for details.
	  (Name): Use '%{name}'.
	  (Epoch): Set to '1' to override older Xconq RPM's with different 
	versioning schemes that would cause RPM version logic to fail.
	  (Version): Use '%{version}'.
	  (Release): Use '%{release}'.
	  (Copyright): Delete field.
	  (License): New field, Assign value: "GPL".
	  (Source0): Determine based on '%{releasedate}'.
	  (buildroot): New user-defined macro which helps enable 
	the creation of Xconq RPM's as a regular user in a specified 
	directory hierarchy.
	  (BuildRoot): Use '%{buildroot}'.
	  (%build): Make the invocation of 'configure' use paths relative 
	to '%{buildroot}'. (Note: This creates issues with Xconq once its 
	binaries are installed in their intended locations. This should 
	be resolved in the Xconq filepath code pieces by falling back on 
	good guesses for the lib dir, if it cannot be found relative to 
	the '%{buildroot}/usr/share' one. The compiled-in dir should still 
	be tried first in case a developer has multiple instances of Xconq 
	installed on the system, but the fallbacks should also be present 
	to deal with the abovementioned RPM-related case and for general 
	robustness.)
	  (%install): Make sure that the Xconq scores directory is 
	properly created.
	  (%files): Add '%defattr(-,root,root,0755)' so that all installed 
	files will be owned by the 'root' group and user, have their 
	permissions left as Xconq's 'make install' set them, and set all 
	directories to be walked into by anyone. Add '%doc' directive for 
	'hacking.info' and wildcard the one for the 'xconq.6' man page. 
	The wildcard is needed if though there is only one item, because 
	some 'rpm-build' configurations will compress documentation and 
	others will not.
	  (%changelog): New section. Put in some initial fluff.

2004-05-20  Hans Ronne <hronne@comhem.se>

	Fix bug that prevented the designer save dialog in the tcltk
	interface from working correctly.
	* tkconq.tcl (save_design): Set dname to game_homedir and
	pass it as initialdir to tk_getSaveFile.

	Fix two bugs in handling of the prefixarg in the Mac interface.
	* maccmd.c (do_keyboard_command): Rewrite the decimal digit
	adding code so that it works correctly. Reset dside->prefixarg to
	(-1) after calling execute_command.

	Fix so that the Mac message dialog diMessageTo text edit field 
	works correctly.
	* maccmd.c (message_dialog): Get rid of nsidedesc. Add code that 
	sets sidedesc from diMessageTo. Set sidemask to ALLSIDES if 
	sidedesc is "all", else set sidemask to NOSIDES, pass sidedesc to 
	parse_side_spec and add the resulting side to sidemask.
	
	Fix bugs that caused popup menus to be much too wide under 
	Mac OSX 10.3. Thanks to Bob Beaty for reporting this bug.
	* Xconq.r (CNTL 240 "Plan Type Popup"): Tweak control size.
	(CNTL 700 "Preferences Popup"): Tweak control size.
	(CNTL 710 "Build Popup"): Tweak control size.
	(CNTL 711 "Science Popup"): Tweak control size.
	(CNTL 715 "City Build Popup"): Tweak control size.
	(DITL 700 "Preferences"): Tweak control size.
	(DITL 803 "Advanced Closeup"): Tweak control sizes.
	(DITL 804 "Unit Research"): Tweak control size.
	(DITL 807 "Unit Build"): Tweak control size.
	(DITL 808 "Unit Plan"): Tweak control size.
	
	Fix so that multiple rounds of building in the same turn is
	possible again for acp-independent units. Thanks to Matthew
	Skala for reporting this bug.
	* run.c (run_construction): Don't set the buildingdone flag
	for human-controlled units that completed a build task.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	Changes to Bellum Aeternum. Details contained in 
	'lib/ChangeLog-bellum'.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	More thoroughly fix the multiple move in direction bug 
	(original incomplete fix was yesterday).
	* task.c (do_move_dir_task): Rearrange code so that movement 
	is checked before entry into a unit. This allows a mover to 
	attempt entry into a cell that contains a trusted unit which 
	is not a transport for the mover but may be able to coexist 
	within the confines of the cell alongside the mover. If this 
	fails, then look for a possible trusted transport to enter.

2004-05-17  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix create/build bug that would prevent a unit which had 
	cancelled its plan (and thereby flushed its task agenda) from 
	building a new unit of a different type. (Reported by Tom 
	Low-Shang. Thanks for all the reports, Tom.) Also, slightly 
	restructure the code to make the various segments clearer and 
	remove a redundancy.
	* task.c (do_build_task): If an unit that is supposedly under 
	construction is alive (complete or incomplete), that is sufficient 
	for testing its completeness; its type does not need to be 
	matched to the utype indicated by the task. Indeed, the type 
	should not be matched, because the utype indicated by the task 
	may have changed, whether or not the unit under construction is 
	complete. Instead, the unit lookup should be flushed if the task utype 
	and the under-construction unit's type do not match. Also, if a 
	looked up unit is not type mismatched and is not complete, then do not 
	explicitly continue its build in the lookup code branch; fall through 
	to the bottom of the task handler, where building is done for any unit 
	under construction, whether it is found by the above lookup or by 
	searching for a unit to complete. Furthermore, explicitly ensure 
	that the search code is only being run if the lookup code fails to 
	find a designated unit under construction, or finds one but flushes it 
	for various reasons (including the one mentioned above).

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix display bug reported by Tom Low-Shang.
	* plan.c (set_waiting_for_tasks): Call 'update_unit_display' 
	and let it schedule a lazy (non-immediate) update. This has the 
	effect of clearing out failed tasks that still linger on the 
	display sometimes; it is harmless to be called by the AI. (Note: 
	The UI still needs to try and predict as many task failures as 
	possible, so that the user gets proper feedback. For example, 
	the multiple move direction command should check to see if the 
	very first cell in the given direction from the present position 
	blocks the attempted move, and warn the user if so.) 

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in return for resupply. Reported by Tom Low-Shang.
	* task.c (do_move_to_task): If a resupply is going to be 
	performed because an unspecified supply or multiple supplies 
	are missing, then only cancel the move/resupply combination if 
	all supplies have been replenished in this case.

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in multiple movement in a straight line direction so that 
	it is not impeded by friendly transports that can contain the 
	mover. Bug reported by Tom Low-Shang and confirmed by Jim. Also 
	improve the task code to use unit views instead of raw units so 
	that it cannot be used to cheat (e.g., stopping for unseen enemy 
	units).
	* task.c (do_move_dir_task): Rewrite the entry code to use unit 
	views. Also, scrutinize the failure return stati of 
	'check_enter_action' more closely. In some cases, the mover may 
	just need to rest and recover ACP before it can enter the transport.

2004-05-16  Jim Kingdon  <kingdon@panix.com>

	* kernel/autotest.c: Remove declaration of set_node_data; the code
	which called it was removed on 2 May 2004.

2004-05-16  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug reported by Martin Fehlhaber and confirmed by Tom 
	Low-Shang. (Thanks guys. Also thanks to Tom for testing the 
	patch.) Bug caused Xconq to freeze when using a multithreaded 
	Tcl interpreter; presumably this occurred because the interpreter 
	maintained a thread to handle events and it was doing a blocking 
	wait on something, which was causing other event handling requests 
	to go unanswered.
	* tcltk/tkmain.c (ui_mainloop): Call 'Tcl_DoOneEvent' with the 
	'TCL_DONT_WAIT' flag set.
	* tcltk/tkmap.c (mapw_display): Likewise.

2004-05-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in construction code that caused a build task to attempt 
	a build on a completed unit, and count that as the create/build 
	of a new unit. This burned through extra construction run length.
	Bug reported by Ed Oskiewicz.
	* task.c (do_build_task): If a complete unit is found based on the 
	unit ID from the builder's 'creation_id' or from the task, reset 
	the 'unit2' unit lookup variable to NULL, so that a new unit 
	will be created, if we don't return with 'TASK_IS_COMPLETE' 
	because more create/build runs must still be executed.

	Fix total failures of reason and logic on my part in recent 
	wake behavior patch (2004/05/13).
	* plan.c (wake_unit): Back out ACP-less unit interception. They 
	can't act anyway, so why make much ado about nothing? Furthermore, 
	they may have occupants that should be forcefully awakened.
	  (selectively_wake_unit): Check only transport's immediate 
	occs, and their occs (if any) when determining whether they should 
	be awakened or not. If so, then recursively call 
	'selectively_wake_unit', thereby letting them determine whether to 
	pass along the wake to their own occs based on their relationships 
	with those occs. Disable this revised code until a valid test case 
	can be created for it.

2004-05-14  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add documentation on new 'uu_can_recursively_wake' table.
	* doc/refman.texi (can-recursively-wake): New entry in 
	"Occupants and Transports" section.

2004-05-13  Eric McDonald  <mcdonald@phy.cmich.edu>

	Add patch from Matthew Skala (with modifications and additions 
	of my own). Give game designer control over recursive wakeup of 
	occs due to their transport spotting an enemy. Also, make any 
	assaulted unit immediately wake up.
	* table.def (uu_can_recursively_wake): New TableUU. Determines 
	whether transport should wake occ, if transport experiences 
	something that would make it wake.
	* kernel.h (wake_unit): Change argument name from 'wakeoccs' to 
	'forcewakeoccs'.
	  (selectively_wake_unit): New prototype.
	* plan.c (wake_unit): Add assert to make sure that a valid 
	unit was passed to the function. Add check to see if an attempt 
	to wake an ACP-less unit is being made, and simply return if so. 
	Change argument name from 'wakeocc' to 'forcewakeoccs'.
	  (selectively_wake_unit): New function. Calls 'wake_unit' based 
	on whether the occupant/transport allows the wakeup.
	* combat.c (hit_unit): Call 'wake_unit' on the assaulted unit if 
	it is still alive.
	* side.c (react_to_seen_unit): Call 'selectively_wake_unit' if 
	an enemy is spotted. Due not force occs to wake, but let the 
	'uu_can_recursively_wake' table decide for the time being. (In the 
	longer term, we may want to couple this logic with a 
	'wake-upon-enemy-seen' table or somesuch.) Add comment that the 
	'g_see_all()' branch in this function does not appear to get 
	executed in see-all games, because the coverage functions are 
	not called; this should be investigated further and fixed if 
	necessary.

2004-05-11  Eric McDonald  <mcdonald@phy.cmich.edu>

	Convert all 'char' and 'unsigned char' bitmap array types to 
	'BMAP_BYTE'.
	* ui.h (BMAP_BYTE): New macro. Determine type based on whether 
	we are using C or C++.
	* x11/xshowimf.c (BMAP_BYTE): Duplicate of previous macro, since 
	'xshowimf' does not use 'ui.h'.
	* addunits.b: Use 'BMAP_BYTE' macro.
	* ants.b: Likewise.
	* attackcurs.b: Likewise.
	* attackmask.b: Likewise.
	* bomb1.b: Likewise.
	* bomb2.b: Likewise.
	* bomb3.b: Likewise.
	* bomb4.b: Likewise.
	* bord32-1.b: Likewise.
	* bordcurs.b: Likewise.
	* buildcurs.b: Likewise.
	* buildmask.b: Likewise.
	* check.b: Likewise.
	* closer.b: Likewise.
	* conncurs.b: Likewise.
	* cursbord.b: Likewise.
	* cursbordm.b: Likewise.
	* curscell.b: Likewise.
	* curscellm.b: Likewise.
	* cursclouds.b: Likewise.
	* curscloudsm.b: Likewise.
	* curscoat.b: Likewise.
	* curscoatm.b: Likewise.
	* cursconn.b: Likewise.
	* cursconnm.b: Likewise.
	* curselev.b: Likewise.
	* curselevm.b: Likewise.
	* cursfeat.b: Likewise.
	* cursfeatm.b: Likewise.
	* cursmaterial.b: Likewise.
	* cursmaterialm.b: Likewise.
	* curspeop.b: Likewise.
	* curspeopm.b: Likewise.
	* curstemp.b: Likewise.
	* curstempm.b: Likewise.
	* cursunit.b: Likewise.
	* cursunitm.b: Likewise.
	* cursview.b: Likewise.
	* cursviewm.b: Likewise.
	* curswinds.b: Likewise.
	* curswindsm.b: Likewise.
	* darkgray.b: Likewise.
	* delay.b: Likewise.
	* dots.b: Likewise.
	* farther.b: Likewise.
	* feature.b: Likewise.
	* featuremask.b: Likewise.
	* fuzz16.b: Likewise.
	* fuzz32.b: Likewise.
	* fuzz64.b: Likewise.
	* gray.b: Likewise.
	* hex16.b: Likewise.
	* hex16b.b: Likewise.
	* hex16iso.b: Likewise.
	* hex32.b: Likewise.
	* hex32b.b: Likewise.
	* hex32iso.b: Likewise.
	* hex64.b: Likewise.
	* hex64b.b: Likewise.
	* hex64iso.b: Likewise.
	* hex8.b: Likewise.
	* hex8b.b: Likewise.
	* hex8iso.b: Likewise.
	* hexcurs.b: Likewise.
	* hexcursmask.b: Likewise.
	* hit.b: Likewise.
	* iso.b: Likewise.
	* kill.b: Likewise.
	* laurels.b: Likewise.
	* lookglass.b: Likewise.
	* lookmask.b: Likewise.
	* miss.b: Likewise.
	* movecurs.b: Likewise.
	* movemask.b: Likewise.
	* people.b: Likewise.
	* reserve.b: Likewise.
	* return.b: Likewise.
	* rotl.b: Likewise.
	* rotr.b: Likewise.
	* scursdown.b: Likewise.
	* scursdownm.b: Likewise.
	* scursleft.b: Likewise.
	* scursleftm.b: Likewise.
	* scursright.b: Likewise.
	* scursrightm.b: Likewise.
	* scursup.b: Likewise.
	* scursupm.b: Likewise.
	* shootcurs.b: Likewise.
	* shootmask.b: Likewise.
	* sleep.b: Likewise.
	* wind0.b: Likewise.
	* wind1e.b: Likewise.
	* wind1ne.b: Likewise.
	* wind1nw.b: Likewise.
	* wind1se.b: Likewise.
	* wind1sw.b: Likewise.
	* wind1w.b: Likewise.
	* wind2e.b: Likewise.
	* wind2ne.b: Likewise.
	* wind2nw.b: Likewise.
	* wind2se.b: Likewise.
	* wind2sw.b: Likewise.
	* wind2w.b: Likewise.
	* wind3e.b: Likewise.
	* wind3ne.b: Likewise.
	* wind3nw.b: Likewise.
	* wind3se.b: Likewise.
	* wind3sw.b: Likewise.
	* wind3w.b: Likewise.
	* wind4e.b: Likewise.
	* wind4ne.b: Likewise.
	* wind4nw.b: Likewise.
	* wind4se.b: Likewise.
	* wind4sw.b: Likewise.
	* wind4w.b: Likewise.

	* configure: Regenerated with newer version of autoconf.

	Changes to Bellum Aeternum. Please see 'ChangeLog-bellum' for 
	details.

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

	Fix crashes due to accessing an unallocated area layer 
	when writing some saved games.
	* write.c (write_side_view): Comment out code that tries 
	to access the bogus side->auxterrviewdate layer.

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

	Fix intermittent failure of the tcltk Xconq to pop up the 
	splash screen when launched from Classic under Mac OSX.
	* tkmac.c (popup_game_dialog): Don't prototype here 
	since it is already prototyped in tkconq.h.
	(main): Call popup_game_dialog before ui_mainloop to make 
	sure the splash screen always is popped up. Add comment 
	about command line code not yet being enabled.

	Fix problem with the splash screen sometimes popping
	up twice due to the above fix.
	* tkconq.tcl (popup_splash_screen): Test if .newgame
	exists already here and just return if true.
	(create_newgame_window): Remove code that tests if
	.newgame already exists.

	Make map view option settings for individual maps persist
	when the tcltk preferences are changed. This makes the tcltk
	interface behave like the Mac interface and eliminates the
	annoying behaviour where view settings for individual maps 
	would revert to default values whenever the preferences
	dialog was used.
	* tkconq.tcl (set_options_from_prefs): Iterate over
	map_options instead of default_map_options.
	(create_map_menus): Change default_map_options to
	map_options everywhere. Pass $mapn in the call to
	popup_meridian_interval_dialog.
	(set_map_view_option): Change default_map_options to
	map_options.
	(popup_meridian_interval_dialog): Change 
	default_map_options to map_options.
	(ok_meridian_interval): Change default_map_options to 
	map_options.
	(ok_preferences): Don't set default_map_options. Remove
	code that was commented out on 2004-05-08.
	(make_people_paint_frame): Change default_map_options 
	to map_options.
	(make_control_paint_frame): Change default_map_options 
	to map_options.
	(make_elev_paint_frame): Change default_map_options 
	to map_options.
	
	Fix bug that would cause the "Feature Names" and "Feature
	Boundaries" tcltk menu items to be checked even if features 
	do not exist.
	* tkconq.tcl (adjust_view_menu): Set the feature_names
	and feature_boundaries items to 0 if numfeatures is 0.

	Fix so that the meridian interval dialog works correctly 
	also with several open maps.
	* tkconq.tcl (meridian_map_number): New global.
	(popup_meridian_interval_dialog): Don't withdraw it (or
	check if it already exists). Instead, always destroy and
	re-create it, so that $mapn is set correctly each time. 
	Set new_meridian_interval to $prefs(meridian:interval).
	Pass meridian_map_number to ok_meridian_interval.
	(ok_meridian_interval): Don't withdraw .meridian.
	Destroy it instead when done.

	Add the ability to set the default meridian interval from 
	the preferences dialog.
	* tkconq.tcl (ok_meridian_interval): Set newprefs to
	$new_meridian_interval when passed 0 as $mapn.
	(add_map_prefs_items): Add button for setting the
	meridian interval.

2004-05-09  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug in the 'choose_move_direction' wrapper.
	* task.c (choose_move_direction): Use 
	'side_thinks_it_can_put_type_at' instead of 
	'type_can_occupy_cell' to prevent a unit from incorrectly 
	being hindered from moving by a friendly unit whose volume 
	completely occupies a cell on the path.

	Add comment about why another bug cannot be fixed so easily.
	* task.c (choose_move_direction)

2004-05-09  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix overzealous error reporting that was not compatible with 
	the random planner's random action generator.
	* actions.c (check_change_type_action): Disable asserting a 
	valid utype for the time being. Instead, simply return with an 
	error code.

2004-05-08  Hans Ronne <hronne@comhem.se>

	Fix so that the saved game directory is used by default for 
	the Open File command on all three tcltk platforms.
	* tkmain.c (tk_game_homedir): New TclCmdFn and prototype.
	(initial_ui_init): Define the game_homedir tcl command.
	* tkconq.tcl (popup_open_dialog): Use game_homedir to 
	set tk_getOpenFile -initialdir.
	 
	Fix bug that would cause XconqPrefs to be saved in the wrong
	place if the game file was opened from a non-standard location.
	* module.c (preferences_name): Remove static pointer.
	(preferences_filename): Don't use preferences_name to 
	cache the file name. Always recompute it instead.
	(old_preferences_filename): Ditto.
	* tkmain.c (get_preferences): Rewrite and simplify so that 
	loading of OLD_PREFERENCESFILE works on all platforms.
	Use fopen instead of stat to test if a given file exists.
	
	Get rid of another unused pointer in the module code.
	* module.c (save_name): Remove static pointer.

	 Get rid of bogus hidden name for the saved game 
	 directory on Windows. Just call it xconq instead.
	 * win32.c (game_homedir): Change _xconq to xconq.
	 
	 Enable the grid menu item also on non-unix platforms.
	 * tkconq.tcl (unix_feature): Remove code that sets it.
	 (default_map_options): Don't set grid to 0 for non-unix.
	 (create_map_menus): Don't declare the grid command 
	 -state $unix_feature.
	 
	Back out of view option fix from 2004-04-18 that 
	interfered with correct saving of some preferences. 
	 * tkconq.tcl (prefs_dialog_option_list): Remove list.
	(ok_preferences): Parse view_option_list instead of 
	prefs_dialog_option_list.
	
	Instead, implement a fix that changes only those view 
	options that cannot be set on a map-by-map basis when 
	the preferences are changed.
	* tkconq.tcl (ok_preferences): Disable code that resets
	the view options for all maps acording to the new default
	view options.

2004-05-03  Jim Kingdon  <kingdon@panix.com>

        * x11/xdraw.c: Rename cell_overlay to xtconq_cell_overlay to avoid
        compiler warning (ui.h also has a cell_overlay).

2004-05-03  Eric McDonald  <mcdonald@phy.cmich.edu>

	Fix bug that caused run_construction to go on a building spree 
	with human-controlled ACP-independent builders.
	* task.c (do_build_task): If creator/builder is ACP-indep, then 
	after it fails its creation lookup, make sure that it calls 
	'find_unit_to_complete' so that it can (generally) fail that 
	search as well, and then go onto the creation code, which will 
	make sure that the right thing gets done.

2004-05-02  Eric McDonald  <mcdonald@phy.cmich.edu>

	Revert to pathfinding that was in use before 2003/11/13, while 
	leaving other changes intact. This reversion is to fix a 
	number of bugs that were never fixed with the new pathfinder. 
	In time, we may carefully reimplement a version of the new 
	pathfinding, but in the interests of using known, working code 
	prior to the impending release, we have opted to fall back to 
	the old pathfinder. (All listed modifications are from the 
	'kernel' directory.)
	* Makefile.in (OBJS): Remove 'path.o' from linkage.
	  (MW32_OBJS): Remove 'path_mw32.o' from linkage.
	  (path.o): Remove dep rules.
	* ai.c (desired_direction_impassable): Revert.
	  (could_be_ferried): Revert.
	  (blocked_by_enemy): Revert.
	  (attack_blockage): Revert.
	* ai.h (blocked_by_enemy): Revert.
	  (attack_blockage): Revert.
	* autotest.c (test_path): Irrelevant; remove.
	  (test_path_disembark): Irrelevant; remove.
	  (autotest): Don't invoke 'test_path' or 'test_path_disembark'.
	* config.h: Remove 'USE_LR_PATHING' and 'USE_LR_PATHING_SOLO' 
	macros.
	* conq.h: Remove 'CMD_*' macros. Remove 'PND_UNMAPPED' macro.
	  (choose_move_direction): Replace Peter's prototype with a 
	truncated one, which is associated with a new wrapper function for 
	'choose_move_dirs'.
	  (get_cached_move_direction): Revert out of existence.
	  (pathway_transport_change): Likewise.
	  (struct path_node_data): Likewise.
	  (path_node_data_index): Likewise.
	  (same_path_nodes): Likewise.
	  (set_path_node_from_key): Likewise.
	  (get_path_cost_estimate): Likewise.
	  (get_path_direction_count): Likewise.
	  (set_dir_path_node_data): Likewise.
	  (cost_to_move_on_path): Likewise.
	  (path_get_next_move): Likewise.
	  (path_get_next_cached_move): Likewise.
	  (path_get_next_cached_node): Likewise.
	  (select_better_path_node): Likewise.
	  (path_clear_cache): Likewise.
	  (choose_move_dirs): Revert into existence.
	  (plausible_move_dir): Likewise.
	* dir.h: Remove 'NUMPATHS' macro.
	  (DIRX): Revert back to 6 basic direction elements.
	  (DIRY): Likewise.
	  (diropp): Revert out of existence.
	  (opposite_dir): Revert back to formula macro.
	* iplayer.c (iplayer_react_to_task_result): Revert.
	* move.c (set_node_data): Revert out of existence.
	  (do_move_action): Revert.
	  (can_be_carried): Revert out of existence.
	  (path_cb_cnt): Likewise.
	  (check_border_slides): Likewise.
	  (unit_can_border_slide): Likewise.
	  (pathable_point_for_unit): Likewise.
	  (pathable_point): Likewise.
	  (target_distance): Likewise.
	  (choose_move_direction): Likewise, and then replace as a wrapper 
	to 'choose_move_dirs'.
	  (pathway_transport_change): Revert out of existence.
	  (get_cached_move_direction): Likewise.
	  (path_node_data_index): Likewise.
	  (same_path_nodes): Likewise.
	  (set_path_node_from_key): Likewise.
	  (set_path_cost_estimate): Likewise.
	  (get_path_direction_count): Likewise.
	  (set_dir_path_node_data): Likewise.
	  (cost_to_move_on_path): Likewise.
	  (select_better_path_node): Likewise.
	* mplayer.c (mplayer_react_to_task_result): Revert.
	* path.c: Ifdef out the entire file, and put bold comments at 
	the beginning and end mentioning that its contents are not 
	presently used.
	* plan.c (plan_exploration): Change arguments to 
	'choose_move_direction' calls to match new wrapper's param list.
	* task.c (enum choicestate): Revert back into existence.
	  (compare_directions): Likewise.
	  (do_approach_subtask): Revert.
	  (could_directly_board_ferry): Revert out of existence.
	  (do_move_to_task): Revert, keeping non-pathfinding-related 
	changes intact.
	  (do_occupy_task): Likewise.
	  (do_pickup_task): Likewise.
	  (choose_move_direction): Wrapper to replace a major function 
	from Peter's pathfinder. Simply calls 'choose_move_dirs' and 
	then does a 'do_move_action'-like check to see if a unit type 
	can occupy a given cell. (Could certainly use improvement.)
	  (choose_move_dirs): Revert back into existence.
	  (plausible_move_dir): Likewise.
	  (compare_directions): Likewise.
	  (sort_directions): Likewise.
	  (create_move_to_task): Revert.
	  (create_occupy_task): Revert.
	* ui.c (impl_move_to): Change arguments to 'choose_move_direction' 
	call to match new wrapper's param list.
	* unit.c (unit_can_build_type_at): Likewise.
	* util.c (dirx): Revert.
	  (diry): Revert.
	  (diropp): Revert out of existence.
	* world.c (closest_dir): Revert.

2004-05-01  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update documentation.
	* doc/refman.texi: Add entries for 'occupant-adds-speed' and 
	'occupant-multiplies-speed'. Remove entry for 
	'speed-occupant-effect'.

2004-05-01  Hans Ronne <hronne@comhem.se>

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

	Fix crashes in MacOS X when adjusting the direction of 
	the cursor outside the area.
	* ui.c (nearest_cell): Test that xfp and yfp exist before 
	trying to set them to zero.

2004-04-30  Eric McDonald  <mcdonald@phy.cmich.edu>

	Enhance occupant effects on speed.
	* move.c (unit_speed): Handle additive effects first, and then 
	multiplicative effects. Incorporate the two new occupant effects 
	tables and get rid of the old one.
	* table.def (uu_occ_adds_speed): New table.
	  (uu_occ_multiplies_speed): New table.
	  (uu_speed_occ_effect): Remove table. Replaced by 
	'uu_occ_multiplies_speed'. No games needed to be updated as a 
	result of this replacement.

	Fix building bug. Bug would sometimes prevent a new build from 
	occuring because the old 'creation_id' field was not cleared 
	in some circumstances. Completed unit would be looked up and the 
	new build task would complete prematurely.
	* task.c (do_build_task): Before writing a re-entered task off as 
	complete, reset the builder's 'creation_id'.

2004-04-27  Hans Ronne <hronne@comhem.se>

	Fix runaway building bug for acp-independent units.
	* task.c (do_build_task): Always use task->args[1] to find
	the build target for acp-independent units. Comment in the
	resume build code. Note: should teach the acp-independent
	build code how to handle unit->creation_id.

2004-04-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Ifdef out section of revised build code that left advanced units
	creating things at an unchecked rate in some games. Also fix 
	space-expanded tabs in that part of the code.
	* task.c (do_build_task): Don't attempt to resume builds of units 
	with known ID's. (At least for now, until I discover the 
	underlying problem.)

2004-04-27  Eric McDonald  <mcdonald@phy.cmich.edu>

	Update Windows build/install document.
	* INSTALL-win.txt: Add MSVC6 build instructions supplied via 
	private email from Martin Fehlhaber. Thanks Martin.

2004-04-27  Hans Ronne <hronne@comhem.se>

	Minor fix to the Mac PPC terrain drawing code.
	* macmap.c (update_grid_leakage): Set map->leaky_grid
	to true if map->draw_transitions is on.

2004-04-26  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix Tcl/Tk create/build interface bugs. The first bug was the 
        prefix arg that was not reset after a successful build; if a 
        player had supplied "1" as the prefix for the first build, and 
        then wanted to supply "1" again for the next build target, 
        he/she would get "11" as the prefix; it was not just a display 
        glitch, the argument was quite annoyingly real. The second bug 
        was the unit type of a previously cancelled build was being 
        recycled on a different (or same) unit's next build request; this 
        was because 'aux_build' was not deactivating itself as the map 
        modal handler when it was cancelled, and was thus being 
        reactivated by 'tk_interp_key' after the prefix was supplied.
        * tcltk/tkconq.tcl (clear_command_line): Also delete the 
        'prefixarg' text.
        * tcltk/tkcmd.c (do_build): Reset the 'inptype' to NONUTYPE, 
        the 'prefixarg' to -1, and the 'modalhandler' to NULL, and clear 
        the command line after a successful build.
          (aux_build): Likewise, but also after a cancel.
          (aux_build_2): Likewise, but also after a cancel.

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add the 'creation_id' field to the network checksum.
        * tp.c (game_checksum)

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Be more conservative with resetting the 'creation_id' field 
        because some odd cases, where 'creation_id' has been reset but 
        the 2nd task arg of the build task is not set either, were still 
        getting through. Now reset 'creation_id' only on verified 
        completion of the unit being built or upon creation of a new one.
        (There are additional cases where a low supply condition prevents 
        creation, and so neither the task arg or the 'creation_id' get set. 
        Dealing with these cases is even trickier, in terms of assumptions.)
        * actions.c (do_build_action): Do not reset 'creation_id' here.
        * task.c (do_build_task): Reset 'creation_id' if we are about to 
        attempt creating a new unit. Resetting the ID here saves us from 
        getting sidetracked on the next pass through the build code if the 
        creation attempt failed.

        Finish fixing the misguided creation/building bug.
        * task.c (do_build_task): Only look for nearest incomplete units to 
        work upon if the builder is not directly human-controlled. If the 
        builder is directly human-controlled, then create a new unit if the 
        type and location of any existing incomplete unit do not match the 
        specified build criteria. If the criteria are matched, then help 
        work on the incomplete unit.

        Reformat some code to be readable on an 80 column display.
        * unit.c (incomplete_build_target)

2004-04-25  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix "runaway creation spree" bug. This would occur in two forms.
        The first is where the creator completed the created unit as a 
        result of the creation action (i.e., it supplied all of the 
        needed CP upon creation), and thus would not have a chance to 
        acquire the created unit's ID for future reference. The second 
        form is where the creator would create a unit, and then another 
        unit would build it to completion before the next turn; this too 
        resulted in the creator not acquiring the created unit's ID. Both 
        forms of this bug stemmed from the fact that the build task would 
        opt to create a new unit, if the old one could not be looked up by 
        ID, and no incomplete units could be found in the build range. Thus 
        one would get endless creation (until supplies or all volume in 
        creation/build range became exhausted).
        * unit.h (struct a_unit): Add 'creation_id' int field to the 
        core unit structure.
        * unit.c (create_unit): Set the default value of the 
        'creation_id' field to 0.
        * keyword.def (K_CREATION_ID): New keyword.
        * read.c (interp_unit): Read the 'creation-id' property into 
        the unit's 'creation_id' field.
        * write.c (write_unit_properties): Write the 'creation-id' 
        property to the unit's form from the unit's 'creation_id' 
        field.
        * actions.c (do_create_in_action): Assign creator's 
        'creation_id' field the new unit's ID.
          (do_create_at_action): Likewise.
          (do_build_action): Reset the builder's 'creation_id' if 
        executing a build action.
        * task.c (do_build_task): If the worked upon unit's ID is stored 
        in either the 2nd task arg or else in the creator's 'creation_id' 
        then look the worked upon unit up by its ID. If that unit turns 
        out to be complete, then reset the creator's 'creation_id' field.
        * doc/refman.texi (creation-id): New entry in "Unit Properties" 
        section.

        Fix harmless build glitch that allowed completeness numerators 
        to be greater than the corresponding denominators.
        * actions.c (do_build_action): Choose the lesser of the 
        uu_cp_per_build entry and the remaining CP needed, when adding to 
        the CP of the unit.

        Partially fix the misdirected builds bug.
        * task.c (do_build_task): If the worked upon unit can be looked 
        up via its ID, then continue work upon it, rather than groping 
        around for the first thing the builder can help build, which 
        oft times as not, is not what the player wanted. (Fixing the 
        problem of new creation being substituted for building an 
        existing unit is somewhat more involved, but I hope to address 
        this shortly.)

2004-04-25  Hans Ronne <hronne@comhem.se>

	Implement a general protection against out-of-bounds access
	to area layers by making the accessor macros check in_area.
	* world.h (aref, aset, aadd): Check in_area(x,y) first.
	* side.h (add_cover): Use aadd instead of aref so that it works
	with the new accessor macros.

	Fix crashes in the Mac PPC interface when clicking in the area
	below the map. Add some player feedback in that case.
	* macmouse.c (move_the_selected_unit): Check the return value
	of m_nearest_cell and return false if it is false. Notify dside with 
	the message "Cannot move unit outside the map!".
	
	Fix bug in the common ui code that would return a valid nearest 
	cell also for points to the left of or below the edges of the map.
	* ui.c (nearest_cell): Set *yp to (-1) if sy > vp->totsh 
	and *xp to (-1) if sxadj < 0.

2004-04-24  Hans Ronne <hronne@comhem.se>

	Fix so that the SDL interface compiles again.
	* sdlmap.c (m_seen_border): Remove macro now defined in ui.h.
	(m_terrain_visible): Remove macro now defined in ui.h.
	(cell_drawing_info): Pass map->vp instead of map to macros.
	(draw_borders): Pass map->vp instead of map to macros.
	(draw_borders_iso): Pass map->vp instead of map to macros.
	(draw_connections): Pass map->vp instead of map to macros.
	(draw_connections_iso): Pass map->vp instead of map to macros.
	(draw_clouds_row): Pass map->vp instead of map to macros.
	(draw_temperature_row): Pass map->vp instead of map to macros.
	(draw_feature_boundary): Pass map->vp instead of map to macros.
	(draw_people): Pass map->vp instead of map to macros.

	Remove bogus dependency of mac.c (and thus the Mac 
	tcltk and SDL apps) on the Mac PPC interface code.
	* mac.c (macdefs.h): Don't include it 
	(macheads.h): Don't include it.
	
	Add basic Apple Event handling to IMFApp so that it can 
	accept quit application events.
	* imfapp.c (hasAppleEvents): New global int.
	(eventloopdone): New global int.
	(do_ae_open_application_proc): New global AEEventHandlerUPP.
	(do_ae_open_documents_proc): New global AEEventHandlerUPP.
	(do_ae_print_documents_proc): New global AEEventHandlerUPP.
	(do_ae_quit_application_proc): New global AEEventHandlerUPP.
	(main): Call init_ae and event_loop. Move content to event_loop.
	(event_loop): New function and prototype with content from main.
	(init_ae): New function and prototype.
	(do_ae_open_application): New function and prototype.
	(do_ae_open_documents): New function and prototype.
	(do_ae_print_documents): New function and prototype.
	(do_ae_quit_application): New function and prototype.
	(do_event): Handle case kHighLevelEvent.
	
2004-04-24  Hans Ronne <hronne@comhem.se>

	Fix grid drawing bug in the Mac PPC interface.
	* macdraw.c (draw_hex_region): Test dogrid when deciding
	whether to use CopyMask or CopyBits.

2004-04-24  Eric McDonald  <mcdonald@phy.cmich.edu>

        Update documentation.
        * doc/PROJECTS (K373): Mention the idea of a treasury 
        reservations system (think malloc/free for side treasuries).
          (L115): Mention an idea that Klaus Schilling posted to the 
        list late last year: a database tool that reads/writes GDL. 
        This would make building complex games so much easier.
        * doc/refman.texi (material-to-create): Mention new usage, and 
        use unit identifier 'u1' with it. Mention that material is not 
        consumed.
          (consumption-on-creation): Use unit identifier 'u2' with it.
          (material-to-build): Mention that material is not consumed.

        Transplant '*consumes_from_treasury_directly' macros from 
        'conq.h' to a new miscellany section of 'kernel.h'. Add 
        '*produces_for_treasury_directly' macros in the new location.
        * conq.h (type_consumes_from_treasury_directly): Remove.
          (consumes_from_treasury_directly): Remove.
        * kernel.h (type_consumes_from_treasury_directly): Add here.
          (consumes_from_treasury_directly): Add here.
          (type_produces_for_treasury_directly): New macro. Does the 
        given unit type supply the given material to the treasury of 
        the given side directly?
          (produces_for_treasury_directly): New macro. Does the given 
        unit supply the given material to its side's treasury directly?

        Make mention of the new direct treasury interactions in the 
        relevant functions.
        * ai.c (exploring_worth)
        * help.c (describe_mtype)
        * unit.c (operating_range_worst, real_operating_range_worst, 
        operating_range_best, real_operating_range_best)

        Add support for direct treasury withdrawals to cover base 
        consumption costs. Add support for direct treasury investments 
        for excess materials from base production.
        * unit.h (unit_side_treasury): New macro. Alternate way to access 
        a unit's side treasury through the unit struct.
        * run2.c (run_unit_base_consumption): Add case to see if treasury 
        has enough material to pick up the consumption tab, if the 
        particular unit can directly withdraw the particular material 
        from the treasury.
          (run_economy): If excess material remains after pushing it 
        out on the supply lines, and the given unit can directly deposit 
        the given material in its side treasury, then go ahead and deposit 
        the remaining excess of that material.

        Safen a macro.
        * unit.h (unit_doctrine): Wrap references to 'unit' in parens in 
        the macro body.

2004-04-23  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix compilation failure with SDL and Xt/Xaw interfaces.
        * ui.h (enum whattouse): Add 'usepictures' to the enumeration.
        * sdl/sdlconq.h: Delete 'enum whattouse'.
        * x11/xtconq.h: Likewise.

        Fix long-standing incomplete unit list issue. Also, address 
        oversight in change-type code.
        * unit.c (type_ever_available): Add tests for a unit that can 
        be added to a side via capture, changing type, or wrecking.
          (type_can_change_type): Remove function.
          (could_change_type_to): Looks up utype pair in 
        'uu_change_type_to' table, before inquiring about ACP-independence
        or ACP-based restrictions.
          (could_change_type): Replace 'type_can_change_type' with this. 
        Call new function, 'could_change_type_to', inside of utype loop.
          (can_change_type): Call 'could_change_type' instead of 
        'type_can_change_type'.
        * unit.h (type_can_change_type): Remove prototype.
          (could_change_type): New prototype.
          (could_change_type_to): New prototype.

2004-04-23  Hans Ronne <hronne@comhem.se>

	Fix bug in modal_map code from 2003-12-31 that would lock 
	the Mac PPC interface in modal mode under some circumstances.
	* macconq.c (maybe_select_next_unit): Reset map_modal to
	NO_MODAL if we lack a current unit than can act. This fixed most 
	of the problems, but it is still possible to get locked if the unit has 
	acps, but not enough to execute the chosen action. Should really do
	like the tcltk interface where actions are checked at the command
	level and feedback provided on failure.
	* macmouse.c (do_mouse_down_map_content): Reenable restting
	of map_modal to NO_MODAL for now, until the command code has 
	been improved.

	Remove bogus cloverleaf shortcut for the fire-into command 
	in the Mac PPC Play menu. Instead, add [ ctrl-f ] which is the
	real shortcut in all interfaces for fire-into. Note: this was a 
	truly ancient bug, present already in 7.4.1 (but not 7.1.0).
	* Xconq.r (MENU 132 "Play"): Remove cloverleaf mark and
	add [ ctrl-f ] after Fire Into instead.
	
	Add menu accelerators for fire and fire-into commands in the 
	tcltk interface for consistency across platforms.
	* tkconq.tcl (create_map_menus): Add -accelerator "f" for
	Fire and -accelerator "Ctrl-f" for Fire Into. Also add "m" for 
	Move.

2004-04-22  Hans Ronne <hronne@comhem.se>

	Add application bundle support for building the MacOS X apps.
	* mac/IMFApp.app: New folder.
	* mac/IMFApp.app/Contents: New folder.
	* mac/IMFApp.app/Contents/MacOS: New folder.
	* mac/IMFApp.app/Contents/Resources: New folder.
	* mac/IMFApp.app/Contents/Resources/IMFApp.icns: New file.
	* mac/IMFApp.app/Contents/info.plist: New file.
	* mac/IMFApp.app/Contents/PkgInfo: New file.
	* mac/Xconq.app: New folder.
	* mac/Xconq.app/Contents: New folder.
	* mac/Xconq.app/Contents/MacOS: New folder.
	* mac/Xconq.app/Contents/Resources: New folder.
	* mac/Xconq.app/Contents/Resources/Xconq.icns: New file.
	* mac/Xconq.app/Contents/info.plist: New file.
	* mac/Xconq.app/Contents/PkgInfo: New file.
	
2004-04-22  Hans Ronne <hronne@comhem.se>

	Add user-settable preferences for default_moveonclick and 
	default_autojumpnext in the Mac PPC interface.
	* macconq.h (defaultmoveonclick): Change to default_moveonclick.
	(defaultautoselect): Change to default_autojumpnext.
	* macconq.c (defaultmoveonclick): Remove global.
	(defaultautoselect): Remove global.
	* maccolors.c (default_moveonclick): Initialize to true.
	(default_autojumpnext): Initialize to true.
	* macdefs.h (diPrefsMoveOnClick): Define as 28.
	(diPrefsAutoJumpNext): Define as 29.
	* macmap.c (create_map): Change defaultmoveonclick and
	defaultautoselect to default_moveonclick and default_autojumpnext.
	* macprefs.c (ui_update_state): Handle default_moveonclick 
	and default_autojumpnext.
	(interp_mac_ui_data): Handle default_moveonclick and 
	default_autojumpnext.
	(set_preferences): Handle cases diPrefsMoveOnClick and
	diPrefsAutoJumpNext.
	(add_preferences_topic_items): Set diPrefsMoveOnClick
	and diPrefsAutoJumpNext. Change defaultmoveonclick and
	defaultautoselect to default_moveonclick and default_autojumpnext.
	(save_preferences_settings): Save default_moveonclick
	and diPrefsAutoJumpNext.
	and default_autojumpnext.
	* Xconq.r (DITL 700 "Preferences"): Tweak button positions.
	(DITL 702 "Preferences Map"): Add checkboxes for 
	diPrefsMoveOnClick and diPrefsAutoJumpNext.
	(DLOG 700 "Preferences"): Tweak size.

2004-04-21  Hans Ronne <hronne@comhem.se>

	Fix MacOS X crashes in get_a_visible_unit. Note: the culprit 
	here is really nearest_unit, which returns true even if no unit 
	was found. Should consider changing that. Thanks to Tom Schaub
	for reporting this and other bugs.
	* maccmd.c (get_a_visible_unit): Return false if unitp does 
	not exist.

	Remove the possibility of setting defaultmoveonclick and
	defaultautoselect from the Mac Side menu when there is no
	frontmap since this was confusing to players. Instead, uncheck 
	and disable these items in the absence of a frontmap. Note: these
	map-specific items should really be moved to the View menu.
	Should also make defaultmoveonclick and defaultautoselect user
	settable map preferences. Further note: the tcltk interface is
	similarly illogical since it allows toggling of the map-specific
	Move/Survey mode from the Side menu.
	* macmenus.c (moveonclick_mi): Call beep instead of toggling
	defaultmoveonclick if no frontmap.
	(autoselect_mi): Call beep instead of toggling defaultautoselect 
	if no frontmap.
	(adjust_menus): Call adjust_menu_item for miSideMoveOnClick
	and miSideAutoSelect with map as argument. Uncheck these items
	if there is no map. 

	Fix unwanted redrawing of invisible control panel when
	Move on Click is toggled in the Mac Side menu.
	* macmenus.c (moveonclick_mi): Test frontmap->conw
	before calling draw_control_panel.

	Fix map scrolling bug in the Mac interface.
	* macconq.c (adjust_cursor): Only do autoscrolling if the
	current process is the front process and the window is the
	topWindow.

	Fix Carbon-specific menu switching bug in the Mac interface.
	* macconq.c (handle_event): Check if the window should be
	brought to the front also in case inDrag.

2004-04-21  Eric McDonald  <mcdonald@phy.cmich.edu>

        Match the usage of um_to_create and um_consumption_on_creation 
        to the usage of um_to_build and um_consumption_per_build; was 
        inconsistent. Also, improve creation/building to draw directly 
        from a side treasury if the side has one, the unit can draw from 
        it, and the unit has no local storage for the material.
        * conq.h (type_consumes_from_treasury_directly): New macro. 
        Checks to see if a given type on a given side can consume a given 
        material directly from the side treasury.
          (consumes_from_treasury_directly): New macro. Checks to see if 
        a given unit can consume a given material directly from the side 
        treasury.
        * actions.c (check_create_common): Allow direct withdrawals from 
        treasury. Make um_to_create dependent on creator rather than 
        the potential creation (to mirror usage of um_to_build in 
        building).
          (check_build_action): Allow direct withdrawals from treasury.
          (do_create_in_action): Perform direct withdrawals from treasury, 
        if allowed and necessary.
          (do_create_at_action): Likewise.
          (do_build_action): Likewise.

        Fix a minor bug that prevented a unit from being created inside a 
        transport that could exactly fit it with no space leftover.
        * task.c (do_build_task): Occ size should <= transport cap, not 
        just < transport cap.

        Reformat code and comments to be readable on 80 column display.
        * unit.c (unit_can_build_type_at): Also add comment questioning 
        the wisdom of restricting creation range with the min of 
        creation range and build range.

        Update games lib to reflect new usage of um_to_create.
        * lib/galaxy.g (material-to-create): Change to 
        'consumption-on-creation', which was probably the author's intent 
        anyway.
        * lib/u-bellum.g (material-to-create): Remove. Wasn't really used 
        anyway.

        Trick Tcl into not treating the string escape character, '"', in 
        a special manner.
        * tkmain.c (c_to_tcl_string): Provide octal escape code for 
        string escape.

2004-04-18  Hans Ronne <hronne@comhem.se>

	Fic display glitch in the Mac PPC pseudo-isometric code.
	* macrow.c (draw_row): Don't draw terrain transitions
	in the pseudo-isometric case.
	
	Fix bug in the tcltk interface that would reset map power and
	coverage to default values whenever a preference was changed.
	* tkconq.tcl (prefs_dialog_option_list): New list with only 
	those view options that can be set in the prefs dialog.
	(ok_preferences): Parse prefs_dialog_option_list instead 
	of view_option_list.

2004-04-17  Hans Ronne <hronne@comhem.se>

	Further improvements to the tcltk map drawing code. Add the
	ability to draw isometric polygons to the Windows interface.
	* ui.h (iws[], ihs[], ics[], ix1[], ix2[]): Declare new global
	arrays for use in isometric cell drawing.
	* ui.c (iws[NUMPOWERS]): Initialize array.
	(ihs[NUMPOWERS]): Initialize array.
	(ics[NUMPOWERS]): Initialize array.
	(ix1[NUMPOWERS]): Initialize array.
	(ix2[NUMPOWERS]): Initialize array.

	* tkmap.c (draw_iso_polygon): New function and prototype.
	(draw_terrain_iso): Rewrite. Call draw_iso_polygon in case
	use_clip_mask is false (Windows). Fix various bugs. Use
	grid_color instead of blackcolor for the grid and draw it after
	coatings and coverage, just as in the overhead drawing code.
	(draw_terrain_row): Rewrite and reformat so that it is more 
	similar to draw_terrain_iso.
	* tkxmac.c (XFillPolygon): Add support for stippled and tiled
	drawing. Use PenSize(0, 0) instead of PenPixPat(gPenPat) to 
	avoid drawing a black edge. 

	Fix crashes in the tcltk terrain transition code.
	* tkmap.c (draw_terrain_transitions): Check that timg 
	exists before dereferencing it.
	
2004-04-15  Eric McDonald  <mcdonald@phy.cmich.edu>

        Trick Tcl into not trying to treat the command substitution 
        character, '[', in a special manner. Also, improve handling of 
        backslash substitution.
        * tkconq.h (c_to_tcl_string): New prototype.
        * tkmain.c (c_to_tcl_string): New function. Converts a "raw" C 
        string to a new dynamically allocated C string that is properly 
        digestible by a Tcl interpreter. The raw string is freed by the 
        function after conversion takes place. 
          (init_unit_type_list): Use the 'c_to_tcl_string' function.

        * game.h (BACKTTYPE): Fix nested comment.

2004-04-09  Hans Ronne <hronne@comhem.se>

	Improve drawing of isometric terrain images on Windows.
	* tkmap.c (draw_terrain_iso): Use XSetFunction GXand on
	Windows to draw a black mask underneath, and then GXor.

2004-04-09  Hans Ronne <hronne@comhem.se>

	Fix bug in Mac Tcl/Tk 8.4.2 that would cause polygons to 
	be drawn with a black edge.
	* tkxmac.c (XFillPolygon): New hacked function that sets
	PenPixPat(gPenPat) before framing the polygon.

2004-04-08  Hans Ronne <hronne@comhem.se>

	Fix bug that would leave a hole in some cases when redrawing
	part of the tcltk map near a high peak in isometric mode.
	* tkmap.c (draw_map_isometric): Add 5 to numrows in case
	SOUTHWEST and NORTHWEST. Note: 5 seems to be enough, but
	should perhaps add area.width rows like in all other cases?

2004-04-07  Hans Ronne <hronne@comhem.se>

	Fix pointer type mismatch in the new tcltk code.
	* tkmap.c (draw_terrain_iso): Pass unseen_image instead 
	of dside->ui->best_unseen_images to best_image.	

	Don't draw a black area background in the isometric case. Fix bug
	that caused occasional slits between cells by testing drop for being
	non-zero before scaling it. 
	* tkmap.c (draw_terrain_iso): Test drop for being greater than
	zero before scaling it. Remove code that draws grid lines in case 
	elevations_defined is true and the drop is zero.
	(draw_map_widget): Only call draw_area_background in the 
	non-isometric case.

2004-04-06  Hans Ronne <hronne@comhem.se>

	Major overhaul of the tcltk map drawing code. Port several
	improvements from the Mac PPC interface and generalize some
	of the code by moving it to the kernel. Add the ability to explicitly 
	draw unseen terrain and bogus window background terrain in order
	to enable correct drawing at map edges and outside the map. Separate
	drawing of overlays and coatings and make both work together as in 
	the Mac PPC interface. Fix some bugs in both interfaces.
	* game.h (BACKTTYPE): Define as (-2) here.
	* ui.c (compute_transition): Return FALSE if (x, y) is invisible.
	Add code from mac_compute_transition that handles overlays and
	shorelines.
	* ui.h (whattouse): Move enum of drawing styles here.
	(a_vp): Add vp->draw_shorelines.
	(m_terrain_visible): Move macro here.
	(m_seen_border): Move macro here.
	(cell_style): Move macro here.
	(cell_overlay): Move macro here.
	(cell_terrain): Move macro here.

	* macconq.h (a_map): Remove map->shorelines.
	(enum dontdraw etc): Move it to ui.h. Remove usepictures.
	(BACKTTYPE): Move definition to game.h.
	* macdraw.c (m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(cell_style): Move macro to ui.h.
	(cell_overlay): Move macro to ui.h.
	(mac_compute_transition): Remove function and prototype.
	(draw_cell_block): Break before drawing coatings or overlays
	if the terrain is unseen.	
	(draw_hex-region): Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_transitions): Pass map->vp instead of map in
	all macros. Call compute_transition instead of the mac-specific
	function but shift the viewport afterwards to compensate for the
	xform_cell call.
	(draw_unseen_fuzz): Pass map->vp instead of map in all macros. 
	(draw_shore_images): Pass map->vp instead of map in all macros. 
	(draw_border_images): Pass map->vp instead of map in all macros.
	* macmap.c (create_map): Set map->vp->draw_shorelines instead
	of map->shorelines.
	* macmenus.c (adjust_menus): Change map->shorelines to
	map->vp->draw-shorelines.
	(toggle_shorelines): Change map->shorelines to
	map->vp->draw-shorelines.
	* macrow.c (tmpdrawlighting): Remove tmp global.
	(tmpdrawcoverage): Remove tmp global.
	(m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(cell_style): Move macro to ui.h.
	(cell_overlay): Include handling of tmpdrawlighting and
	tmpdrawcoverage here and move the macro to ui.h.
	(cell_terrain): Move macro to ui.h.
	(draw_row): Pass map->vp instead of map in all macros. Change 
	map->shorelines to map->vp->draw-shorelines.
	(draw_terrain_row): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage. Remove unused
	usepictures drawing style.
	(draw_cliffs): Pass map->vp instead of map in all macros. 
	(draw_contours): Pass map->vp instead of map in all macros. 
	(draw_gridlines): Pass map->vp instead of map in all macros. 
	(draw_shores): Pass map->vp instead of map in all macros. 
	(draw_shorelines): Pass map->vp instead of map in all macros. 
	(draw_borders): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage.
	(draw_connections): Pass map->vp instead of map in all macros.
	Remove tmpdrawlighting and tmpdrawcoverage.
	(draw_feature_boundary): Pass map->vp instead of map in all
	macros.
	(draw_people_row): Pass map->vp instead of map in all macros.
	(draw_materials): Pass map->vp instead of map in all macros.
	(draw_units): Pass map->vp instead of map in all macros.
	(draw_unit_and_occs): Pass map->vp instead of map in all macros.
	(draw_unit_view_and_occs): Pass map->vp instead of map in all 
	macros.
	(draw_ai_region): Pass map->vp instead of map in all macros.
	(draw_region_borders): Pass map->vp instead of map in all macros.
	
	* tkconq.h (whattouse): Move enum to ui.h. Remove usepictures.
	(a_ui): Add (Image *) best_unseen_images[NUMPOWERS].
	* tkinit.c (init_terrain_images): Call get_unseen_images. 
	Allocate and init dside->ui->best_unseen_images.
	* tkmap.c (m_terrain_visible): Move macro to ui.h.
	(m_seen_border): Move macro to ui.h.
	(MapW): Remove unused mapw->draw_polygons.
	(config_specs): Don't config mapw->draw_polygons. 
	(draw_hex_polygon): Remove some unused arguments. Separate
	drawing of overlays and coatings.
	(cell_drawing_info): Remove function and prototype.
	(cell_drawing_colors): New simplified function and prototype.
	(mapw_cmd): Don't set mapw->draw_polygons.
	(draw_terrain_iso): Rewrite to work more like the Mac PPC
	interface. Use macros from ui.h instead of cell_drawing_info.
	Split code for handling overlays and coatings. Use cell_terrain
	instead of terrain_at. Use unseen_color to draw cliffs if the
	terrain is NONTTYPE. Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_row): Rewrite to work more like the Mac PPC
	interface. Use macros from ui.h instead of cell_drawing_info.
	Split code for handling overlays and coatings. Rename usepictures
	to usepolygons for consistency with the Mac PPC interface and
	remove th unused former usepolygons case. Pass fewer arguments
	to draw_hex_polygon. Break before drawing coatings or overlays
	if the terrain is unseen.
	(draw_terrain_transitions): Rewrite to work more like the Mac 
	PPC interface. Use macros from ui.h instead of cell_drawing_info.
	Use cell_terrain instead of terrain_at. Split code for handling 
	overlays and coatings.
	(draw_unseen_fuzz): Pass mapw->vp instead of mapw in all macros.
	(draw_contours): Pass mapw->vp instead of mapw in all macros.
	(draw_clouds_row): Pass mapw->vp instead of mapw in all macros.
	(draw_temperature_row): Pass mapw->vp instead of mapw in all 
	macros.
	(draw_people): Pass mapw->vp instead of mapw in all macros.
	(draw_borders): Pass mapw->vp instead of mapw in all macros.
	(draw_borders_iso): Pass mapw->vp instead of mapw in all macros.
	(draw_connections): Pass mapw->vp instead of mapw in all macros.
	(draw_connections_iso): Pass mapw->vp instead of mapw in all 
	macros.
	(draw_feature_boundary): Pass mapw->vp instead of mapw in all 
	macros.

2004-04-03  Hans Ronne <hronne@comhem.se>

	Fix so that the number of entries and empty fields in the tcltk
	player setup list is recomputed correctly when the indepside is
	hidden or revealed.
	* tkconq.tcl (add_player_dialog_items): Check $indepside_up
	before adding one extra row for indepside. 
	(set_indepside): Add one row if indepside is visible. Recompute
	the length of the player list when done.

2004-04-02  Hans Ronne <hronne@comhem.se>

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

	Fix rare synch error affecting games with auto-repair.
	* task.c (do_repair_task): Initialize tmpunit correctly before 
	calling repair_here. Also add a missing linefeed at the end of the
	DMprintf output.

2004-03-29  Hans Ronne <hronne@comhem.se>

	Fix bug in the native Mac interface that would cause an empty
	text window to disappear if its zoom box was clicked.
	* macconq.c (set_standard_state): Set fullh to min 10 pixels.
	(set_vertical_standard_state): Set fullh to min 10 pixels.

	Fix minor compile problem in the Mac tcltk code.
	* tkmac.c (open_game_from_fsspec): Add missing prototype.

2004-03-28  Hans Ronne <hronne@comhem.se>

	Add Mac command key shortcuts in the tcltk apps. Note:
	commands were taken from the Mac native apps. Should 
	review command key shortcuts in all interfaces and unify 
	them as much as possible.
	* imfapp.tcl: Add Mac command keys as accelerators. Also
	set all menus to -tearoff 0 and change "About IMFAppTCL..."
	to "About IMFApp..." in the Apple menu.
	* tkconq.tcl (create_map_menus): Add Mac command keys
	as accelerators. Change "About XconqTCL.." to "About Xconq"
	in the Apple menu.

2004-03-28  Hans Ronne <hronne@comhem.se>

	Improve the appearance of the unseen fuzz.
	* images/fuzz24x26.gif: Remove some nicks and bumps.
	* images/fuzz44x48.gif: Remove some nicks and bumps.
	* images/fuzz88x96.gif: Remove some nicks and bumps.
	* bitmaps/fuzz16.b: Remove some nicks and bumps.
	* bitmaps/fuzz32.b: Remove some nicks and bumps.
	* bitmaps/fuzz64.b: Remove some nicks and bumps.

2004-03-27  Hans Ronne <hronne@comhem.se>

	Fix long-standing problem with excessive updates of the map
	outline rect in the tcltk worldmap which caused an annoying
	flicker and eventually locked up the MacTCL interface. Also
	fix so that the corners of the map rect are drawn correctly. 
	* tkmain.c (tk_animate_selection): Now call update_cell also
	in survey mode in order to force updates of the worldmap map
	outline after scrolling etc.
	* tkmap.c (mapw_cmd): Initialize mapw->last_ws_valid to
	FALSE (not needed but may prevent future problems).
	(mapw_widget_cmd): Add some brackets.
	(mapw_display): Add some brackets.
	(draw_map_outline): Rewrite. Only draw line segments that
	intersect the update rect. Fix so that segments do not overlap
	in the corners. Add code that tests if the map was moved and
	forces a redraw in that case. Only reset wsx and wsy after the
	new outline is drawn, not after erasing the old one. Reenable
	the code also in the MacTCL interface.
	
	Fix bug in currently unused scale_point calls in the tcltk
	interface and enable this function for future use.
	* tkmap.c (draw_map_outline): Switch widgets in call to
	scale_point. Add another commented out call for the standard
	non-isometric case.
	* ui.h (scale_point): Add prototype.
	* ui.c (scale_point): Enable function but add comment about
	not working correctly in the isometric case.

2004-03-26  Hans Ronne <hronne@comhem.se>

	Fix so that double-clicking of game files works in the MacTCL 
	interface by porting the relevant Apple Event processing code 
	from the MacPPC interface. Remove some unix-specific stuff 
	from the MacTCL code.
	* tkmac.c (interpret_variants): Remove prototype.
	(cmd_error): Remove prototype.
	(main): Rewrite and remove unix-specific stuff. Don't call
	TkMacInitAppleEvents. Don't use option_popup_new_game_dialog.
	Copy ifdef MACOSX command line code from macconq.c.
	(MissingParameterCheck): Remove function and prototype.
	(DoOpenApp): Remove function and prototype.
	(DoQuitApp): Remove function and prototype.
	(DoOpenDocument): Remove function and prototype.
	(missed_any_parameters): New function and prototype.
	(do_ae_open_application): New function and prototype.
	(do_ae_open_documents): New function and prototype.
	(do_ae_print_documents): New function and prototype.
	(do_ae_quit_application): New function and prototype.
	(open_game_from_fsspec): New function and prototype.	
	(init_ae): Call new event handler procedures instead.
	* tkconq.tcl (popup_splash_screen): Call create_newgame_window
	to set up the window and then add_splash_screen_dialog_items.
	(create_newgame_window): New procedure with most of the 
	content from the old popup_splash_screen.
	(popup_variants_dialog): Call create_newgame_window if
	the .newgame window does not exist.
	(popup_player_dialog): Call create_newgame_window if
	the .newgame window does not exist.

	Clean out unused stuff from the MacTCL and MacPPC interfaces.
	* macconq.c (keyReplyErr): Remove macro for 'errn'.
	(get_files): Remove unused prototype.
	(main): Clean up the ifdef MACOSX code.
	(do_ae_open_application): Use keyErrorNumber instead.
	(do_ae_open_documents): Use keyErrorNumber instead.
	(do_ae_print_documents): Use keyErrorNumber instead.
	(do_ae_quit_application): Use keyErrorNumber instead.
	* tkmac.c (XconqSignature): Remove unused macro.

2004-03-25  Hans Ronne <hronne@comhem.se>

	Remove the empty lib-x11 directory from all modules.
	* modules/modules (xconq-unix): Remove xconq/lib-x11.
	(xconq): Remove xconq/lib-x11.
	
2004-03-24  Hans Ronne <hronne@comhem.se>

	Update BWidget to version 1.7.0.
	tcltk/BWidget: Update all existing files to 1.7.0.
	* wizard.tcl: Add new BWidget file.

2004-03-24  Hans Ronne <hronne@comhem.se>

	Fix display glitch in the tcltk build select buttons.
	* tkconq.tcl (fill_in_unit_type_list): Initialize sy to 1.
	Set width and height to 44 instead of 48 for unit images.

2004-03-24  Hans Ronne <hronne@comhem.se>

	Fix move-to command bug by always enabling moves into the 
	unknown, also when moving under manual control. 
	* move.c (pathable_point): Comment out test for CMD_EXPLORE
	when terrain is unseen. Always set PND_UNMAPPED and add 2
	points to pmcost.
	* task.c (do_move_to_task): Comment out code that sets
	CMD_EXPLORE.

	Rewrite part of the command processing common interface code 
	so that unit views always are used instead of units when trying 
	to figure out what commands are acceptable. Fix so that it is no
	longer possible to figure out if an enemy unit is hiding in a cell
	by clicking on that cell in the process.
	* side.h (for_all_view_stack_with_occs): New macro.
	* unit.c (side_thinks_type_can_occupy_cell): New function.
	(side_thinks_it_can_put_type_at): New function.
	(side_thinks_it_can_put_type_at_without): New function.
	(side_thinks_type_can_occupy): New function.
	(side_thinks_type_can_occupy_without): New function.
	(side_could_put_type_at): Remove function.
	(unit_can_build_type_at): Call side_thinks_it_can_put_type_at 
	and side_thinks_it_can_put_type_at_without instead of
	side_can_put_type_at and side_can_put_type_at_without. 
	* unit.h (side_thinks_type_can_occupy_cell): New prototype.
	(side_thinks_it_can_put_type_at): New prototype.
	(side_thinks_it_can_put_type_at_without): New prototype.
	(side_thinks_type_can_occupy): New prototype.
	(side_thinks_type_can_occupy_without): New prototype.
	(side_could_put_type_at): Remove prototype.
	* ui.c (impl_move_to): Call side_thinks_it_can_put_type_at 
	instead of side_can_put_type_at. Don't check terrain_visible
	here.

	Make it possible to resume builds manually on the Mac also 
	if the destination cell is full. Always enable possible build 
	targets for mobile builders.
	* macunit.c (update_build_menu): Check for incomplete 
	build targets and include the type in the menu. Also enable 
	all build targets if builder is mobile.
	
	Remove obsolete resource include file for CodeWarrior.
	* XconqMWC.r: Remove. The only include currently needed 
	by Rez is Types.r and it can be set as prefix file for Rez in 
	all supported versions of CodeWarrior.

2004-03-10  Hans Ronne <hronne@comhem.se>

	Fix init warnings due to internal zz data that was saved in 
	debug mode being read when a saved game is loaded.
	* read.c (fill_in_utype): Don't read zz-properties.
	(fill_in_mtype): Don't read zz-properties.
	(fill_in_atype): Don't read zz-properties.
	(fill_in_ttype): Don't read zz-properties.
	(interp_table): Don't read zz-tables.

2004-03-10  Hans Ronne <hronne@comhem.se>

	Fix strange bug that would put land units in the middle of lakes 
	if the river-generating code was run after making units.
	* mkrivers.c (make_up_river_borders): Check that no units
	are present in a sink cell before changing it to liquid terrain.

2004-03-07  Hans Ronne <hronne@comhem.se>

        Fix reference to empty filename when loading library modules.
        * module.c (open_module): Don't report filenames for library
        modules in the Dprintf message.

        Prevent possible path buffer overflow in the tcltk init code.
        * tkmain.c (initial_ui_init): Allocate PATH_SIZE instead of
        BUFSIZE to pathbuf.

        Fix so that imfapp always can find imfapp.tcl under Unix by 
        copying the tkconq.tcl finding code. Note: should eventually
        untangle and simplify this spaghetti code. 
        * tkiapp.c (ui_init): Copy library path scanning code from
        initial_ui_init in tkmain.c. Comment out the old code. Also 
        call init_library_path already here.
        (imfapp_main): Don't call init_library_path here.

2004-03-07  Hans Ronne <hronne@comhem.se>

	Fix so that game files can be run from non-standard locations in
	single player games.
	* gif.c (get_gif): Search a sibling images dir first instead of last
	in case we opened the game from a non-standard location.
	* module.c (open_module_saved_game): Search the working dir
	first of all in single player games.
	(open_module_library_file): Search the working dir first of all
	in single player games.
	* mac.c (open_file): Always restore the current volume and 
	directory before returning. Simplify special case code. Remove
	the obsolete "Checkpoint" file name case. 
	(save_game): Save and restore the current volume and directory.
	(game_homedir): Save the current volume and directory and restore
	them as long as we are loading the game. Set the current volume and
	directory to initial_vrefnum and initial_dirid when the mainmodule
	has been loaded so that files are saved in the standard location. 
	* macinit.c (open_game_from_name_and_volume): Don't restore
	the initial current volume and directory after opening a game file 
	from a non-standard location.
	* tkconq.tcl (popup_open_dialog): Set the working directory to 
	the game file location.
	
	Fix so that imfapp also can handle files in non-standard locations.
	* imfapp.tcl (open_imf_dir_cmd): Set the working directory.
	(add_imf_file_cmd): Set the working directory.
	(save_imf_dir_cmd): Set the working directory.
	(save_imf_file_cmd): Set the working directory.
	
2004-03-07  Hans Ronne <hronne@comhem.se>

	Fix display bug in the tcltk interface which caused the connection 
	pen size to spill over into the grid drawing code. Make sure the pen
	size always is set to default for the grid.
	* tkmap.c (draw_terrain_grid): Call XSetLineAttributes in order
	to set the pen size to the default zero value.
	(draw_connections): Add missing test for timg->isconnection in 
	the line drawing cleanup code.

	Fix run warning in the Beirut game due to units that can move
	becoming independent even though indepside->ingame is false.
	* beirut.g (movers): Add possible-sides "locals".
	
	Add Lincoln Peters' new Bolo game variant.
	* bolodd3.g: New game module file.

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

2004-02-15  Hans Ronne <hronne@comhem.se>

	Update the game library. Enable more setup options. Promote
	some working games to release status. Fix a number of game 
	module bugs. Tweak game blurb descriptions.

	* 3rd-age.g (blurb): Tweak text.
	(ng-weird): Use it instead of ng-swedish.
	* 1756.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	(scorekeeper): Change to do last-side-wins.
	(last-turn): Disable. Too short time to play a game.
	* 1757.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* 1805.g (title): Tweak text.
	(blurb): Add period.
	(version): Set to 1.0.	
	(variants): Add world-seen and sequential.
	(instructions): Change text.
	(last-turn): Disable. Too short time to play a game.
	(scorekeeper): Change to do last-side-wins.
	* advances.g (blurb): Tweak text.
	(already-seen): Set to 100 for places.
	(already-seen-independent): Set to 100 for places.
	(see-always): Comment out for places.
	(Aztec Empire): Change to the Aztecs.
	(Maya State): Change to the Mayas.
	* africa-1850.g (title): Tweak text.
	(blurb): Add text.
	(variants): Enable sequential only.
	(instructions): Add text.
	* africa.g (title): Set to Africa.
	(blurb): Tweak text.
	(variants): Enable world-seen, see-all and sequential play.
	(instructions): Add text.
	(sides-min): Don't set.
	(sides-wanted): Set to 4.
	* anc-near-east.g (blurb): Tweak text.
	(variants): Remove people, economy and supply.
	(instructions): Copy from advances.g.
	(indepside-has-ai): Set to false.
	(indepside-can-research): Set to false.
	* ancient-days.g (blurb): Add text.
	(variants): Enable world-seen and sequential play.
	(instructions): Add text.
	(real-time-per-turn): Disable for now.
	(sides-wanted): Set to 4.
	* beirut.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(militia): Change image to trident-riflemen.
	(death-squad): Change image to trident-fanatics.
	(leader): Change image to trident-diplomat.
	(leader): Change name to warlord. Tweak help text.
	(tank): Change image to trident-armor.
	(wreckage): Change image to city20-fire.
	(beach): Change image to adv-desert.
	(street): Change image to flagstone.
	(block): Change image to lime-green.
	(trees): Change image to adv-forest.
	(L): Define as warlord.
	(hp-max): Change to 12 for tanks.
	(self-required): Set to true.
	(can-be-self): Set to true for leader.
	(self-resurrects ): Set to true for leader.
	(occupant-escape-chance): Set to 100.00 for all units.
	(acp-for-retreat): Set to 1 for all units.
	(action-notices):Tweak text.
	(start-with): Give each side 5 warlords and 4 tanks.
	(side-library): Add complete side library for all sides.
	Add missing flags. Add namers for warlords.
	Add adjectives etc. as necessary.
	(maronites): New in-order namer for warlords.
	(amal): New in-order namer for warlords.
	(hezbollah): New in-order namer for warlords.
	(druze): New in-order namer for warlords.
	(syria): New in-order namer for warlords.
	(israel): New in-order namer for warlords.
	(plo): New in-order namer for warlords.
	(sides-max): Change to 7.
	(sides-min): Change to 7.
	(side 0): Set adjective to "empty".
	(instructions): Tweak text. Add line about role of leaders.
	* bolodd2.g (blurb): Add author name.
	(version): Set to 0.1.
	* cave2.g (title): Change to Cave of Amazement.
	(blurb): Tweak text.
	(variants): Add sequential.
	* cave.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* cherbourg.g (blurb): Tweak text.
	(variants): Add world-seen.
	* cil.g (blurb): Add author name.
	(cil-rules): Include it instead of using it as base module
	since it is not playable on its own. 
	* civ2.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(unarmed): Define unarmed units.
	(terrain-density): Increase lush-grassland to 5000.
	(independent-density): Increase village density to 400.
	(independent-density): Double the amount of huts.
	(hit-chance): Add units village 100 (fixed serious bug that 
	caused all offensive units to ignore villages, thus forcing cities 
	to continue building offensive units instead of colonizers if there 
	was a nearby village at the start of the game). Also add unarmed 
	u* 0, thus fixing another bug that forced settlers and engineers 
	to try in vain to attack enemy units.
	(encounter-result ): Tweak text.
	(indepside-has-ai): Set to true so that the Barbarians work 
	the way they are supposed to.
	(side 0): Set name "the Barbarians".
	(side 0): Set adjective "Barbarian".
	* classic.g (version): Change from "obsolete" to 1.0.
	(variants): Add see-all and sequential.
	(synthesis-methods): Add name-geographical-features.
	(feature-types): Define peaks, islands, lakes, bays, seas,
	continents, desert, forest, mountains.
	(feature-namers): Add namers for above features.
	(town-names): Include it.
	(ng-features): Include it.
	* cobra.g (variants): Add world-seen.
	* colonizer (game-module): Don't capitalize.
	(title): Set to "Planet Colonization".
	(version): Set to "0.5".
	(blurb): Add author name.
	(bigicons): Remove obsolete gvar.
	* coral-sea-th.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* coral-sea.g (title): Tweak text.
	(version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* crater-lake.g (version): Change from "obsolete" to 1.0.
	(variants): Add world-seen and sequential.
	* duel.g (blurb): Change text.
	(variants): Add world-seen.
	(side 1): Add name "One".
	(side 2): Add name "Two".
	* dukla.g (title): Add it.
	(blurb): Add it.
	(version): Set to 1.0.
	(variants): Add sequential. Add missing stuff in capture
	the town from pgu.g.
	(synthesis-methods): Enable make-countries only.
	(area): Remove gully patch in impassable terrain.
	* dwellings.imf (village): Change name to village-s at (16 16).
	* empire.g (blurb): Tweak text.
	(variants): Add sequential.
	(version): Set to 0.5.
	(town-names): Include it.
	(capital): Add namer random-town-names.
	(ng-features): Include it.
	(feature-types): Define peaks, islands, lakes, bays, seas,
	continents, mountains.
	(feature-namers): Add namers for above features.
	(sides-min): Set to 2.
	(design-notes): Add note about problems.
	* fantasy.g (variants): Add sequential.
	(desert): Change image-name to adv-desert.
	(plains): Change image-name to adv-plain.
	(forest): Change image-name to adv-forest.
	(hills): Change image-name to adv-hills.
	(mountains): Change image-name to adv-mountains.
	(ice): Change image-name to adv-ice.
	(void): Change image-name to black.
	* feb-1917.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	* flags.imf (flag-amal): New image family.
	(flag-druze): New image family.
	(flag-hezbollah): New image family.
	(flag-plo): New image family.
	* flattop.g (burb): Tweak text.
	(variants): Add world-seen and sequential.
	* fred.g (blurb): Tweak text.
	(variants): Add world-seen and sequential. Set see-all to 
	false. Add last-side-wins scorekeeper variant.
	(sides-min): Set to 2.
	(sides-wanted): Set to 4.
	(sides-max): Set to 8.
	(side-library): Add sides from Seven Years War.
	* future.g (blurb): Add period.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Enable see-all and sequential play.
	(instructions): Copy the beginning of the notes.
	(sides-wanted): Set to 4.
	(namer): Use short-generic-names.
	(features): Add types from standard game.
	(feature-namers): Use standard namers.
	* galaxy2.g (version): Bump to 1.0.
	(blurb): Change text.
	(hit-by): Remove incorrectly used table.
	* galaxy.g (title): Change to Galaxy 1.
	(blurb): Change text.
	(version): Bump to 1.0.
	(variants): Add sequential.
	* game.dir (bolodd2): Add game module.
	(cave2): Add game module.
	(cil): Add game module.
	(colonizer): Add game module.
	(dukla): Add game module.
	(log): Add game module.
	(neurope): Add game module.
	(pgu): Add game module.
	(space-civ): Add game module.
	(spec): Add game module.
	* gazala.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen, see-all and sequential.
	* gettysburg.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add sequential.
	* greek.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Enable sequential. Set last-side-wins to true
	since the game does not work without a scorekeeper.
	(peltast): Change image-name to ancient-spearman.
	(hoplite): Change image-name to ancient-swordman.
	(archer): Change image-name to ancient-archer.
	(cavalry): Change image-name to ancient-cavalry.
	(trireme): Change image-name to ancient-trireme.
	(siege-engine): Change image-name to ancient-ballista.
	(fortifications): Change image-name to walltown.
	(polis): Change image-name to ancient-city.
	(self-required): Set to true.
	(can-be-self): Set to true for metropolis.
	(self-resurrects ): Set to true for metropolis.
	(independent-density): Increase it on plains forest and desert.
	(side-library): Add metropolis namers for each side.	
	(greek-names): New namer with greek city names.
	(greek-island-names): New namer with greek island names.
	(greek-mountain-names): New namer with greek mountain 
	names.
	(metropolis): Add namer greek-names.
	(polis): Add namer greek-names.
	(islands): Define as between 1 and 500 cells.
	(mountains): Define as at least 3 cells.
	(islands): Add feature-namer greek-island-names.
	(mountains): Add feature-namer greek-mountain-names.
	* hill.g (variants): Add world-seen, see-all and sequential.
	(sides-max): Set to 2.
	* imf.dir (city20-fire): List new image family.
	(flag-amal): List new image family.
	(flag-druze): List new image family.
	(flag-hezbollah): List new image family.
	(flag-plo): List new image family.
	* insects.g 	(blurb): Add author name.
	(version): Bump to 1.0.
	(variants): Add sequential.
	(puddle): Set image-name to sea.
	(bare): Set image-name to adv-mountains.
	(grass): Set image-name to civ-grassland.
	(sides-max): Set to 4.
	* intro.g (blurb): Tweak text.
	(instructions): Tweak text.
	(human, robot): Capitalize. Add adjectives.
	* lhs.g (blurb): Change text.
	(version): Set to 1.0.
	(feature-types): Reorder so that bays and peaks are named.
	* log.g (blurb): Add period.
	(feature-types): Reorder so that bays and peaks are named.
	* lord-rings.g (blurb): Change text.
	* magellan.g (blurb): Add period.
	(variants): Add world-seen, see-all and sequential. Add do 
	last-side-wins scorekeeper variant set to false.
	* magnuszew.g (blurb): Add period.
	(variants): Add world-seen and sequential.
	* mars.g (blurb): Tweak text.
	(version): Bump to 1.0.	
	(variants): Add world-seen and sequential.
	* metz-1944.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen.
	* midway.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* monster.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	Add do last-side-wins scorekeeper variant.
	(sides-max): Set to 8 (no more monsters).
	(area 30 30): Define so that the sides can find each other.
	* mormon.g (blurb): Add period.
	(version): Set to 1.0.
	(variants): Define see-all and add sequential.
	(acp-to-build): Fix so that Mormons can make new Mormons.
	(hp-max): Beef up Brigham Young so that he does not always 
	perish on turn 1.
	(hit-chance): Add (places u* 0). Log cabins don't fight.
	* napoleon.g (blurb): Change text.
	(version): Set to 1.0.
	(variants): Add sequential. Set clouds, winds and scoring to 
	true. Change checkbox title to "Last Side Wins". Move point 
	values out of the variant.
	(ldr): Change unit name from leader to marshal.
	(sides-wanted): Set to 6.
	(sides-max): Set to 6.
	(ng-european): Include it.
	(ng-english): Include it.
	(ng-german): Include it.
	(ng-weird): Include it.
	(places): Add namer generic-names.
	(side-library): Add emblems and unit namers for all sides.
	* neurope (title): Add it.
	(blurb): Chnage text.
	(version): Set to 0.1.
	(base-module): Set to classic.
	(variants): Add world-seen and sequential.	
	* normandy.g (title): Change to D-Day.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add world-seen. Remove Scoring variant.
	(scorekeeper): Add do last-side-wins.
	* nw-europe.g (title): Change to Operation Overlord.
	(version): Bump to 1.0.
	(blurb): Change text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* old-empire.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	(ng-features): Include it.
	(feature-types): Define peaks, islands, lakes, bays, seas 
	and continents.
	(feature-namers): Add generic feature namers.
	(city): Add namer generic-names.
	* omaha.g (blurb): Add it.
	(variants): Add world-seen.
	* panzer.g (blurb): Tweak text.
	(variants): Add sequential.
	(swamp): Add image-name flooded.
	(clear): Change image-name to adv-plain.
	(woods): Change image-name to adv-forest.
	(slope): Change image-name to hills.
	(gully): Add image-name swamp.
	* pearl.g (version): Bump to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(scorekeeper): Add do last-side-wins.
	(last-turn): Comment out.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(side 3): Set active false.
	* pelops.g (blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Enable world-seen and sequential. Remove 
	scorekeeper as a variant.
	(scorekeeper): Add do last-side-wins.
	(sides-min): Set to 3.
	(sides-max): Set to 3.
	(feature-namers): Set to none (disables naming from 
	base module).
	* pgu.g (title): Change to Panzer General.
	(version): Bump to 1.0.
	(blurb): Change text.
	(variants): Add sequential.
	(airfield): Change image-name to gray.
	* postmodern.g (variants): Add sequential.
	(ng-features): Include it.
	(feature-types): Define the usual set of features.
	(feature-namers): Add namers for all features.
	* quest.g (blurb): Tweak text.
	(variants): Add sequential.
	(ng-features): Include it.
	(feature-types): Define the usual set of features.
	(feature-namers): Add namers for all features.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* red-october.g (blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add sequential.
	(sides): Use noun or plural-noun instead of name.
	* rom-civ-war.g (blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential.
	* roman.g (blurb): Tweak text.
	(notes): Tweak text.
	(infantry): Change image to ancient-spearman.
	(cavalry): Change image to ancient-cavalry.
	(archer): Change image to ancient-archer.
	(legion): Change image to ancient-legion.
	(bireme): Change image to ancient-bireme.
	(trireme): Change image to ancient-trireme.
	(barge): Change image to ancient-barge.
	(siege-engine): Change image to ancient-onager.
	(camp): Change image to stockade.
	(tribe): Change image to ancient-tribe.
	(oppidum): Change image to village.
	(civitas): Change image to ancient-city.
	* russian-rev.g (blurb): Add author name.
	(variants): Add sequential.
	(ng-european): Include it.
	(default-namer): Set to random_town_names.
	(places): Use namer russian-place-names.
	* space-civ (title): Capitalize.
	(blurb): Add author.
	(notes): Tweak text.
	(version): Set to 0.5.
	(variants): Add sequential. Set last-side-winds to true.
	* space.g (blurb): Add it.
	(variants): Add world-seen, see-all and sequential.
	* spec-rules (mp-to-enter-terrain): Set to 1 for ferak 
	and royalferak in jungle. Don't set to 1 for these units in 
	forest and deepforest (fixes movement bug).
	* spec (version): Bump to 1.0.
	(blurb): Add author name.
	(base-module): Don't define as spec-rules since it is not 
	playable on its own.
	(instructions): Remove no longer needed file instructions.
	(spec-rules): Include it instead.
	* standard.g (blurb): Add period.
	(feature-types): Reorder so that bays and peaks are named.
	(already-seen): Set to 100 for places.
	(already-seen-independent): Set to 100 for places.
	* standard.imf (city20-fire): Add new image family.
	* steppes.g (blurb): Add period.
	(variants): Enable sequential play.
	* tailhook.g (blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 2.
	(sides-max): Set to 2.
	* tank.g (blurb): Change text.
	(variants): Add sequential. Add do last-side-wins
	scorekeeper variant.
	* time.g (blurb): Add authors.
	(version): Set to 1.0.
	(variants): Add sequential.
	* tokyo.g (variants): Add world-seen and sequential.
	(sides-max): Set to 2 (no more units).
	* u-greek.g (Athens): Put at the top of the list to make 
	self-unit.
	(Sparta): Put at the top of the list to make self-unit.
	(Sardes): Put at the top of the list to make self-unit.
	* u-normandy.g: Remove unused file.
	* voyages.g (blurb): Tweak text.
	(variants): Add sequential. Set winds to true. Add do 
	last-side-wins scorekeeper variant set to true.
	(sides-wanted): Set to 5.
	(sides-max): Set to 5.
	(ng-european): Include it.
	(ng-english): Include it.
	(side-library): Include nation-specific unit namers 
	for places.
	* wizard.g (version): Set to 1.0.
	(blurb): Add period.
	(variants): Att world-seen, see-all and sequential.
	(wagon): Change image-name to trident-settlers.
	(ship): Change image-name to ancient-trireme.
	(grog): Change image-name to heroes-dwarf1.
	(knight): Change image-name to ancient-cavalry.
	(d): Change image-name to monsters-vampire.
	(wizard): Change image-name to heroes-priest1.
	(town): Change image-name to ancient-village1.
	(city): Change image-name to ancient-blue-city.
	(guild): Change image-name to ancient-white-castle.
	(outpost): Change image-name to ancient-tower.
	(ng-features): Include it.
	(ng-weird): Include it.
	(default-namer): Set to short-generic-names.
	(town etc): Add namer short-generic-names.
	(feature-types): Define continents islands seas lakes 
	bays desert forest and mountains.
	(feature-namers): Add generic namers for all features. 
	* ww2-38.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 12.
	(agreements): Set up alliances anno 1938.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-39.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 8.
	(agreements): Set up alliances anno 1939.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-42.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen and sequential.
	(initial-year-part): Set to 8.
	(agreements): Set up alliances anno 1942.
	(scorekeeper): Add do last-alliance-wins.
	* ww2-adv (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen, see-all and sequential. Add 
	do last-alliance-wins scorekeeper variant set to true.
	(unit-size-as-occupants): Set to 10 for ground-types 
	in place-types (20 was too crowded).
	(initial-date): Set to Sep 1939.
	(initial-year-part): Set to 8.
	(sides-max): Set to 10.
	(ng-asian): Include it.
	(ng-european): Include it.
	(ng-english): Include it.
	(ng-german): Include it.
	(ng-american): Include it.
	(ng-chinese): Include it.
	(ng-japanese): Include it.
	(ng-italian): Include it.
	(side-library): Include nation-specific unit namers 
	for places.
	* ww2-bn.g (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential. Add do 
	last-side-wins scorekeeper variant set to true.
	(initial-date): Set to 0 1 Jan 1944.
	(sides-max): Set to 2.
	* ww2-div-eur.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Set to 1.0.
	(variants): Add sequential. Chnage Keep Scores to
	Last Side Wins.
	* ww2-div-pac.g (title): Tweak text.
	(blurb): Tweak text.
	(version): Bump to 1.0.
	(variants): Add world-seen, see-all, sequential and
	Last Side Wins.
	* ww2-eur-42 (title): Tweak text.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	* ww2s-pac-41.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2s-42.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2s-eur-42.g (title): Tweak text.
	(version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Enable world-seen and sequential play.
	(instructions): Tweak text.
	* ww2-pac-41.g (version): Set to 1.0.
	(blurb): Tweak text.
	(variants): Add world-seen and sequential.
	(sides-min): Set to 3.
	(sides-max): Set to 3.

	Add four more flags that are needed in the Beirut game.
	* flags16x16.gif: Add Amal, Druze, Hezbollah and PLO 
	flags. Improve the Jolly Roger.
	* flags8x8.gif: Add Amal, Druze, Hezbollah and PLO 
	flags. Improve the Jolly Roger.
	
	Update the pre-release version date.
	* version.h (VERSION): Change to February 2004.

2004-02-15  Hans Ronne <hronne@comhem.se>

	Fix some minor build problems.
	* plan.c (plan_defense): Remove partially commented 
	out if-else branch that caused parsing problems.
	(plan_random): Rewrite case TASK_HIT_UNIT without
	the empty statement that is disliked by some compilers.
	* conq.h (cmd_error): Move prototype here so that 
	skelconq can find it (this function is never used by
	skelconq, but we keep support for it anyway).
	* ui.h (cmd_error): Move prototype to conq.h.

2004-02-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make the 'kwic' program compile with a C++ compiler.
        doc/kwic.c (compare_names): Cast "const void *" to 
        "const char *".

2004-02-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add automatic unit type upgrades and the ability to apply 
        additional change-type constraints.
        * doc/refman.texi: Update documentation to reflect new 
        tables and new utype property.
        * actions.c (check_change_type_action): Make more flexible so 
        that it can deal with both doing checks at the start of a turn 
        and during a turn. Add checks involving the new tables.
        * init.c (calculate_globals): Compute a new global flag to see 
        if any types can auto-change-type.
        * kernel.h (any_auto_change_types): New extern global flag.
        * run2.c (run_auto_change_types): New function. If any units 
        can auto-change-type, then iterate through unit list and find 
        out which ones are eligible for promotion, and upgrade them to 
        their new types, if there is room. 
        * table.def (ua_to_change_type): New table. Advance(s) needed to 
        change type.
          (uu_change_type_to): New table. Possible types to change to.
          (uu_cxp_to_change_type): New table. Combat experience needed to 
        change type.
          (uu_occs_to_change_type): New table. Occupants needed to change 
        type.
          (uu_size_to_change_type): New table. Growth needed to change type.
          (uu_turn_to_change_type): New table. Minimum turn required before 
        change type.
        * utype.def (u_auto_upgrade_to): New property. Unit type to 
        automatically upgrade to.

        * aiutil.c: Add additional check to see if the unit can have any 
        supplies at all. If not, then return an approporiate value in all 
        of the recently added materials-related functions.

        * actions.c (check_transfer_action): Remove redundant tests.

        * misc.h (assert_break): Remove extra paramter for messages.
          (assert_continue): Likewise.
          (assert_goto): Likewise.
          (assert_return): Likewise.

        More preparations for more intelligent AI resupply code.
        * task.c (stock_up_materials_for_free): New function. Not compiled.
        Incomplete. Check to see if a unit can swipe any available 
        materials without expending ACP.
          (do_move_to_task): Call 'stock_up_materials_for_free'. Not 
        compiled into code at this point.
        
        Use auto-upgrade mechanism in Bellum. Please see 
        'lib/ChangeLog-bellum' for details.

2004-01-26  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve victim rating computation and fix some bugs in victim 
        seeking.
        * ai.c (ai_go_after_victim): Captures must be done 1 cell away, 
        not strikedist cells away.
        * plan.c (ai_score_potential_victim_occupants): Do not use 
        precomputed basic worths. Use probabilities from tables instead.
        This prevents negative basic scores from being used, which would 
        throw off the rest of the score calculation.
          (ai_score_potential_victim): Likewise. Also, use a separate 
        'baserating' variable to base rating calculations off of. This 
        prevents 'rating' from ballooning too rapidly in some cases. 
        Add a bonus based on how many types an unit type can build rather 
        than simply whether it can build or not. Add a bonus if the 
        potential victim is worth many more construction points than the 
        victim seeker. Fix bug in the score penalty, which made heavily 
        outclassed victim seekers less penalized than moderately 
        outclassed ones.
          (ai_victim_here): Hoist the occupancy status check above most 
        of the victim seeker logic to make sure that it is always called 
        when it should be. Remove commented out test.
          (ai_consider_capturing): Force a victim seeker consider 
        capturing an enemy self-unit, if that victim seeker is the only kind 
        of unit on its side which could capture the enemy self-unit. Add 
        sanity checks to beginning of function. Simplify capture chance 
        logic.

        Prepare functions for making AI more intelligent wrt resupply.
        (Some of the new functions are near duplicates of existing ones, 
        and this redundancy should be resolved in the near future.)
        (Some of the new functions may be useful at a lower level than the 
        AI, and should perhaps be moved to different files.)
        * aiutil.c (has_enough_of_material): New function. Is a given unit 
        satisfied that is has enough of a given material?
          (needs_n_of_material): New function. How much a given material 
        is needed to satisfy a given unit?
          (has_full_amount_of_material): New function. Does the given unit 
        have the full amount of a given material?
          (wants_n_of_material): New function. How much of a given material 
        is needed to fill a given unit?
          (would_starve_without_material): New function. Would a given unit 
        type starve without a given material?
          (will_starve_wrt_material): New function. Will a given unit starve 
        unless it has some of a given material?
          (can_donate_n_of_material): New function. How much of a given 
        material can a given unit willingly provide?
          (can_sacrifice_n_of_material): New function. How much of a given 
        material can a given unit provide and still survive without acting 
        for one turn?
          (has_enough_of_all_materials): New function. Is a given unit 
        satisfied taht it has enough of all materials?
          (has_full_amount_of_all_materials): New function. Does as given 
        unit have a full amount of all materials?
          (will_starve): New function. Will a given unit starve unless it 
        receives some material?
          (critcally_needed_material): New function. What is the first 
        material needed to prevent starvation?
          (most_needed_material): New function. Which material is most 
        needed by the given unit, and how much of it is needed?
          (most_wanted_material): New function. Which material is most 
        wanted by the given unit, and how much of it is desired?
        * aiutil.h (has_enough_of_material): New prototype.
          (needs_n_of_material): New prototype.
          (has_full_amount_of_material): New prototype.
          (wants_n_of_material): New prototype.
          (would_starve_without_material): New prototype.
          (will_starve_wrt_material): New prototype.
          (can_donate_n_of_material): New prototype.
          (can_sacrifice_n_of_material): New prototype.
          (has_enough_of_all_materials): New prototype.
          (has_full_amount_of_all_materials): New prototype.
          (will_starve): New prototype.
          (critically_needed_material): New prototype.
          (most_needed_material): New prototype.
          (most_wanted_material): New prototype.

        Fix odd movement bug, which would loop infinitely due to a unit 
        attempting to move to its own cell because the next cell was being 
        chosen incorrectly.
        * move.c (do_move_action): Break out of infinite loop if 
        next-cell-is-same-cell weirdness occurs.

        Make the Random plan more intelligent. Just because the plan is 
        random does not mean that its task assignments should be random to 
        the point of lunacy.
        * plan.c (plan_random): Call 'ai_go_after_victim' for the 
        'TASK_CAPTURE' and 'TASK_HIT_UNIT' cases. If that call returns 
        false, put the unit into reserve. Make the 'TASK_MOVE_TO' case 
        check to see if it is using a valid coordinate pair; if not, then 
        put the unit into reserve.

        Cancel a movement task if it is for getting materials that are no 
        longer needed.
        * task.c (do_move_to_task): If next task after the current move-to 
        is a resupply task, then check to see if the resupply indicated 
        by that next task is still needed. Supply lines may have removed 
        the need between turns.

2004-01-19  Eric McDonald  <mcdonald@phy.cmich.edu>

        Improve victim rating computation.
        * ai.c (ai_go_after_victim): Set initial victim_rating to 0 
        rather than INT_MIN. This allows negative ratings to be rejected.
        * aiutil.c (can_be_blocked_by_any_known_enemy_at_if_at): New 
        function. Can be used as predicate with search routines. 
        Performs a check similar to the one used by the movement code, but 
        checks for blocking ZOC's only from known enemy units.
          (can_be_blocked_by_any_known_enemy_if_at): New function. Can be 
        used as a predicate with search routines. For each cell that a 
        unit could hypothetically move to, this searches for potential 
        enemy blockers.
        * aiutil.h (struct a_blocking_zoc_param_box): Structure used for 
        passing parameters in and out of a blocking ZOC search routines. 
        Provides a sleeker, reentrancy-safe alternative to the globals 
        (such as the "victim_*" family and tmpunit) commonly used now.
          (can_be_blocked_by_any_known_enemy_at_if_at): New prototype.
          (can_be_blocked_by_any_known_enemy_if_at): New prototype.
        * conq.h (zoc_range): Transplanted prototype from 'move.c'.
          (unit_blockable_by): Transplanted prototype from 'move.c'.
        * move.c (unit_blockable_by): Remove prototype.
          (zoc_range): Remove prototype.
        * plan.c (ai_score_potential_victim): Add a reciprocal distance 
        penalty, an encounterable victim bonus, self-defense bonus, and 
        victim-with-superior-firepower penalty to computation. Also rewrite 
        the builder-defense bonus not to use a hard-wired constant.
        * task.c (do_move_to_task): If pathfinding is failing and likely 
        due to the presence of a blocking ZOC, and unit is planning to hit 
        or capture something next, then blast the task, and let the planner 
        reconsider what to be done (perhaps hit the blocker). (This is 
        modification is only mildly effective at this point, as the 
        pathfinder usually finds another path which avoids the blockage.)

        Improve performance in non-networked games of Xconq until network 
        sync bug is found and fixed.
        * config.h (USE_LR_PATHING_SOLO): New macro definition.
        * move.c (choose_move_direction): If 'USE_LR_PATHING_SOLO' is set, 
        then wrap cache access code with a check to see that numremotes 
        equals 0 (i.e., a standalone game is being played).
        * path.c (path_get_next_move): Likewise.

        Add some new macro routines for debugging. Will assert if 
        assertions are enabled; otherwise they will output a diagnostic 
        to the user and/or perform a flow control action.
        * misc.h (assert_warning): Warn user if condition test fails.
          (assert_warning_break): Warn user if condition test fails, and 
        then break.
          (assert_warning_continue): Warn user if condition test fails, 
        and then continue.
          (assert_warning_goto): Warn user if condition test fails, and 
        then goto the specified label.
          (assert_warning_return): Warn user if condition test fails, and 
        then return the specified value.
          (assert_error): Give user an error notification if condition test 
        fails, and then abort Xconq.
          (assert_break): Break if condition test fails.
          (assert_continue): Continue if condition test fails.
          (assert_goto): Goto specified label if condition test fails.
          (assert_return): Return specified value if condition test fails.

        Add new search algorithm.
        * world.c (limited_search_under_arc): New function. Searches all the 
        cells in the area from an origin point out to the specified distance, 
        and walled within two adjacent directions. Search may be left-handed 
        or right-handed (in reference to which neighboring direction is used). 
        Search may also be "no-handed", in which case only a radial line 
        segment is searched. Has result limiter. Uses a "parameter box" 
        mechanism instead of common globals. Search performed in depth-first 
        manner.
          (search_under_arc): New function. Wrapper for 
        'limited_search_under_arc' which calls it with an effectively 
        unlimited result limit.
        * world.h (limited_search_under_arc): New prototype.
          (search_under_arc): New prototype.

2004-01-17  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix somewhat latent network sync error introduced by yesterday's 
        patch.
        * ai.c (ai_go_after_victim): Add broadcast flag to parameter 
        list. Use broadcast flag to choose between local and net versions 
        for tasking.
          (offensive_reaction): Call 'ai_go_after_victim' with broadcast 
        flag set to TRUE.
        * plan.c (plan_offense): Call 'ai_go_after_victim' with broadcast 
        flag set to FALSE.
          (plan_defense): Likewise.
          (plan_exploration): Likewise.

2004-01-16  Eric McDonald  <mcdonald@phy.cmich.edu>

        Unify victim finding for capturing, firing, and attacking, and 
        use the victim finder in all places where the previous 
        action-specific victim finders were used. Make victim finder 
        no longer give expedited treatment to capturable and 
        encounterable units. Separate scoring of victims from victim 
        rejection filter. Let victim finder rely on more small evaluator 
        functions rather than retaining so much logic in the main body 
        of the function. (More work still needs to be done to further 
        refine and polish the victim finding, but I would consider this 
        checkin to be an improvement.)
        * ai.c (ai_go_after_victim): No longer static; now global. 
        Comment out old move/attack dispatcher logic. Replace with new 
        logic that accounts for both combat models, prefered capture and 
        hit methods, and prescheduled movement to within striking 
        distance of target. (A few simplifications could be made to 
        this new logic.)
          (average_damage): Rewrite to use new 'dice_roll_mean' function.
          (offensive_worth): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (defensive_worth): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (basic_hit_worth): Make sure that acp-to-attack being zero is 
        only a penalty to acp-dependent units.
          (basic_fire_worth): Make sure that aco-to-fire being zero is 
        only a penalty to acp-dependent units. Use new 'fire_hit_chance' 
        and 'fire_damage' functions.
        * aiutil.c (dice_roll_min): New function. Minimum value from 
        a given integer dice rep.
          (dice_roll_mean): New function. Mean value from a given integer 
        dice rep.
          (dice_roll_max): New function. Maximum value from a given 
        integer dice rep.
          (could_damage_by_fire): Use new 'fire_damage' function.
          (could_capture_any): New function. Could the given type capture 
        any other type?
          (type_attack_damage_max): Use new 'dice_roll_max' function.
          (type_attack_damage_min): Use new 'dice_roll_min' function.
          (type_fire_damage_max): Use new 'dice_roll_max' and 'fire_damage' 
        functions.
          (type_fire_damage_min): Use new 'dice_roll_min' and 'fire_damage' 
        functions.
          (type_fire_range_max): New function. Maximum fire range of one 
        type vs. another.
          (type_hit_range_max): New function. Maximum hit range of one 
        type vs. another.
          (type_ideal_fire_range_max): More cautious logic. Use the greater 
        of hit-falloff-range and range-min.
          (type_possible_damage_methods): Return the various methods that 
        a given type can damage another given type.
          (occ_status): Improved logic. If not see-all but can-see-occupant, 
        then return 'MAYBE_HAS_OCCS' instead of 'DEFINITELY_HAS_NO_OCCS', if 
        no occs seen.
          (n_planning_to_hit_type_at): New function. How many side units are 
        planning to hit a given type at a given position?
          (n_planning_to_capture_type_at): New function. How many side units 
        are planning to capture a given type at a given position?
        * aiutil.h (dice_roll_min): New prototype.
          (dice_roll_mean): New prototype.
          (dice_roll_max): New prototype.
          (could_capture_any): New prototype.
          (type_fire_range_max): New prototype.
          (type_hit_range_max): New prototype.
          (type_possible_damage_methods): New prototype.
          (n_planning_to_hit_type_at): New prototype.
          (n_planning_to_capture_type_at): New prototype.
        * combat.c (fire_hit_chance): New function. Get the value from 
        'fire-hit-chance' or 'hit-chance' as appropriate.
          (fire_damage): New function. Get the value from 'fire-damage' 
        or 'damage' as appropriate.
          (indep_capture_chance): New function. Get the value from 
        'independent-capture-chance' or 'capture-chance' as appropriate.
          (check_fire_at_action): Use new 'fire_hit_chance' function.
          (maybe_hit_unit): Use new 'fire_hit_chance' and 'fire_damage' 
        functions.
          (could_capture_by_attack): New function.
          (could_capture_by_fire): New function.
          (could_capture_by_capture): New function.
          (could_capture): New function.
          (capture_chance): Use new functions 'fire_hit_chance' and 
        'indep_capture_chance'.
          (could_fire_at): Use new function 'fire_hit_chance'.
          (type_can_fire): Use new functions 'fire_hit_chance' and 
        'fire_damage'.
        * config.h (INT_MIN): New macro defining minimum integer size. 
        (This should be handled more dynamically in the future.)
        * conq.h (fire_hit_chance): New prototype.
          (fire_damage): New prototype.
          (indep_capture_chance): New prototype.
          (could_capture_by_attack): New prototype.
          (could_capture_by_fire): New prototype.
          (could_capture_by_capture): New prototype.
          (could_capture): New prototype.
        * plan.c (compute_damage_ratio): Rename to 'ai_damage_ratio_vs_type'.
          (go_after_victim): Disable. 'ai_go_after_victim' now used.
          (ai_score_potential_victim_occupants): New function. Find out 
        how the known occupants of potential victim add to that victim's 
        rating.
          (ai_score_potential_victim): New function. Evaluate how much a 
        victim is worth.
          (ai_choose_best_hit_method): New function. (Still fairly crude.) 
        Evaluate what the best way to hit a target is.
          (ai_consider_capturing): New function. Determine whether an AI 
        should bother attempting capture.
          (ai_consider_shaking): New function. Determine whether an AI 
        should bother roughing up a transport to hurt possible occupants.
          (ai_go_after_vicitm): Declare extern for now. Implementation 
        rests in 'ai.c'. Eventually all of the "ai_*" namespace functions 
        might go there.
          (plan_offense): Call 'ai_go_after_victim' instead of 
        'go_after_victim'. Replace call to 'fire_at_opportunity' with call 
        to 'ai_go_after_victim'.
          (plan_defense): Call 'ai_go_after_victim' instead of 
        'go_after_victim'. Replace calls to 'fire_at_opportunity', 
        'capture_indep_if_nearby', and 'capture_useful_if_nearby' with 
        call to 'ai_go_after_victim'.
          (plan_exploration): Replace calls to 'capture_indep_if_nearby' 
        and 'capture_useful_if_nearby' with call to 'ai_go_after_victim'. 
        Protect call to 'ai_go_after_victim' with anti-flashing logic. 
        Add commented out safeguards to see if provided goals have 
        pathable destinations; pathfinder needs to be improved before 
        turning on these checks; (goal-setter should also be looked at to 
        nip the problem of bad goals in the bud). Fix memory leak in 
        goal blanking logic.
          (ai_victim_here): Partially rewrite to support beforementioned 
        new features of the code.
          (target_here): Unused function. Use new 'fire_damage' function.
          (capture_useful_if_nearby): Unused function. Partially rewrite 
        to more thoroughly accomodate both combat models and ways of 
        capturing units.
        * ui.c (unit_could_attack): Use new 'fire_hit_chance' function.

        * ui.c (impl_move_to): Fix bug that prevented setting destinations 
        into unknown cells.

2004-01-10  Eric McDonald  <mcdonald@phy.cmich.edu>

        Add new files for AI/UI utility functions that return strict, 
        objective answers, but are not used by the referee code.
        * kernel/Makefile.in (ALL_H): Add 'aiutil.h'.
          (OBJS): Add 'aiutil.o'.
          (MW32_OBJS): Add 'aiutil_mw32.o'.
        * kernel/ai.c: Include 'aiutil.h'.
        * kernel/plan.c: Include 'aiutil.h'.
        * kernel/task.c: Include 'aiutil.h'.
        * kernel/aiutil.h: New file.
        * kernel/aiutil.c: New file.

        Start adding more AI-related functions to "ai_" namespace.
        * kernel/ai.c (ai_go_after_victim): Change 'victim_here' call 
        to 'ai_victim_here' call.
          (enemy_close_by): Likewise.
        * kernel/autotest.c (test_victim_here): Likewise.
        * kernel/plan.c (go_after_victim): Likewise. Also rename 
        'victim_here' to 'ai_victim_here'.
        * kernel/conq.h: Rename 'victim_here' to 'ai_victim_here'.

        Include 'assert.h' as a master header instead of in disparate 
        source files.
        * kernel/config.h: Include 'assert.h' here.
        * kernel/ai.c: Do not include 'assert.h' here.
        * kernel/move.c: Likewise.
        * kernel/path.c: Likewise.
        * kernel/task.c: Likewise.

        * kernel/combat.c (could_hit): Rewrite in terms of 'could_attack' 
        and 'could_fire_at'.
          (could_attack): New function with "more correct" logic.
          (could_fire_at): New function with "more correct" logic.
        * kernel/conq.h (could_attack): New prototype.
          (could_fire_at): New prototype.

        Transplant existing AI/UI utility functions and create some new 
        ones.
        * kernel/plan.c (unit_planning_to_hit): Move to 'aiutil.c' and 
        rename to 'planning_to_hit_type_at'.
          (side_planning_to_capture): Move to 'aiutil.c' and rename to 
        'side_planning_to_capture_type_at'.
          (side_planning_to_hit): Move to 'aiutil.c' and rename to 
        'side_planning_to_hit_type_at'.
          (ai_victim_here): Rename calls according to their changed names.
        Also call 'occ_status' instead of duplicating its logic in the 
        function body. Remove anonymous "occupancy status" enum now that 
        OccStatus is declared in 'aiutil.h'. Replace checks for 
        damagability and destructibiliy with call to 'could_destroy'.
          (target_here): Rename 'side_planning_to_capture' call to 
        'side_planning_to_capture_type_at'.
          (compute_damage_ratio): Rename calls according to their changed 
        names. (This function is AI code and should be added to the AI 
        namespace and eventually moved.)
          (type_damage_amount_max): Move to 'aiutil.c' and rename to 
        'type_damage_max'.
        * kernel/aiutil.c (planning_to_hit_type_at): Transplanted from 
        'plan.c'.
          (planning_to_capture_type_at): New function. Logic taken from 
        old 'side_planning_to_capture' function.
          (side_planning_to_hit_type_at): Transplanted from 'plan.c'. 
        Rewritten in terms of 'planning_to_hit_type_at'.
          (side_planning_to_capture_type_at): Transplanted from 'plan.c'. 
        Rewritten in terms of 'planning_to_capture_type_at'.
          (could_damage_by_attack): New function.
          (could_damage_by_fire): New function.
          (could_damage): New function.
          (could_destroy): New function.
          (type_attack_damage_max): New function.
          (type_attack_damage_min): New function.
          (type_fire_damage_max): New function.
          (type_fire_damage_min): New function.
          (type_damage_max): Transplanted from 'plan.c'. Rewritten in terms 
        of 'type_attack_damage_max' and 'type_fire_damage_max'.
          (type_attack_range_max): New function.
          (type_ideal_attack_range_max): New function.
          (type_ideal_fire_range_max): New function.
          (type_ideal_hit_range_max): New function.
          (occ_status): New function. Logic transplanted from 'plan.c'.
        * kernel/aiutil.h: Create prototypes for functions in 'aiutil.c'.

        Help victim finder not choose unreachable victims.
        * kernel/plan.c (ai_victim_here): Calculate a strike distance 
        based on the best ideal range for attacking or firing at a 
        potential victim. If potential victim is outside strike distance, 
        and victim seeker is mobile, then see if victim seeker can get 
        within the strike distance of the potential victim.

2004-01-05  Hans Ronne <hronne@comhem.se>

	Add pre-flight command checking for move and move-to
	commands in all interfaces that tests if a path exists to
	the intended destination. 
	* history.def (A_MOVE_NO_PATH): New HistEventType.
	* nlang.c (advance_failure_desc): Return empty string
	if reason was A_MOVE_NO_PATH.
	* ui.h (impl_move_to): Prototype extern.
	* ui.c (impl_move_to): New function.
	(advance_into_cell): Call impl_move_to instead of
	net_set_move_to_task. Check the result and set reason 
	to A_MOVE_NO_PATH if we failed. Provide notification
	feedback when a unit is unable to move because it lacks
	acps.
	* ccmd.c (do_move_to): Call impl_move_to instead 
	of net_set_move_to_task or net_designer_teleport. 
	Return cmd_error for non-mobile units unless 
	is_designer(side).
	* maccmd.c (do_one_move_to): Call impl_move_to
	instead of net_set_move_to_task or net_designer_teleport.
	Set map_modal to NO_MODAL when done. Return cmd_error
	for non-mobile units unless is_designer(dside).
	* tkcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.
	* tkmap.c (move_the_selected_unit): Check that failbuf
	is non-empty before using it.
	* sdlcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.
	* xcmd.c (do_move_to): Return cmd_error for 
	non-mobile units unless is_designer(side). 
	(aux_move_to): Call impl_move_to instead of 
	net_set_move_to_task or net_designer_teleport. Set 
	modalhandler to aux_move_to if impl_move_to fails.

	Fix various problems with the new pre-flight command 
	checking for the build code.
	* ui.c (impl_build): Add message that tells the user to 
	try once again if the selected location was no good.
	* unit.c (side_could_put_type_at): New function.
	(unit_can_build_type_at): Check for incomplete units in
	the same cell and don't require extra space for creating a
	new unit in that case. Add notification messages that tell
	the player to pick a new location if we fail.
	* ccmd.c (do_build): Replace commented out cmd_error
	with working version from tkcmd.c. Improve notification 
	messages.
	* macunit.c (update_build_menu): Add any incomplete
	units that we may build on even if there is no space for
	new units.
	* tkcmd.c (do_build): Improve notification messages.
	(aux_build): Rearrange so that the Escape key works 
	again. Improve notification messages.
	(aux_build_2): Rearrange so that the Escape key works 
	again. Improve and add notification messages.
	(aux_change_type): Improve notification messsage.
	* sdlcmd.c (aux_build): Rearrange so that the Escape 
	key works again. Improve notification messages.
	(aux_build_2): Rearrange so that the Escape key works 
	again. Improve and add notification messages.
	(aux_change_type): Improve notification messsage.
	* xcmd.c (do_build): Don't test for numtypes in the
	cmd_error code. Improve notification messsage.
	(aux_build): Improve notification messages.
	(aux_change_type): Improve notification messsage.
	
	Add a side->cancarry vector to speed up path-finding
	that involves transports.
	* actions.c (make_unit_complete): Make a call to
	update_cancarry_vector for transports.
	* conq.h (update_cancarry_vector): Prototype extern.
	* init.c (calculate_globals): Call update_cancarry_vector.
	* run.c (update_cancarry_vector): New function.
	* side.c (create_side): Allocate side->cancarry vector.
	* side.h (a_side): Add side->cancarry vector.
	(side_can_carry): New macro.
	* unit.c (change_unit_type): Call update_cancarry_vector.
	(change_unit_side): Call update_cancarry_vector.
	* unit.h (side_could_put_type_at): Prototype.

	Make direct_access_to available to the kernel.
	* kernel.h (direct_access_to): Prototype here.
	* plan.c (direct_access_to): Remove prototype.
	* task.c (direct_access_to): Remove prototype.
	
	Remove hack in the tcltk interface that forces the unit to
	build on an incomplete transport even if the player wants
	it to do something else.
	* tkcmd.c (do_build): Remove net_resume_build_task
	call in the default case.

	Fix so that the Escape key works in the command line of 
	the Mac tcltk interface.
	* tkmain.c (tk_interp_key): Add code that checks argv[3]
	for "Escape" and set inpch to ESCAPE_CHAR in that case.
	* tkconq.tcl (make_normal_bindings): Add key binding
	for "%K" == "Escape".

2004-01-04  Jim Kingdon  <kingdon@panix.com>

	* curses/ccmd.c (cmd_error): Call vsnprintf not vsprintf.
	* kernel/skelconq.c (cmd_error): Add this function.

2004-01-04  Hans Ronne <hronne@comhem.se>

	Fix so that the curses interface does not choke on games
	like Bellum that generate messages during run_turn_start.
	* cdraw.c (show_cursor): Return if we lack curunit.

	Add change-type handling code to the Mac PPC interface 
	and enable Eric's code for the other interfaces.
	* cmd.def (do_change_type): Enable command.
	* maccmd.c (do_change_type): New function.
	* macdefs.h (miPlayChangeType): New menu item. 
	Reorder existing menu items.
	(mChangeTypePopup): New menu.
	(dChangeType): New dialog and items.
	* macconq.h (changetypewin): Declare extern WindowPtr.
	(changetypewin_unit): Declare extern unit.
	(show_change_type_dialog): Prototype extern.
	(draw_change_type_dialog): Prototype extern.
	(do_mouse_down_change_type): Prototype extern.
	(do_key_down_change_type): Prototype extern.
	* macconq.c (do_mouse_down): Handle changetypewin.
	(handle_keystroke): Handle changetypewin.
	(update_window): Handle changetypewin.
	(update_unit_acp_display): Update changetypewin.
	* macmenus.c (do_menu_command): Add miPlayChangeType.
	(adjust_menus): Handle miPlayChangeType.
	(enable_commands_for_unit): Handle miPlayChangeType.
	* macunit.c (buildwin_unit): Initialize to NULL.
	(changetypewin_unit): Initialize to NULL.
	(changetypewin): Initialize to NULL.
	(changetype_dlg): Initialize to NULL.
	(show_change_type_dialog): New function.
	(draw_change_type_dialog): New function.
	(do_mouse_down_change_type): New function.
	(do_key_down_change_type): New function.
	(hit_change_type_dialog): New function and prototype.
	(update_change_type_menu): New function and prototype.
	* tkconq.tcl (create_map_menus): Enable Change Type
	command in the Play menu.
	(adjust_play_menu): Enable Change Type adjustment.
	* Xconq.r (CNTL 721 "Change Type Popup): New control.
	(dctb 813 "Change Type"): New dialog color table.
	(DITL 813 "Change Type"): New dialog item list.
	(DLOG 813 "Change Type"): New dialog resource.
	(MENU 132 "Play"): Add Change Type menu item.
	(MENU 721 "Change Type Popup"): New popup menu.
	
	Improve notification feedback and history event message
	code for change type actions.
	* history.def (H_UNIT_TYPE_CHANGED): Pass the new
	unit type as third argument.
	* nlang.c (historical_event_desc): Handle case
	H_UNIT_TYPE_CHANGED.
	* ui.c (impl_build): Fix some comment typos.
	(impl_change_type): Add notification feedback for 
	successful action. Tweak the other messages and add
	 the unit type name.
	 * unit.c (change_unit_type): Pass newtype as third
	 argument in the call to record_event.
	
	Fix minor bug in the Mac PPC unit build popup.
	* macunit.c (draw_unit_build_dialog): Remove 
	redundant call to GetDItem.

	Fix to unit selection in the Mac PPC interface.
	* maccmd.c (get_selected_units): Check that the selected unit
	is in_play and that side_controls_unit is true also for units
	that are selected from a list. Note: this check is redundant since
	apply_to_all_selected checks the same thing again, but we do
	it anyway for consistency and in case get_selected_units is 
	used in some other way in the future.
	(get_one_selected_unit): New function and prototype.

2004-01-02  Eric McDonald  <mcdonald@phy.cmich.edu>

        Fix very serious movement bug that prevented units from legally 
        disembarking from a transport as part of movement. Thanks to 
        Jim Kingdon and Brian Dunn who reported this bug.
        * move.c (pathable_point): Add a special test to make sure that 
        proper ferry costs are used when leaving a transport. (This still 
        may not be quite correct because we should check the ferry entry 
        costs of another ferry we might be boarding on the first step 
        of the journey.)

        Try to speed up the pathing a little.
        * move.c (pathable_point): Try to optimize the logic in the 
        side_unit_list iterator when looking for suitable transports.
        * path.c (path_get_next_move): Keep nodelist_verify calls out 
        of the most active flow.

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        Make CVS ignore alternately named executables and clutter in 
        the kernel directory.
        * curses/.cvsignore: Ignore 'xconq' and 'xconq.exe'.
        * kernel/.cvsignore: Ignore 'Xconq.Warnings' from 'skelconq'.
        * sdl/.cvsignore: Ignore 'sdlconq' and 'sdlconq.exe'.
        * tcltk/.cvsignore: Ignore 'tkconq' and 'tkconq.exe'.

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        The new year comes amain in the US Mountain timezone. Just 
        a few more minutes....
        Happy New Year from Boulder, CO, USA!

        Add disabled (but tested) support for the "change-type" 
        mechanism in the Curses, Xt/Xaw, SDL, and Tcl/Tk interfaces.
        To be enabled once the Mac interface supports change-type.
        * kernel/cmd.def (c): Fill out change-type command information 
        for 'c' key binding. Leave commented out. Must uncomment to 
        enable change-type.
        * curses/ccmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (This has not been tested 
        because Cconq presently chokes on Bellum, the test case.)
        * kernel/ui.c (impl_change_type): New function. Common code 
        shared by all the interfaces. This interacts with the 
        change-type machinery in the kernel.
        * kernel/ui.h (impl_change_type): New prototype.
        * lib/u-bellum.g (material-to-change-type): Hacked for testing.
        * lib/uu-bellum.g (acp-to-change-type): Hacked for testing.
        * sdl/sdlcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type.
        * tcltk/tkcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type.
        * tcltk/tkconq.tcl: Add "Change Type" to "Play" menu and make 
        sure that it gets updated. Commented out for now. (Remember to 
        uncomment when activating change-type in Xconq.)
        * tcltk/tkinit.c (update_action_controls_info): Make sure that 
        the "Change Type" info flag is properly udpated.
        * x11/xcmd.c (do_change_type): New function. Handle user 
        interaction with change-type. (Fully tested.)
          (aux_change_type): New prototype and function. Provide extended 
        user interaction for change-type. (Fully tested.)

2004-01-01  Eric McDonald  <mcdonald@phy.cmich.edu>

        Splice in entries that were missed during log separation.
        * ChangeLog-2003: Reinsert missed entries from between 12-28 
        and 12-30.

2004-01-01  Hans Ronne <hronne@comhem.se>

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

	Split the ChangeLog file.
	* ChangeLog: Move old content to ChangeLog-2003.
	* ChangeLog-2003: New file.
