Fix headless compilation and do some formatting

This commit is contained in:
Agent X 2024-06-30 20:55:47 -04:00
parent 1bde63d3d8
commit fe114133ff
13 changed files with 68 additions and 70 deletions

View File

@ -753,6 +753,12 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL)
endif
endif
ifeq ($(WINDOW_API),DUMMY)
ifeq ($(WINDOWS_BUILD),1)
BACKEND_LDFLAGS += -lole32 -luuid -lshlwapi
endif
endif
ifneq (,$(findstring SDL2,$(AUDIO_API)$(WINDOW_API)$(CONTROLLER_API)))
SDL2_USED := 1
endif

View File

@ -5,10 +5,8 @@
#include <windows.h>
extern HWND gfx_dxgi_get_h_wnd(void);
static bool mouse_relative_prev_cursor_state;
#elif defined(CAPI_SDL1)
#include <SDL/SDL.h>
#elif defined(CAPI_SDL2)
#include <SDL2/SDL.h>
#endif
@ -39,10 +37,8 @@ void controller_mouse_read_window(void) {
mouse_window_x = p.x;
mouse_window_y = p.y;
}
#elif defined(CAPI_SDL1) || defined(CAPI_SDL2)
mouse_window_buttons = SDL_GetMouseState(&mouse_window_x, &mouse_window_y);
#endif
}
@ -91,13 +87,10 @@ void controller_mouse_enter_relative(void) {
}
ShowCursor(FALSE);
#elif defined(CAPI_SDL1)
SDL_WM_GrabInput(SDL_GRAB_ON);
#elif defined(CAPI_SDL2)
SDL_SetRelativeMouseMode(SDL_TRUE);
#endif
}
}
@ -108,13 +101,10 @@ void controller_mouse_leave_relative(void) {
#if defined(WAPI_DXGI)
ShowCursor(mouse_relative_prev_cursor_state);
#elif defined(CAPI_SDL1)
SDL_WM_GrabInput(SDL_GRAB_OFF);
#elif defined(CAPI_SDL2)
SDL_SetRelativeMouseMode(SDL_FALSE);
#endif
}
}

View File

@ -1,3 +1,4 @@
#include <ctype.h>
#include "djui.h"
#include "djui_panel.h"
#include "djui_panel_menu.h"

View File

@ -1,3 +1,4 @@
#include <inttypes.h>
#include "sm64.h"
#include "types.h"