Merge branch 'master' of ssh://github.com/86Box/86Box into cleanup30
This commit is contained in:
@@ -423,6 +423,10 @@ RFLAGS += -DMTR_ENABLED
|
||||
MINITRACEOBJ := minitrace.o
|
||||
endif
|
||||
|
||||
ifeq ($(FAUDIO), y)
|
||||
OPTS += -DUSE_FAUDIO
|
||||
endif
|
||||
|
||||
# Options for the DEV branch.
|
||||
ifeq ($(DEV_BRANCH), y)
|
||||
OPTS += -DDEV_BRANCH
|
||||
@@ -750,9 +754,6 @@ endif
|
||||
ifeq ($(OPENAL), y)
|
||||
SNDOBJ += openal.o
|
||||
else
|
||||
ifeq ($(FAUDIO), y)
|
||||
OPTS += -DUSE_FAUDIO
|
||||
endif
|
||||
SNDOBJ += xaudio2.o
|
||||
endif
|
||||
|
||||
@@ -767,8 +768,12 @@ endif
|
||||
ifeq ($(OPENAL), y)
|
||||
LIBS := -mwindows -lopenal -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid
|
||||
else
|
||||
ifeq ($(FAUDIO), y)
|
||||
LIBS := -mwindows -lfaudio -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid
|
||||
else
|
||||
LIBS := -mwindows -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(RTMIDI), y)
|
||||
SNDOBJ += midi_rtmidi.o
|
||||
|
||||
@@ -733,7 +733,7 @@ BEGIN
|
||||
LTEXT STR_CD_SPEED, IDT_CD_SPEED,
|
||||
CFG_HMARGIN, 207, 34, CFG_PANE_LTEXT_HEIGHT
|
||||
COMBOBOX IDC_COMBO_CD_SPEED,
|
||||
43, 205, 328, 12,
|
||||
33, 205, 328, 12,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
@@ -495,6 +495,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
|
||||
return(1);
|
||||
}
|
||||
|
||||
extern int gfxcard_2;
|
||||
gfxcard_2 = 0;
|
||||
|
||||
/* Create console window. */
|
||||
if (force_debug) {
|
||||
CreateConsole(1);
|
||||
@@ -552,11 +555,12 @@ main_thread(void *param)
|
||||
Sleep(1);
|
||||
|
||||
/* If needed, handle a screen resize. */
|
||||
if (!atomic_flag_test_and_set(&doresize) && !video_fullscreen && !is_quit) {
|
||||
if (atomic_load(&doresize_monitors[0]) && !video_fullscreen && !is_quit) {
|
||||
if (vid_resize & 2)
|
||||
plat_resize(fixed_size_x, fixed_size_y);
|
||||
else
|
||||
plat_resize(scrnsz_x, scrnsz_y);
|
||||
atomic_store(&doresize_monitors[0], 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1173,7 +1177,7 @@ plat_setfullscreen(int on)
|
||||
video_fullscreen &= 1;
|
||||
video_force_resize_set(1);
|
||||
if (!(on & 1))
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
|
||||
win_mouse_init();
|
||||
|
||||
@@ -1251,7 +1255,7 @@ void
|
||||
take_screenshot(void)
|
||||
{
|
||||
startblit();
|
||||
screenshots++;
|
||||
monitors[0].mon_screenshots++;
|
||||
endblit();
|
||||
device_force_redraw();
|
||||
}
|
||||
|
||||
@@ -871,21 +871,21 @@ static void opengl_main(void* param)
|
||||
CoUninitialize();
|
||||
}
|
||||
|
||||
static void opengl_blit(int x, int y, int w, int h)
|
||||
static void opengl_blit(int x, int y, int w, int h, int monitor_index)
|
||||
{
|
||||
int row;
|
||||
|
||||
if ((x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (thread == NULL) ||
|
||||
atomic_flag_test_and_set(&blit_info[write_pos].in_use))
|
||||
atomic_flag_test_and_set(&blit_info[write_pos].in_use) || monitor_index >= 1)
|
||||
{
|
||||
video_blit_complete();
|
||||
video_blit_complete_monitor(monitor_index);
|
||||
return;
|
||||
}
|
||||
|
||||
for (row = 0; row < h; ++row)
|
||||
video_copy(&(((uint8_t *) blit_info[write_pos].buffer)[row * ROW_LENGTH * sizeof(uint32_t)]), &(buffer32->line[y + row][x]), w * sizeof(uint32_t));
|
||||
|
||||
if (screenshots)
|
||||
if (monitors[0].mon_screenshots)
|
||||
video_screenshot(blit_info[write_pos].buffer, 0, 0, ROW_LENGTH);
|
||||
|
||||
video_blit_complete();
|
||||
|
||||
@@ -229,13 +229,13 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
||||
|
||||
|
||||
static void
|
||||
sdl_blit(int x, int y, int w, int h)
|
||||
sdl_blit(int x, int y, int w, int h, int monitor_index)
|
||||
{
|
||||
SDL_Rect r_src;
|
||||
int ret;
|
||||
|
||||
if (!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)) {
|
||||
video_blit_complete();
|
||||
if (!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL) || monitor_index >= 1) {
|
||||
video_blit_complete_monitor(monitor_index);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ sdl_blit(int x, int y, int w, int h)
|
||||
r_src.h = h;
|
||||
SDL_UpdateTexture(sdl_tex, &r_src, &(buffer32->line[y][x]), 2048 * sizeof(uint32_t));
|
||||
|
||||
if (screenshots)
|
||||
if (monitors[0].mon_screenshots)
|
||||
video_screenshot((uint32_t *) buffer32->dat, x, y, 2048);
|
||||
|
||||
video_blit_complete();
|
||||
@@ -269,7 +269,7 @@ sdl_blit(int x, int y, int w, int h)
|
||||
|
||||
|
||||
static void
|
||||
sdl_blit_ex(int x, int y, int w, int h)
|
||||
sdl_blit_ex(int x, int y, int w, int h, int monitor_index)
|
||||
{
|
||||
SDL_Rect r_src;
|
||||
void *pixeldata;
|
||||
@@ -288,7 +288,7 @@ sdl_blit_ex(int x, int y, int w, int h)
|
||||
for (row = 0; row < h; ++row)
|
||||
video_copy(&(((uint8_t *) pixeldata)[row * 2048 * sizeof(uint32_t)]), &(buffer32->line[y + row][x]), w * sizeof(uint32_t));
|
||||
|
||||
if (screenshots)
|
||||
if (monitors[0].mon_screenshots)
|
||||
video_screenshot((uint32_t *) pixeldata, 0, 0, 2048);
|
||||
|
||||
SDL_UnlockTexture(sdl_tex);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/win.h>
|
||||
|
||||
@@ -133,7 +134,7 @@ SpecifyDimensionsDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM
|
||||
|
||||
scrnsz_x = fixed_size_x;
|
||||
scrnsz_y = fixed_size_y;
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
|
||||
GetWindowRect(hwndMain, &r);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <86box/plat.h>
|
||||
#include <86box/resource.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/win.h>
|
||||
|
||||
HWND hwndRebar = NULL;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* Copyright 2017-2020 Fred N. van Kempen.
|
||||
* Copyright 2019,2020 GH Cao.
|
||||
*/
|
||||
#include <stdatomic.h>
|
||||
#define UNICODE
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
@@ -646,7 +647,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
scrnsz_x = unscaled_size_x;
|
||||
scrnsz_y = unscaled_size_y;
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
@@ -745,7 +746,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
reset_screen_size();
|
||||
device_force_redraw();
|
||||
video_force_resize_set(1);
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
@@ -760,7 +761,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_VID_HIDPI:
|
||||
dpi_scale = !dpi_scale;
|
||||
CheckMenuItem(hmenu, IDM_VID_HIDPI, dpi_scale ? MF_CHECKED : MF_UNCHECKED);
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
@@ -860,7 +861,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + (hide_status_bar ? 0 : sbar_height) + (hide_tool_bar ? 0 : tbar_height));
|
||||
} else if (!user_resize)
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
break;
|
||||
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
@@ -909,13 +910,13 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (temp_x != scrnsz_x || temp_y != scrnsz_y) {
|
||||
scrnsz_x = temp_x;
|
||||
scrnsz_y = temp_y;
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
}
|
||||
} else {
|
||||
if (rect.right != scrnsz_x || rect.bottom != scrnsz_y) {
|
||||
scrnsz_x = rect.right;
|
||||
scrnsz_y = rect.bottom;
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1092,7 +1093,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
/* If window is not resizable, then tell the main thread to
|
||||
resize it, as sometimes, moves can mess up the window size. */
|
||||
if (!vid_resize)
|
||||
atomic_flag_clear(&doresize);
|
||||
atomic_store(&doresize_monitors[0], 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1297,8 +1298,7 @@ ui_init(int nCmdShow)
|
||||
ToolBarCreate(hwndMain, hinstance);
|
||||
|
||||
/* Get the actual height of the toolbar */
|
||||
GetWindowRect(hwndRebar, &rect);
|
||||
tbar_height = rect.bottom - rect.top;
|
||||
tbar_height = SendMessage(hwndRebar, RB_GETROWHEIGHT, 0, 0);
|
||||
if (hide_tool_bar)
|
||||
ShowWindow(hwndRebar, SW_HIDE);
|
||||
|
||||
@@ -1557,6 +1557,12 @@ plat_resize(int x, int y)
|
||||
}
|
||||
|
||||
|
||||
void plat_resize_request(int w, int h, int monitor_index)
|
||||
{
|
||||
atomic_store((&doresize_monitors[monitor_index]), 1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
plat_mouse_capture(int on)
|
||||
{
|
||||
@@ -1580,3 +1586,6 @@ plat_mouse_capture(int on)
|
||||
mouse_capture = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ui_init_monitor(int monitor_index) {}
|
||||
void ui_deinit_monitor(int monitor_index) {}
|
||||
|
||||
Reference in New Issue
Block a user