--- main-win.c	2011-06-15 19:46:30.000000000 -0500
+++ ..\main-win.c	2011-06-16 10:57:20.000000000 -0500
@@ -195,16 +195,8 @@
 #define IDM_WINDOW_D_HGT_7		277
 
 #define IDM_OPTIONS_GRAPHICS_NONE   400
-#define IDM_OPTIONS_GRAPHICS_OLD    401
-#define IDM_OPTIONS_GRAPHICS_ADAM   402
-#define IDM_OPTIONS_GRAPHICS_DAVID  403
-#define IDM_OPTIONS_GRAPHICS_NOMAD  404
-#define IDM_OPTIONS_GRAPHICS_NICE   405
-#define IDM_OPTIONS_GRAPHICS_SHOCK  406
-#define IDM_OPTIONS_GRAPHICS_EXTRA  407
-//#define IDM_OPTIONS_TRPTILE         407
-//#define IDM_OPTIONS_DBLTILE         408
-//#define IDM_OPTIONS_BIGTILE         409
+#define IDM_OPTIONS_GRAPHICS_NICE   445
+
 #define IDM_OPTIONS_LOW_PRIORITY    420
 #define IDM_OPTIONS_SAVER           430
 #define IDM_OPTIONS_MAP             440
@@ -223,27 +215,39 @@
 #define IDM_OPTIONS_TILE_16x8       458
 #define IDM_OPTIONS_TILE_16x16      459
 
+#define IDM_TILE_FONT 		190
+#define IDM_TILE_08X08		191
+#define IDM_TILE_16X16		192
+#define IDM_TILE_32X32		193
+#define IDM_TILE_08X16		194
+#define IDM_TILE_10X20		195
+#define IDM_TILE_16X32		196
+#define IDM_TILE_08X13		197
+#define IDM_TILE_10X17		198
+#define IDM_TILE_12X13		199
+#define IDM_TILE_12X20		188
+#define IDM_TILE_16X25		189
+
 #define IDM_HELP_GENERAL		901
 #define IDM_HELP_SPOILERS		902
 
 /* Specifications for graphics modes.  */
 static const struct {
- 	const char *file;			// Base name of png file (if any)
-	const char *name;			// Value of ANGBAND_GRAF variable
-	int menuItem;			// Menu item to select the fileset
 	short grafID;			// id of tile set should be >0 and unique for anything new
 	short overdrawCol;	// column in the file where tiles to the right of draw the tile above as well
+	const char *name;			// Value of ANGBAND_GRAF variable
+ 	const char *file;			// name of png file (if any)
 	const char *menuname;			// Value of ANGBAND_GRAF variable
 } graphics_modes[] = {
-	{ "8x8.png",     "old", IDM_OPTIONS_GRAPHICS_OLD,   1,  0, "&Old tiles"},
-	{ "16x16.png",   "new", IDM_OPTIONS_GRAPHICS_ADAM,  2,  0, "&Adam Bolt's tiles"},
-	{ "32x32.png", "david", IDM_OPTIONS_GRAPHICS_DAVID, 3,  0, "&David Gervais' tiles"},
-	{ "8x16.png",  "nomad", IDM_OPTIONS_GRAPHICS_NOMAD, 4,  0, "No&mad's tiles"},
-	{ "64x64.png", "shock", IDM_OPTIONS_GRAPHICS_SHOCK, 6,122, "&Shockbolt's tiles"},
-	{ "32x32.png", "david", IDM_OPTIONS_GRAPHICS_EXTRA, 7,  0, "&Extra tiles"},
-	{ NULL,           NULL, IDM_OPTIONS_GRAPHICS_NONE,  0,  0, "&None"}
+  {  1,   0,   "old", "8x8.png",   "&Old tiles"},
+  {  2,   0,   "new", "16x16.png", "&Adam Bolt's tiles"},
+  {  3,   0, "david", "32x32.png", "&David Gervais' tiles"},
+	{  4,   0, "nomad", "8x16.png",  "No&mad's tiles"},
+	{  6, 122, "shock", "64x64.png", "&Shockbolt's tiles"},
+	{  7,   0, "david", "32x32.png", "&Extra tiles"},
+	{  0,   0,    NULL,        NULL, "&None"}
 };
-
+static const int graphics_mode_high_id = 7;
 
 /*
  * This may need to be removed for some compilers XXX XXX XXX
@@ -1350,72 +1354,17 @@
 		path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name);
 
 		/* Load the image or quit */
