Skip to content

Commit

Permalink
Merge pull request #34 from chirsz-ever/setinitmode-2007
Browse files Browse the repository at this point in the history
修正初始化标志位设定的行为
  • Loading branch information
wysaid authored Jul 22, 2020
2 parents 2980804 + 5c2f897 commit 9c94bf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static DWORD g_windowstyle = WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEB
static DWORD g_windowexstyle = WS_EX_LEFT|WS_EX_LTRREADING;
static int g_windowpos_x = CW_USEDEFAULT;
static int g_windowpos_y = CW_USEDEFAULT;
static int g_initoption = INIT_DEFAULT;
static int g_initoption = -1;
static HWND g_attach_hwnd = 0;
static WNDPROC DefWindowProcFunc = NULL;

Expand Down Expand Up @@ -1257,6 +1257,8 @@ initgraph(int *gdriver, int *gmode, char *path) {
}

//初始化环境
if (g_initoption == -1)
setinitmode();
setmode(*gdriver, *gmode);
init_img_page(pg);

Expand Down Expand Up @@ -1303,7 +1305,7 @@ void
initgraph(int Width, int Height, int Flag) {
int g = TRUECOLORSIZE, m = (Width) | (Height<<16);

if (!graph_setting.has_init)
if (g_initoption == -1)
setinitmode(Flag);

initgraph(&g, &m, (char*)"");
Expand Down

0 comments on commit 9c94bf9

Please sign in to comment.