• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionb0f9b6abd541c3c535585b9675eb3fb88ce830eb (tree)
Zeit2016-11-05 01:03:12
AutorDeskull <desull@user...>
CommiterDeskull

Log Message

GDI+の初期化処理と画像ファイルロード処理を追加 / Add initializing and image file loading of GDI+

Ändern Zusammenfassung

Diff

--- a/src/main-win.c
+++ b/src/main-win.c
@@ -76,10 +76,13 @@
7676
7777 #ifdef WINDOWS
7878 #include <windows.h>
79+#include <gdiplus.h>
7980 #include <direct.h>
8081 #include <locale.h>
8182 #include "z-term.h"
8283 #include "png-util.h"
84+using namespace Gdiplus;
85+
8386
8487 /*
8588 * Extract the "WIN32" flag from the compiler
@@ -1050,6 +1053,16 @@ static void validate_dir(cptr s, bool vital)
10501053 }
10511054 }
10521055
1056+bool load_image(HWND hwnd, Image *image, char *filename)
1057+{
1058+ size_t r;
1059+ char buf[200];
1060+ wchar_t wchar[200];
1061+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, filename);
1062+ mbstowcs_s(&r, wchar, 200, buf, _TRUNCATE);
1063+ image = new Image(wchar);
1064+ return true;
1065+}
10531066
10541067 /*
10551068 * Get the "size" for a window
@@ -1692,9 +1705,6 @@ static bool init_graphics(void)
16921705 int wid, hgt, twid, thgt, ox, oy;
16931706 cptr name;
16941707
1695- path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "Ugluk.png");
1696- //paint_test(hwndSaver);
1697-
16981708 if (arg_graphics == GRAPHICS_ADAM_BOLT)
16991709 {
17001710 wid = 16;
@@ -5776,6 +5786,11 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
57765786 angband_color_table[i][0] = win_pal[i];
57775787 }
57785788
5789+ /* Initialize GDI+ */
5790+ GdiplusStartupInput gdiplusStartupInput;
5791+ ULONG_PTR gdiplusToken;
5792+ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
5793+
57795794 /* Prepare the windows */
57805795 init_windows();
57815796