-		if (!ReadDIB2_PNG(data[0].w, buf, &infGraph, &infMask)) {
-			plog_fmt("Cannot read file '%s'", name);
-			return FALSE;
-		}
-
-		/* Save the new sizes */
-		infGraph.CellWidth = wid;
-		infGraph.CellHeight = hgt;
-
-		/* Activate a palette */
-		if (!new_palette())
-		{
-			/* Free bitmap XXX XXX XXX */
-
-			/* Oops */
-			plog("Cannot activate palette!");
-			return (FALSE);
-		}
-
-		/* Graphics available */
-		can_use_graphics = arg_graphics;
-	}
-
-	/* Result */
-	return (can_use_graphics);
-}
-static bool init_graphics_alpha(void)
-{
-	/* Initialize once */
-	/* if (can_use_graphics != arg_graphics) */
-	{
-		char buf[1024];
-		int wid, hgt;
-		const char *name;
-
-    
-		 if (tileset[0] && arg_graphics) {
-      char *end;
-      if (!tilegraf[0]) {
-			  plog_fmt("invalid tile name '%s'", tilegraf);
-			  return FALSE;
-      }
-      wid = strtol(tileset,&end,10);
-      hgt = strtol(end+1,&end,10);
-      if ((wid < 2) || (hgt < 2)) {
-			  plog_fmt("invalid tile dimensions in tileset name: '%s'", tileset);
+    if (overdraw) {
+		  if (!ReadDIB2_PNG(data[0].w, buf, &infGraph, NULL)) {
+			  plog_fmt("Cannot read file '%s'", name);
 			  return FALSE;
-      }
-      name = tileset;
-      ANGBAND_GRAF = tilegraf;
-			use_transparency = FALSE;
+		  }
     } else {
-			wid = 8;
-			hgt = 8;
-			name = "8x8.png";
-			ANGBAND_GRAF = "old";
-		}
-
-		/* Access the bitmap file */
-		path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name);
-
-		/* Load the image or quit */
-		if (!ReadDIB_PNG_Alpha(data[0].w, buf, &infGraph)) {
-			plog_fmt("Cannot read file '%s'", name);
-			return FALSE;
-		}
+		  if (!ReadDIB2_PNG(data[0].w, buf, &infGraph, &infMask)) {
+			  plog_fmt("Cannot read file '%s'", name);
+			  return FALSE;
+		  }
+    }
 
 		/* Save the new sizes */
 		infGraph.CellWidth = wid;
@@ -1438,6 +1387,7 @@
 	/* Result */
 	return (can_use_graphics);
 }
+
 #endif /* USE_GRAPHICS */
 
 
@@ -1852,28 +1802,19 @@
 		FreeDIB(&infMask);
 
 		/* Initialize (if needed) */
-    if (overdraw) {
-		  if (arg_graphics && !init_graphics_alpha())
-		  {
-			  /* Warning */
-			  plog("Cannot initialize graphics!");
+		if (arg_graphics && !init_graphics())
+		{
+			/* Warning */
+			plog("Cannot initialize graphics!");
 
-			  /* Cannot enable */
-			  arg_graphics = GRAPHICS_NONE;
-      } else {
-       	td->t.pict_hook = Term_pict_win_alpha;
-      }
+			/* Cannot enable */
+			arg_graphics = GRAPHICS_NONE;
     } else {
-		  if (arg_graphics && !init_graphics())
-		  {
-			  /* Warning */
-			  plog("Cannot initialize graphics!");
-
-			  /* Cannot enable */
-			  arg_graphics = GRAPHICS_NONE;
+      if (overdraw) {
+        td->t.pict_hook = Term_pict_win_alpha;
       } else {
        	td->t.pict_hook = Term_pict_win;
-		  }
+      }
     }
 
 		/* Change setting */
@@ -2511,9 +2452,6 @@
 		}
 	}
 
-  if (overdraw) {
-  }
-
 	/* Release */
 	SelectObject(hdcSrc, hbmSrcOld);
 	DeleteDC(hdcSrc);
