Skip to content
Snippets Groups Projects
Commit 8b1031d8 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add a new ciolib_initial_mode global variable

For graphical modes, this requests that ciolib be initialized in
the specified mode.  For text-based modes (ANSI, Curses, Win32 Console),
this is not used and "current" is used instead.
parent acc0bffc
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4246 passed
...@@ -88,6 +88,7 @@ CIOLIBEXPORT const char *ciolib_appname=NULL; ...@@ -88,6 +88,7 @@ CIOLIBEXPORT const char *ciolib_appname=NULL;
CIOLIBEXPORT int ciolib_initial_window_height = -1; CIOLIBEXPORT int ciolib_initial_window_height = -1;
CIOLIBEXPORT int ciolib_initial_window_width = -1; CIOLIBEXPORT int ciolib_initial_window_width = -1;
CIOLIBEXPORT int ciolib_initial_scaling = 0; CIOLIBEXPORT int ciolib_initial_scaling = 0;
CIOLIBEXPORT int ciolib_initial_mode = C80;
CIOLIBEXPORT const uint32_t *ciolib_r2yptr; CIOLIBEXPORT const uint32_t *ciolib_r2yptr;
CIOLIBEXPORT const uint32_t *ciolib_y2rptr; CIOLIBEXPORT const uint32_t *ciolib_y2rptr;
......
...@@ -407,6 +407,7 @@ CIOLIBEXPORTVAR const char *ciolib_appname; ...@@ -407,6 +407,7 @@ CIOLIBEXPORTVAR const char *ciolib_appname;
CIOLIBEXPORTVAR int ciolib_initial_window_height; CIOLIBEXPORTVAR int ciolib_initial_window_height;
CIOLIBEXPORTVAR int ciolib_initial_window_width; CIOLIBEXPORTVAR int ciolib_initial_window_width;
CIOLIBEXPORTVAR int ciolib_initial_scaling; CIOLIBEXPORTVAR int ciolib_initial_scaling;
CIOLIBEXPORTVAR int ciolib_initial_mode;
CIOLIBEXPORTVAR const uint32_t *ciolib_r2yptr; CIOLIBEXPORTVAR const uint32_t *ciolib_r2yptr;
CIOLIBEXPORTVAR const uint32_t *ciolib_y2rptr; CIOLIBEXPORTVAR const uint32_t *ciolib_y2rptr;
......
...@@ -409,7 +409,7 @@ int sdl_init(int mode) ...@@ -409,7 +409,7 @@ int sdl_init(int mode)
_beginthread(sdl_video_event_thread, 0, NULL); _beginthread(sdl_video_event_thread, 0, NULL);
#endif #endif
sdl_user_func_ret(SDL_USEREVENT_INIT); sdl_user_func_ret(SDL_USEREVENT_INIT);
sdl_init_mode(3, true); sdl_init_mode(ciolib_initial_mode, true);
if(sdl_init_good) { if(sdl_init_good) {
cio_api.mode=fullscreen?CIOLIB_MODE_SDL_FULLSCREEN:CIOLIB_MODE_SDL; cio_api.mode=fullscreen?CIOLIB_MODE_SDL_FULLSCREEN:CIOLIB_MODE_SDL;
......
...@@ -961,7 +961,7 @@ gdi_init(int mode) ...@@ -961,7 +961,7 @@ gdi_init(int mode)
CreatePipe(&rch, &wch, NULL, 0); CreatePipe(&rch, &wch, NULL, 0);
bitmap_drv_init(gdi_drawrect, gdi_flush); bitmap_drv_init(gdi_drawrect, gdi_flush);
gdi_textmode(C80); gdi_textmode(ciolib_initial_mode);
// code that tells windows we're High DPI aware so it doesn't scale our windows // code that tells windows we're High DPI aware so it doesn't scale our windows
// taken from Yamagi Quake II // taken from Yamagi Quake II
...@@ -1005,7 +1005,7 @@ gdi_init(int mode) ...@@ -1005,7 +1005,7 @@ gdi_init(int mode)
WaitForSingleObject(init_sem, INFINITE); WaitForSingleObject(init_sem, INFINITE);
CloseHandle(init_sem); CloseHandle(init_sem);
if (init_success) { if (init_success) {
gdi_textmode(C80); gdi_textmode(ciolib_initial_mode);
cio_api.mode=CIOLIB_MODE_GDI; cio_api.mode=CIOLIB_MODE_GDI;
FreeConsole(); FreeConsole();
......
...@@ -557,7 +557,7 @@ static int video_init() ...@@ -557,7 +557,7 @@ static int video_init()
x_cvstat.scaling = vstat.scaling = 1; x_cvstat.scaling = vstat.scaling = 1;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
/* Initialize mode 3 (text, 80x25, 16 colors) */ /* Initialize mode 3 (text, 80x25, 16 colors) */
if(load_vmode(&vstat, C80)) if(load_vmode(&vstat, ciolib_initial_mode))
return(-1); return(-1);
x_cvstat = vstat; x_cvstat = vstat;
if(init_window()) if(init_window())
......
...@@ -1554,6 +1554,7 @@ main(int argc, char **argv) ...@@ -1554,6 +1554,7 @@ main(int argc, char **argv)
text_mode = screen_to_ciolib(settings.startup_mode); text_mode = screen_to_ciolib(settings.startup_mode);
else else
text_mode = _ORIGMODE; text_mode = _ORIGMODE;
ciolib_initial_mode = text_mode;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (argv[i][0] == '-' if (argv[i][0] == '-'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment