diff --git a/common/version.h b/common/version.h index adb0688a..86192915 100644 --- a/common/version.h +++ b/common/version.h @@ -2,8 +2,8 @@ #define MIHAJONG_MAJOR_VER 2 #define MIHAJONG_MINOR_VER 4 -#define MIHAJONG_PATCH_VER 3 -#define MIHAJONG_VER "2.4.3" +#define MIHAJONG_PATCH_VER 4 +#define MIHAJONG_VER "2.4.4" #define MJCORE_MAJOR_VER 2 #define MJCORE_MINOR_VER 4 @@ -32,8 +32,8 @@ #define GRAPHIC_MAJOR_VER 2 #define GRAPHIC_MINOR_VER 4 -#define GRAPHIC_PATCH_VER 2 -#define GRAPHIC_VER "2.4.2" +#define GRAPHIC_PATCH_VER 4 +#define GRAPHIC_VER "2.4.4" #define CONFIG_MAJOR_VER 2 #define CONFIG_MINOR_VER 4 diff --git a/graphic/init.cpp b/graphic/init.cpp index c367ae2e..2fd1965a 100644 --- a/graphic/init.cpp +++ b/graphic/init.cpp @@ -23,6 +23,9 @@ namespace { std::condition_variable condVar; bool initialized = false; } +#ifndef WITH_DIRECTX +thread_local bool isGraphicThread = false; +#endif #if defined(_WIN32) && !defined(WITH_DIRECTX) GdiplusStartupInput gdiplusInput; @@ -37,6 +40,9 @@ EXPORT bool InitWindow(void* hInstance, int nCmdShow, LPCTSTR icon, Window* hwnd { /* ウィンドウの初期化 */ std::unique_lock lock(initMutex); +#ifndef WITH_DIRECTX + isGraphicThread = true; +#endif #if defined(_WIN32) && !defined(WITH_DIRECTX) GdiplusStartup(&gdiplusToken, &gdiplusInput, nullptr); #endif diff --git a/graphic/loadtex.cpp b/graphic/loadtex.cpp index 02dd36b3..a0b78a47 100644 --- a/graphic/loadtex.cpp +++ b/graphic/loadtex.cpp @@ -22,8 +22,16 @@ namespace mihajong_graphic { std::map TextureHeight; #endif //} +#ifndef WITH_DIRECTX +extern thread_local bool isGraphicThread; +#endif void LoadTexture(DevicePtr device, TexturePtr* texture, LPCTSTR resource) { +#ifndef WITH_DIRECTX + if (!isGraphicThread) { + return; // OpenGLの場合は違うスレッドで読み込んでも意味がない + } +#endif #if defined(_WIN32) && !defined(WITH_DIRECTX) using namespace Gdiplus; #endif