@@ -2957,7 +2895,7 @@
   mii.fMask = MIIM_ID | MIIM_TYPE;
   mii.fType = MFT_STRING;
   while (graphics_modes[i].grafID != 0) {
-    mii.wID = graphics_modes[i].menuItem; // graphics_modes[i].grafID + IDM_OPTIONS_GRAPHICS_NONE;
+    mii.wID = graphics_modes[i].grafID + IDM_OPTIONS_GRAPHICS_NONE;
     mii.dwTypeData = graphics_modes[i].menuname;
     mii.cch = strlen(graphics_modes[i].menuname);
     InsertMenuItem(hm,IDM_OPTIONS_GRAPHICS_NONE, FALSE, &mii);
@@ -3138,7 +3076,7 @@
 	/* Menu "Options", disable all */
   i=0;
   do {
-	  EnableMenuItem(hm, graphics_modes[i].menuItem,
+	  EnableMenuItem(hm, graphics_modes[i].grafID + IDM_OPTIONS_GRAPHICS_NONE,
 	                 MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
   } while (graphics_modes[i++].grafID != 0); 
 
@@ -3188,7 +3126,7 @@
 	/* Menu "Options", update all */
   i=0;
   do {
-	  CheckMenuItem(hm, graphics_modes[i].menuItem,
+	  CheckMenuItem(hm, graphics_modes[i].grafID + IDM_OPTIONS_GRAPHICS_NONE,
 	                (arg_graphics == graphics_modes[i].grafID ? MF_CHECKED : MF_UNCHECKED));
   } while (graphics_modes[i++].grafID != 0); 
 
@@ -3260,6 +3198,18 @@
   else
     CheckMenuItem(hm, IDM_OPTIONS_TILE_16x16, MF_UNCHECKED);
 
+  i = data[0].tile_hgt;
+  if ((data[0].tile_wid == data[0].font_wid) && (i == data[0].font_hgt))
+    CheckMenuItem(hm, IDM_TILE_FONT, MF_CHECKED);
+  else
+    CheckMenuItem(hm, IDM_TILE_FONT, MF_UNCHECKED);
+
+  if ((data[0].tile_wid == 8) && (i == 16))
+    CheckMenuItem(hm, IDM_TILE_08X16, MF_CHECKED);
+  else
+    CheckMenuItem(hm, IDM_TILE_08X16, MF_UNCHECKED);
+
+
 #ifdef USE_SAVER
 	CheckMenuItem(hm, IDM_OPTIONS_SAVER,
 	              (hwndSaver ? MF_CHECKED : MF_UNCHECKED));
@@ -3274,7 +3224,7 @@
 		/* Menu "Options", Item "Graphics" */
     i=0;
     do {
-	    EnableMenuItem(hm, graphics_modes[i].menuItem,MF_ENABLED );
+	    EnableMenuItem(hm, graphics_modes[i].grafID + IDM_OPTIONS_GRAPHICS_NONE,MF_ENABLED );
     } while (graphics_modes[i++].grafID != 0); 
 
 		EnableMenuItem(hm, IDM_OPTIONS_GRAPHICS_NICE, MF_ENABLED);
@@ -3830,54 +3780,6 @@
       break;
     }
 
-    case IDM_OPTIONS_GRAPHICS_NONE:
-		case IDM_OPTIONS_GRAPHICS_OLD:
-		case IDM_OPTIONS_GRAPHICS_ADAM:
-		case IDM_OPTIONS_GRAPHICS_NOMAD:
-		case IDM_OPTIONS_GRAPHICS_DAVID:
-		case IDM_OPTIONS_GRAPHICS_SHOCK:
-		case IDM_OPTIONS_GRAPHICS_EXTRA:
-		{
-      int selected_mode = 0;
-			/* Paranoia */
-			if (!inkey_flag || !initialized)
-			{
-				plog("You may not do that right now.");
-				break;
-			}
-      i=0;
-      do {
-        if (graphics_modes[i].menuItem == wCmd) {
-			    selected_mode = graphics_modes[i].grafID;
-          overdraw = graphics_modes[i].overdrawCol;
-          if (graphics_modes[i].file) {
-            strncpy(tileset,graphics_modes[i].file,32);
-          } else {
-            tileset[0] = 0;
-          }
-          if (graphics_modes[i].file) {
-            strncpy(tilegraf,graphics_modes[i].name,8);
-          } else {
-            tilegraf[0] = 0;
-          }
-          break;
-        }
-      } while (graphics_modes[i++].grafID != 0); 
-
-			/* Toggle "arg_graphics" */
-			if (arg_graphics != selected_mode)
-			{
-				arg_graphics = selected_mode;
-
-				/* React to changes */
-				Term_xtra_win_react();
-
-				/* Hack -- Force redraw */
-				Term_key_push(KTRL('R'));
-			}
-
-			break;
-		}
     case IDM_OPTIONS_TILE_1x1:
     case IDM_OPTIONS_TILE_2x1:
     case IDM_OPTIONS_TILE_2x2:
@@ -3992,6 +3894,91 @@
 			break;
 		}
 
+    case IDM_TILE_FONT:
+    case IDM_TILE_08X08:
+    case IDM_TILE_16X16:
+    case IDM_TILE_32X32:
+    case IDM_TILE_08X16:
+    case IDM_TILE_10X20:
+    case IDM_TILE_16X32:
+    case IDM_TILE_08X13:
+    case IDM_TILE_10X17:
+    case IDM_TILE_16X25:
+    case IDM_TILE_12X20:
+    {
+      /* Paranoia */
+      if (!inkey_flag || !initialized)
+      {
+        plog("You may not do that right now.");
+        break;
+      }
+			td = &data[0];
+	    switch (wCmd)
+	    {
+        case IDM_TILE_FONT:
+        {
+			    td->tile_wid = td->font_wid;
+			    td->tile_hgt = td->font_hgt;
+          break;
+        }
+        case IDM_TILE_08X16:
+        {
+			    td->tile_wid = 8;
+			    td->tile_hgt = 16;
+          break;
+        }
+        case IDM_TILE_08X08:
+        {
+			    td->tile_wid = 8;
+			    td->tile_hgt = 8;
+          break;
+        }
+        case IDM_TILE_16X16:
+        {
+			    td->tile_wid = 16;
+			    td->tile_hgt = 16;
+          break;
+        }
+        case IDM_TILE_32X32:
+        {
+			    td->tile_wid = 32;
+			    td->tile_hgt = 32;
+          break;
+        }
+        case IDM_TILE_10X20:
+        {
+			    td->tile_wid = 10;
+			    td->tile_hgt = 20;
+          break;
+        }
+        case IDM_TILE_16X32:
+        {
+			    td->tile_wid = 16;
+			    td->tile_hgt = 32;
+          break;
+        }
+        case IDM_TILE_12X20:
+        {
+			    td->tile_wid = 12;
+			    td->tile_hgt = 20;
+          break;
+        }
+        case IDM_TILE_16X25:
+        {
+			    td->tile_wid = 16;
+			    td->tile_hgt = 25;
+          break;
+        }
+      }
+
+      /* React to changes */
+			term_getsize(td);
+
+			term_window_resize(td);
+
+			break;
+		}
+
 
 #ifdef USE_SAVER
 
@@ -4106,6 +4093,51 @@
 			display_help(HELP_SPOILERS);
 			break;
 		}
+    default:
+    {
+      if ((wCmd > IDM_OPTIONS_GRAPHICS_NONE) && (wCmd < IDM_OPTIONS_GRAPHICS_NONE+graphics_mode_high_id))
+		  {
+        int selected_mode = 0;
+        int desired_mode = wCmd - IDM_OPTIONS_GRAPHICS_NONE;
+			  /* Paranoia */
+			  if (!inkey_flag || !initialized)
+			  {
+				  plog("You may not do that right now.");
+				  break;
+			  }
+        i=0;
+        do {
+          if (graphics_modes[i].grafID == desired_mode) {
+			      selected_mode = desired_mode;
+            overdraw = graphics_modes[i].overdrawCol;
+            if (graphics_modes[i].file) {
+              strncpy(tileset,graphics_modes[i].file,32);
+            } else {
+              tileset[0] = 0;
+            }
+            if (graphics_modes[i].file) {
+              strncpy(tilegraf,graphics_modes[i].name,8);
+            } else {
+              tilegraf[0] = 0;
+            }
+            break;
+          }
+        } while (graphics_modes[i++].grafID != 0); 
+
+			  /* Toggle "arg_graphics" */
+			  if (arg_graphics != selected_mode)
+			  {
+				  arg_graphics = selected_mode;
+
+				  /* React to changes */
+				  Term_xtra_win_react();
+
+				  /* Hack -- Force redraw */
+				  Term_key_push(KTRL('R'));
+			  }
+		  }
+      break;
+    }
 	}
 }
 
