OSDN Git Service

Merge branch 'develop' into macos-develop
authorEric Branlund <ebranlund@fastmail.com>
Fri, 30 Apr 2021 15:33:21 +0000 (08:33 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Fri, 30 Apr 2021 15:33:21 +0000 (08:33 -0700)
1  2 
src/Makefile.am
src/main-win/graphics-win.cpp

diff --cc src/Makefile.am
Simple merge
@@@ -49,3 -69,106 +69,106 @@@ HBITMAP read_graphic(char *filename
  
      return result;
  }
 -        name_mask = "mask.bmp";
+ namespace Impl {
+ graphics_mode change_graphics(graphics_mode arg)
+ {
+     if (current_graphics_mode == arg)
+         return current_graphics_mode;
+     char buf[MAIN_WIN_MAX_PATH];
+     BYTE wid, hgt, twid, thgt, ox, oy;
+     concptr name;
+     concptr name_mask = NULL;
+     infGraph.delete_bitmap();
+     if (arg == graphics_mode::GRAPHICS_ORIGINAL) {
+         wid = 8;
+         hgt = 8;
+         twid = 8;
+         thgt = 8;
+         ox = 0;
+         oy = 0;
+         name = "8X8.BMP";
+         ANGBAND_GRAF = "old";
+     } else if (arg == graphics_mode::GRAPHICS_ADAM_BOLT) {
+         wid = 16;
+         hgt = 16;
+         twid = 16;
+         thgt = 16;
+         ox = 0;
+         oy = 0;
+         name = "16X16.BMP";
++        name_mask = "16x16-mask.bmp";
+         ANGBAND_GRAF = "new";
+     } else if (arg == graphics_mode::GRAPHICS_HENGBAND) {
+         wid = 32;
+         hgt = 32;
+         twid = 32;
+         thgt = 32;
+         ox = 0;
+         oy = 0;
+         name = "32X32.BMP";
+         name_mask = "mask32.bmp";
+         ANGBAND_GRAF = "ne2";
+     } else {
+         ANGBAND_GRAF = "ascii";
+         current_graphics_mode = graphics_mode::GRAPHICS_NONE;
+         return current_graphics_mode;
+     }
+     path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name);
+     infGraph.hBitmap = read_graphic(buf);
+     if (!infGraph.hBitmap) {
+         plog_fmt(_("ビットマップ '%s' を読み込めません。", "Cannot read bitmap file '%s'"), name);
+         ANGBAND_GRAF = "ascii";
+         current_graphics_mode = graphics_mode::GRAPHICS_NONE;
+         return current_graphics_mode;
+     }
+     infGraph.CellWidth = wid;
+     infGraph.CellHeight = hgt;
+     infGraph.TileWidth = twid;
+     infGraph.TileHeight = thgt;
+     infGraph.OffsetX = ox;
+     infGraph.OffsetY = oy;
+     if (name_mask) {
+         path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name_mask);
+         infGraph.hBitmapMask = read_graphic(buf);
+         if (!infGraph.hBitmapMask) {
+             plog_fmt(_("ビットマップ '%s' を読み込めません。", "Cannot read bitmap file '%s'"), name_mask);
+             ANGBAND_GRAF = "ascii";
+             current_graphics_mode = graphics_mode::GRAPHICS_NONE;
+             return current_graphics_mode;
+         }
+     }
+     current_graphics_mode = arg;
+     return arg;
+ }
+ }
+ graphics_mode Graphics::change_graphics(graphics_mode arg)
+ {
+     return Impl::change_graphics(arg);
+ }
+ const tile_info &Graphics::get_tile_info(void)
+ {
+     return infGraph;
+ }
+ void Graphics::init(void)
+ {
+     init_gdi_plus();
+ }
+ void Graphics::finalize()
+ {
+     infGraph.delete_bitmap();
+     finalize_gdi_plus();
+ }