313 Commits

Author SHA1 Message Date
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
lamebanana
8af0b8baa5 OPENGL: Fix aspect ratio bug when switching render 2021-04-14 20:33:59 +02:00
Cameron Cawley
24b59ecb4c Revert "OPENGL: Implement high DPI support on Android (#1895)"
This reverts commit 177d709909808313eee720ce76465cf99f909c5e.
2021-04-12 00:54:12 +01:00
Eugene Sandulenko
5e395d166a BACKENDS: HiDPI support in OpenGL backend 2021-04-11 21:21:44 +02:00
Thierry Crozat
b6186ccdd6 OPENGL: Fix hidden overladed virtual saveScreenshot() warning
This noisy warning at least occur when building for Android
(OpenGL, but not SDL).
2021-04-07 00:09:50 +01:00
Thierry Crozat
7408dee5df Revert "GRAPHICS: Tentative fix saveScreenshot() warning for OpenGL"
This reverts commit 0f118d0210d1dc1d4e4174fd72179de82b263ed8.
2021-04-07 00:09:50 +01:00
antoniou79
0f118d0210 GRAPHICS: Tentative fix saveScreenshot() warning for OpenGL
Building for Android (OpenGL) had noisy warning for hiding overloaded virtual function

Added a dummy implementation in OpenGLGraphics manager, and also for OpenGLSdlGraphicsManager it now explicitly calls the SdlGraphicsManager implementation for the void argument signature.
2021-04-03 14:03:36 +03:00
Cameron Cawley
4284d9754f
OPENGL: Remove SDL specific code from OpenGLGraphicsManager
The "OSystem::kFeatureFullscreenToggleKeepsContext" feature is already handled in the OpenGLSdlGraphicsManager subclass.
2020-10-13 20:45:32 +01:00
Paweł Kołodziejski
59ba9cb715
SDL: Do not allow toggle fullscreen for backends which can lose opengl context used for 3d games. (#2514) 2020-10-13 20:27:58 +02:00
Paweł Kołodziejski
35b9cccbde ALL: Merge ResidualVM 2020-10-09 19:44:13 +02:00
Pawel Kolodziejski
c12503a869 Synced with ScummVM rev: f6c5fed1739ddadc59b919407859bec7ee403c35 2020-10-03 18:14:12 +02:00
Pawel Kolodziejski
d8f2040dba ALL: Drop setupScreen API, use new initGraphics3d from engine API.
Enabled system API for begin/end gfx transactions, initSize, setGraphicsMode.
Function setGraphicsMode will use optional params to trigger 3d rendering
and switch to proper SDL Gfx manager.
2020-10-02 19:14:19 +02:00
antoniou
50d2ae3b4c OPENGL: Use nearest neighbor scaling for overlay UI when filtering is disabled
User choice in launcher's Option, Graphics Tab detemines whether filtered graphics should be used

This now affects the ScummVM UI (it was previously set to not affect the UI overlay for OPENGL)
2020-10-02 12:38:46 +03:00
Pawel Kolodziejski
d0713f1072 BACKENDS: Fixed Android compilation 2020-09-29 17:00:04 +02:00
Pawel Kolodziejski
3e453e0240 BACKENDS: Attempt to fix Android compilation 2020-09-29 15:59:26 +02:00
Pawel Kolodziejski
6aa7cf6025 BACKENDS: Made code less different in SDL platform backend 2020-09-29 15:08:16 +02:00
aryanrawlani28
56911beea2 GUI: U32: Add and use a U32Tokenizer
- Added in common/tokenizer.cpp
- Uses iterators to function
2020-08-30 14:43:41 +02:00
aryanrawlani28
d4d5b8906e GUI: U32: Begin making TTS take in U32Strings for saying
Only for strings without an explicit action. The first level takes in a u32 string, encodes it, and passes it along further with the default action

- For gui widgets, the strings are passed in as native u32 strings.
- For everything else, they are being converted to u32 by Common::convertToU32... and then being passed along
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
BeWorld
3f69eca932 MORPHOS: remove USE_GLES_MODE
Not necessary
2020-08-21 00:59:18 +02:00
BeWorld
85f7d5865b MORPHOS: Update opengl-sys.h 2020-08-21 00:59:18 +02:00
Eugene Sandulenko
432383a667 ALL: Remove Tizen port 2020-08-01 14:42:45 +02:00
Cameron Cawley
b28e112d62 OPENGL: Use a 4 bytes per pixel mode when taking screenshots
GL_RGBA and GL_UNSIGNED_BYTE are guaranteed to be usable with glReadPixels() when using OpenGL ES 1.
2020-05-27 12:45:50 +02:00
Paul Gilbert
7b721eaac1 ENGINES: Adding debugger to base Engine class 2020-02-16 13:07:19 +02:00
rsn8887
1489f2ed0f OPENGL: Fix GUI centering when using Fit to window (4:3) mode 2020-01-23 15:06:08 -06:00
rsn8887
b8cf747ad5 OPENGL: Implement stretch mode Fit to window (4:3) 2020-01-22 04:24:42 -06:00
Cameron Cawley
d289fa5f98 OPENGL: Ensure surfaces created by saveScreenshot are the right way up 2020-01-02 20:53:29 +02:00
Cameron Cawley
e92ac655be BACKENDS: Add default implementation for GraphicsMode functions 2019-12-15 16:06:56 +02:00
Cameron Cawley
c3c3137ab3 BACKENDS: Move nextHigher2() into common/algorithm.h 2019-12-14 17:09:18 +02:00
sluicebox
b8390fa161 GRAPHICS: Add interface for horizontal shake 2019-11-19 00:20:40 +01:00
Cameron Cawley
d1fa1154fe BACKENDS: Fix using fillScreen in non-paletted screen modes 2019-11-10 01:25:46 +02:00
Cameron Cawley
177d709909 OPENGL: Implement high DPI support on Android (#1895)
* OPENGL: Implement high DPI support on Android

* PSP2: Fix build
2019-11-01 13:39:46 +02:00
Cameron Cawley
3d83d144a3 OPENGL: Fix warning when using builtin OpenGL functions 2019-10-18 16:49:12 +01:00
D G Turner
f6fff71d8d OPENGL: Add Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-05 04:54:57 +01:00
Cameron Cawley
7a05624e1b
ANDROID: Rewrite to make use of OpenGLGraphicsManager (#1695)
* ANDROID: Rewrite to make use of OpenGLGraphicsManager

* ANDROID: Fix emulated mouse button up events
2019-09-08 19:37:48 +01:00
Jaromir Wysoglad
bbbb608c52 TTS: Implement OSD message reading 2019-09-01 22:47:55 +03:00
Cameron Cawley
1feb86ee97 BACKENDS: Handle screen shaking in WindowedGraphicsManager 2019-08-15 02:01:21 +03:00
Cameron Cawley
d765440c1a OPENGL: Support RGBA8888 swapped textures when using OpenGL ES 2019-08-04 18:46:30 +01:00
Filippos Karapetis
d524d36a6a OPENGL: Specify a GLSL version tag, and rename reserved keywords
The GLSL version code has been taken from ResidualVM. The variable
'texture' is now a reserved keyword in GLSL 3.00, so it has been
renamed. This fixes compilation issues in AmigaOS4 (PR 1554).
2019-07-14 16:10:55 +03:00
Cameron Cawley
16f8c024d1 OPENGLSDL: Move stretch mode handling into OpenGLGraphicsManager 2019-06-24 02:19:28 +03:00
Cameron Cawley
0ddfe927ce OPENGLSDL: Move getSupportedFormats into OpenGLGraphicsManager 2019-06-22 01:15:39 +03:00
Cameron Cawley
205df5dbdf IMAGE: Fix taking screenshots on big endian systems 2019-03-02 07:29:22 +01:00
Cameron Cawley
8ae17b481a IMAGE: Move bitmap writing code out of OpenGLGraphicsManager 2019-03-02 07:29:22 +01:00
Bastien Bouclet
3376597abd OPENGL: Use premultiplied alpha for color-keyed cursors
This fixes colour fringing on keyed cursors when using filtering.

Fixes Trac#10594.
2018-08-26 21:08:40 +02:00
Colin Snover
5c855a0a5a BACKENDS: Fix shake position getting stuck
If a game is doing a screen shake (for example, DOTT when the
stereo is on), and the user does an RTL, the screen shake offset
may get stuck if the engine does not reset it on shutdown. To
avoid this in all cases, just always reset the screen shake
whenever the graphics manager is told to switch to a new graphics
mode.
2017-12-01 19:43:12 -06:00
Colin Snover
5d8cf6ba42 BACKENDS: Fix GraphicsManager handling of empty cursors
The SDL graphics manager was just ignoring calls from CursorMan to
set the cursor to a blank cursor, which meant engines that did not
immediately send a cursor to CursorMan at startup would still show
the launcher's cursor (usually with a broken palette).

The OpenGL graphics manager would try to generate and draw an
invalid cursor surface when receiving an empty cursor.
2017-10-15 13:24:20 -05:00
Colin Snover
da0a8db704 BACKENDS: Also hide mouse cursor outside game area when an engine has hidden the cursor
The only reason we show the system cursor outside the game area is
to show users where their mouse is when the window is resized and
the mouse is outside the game area. If the game cannot be
interacted with, then the mouse also does not need to be shown in
the black areas.
2017-10-15 13:24:20 -05:00
Colin Snover
de2bbe3b97 BACKENDS: Refactor OpenGL & SDL graphics backends
This patch refactors the OpenGL and SDL graphics backends,
primarily to unify window scaling and mouse handling, and to
fix coordinate mapping between the ScummVM window and the
virtual game screen when they have different aspect ratios.

Unified code for these two backends has been moved to a new
header-only WindowedGraphicsManager class, so named because it
contains code for managing graphics managers that interact with
a windowing system and render virtual screens within a larger
physical content window.

The biggest behavioral change here is with the coordinate
system mapping:

Previously, mouse offsets were converted by mapping the whole
space within the window as input to the virtual game screen
without maintaining aspect ratio. This was done to prevent
'stickiness' when the mouse cursor was within the window but
outside of the virtual game screen, but it caused noticeable
distortion of mouse movement speed on the axis with blank
space.

Instead of introducing mouse speed distortion to prevent
stickiness, this patch changes coordinate transformation to
show the system cursor when the mouse moves outside of the virtual
game screen when mouse grab is off, or by holding the mouse inside
the virtual game screen (instead of the entire window) when mouse
grab is on.

This patch also improves some other properties of the
GraphicsManager/PaletteManager interfaces:

* Nullipotent operations (getWidth, getHeight, etc.) of the
  PaletteManager/GraphicsManager interfaces are now const
* Methods marked `virtual` but not inherited by any subclass have
  been de-virtualized
* Extra unnecessary calculations of hardware height in
  SurfaceSdlGraphicsManager have been removed
* Methods have been renamed where appropriate for clarity
  (setWindowSize -> handleResize, etc.)
* C++11 support improved with `override` specifier added on
  overridden virtual methods in subclasses (primarily to avoid
  myself accidentally creating new methods in the subclasses
  by changing types/names during refactoring)

Additional refactoring can and should be done at some point to
continue to deduplicate code between the OpenGL and SDL backends.
Since the primary goal here was to improve the coordinate mapping,
full refactoring of these backends was not completed here.
2017-10-15 13:24:20 -05:00
Colin Snover
b53020f704 BACKENDS: Fix some comment typos 2017-10-15 13:24:20 -05:00
Bastien Bouclet
8e4697946e OPENGL: Always clear the whole backbuffer
Previously we were clearing the whole backbuffer for 3 frames after a
window size change, and then only clearing the game area. This assumes
the OpenGL driver uses at most 3 render buffer and uses them in
sequential order. This does not seem to be the case on Linux when using
an Intel integrated GPU.
Instead we now clear the whole backbuffer on each frame to make sure
there are no leftovers remaining on the screen. All semi-recent GPUs
should have hardware clear anyway so this should not impact negatively
performance.

Possibly fixes #10025.
2017-08-05 08:36:32 +02:00