mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-18 18:30:59 +00:00
SWITCH: Add support for 3d games (#2558)
SWITCH: Add support for 3d games
This commit is contained in:
parent
d937daceb4
commit
90d9540ad8
@ -220,8 +220,15 @@ void SwitchEventSource::preprocessFingerMotion(SDL_Event *event) {
|
||||
if (numFingersDown >= 1) {
|
||||
int x = _mouseX;
|
||||
int y = _mouseY;
|
||||
int xMax = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowWidth() - 1;
|
||||
int yMax = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowHeight() - 1;
|
||||
int xMax;
|
||||
int yMax;
|
||||
if (dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)) {
|
||||
xMax = dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)->getOverlayWidth() - 1;
|
||||
yMax = dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)->getOverlayHeight() - 1;
|
||||
} else {
|
||||
xMax = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowWidth() - 1;
|
||||
yMax = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowHeight() - 1;
|
||||
}
|
||||
|
||||
if (port == 0 && !ConfMan.getBool("touchpad_mouse_mode")) {
|
||||
convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y);
|
||||
@ -353,8 +360,15 @@ void SwitchEventSource::preprocessFingerMotion(SDL_Event *event) {
|
||||
}
|
||||
|
||||
void SwitchEventSource::convertTouchXYToGameXY(float touchX, float touchY, int *gameX, int *gameY) {
|
||||
int screenH = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowHeight();
|
||||
int screenW = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowWidth();
|
||||
int screenH, screenW;
|
||||
|
||||
if (dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)) {
|
||||
screenH = dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)->getOverlayHeight();
|
||||
screenW = dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)->getOverlayWidth();
|
||||
} else {
|
||||
screenH = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowHeight();
|
||||
screenW = dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowWidth();
|
||||
}
|
||||
|
||||
const int dispW = TOUCHSCREEN_WIDTH;
|
||||
const int dispH = TOUCHSCREEN_HEIGHT;
|
||||
|
@ -338,6 +338,7 @@ void OSystem_SDL::detectFramebufferSupport() {
|
||||
}
|
||||
|
||||
void OSystem_SDL::detectAntiAliasingSupport() {
|
||||
#ifndef NINTENDO_SWITCH
|
||||
_capabilities.openGLAntiAliasLevels.clear();
|
||||
|
||||
int requestedSamples = 2;
|
||||
@ -380,6 +381,7 @@ void OSystem_SDL::detectAntiAliasingSupport() {
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // defined(USE_OPENGL_GAME) || defined(USE_OPENGL_SHADERS)
|
||||
|
@ -39,6 +39,7 @@ static const Common::HardwareInputTableEntry switchJoystickButtons[] = {
|
||||
{ "JOY_Y", Common::JOYSTICK_BUTTON_Y, _s("X") },
|
||||
{ "JOY_BACK", Common::JOYSTICK_BUTTON_BACK, _s("Minus") },
|
||||
{ "JOY_START", Common::JOYSTICK_BUTTON_START, _s("Plus") },
|
||||
{ "JOY_GUIDE", Common::JOYSTICK_BUTTON_START, _s("Plus") },
|
||||
{ "JOY_LEFT_STICK", Common::JOYSTICK_BUTTON_LEFT_STICK, _s("L3") },
|
||||
{ "JOY_RIGHT_STICK", Common::JOYSTICK_BUTTON_RIGHT_STICK, _s("R3") },
|
||||
{ "JOY_LEFT_SHOULDER", Common::JOYSTICK_BUTTON_LEFT_SHOULDER, _s("L") },
|
||||
|
@ -15,6 +15,10 @@ ifdef DIST_FILES_NETWORKING
|
||||
endif
|
||||
ifdef DIST_FILES_VKEYBD
|
||||
cp $(DIST_FILES_VKEYBD) ./switch_release/scummvm/data
|
||||
endif
|
||||
ifdef DIST_FILES_SHADERS
|
||||
mkdir -p ./switch_release/scummvm/data/shaders
|
||||
cp $(DIST_FILES_SHADERS) ./switch_release/scummvm/data/shaders
|
||||
endif
|
||||
cp $(DIST_FILES_DOCS) ./switch_release/scummvm/doc/
|
||||
cp $(srcdir)/backends/platform/sdl/switch/README.SWITCH ./switch_release/scummvm/doc/
|
||||
|
3
configure
vendored
3
configure
vendored
@ -3630,6 +3630,7 @@ if test -n "$_host"; then
|
||||
# This might be related to a known crash on OpenGL de-init due
|
||||
# to the OpenGL implementation on this platform.
|
||||
_opengl_mode=gles2
|
||||
_opengl_game_es2=yes
|
||||
_vkeybd=yes
|
||||
_port_mk="backends/platform/sdl/switch/switch.mk"
|
||||
;;
|
||||
@ -5391,7 +5392,7 @@ echocheck "OpenGL for game"
|
||||
|
||||
if test "$_opengl_game" = auto ; then
|
||||
_opengl_game=no
|
||||
if (test "$_backend" = "sdl" && test "$_opengl" = yes) || test "$_backend" = "android3d"; then
|
||||
if (test "$_backend" = "sdl" && test "$_opengl" = yes) || test "$_backend" = "android3d" || test "$_backend" = "switch"; then
|
||||
# Try different header filenames
|
||||
# 1) GL/gl.h This is usually used on POSIX and Windows systems
|
||||
# 2) OpenGL/gl.h This is used on Mac OS X
|
||||
|
Loading…
x
Reference in New Issue
Block a user