From 80bfd4b71dcade49915ee6be57f355fd51092958 Mon Sep 17 00:00:00 2001 From: yixy-only Date: Wed, 15 May 2024 20:38:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Debug=20=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E4=BB=8D=E5=87=BA=E7=8E=B0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E7=9A=84=E9=97=AE=E9=A2=98=20(#168=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/ege.h | 11 ++++++++++- src/graphics.cpp | 9 --------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/ege.h b/include/ege.h index b4d1e1a..0879fb2 100644 --- a/include/ege.h +++ b/include/ege.h @@ -815,7 +815,16 @@ bool EGEAPI getunicodecharmessage(); void EGEAPI setinitmode(int mode, int x = CW_USEDEFAULT, int y = CW_USEDEFAULT); int EGEAPI getinitmode(); void EGEAPI initgraph(int width, int height, int mode); -void EGEAPI initgraph(int width, int height); + +inline void EGEAPI initgraph(int width, int height) +{ +#if !defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) + initgraph(width, height, getinitmode()); +#else + initgraph(width, height, getinitmode() | INIT_WITHLOGO); +#endif +} + void EGEAPI initgraph(int* gdriver, int* gmode, const char* path); void EGEAPI closegraph(); bool EGEAPI is_run(); diff --git a/src/graphics.cpp b/src/graphics.cpp index 11edfec..8a667e9 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -874,15 +874,6 @@ void initgraph(int width, int height, int mode) initgraph(&g, &m, ""); } -void EGEAPI initgraph(int width, int height) -{ - #if !defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) - initgraph(width, height, getinitmode()); - #else - initgraph(width, height, getinitmode() | INIT_WITHLOGO); - #endif -} - void detectgraph(int* gdriver, int* gmode) { *gdriver = VGA;