From 55bded33951753c8a1bf4d78b202ac311de9b6b9 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sat, 2 Apr 2016 23:25:26 +0900 Subject: [PATCH] Move console functions to platform dir --- Makefile | 2 +- src/sys/nact.cpp | 34 ----------------------- src/win/{nact_dialog.cpp => nact_win.cpp} | 33 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 35 deletions(-) rename src/win/{nact_dialog.cpp => nact_win.cpp} (76%) diff --git a/Makefile b/Makefile index 6c9f693..d829fa6 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ OBJS = src/fileio.o \ src/sys/nact_crc32.o \ src/sys/nact_input.o \ src/sys/nact_sys3.o \ - src/win/nact_dialog.o \ + src/win/nact_win.o \ src/win/unicode.o \ src/res3/Script1.o diff --git a/src/sys/nact.cpp b/src/sys/nact.cpp index b9179c6..f3bf142 100644 --- a/src/sys/nact.cpp +++ b/src/sys/nact.cpp @@ -4,7 +4,6 @@ [ NACT ] */ -#include #include "nact.h" #include "ags.h" #include "mako.h" @@ -439,36 +438,3 @@ void NACT::select_sound(int dev) mako->play_music(page); } } - -// デバッグコンソール -HANDLE hConsole; - -void NACT::initialize_console() -{ -#if defined(_DEBUG_CONSOLE) - AllocConsole(); - hConsole = GetStdHandle(STD_OUTPUT_HANDLE); -#if defined(_SYSTEM1) - SetConsoleTitle("SYSTEM1 NACT Tracer"); -#elif defined(_SYSTEM2) - SetConsoleTitle("SYSTEM2 NACT Tracer"); -#else - SetConsoleTitle("SYSTEM3 NACT Tracer"); -#endif -#endif -} - -void NACT::release_console() -{ -#if defined(_DEBUG_CONSOLE) - FreeConsole(); -#endif -} - -void NACT::output_console(char log[]) -{ -#if defined(_DEBUG_CONSOLE) - DWORD dwWritten; - WriteConsole(hConsole, log, strlen(log), &dwWritten, NULL); -#endif -} diff --git a/src/win/nact_dialog.cpp b/src/win/nact_win.cpp similarity index 76% rename from src/win/nact_dialog.cpp rename to src/win/nact_win.cpp index eaccb9a..b2cef11 100644 --- a/src/win/nact_dialog.cpp +++ b/src/win/nact_win.cpp @@ -78,3 +78,36 @@ void NACT::text_dialog() SDL_GetWindowWMInfo(g_window, &info); int r = DialogBoxParam(hinst, MAKEINTRESOURCE(IDD_DIALOG1), info.info.win.window, TextDialogProc, (LPARAM)this); } + +// デバッグコンソール +HANDLE hConsole; + +void NACT::initialize_console() +{ +#if defined(_DEBUG_CONSOLE) + AllocConsole(); + hConsole = GetStdHandle(STD_OUTPUT_HANDLE); +#if defined(_SYSTEM1) + SetConsoleTitle("SYSTEM1 NACT Tracer"); +#elif defined(_SYSTEM2) + SetConsoleTitle("SYSTEM2 NACT Tracer"); +#else + SetConsoleTitle("SYSTEM3 NACT Tracer"); +#endif +#endif +} + +void NACT::release_console() +{ +#if defined(_DEBUG_CONSOLE) + FreeConsole(); +#endif +} + +void NACT::output_console(char log[]) +{ +#if defined(_DEBUG_CONSOLE) + DWORD dwWritten; + WriteConsole(hConsole, log, strlen(log), &dwWritten, NULL); +#endif +}