From 2146101637a9c654ade4fac629a183ffd358ce7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Sat, 18 Apr 2020 11:51:54 +0200 Subject: [PATCH] Remove VNC from regular builds for the time being --- src/include/86box/resource.h | 4 +++- src/include/86box/win.h | 4 ++++ src/win/86Box.rc | 2 ++ src/win/Makefile.mingw | 12 ++++++++++++ src/win/Makefile_ndr.mingw | 12 ++++++++++++ src/win/win.c | 19 ++++++++++++++----- src/win/win_ui.c | 4 ++++ 7 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/include/86box/resource.h b/src/include/86box/resource.h index a72822b99..60990f691 100644 --- a/src/include/86box/resource.h +++ b/src/include/86box/resource.h @@ -1,4 +1,4 @@ -/* +/* * 86Box A hypervisor and IBM PC system emulator that specializes in * running old operating systems and software designed for IBM * PC systems and compatibles from 1981 through fairly recent @@ -275,7 +275,9 @@ #define IDM_VID_REMEMBER 40041 #define IDM_VID_SDL_SW 40050 #define IDM_VID_SDL_HW 40051 +#ifdef USE_VNC #define IDM_VID_VNC 40052 +#endif #define IDM_VID_SCALE_1X 40055 #define IDM_VID_SCALE_2X 40056 #define IDM_VID_SCALE_3X 40057 diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 33d38a175..597ebaa59 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -64,7 +64,11 @@ /* The emulator has shut down. */ #define WM_HAS_SHUTDOWN 0x8897 +#ifdef USE_VNC #define RENDERERS_NUM 3 +#else +#define RENDERERS_NUM 2 +#endif #ifdef __cplusplus diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 049fd5412..432a0b8c1 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -68,7 +68,9 @@ BEGIN BEGIN MENUITEM "&SDL (Software)", IDM_VID_SDL_SW MENUITEM "&SDL (Hardware)", IDM_VID_SDL_HW +#ifdef USE_VNC MENUITEM "&VNC", IDM_VID_VNC +#endif END MENUITEM SEPARATOR MENUITEM "F&orce 4:3 display ratio", IDM_VID_FORCE43 diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 73cad4331..b1da998a4 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -80,6 +80,9 @@ ifeq ($(DEV_BUILD), y) ifndef VGAWONDER VGAWONDER := y endif + ifndef VNC + VNC := y + endif ifndef XL24 XL24 := y endif @@ -129,6 +132,9 @@ else ifndef VGAWONDER VGAWONDER := n endif + ifndef VNC + VNC := n + endif ifndef XL24 XL24 := n endif @@ -373,12 +379,16 @@ MUNTOBJ := midi_mt32.o \ Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o endif +ifeq ($(VNC), y) +OPTS += -DUSE_VNC +RFLAGS += -DUSE_VNC ifneq ($(VNC_PATH), ) OPTS += -I$(VNC_PATH)\INCLUDE VNCLIB := -L$(VNC_PATH)\LIB endif VNCLIB += -lvncserver VNCOBJ := vnc.o vnc_keymap.o +endif ifeq ($(DISCORD), y) OPTS += -DUSE_DISCORD @@ -667,7 +677,9 @@ ifeq ($(DEBUG), y) LIBS += -lssp endif +ifeq ($(VNC), y) LIBS += $(VNCLIB) -lws2_32 +endif ifneq ($(WX), n) LIBS += $(WX_LIBS) -lm endif diff --git a/src/win/Makefile_ndr.mingw b/src/win/Makefile_ndr.mingw index e8bdacd58..63aa78608 100644 --- a/src/win/Makefile_ndr.mingw +++ b/src/win/Makefile_ndr.mingw @@ -80,6 +80,9 @@ ifeq ($(DEV_BUILD), y) ifndef VGAWONDER VGAWONDER := y endif + ifndef VNC + VNC := y + endif ifndef XL24 XL24 := y endif @@ -132,6 +135,9 @@ else ifndef VGAWONDER VGAWONDER := n endif + ifndef VNC + VNC := n + endif ifndef XL24 XL24 := n endif @@ -382,12 +388,16 @@ MUNTOBJ := midi_mt32.o \ Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o endif +ifeq ($(VNC), y) +OPTS += -DUSE_VNC +RFLAGS += -DUSE_VNC ifneq ($(VNC_PATH), ) OPTS += -I$(VNC_PATH)\INCLUDE VNCLIB := -L$(VNC_PATH)\LIB endif VNCLIB += -lvncserver VNCOBJ := vnc.o vnc_keymap.o +endif ifeq ($(DISCORD), y) OPTS += -DUSE_DISCORD @@ -668,7 +678,9 @@ endif LIBS := -mwindows -lcomctl32 \ -lopenal -lole32 +ifeq ($(VNC), y) LIBS += $(VNCLIB) -lws2_32 +endif ifneq ($(WX), n) LIBS += $(WX_LIBS) -lm endif diff --git a/src/win/win.c b/src/win/win.c index 7323e13b7..e79844528 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -42,7 +42,9 @@ #include <86box/plat.h> #include <86box/plat_midi.h> #include <86box/ui.h> -#include <86box/vnc.h> +#ifdef USE_VNC +# include <86box/vnc.h> +#endif #include <86box/win_sdl.h> #include <86box/win.h> @@ -86,13 +88,17 @@ static const struct { } vid_apis[2][RENDERERS_NUM] = { { { "SDL_Software", 1, (int(*)(void*))sdl_inits, sdl_close, NULL, sdl_pause, sdl_enable }, - { "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable }, - { "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL } + { "SDL_Hardware", 1, (int(*)(void*))sdl_inith, sdl_close, NULL, sdl_pause, sdl_enable } +#ifdef USE_VNC + ,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL } +#endif }, { { "SDL_Software", 1, (int(*)(void*))sdl_inits_fs, sdl_close, sdl_resize, sdl_pause, sdl_enable }, - { "SDL_Hardware", 1, (int(*)(void*))sdl_inith_fs, sdl_close, sdl_resize, sdl_pause, sdl_enable }, - { "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL } + { "SDL_Hardware", 1, (int(*)(void*))sdl_inith_fs, sdl_close, sdl_resize, sdl_pause, sdl_enable } +#ifdef USE_VNC + ,{ "VNC", 0, vnc_init, vnc_close, vnc_resize, vnc_pause, NULL } +#endif }, }; @@ -685,9 +691,12 @@ plat_vidapi_name(int api) break; case 1: break; + +#ifdef USE_VNC case 2: name = "vnc"; break; +#endif default: fatal("Unknown renderer: %i\n", api); break; diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 900fb137a..2a9099c3f 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -154,7 +154,9 @@ ResetAllMenus(void) CheckMenuItem(menuMain, IDM_VID_RESIZE, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_SDL_SW, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_SDL_HW, MF_UNCHECKED); +#ifdef USE_VNC CheckMenuItem(menuMain, IDM_VID_VNC, MF_UNCHECKED); +#endif CheckMenuItem(menuMain, IDM_VID_FS_FULL+0, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_FS_FULL+1, MF_UNCHECKED); CheckMenuItem(menuMain, IDM_VID_FS_FULL+2, MF_UNCHECKED); @@ -436,7 +438,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case IDM_VID_SDL_SW: case IDM_VID_SDL_HW: +#ifdef USE_VNC case IDM_VID_VNC: +#endif CheckMenuItem(hmenu, IDM_VID_SDL_SW + vid_api, MF_UNCHECKED); plat_setvid(LOWORD(wParam) - IDM_VID_SDL_SW); CheckMenuItem(hmenu, IDM_VID_SDL_SW + vid_api, MF_CHECKED);