Remove global HINSTANCE

This commit is contained in:
kichikuou
2016-04-02 21:31:28 +09:00
parent f51f224fe4
commit e988478d4d
5 changed files with 6 additions and 9 deletions
-3
View File
@@ -2,13 +2,10 @@
#include "sys/nact.h"
_TCHAR g_root[_MAX_PATH];
HINSTANCE g_hinst;
SDL_Window* g_window;
int main(int argc, char *argv[])
{
g_hinst = (HINSTANCE)::GetModuleHandle(NULL);
SDL_Init(SDL_INIT_VIDEO);
// ウィンドウ表示
+3 -3
View File
@@ -6,8 +6,6 @@
#include "ags.h"
extern HINSTANCE g_hinst;
void AGS::load_cursor(int page)
{
// カーソルCGをロードする
@@ -28,6 +26,8 @@ void AGS::load_cursor(int page)
cg_dest_y = j_y;
dest_screen = dest;
HINSTANCE hinst = (HINSTANCE)GetModuleHandle(NULL);
// フォントの生成
for(int i = 0; i < 10; i++) {
// パターン読み込み
@@ -78,7 +78,7 @@ void AGS::load_cursor(int page)
if(hCursor[i]) {
DestroyCursor(hCursor[i]);
}
hCursor[i] = CreateCursor(g_hinst, 2, 2, 32, 32, amask, xmask);
hCursor[i] = CreateCursor(hinst, 2, 2, 32, 32, amask, xmask);
}
}
+1
View File
@@ -441,6 +441,7 @@ void NACT::select_sound(int dev)
}
// デバッグコンソール
HANDLE hConsole;
void NACT::initialize_console()
{
-1
View File
@@ -226,7 +226,6 @@ private:
// デバッグログ
void initialize_console();
void release_console();
HANDLE hConsole;
public:
NACT();
+2 -2
View File
@@ -11,7 +11,6 @@
#endif
extern SDL_Window* g_window;
extern HINSTANCE g_hinst;
static BOOL CALLBACK TextDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -74,7 +73,8 @@ static BOOL CALLBACK TextDialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
void NACT::text_dialog()
{
HINSTANCE hinst = (HINSTANCE)GetModuleHandle(NULL);
SDL_SysWMinfo info;
SDL_GetWindowWMInfo(g_window, &info);
int r = DialogBoxParam(g_hinst, MAKEINTRESOURCE(IDD_DIALOG1), info.info.win.window, TextDialogProc, (LPARAM)this);
int r = DialogBoxParam(hinst, MAKEINTRESOURCE(IDD_DIALOG1), info.info.win.window, TextDialogProc, (LPARAM)this);
}