Commit Graph
397 Commits
Author SHA1 Message Date
Vladimir Serbinenko 1bc4fe5279 SDL: Move RS90-specific code to opendingux directory 2023-01-17 13:48:50 +03:00
Vladimir Serbinenko 81fdd308cf SURFACESDL: Extract initing of graphics surface into a separate method. 2023-01-17 13:48:50 +03:00
Vladimir Serbinenko 4a0d9c2665 SDL: Add missing init of _prevCursorNeedsRedraw 2023-01-17 13:48:20 +03:00
Cameron Cawley 138a983d80 COMMON: Refactor VSync handling to match the other options 2023-01-16 18:09:53 +01:00
Christophe Branchereau 2994ab025d OPENDINGUX: force 320x240 for the RG99
The device has a 320x480 screen and aspect of gui is wrong if we use
the full resolution

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2023-01-16 10:31:14 +01:00
Vladimir Serbinenko 4e4c652433 SDL: Properly restore gfx mode if several parameters have changed
Currently we have bunch of else-if and only one of them triggered. When
e.g. aspect ratio correction and resolution changes only aspect ratio is
covered by restoration. If this fails the code retries the same mode endlessly
2023-01-12 16:39:38 +03:00
Vladimir Serbinenko 74336c5411 SDL: Fix potential buffer overflow
This causes a segmentation error on Miyoo Mini but is not specific to it
2023-01-12 14:01:45 +01:00
Le Philousophe 4f626159a1 SDL: Delete mouse scaler to avoid memory leak 2023-01-12 08:44:38 +01:00
Vladimir Serbinenko 30d9976a1c SDL: Use hardware palette on RS90 and scale 1 2023-01-12 10:27:20 +03:00
Vladimir Serbinenko 70b174bca5 SDL: Disable fullscreen on RS90
Fullscreen flag causes an error in SetVideoMode.
2023-01-12 10:27:20 +03:00
Vladimir Serbinenko 3f6691dc6d RS90: Workaround for unusual SDL_PixelFormat
SDL_PixelFormat returns 0xff/0xff/0xff as pixel format for paletted HWSURFACE.
2023-01-12 10:27:20 +03:00
Vladimir Serbinenko b91d873df6 SDL: Support auto-detection of GUI resolution. 2023-01-12 10:27:20 +03:00
Vladimir Serbinenko 47ab3fe4fc SDL: Support double-buffering on SDL1. 2023-01-12 10:27:20 +03:00
Vladimir Serbinenko 462be38081 SDL: Support rendering to 8-bit graphics 2023-01-12 10:27:20 +03:00
Cameron Cawley cf70814cbd SURFACESDL: Initial support for 32-bit screen output 2023-01-11 12:57:53 +00:00
Cameron Cawley 7f2d9fd0fd GRAPHICS: Split conversion.cpp into multiple files 2022-12-22 23:45:14 +01:00
Le Philousophe 87bad2cc7d COMMON: Allow games to use overlay for something else than GUI
This can be used for subtitles without changing the mouse coordinates.
2022-11-12 19:12:05 +01:00
Eugene Sandulenko 5e05f93f36 ALL: Remove Symbian port 2022-05-28 12:32:29 +02:00
Cameron Cawley a14c5a4a53 SDL: Replace gfx_mode with scale_factor in initSizeHint() 2022-01-16 13:22:37 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Cameron Cawley a21961516a GRAPHICS: Split ScalerPluginObject into two classes 2021-11-23 23:32:58 +01:00
athrxx def88b7bae BACKENDS: (SURFACESDL) - improve comment
(we don't have "shake views" - these  changes of mine come from a long-abandoned experimental branch which allowed limiting the screen shaking to a certain area)
2021-11-16 20:48:04 +01:00
athrxx 3b061ae0e8 BACKENDS: (OPENGL/SURFACESDL) - include mouse pointer in screen shakes
This is the original behaviour of DOS games (where the screen shakes are done by writing certain offsets into the crt cotnrol register of the vga adapter).

Usually it doesn't matter much, since the shake is an effect that passes quickly. But the difference can be noticed in cases like DOTT when switching on the stereo in green tentacle's room. The shaking will continue until the stereo is turned off again. In that case it is really more appealing if the mouse cursor "sticks" to the background.
2021-11-16 20:34:20 +01:00
Eugene Sandulenko b0001ef9f6 BACKENDS: MACOSX: Display OSD messages on the Touchbar
Okay, so Apple now deprecated the Touchbar in their line of
MacBooks. Exciting! Time to finally add support for it!
2021-11-15 17:45:30 +01:00
Orgad Shaneh 44219dfa1a BACKENDS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Paweł Kołodziejski 543e53eaad SURFACESDL: Implemented missing kFeatureVSync for getFeatureState() 2021-11-08 09:07:48 +01:00
Paweł Kołodziejski dfe477e95e SURFACESDL: Implemented fallback in case lack of VSYNC 2021-11-08 09:07:48 +01:00
Vanfanel 58a243842f SDL: Remove redundant #if. 2021-10-23 20:53:22 +01:00
Vanfanel 046b48f90d SDL: Add OSystem::kFeatureVSync to SDL surface and OpenGL graphics. 2021-10-23 20:53:22 +01:00
Vanfanel 3a59c28179 SDL: Generalize VSYNC option so it works for 2D games too, in both SDL surface and opengl graphic modes. 2021-10-23 20:53:22 +01:00
Torbjörn Andersson 8ba69ec278 SDL: Silence signed/unsigned warning 2021-09-09 07:20:04 +02:00
Thierry Crozat b3b3684b46 SDL: Fix starting high resolution game with default scale factor 2021-09-08 21:32:42 +01:00
Torbjörn Andersson 9df10525df SDL: Check if hi-res scaler is available at desired factor
Instead of falling back to the normal scaler if the new scale factor is
1, explicitly check if the desired scaler is available at the new scale
factor. Suggested by criezy, and I'm shamelessly copying his
implementation because this sort of C++ trickery is something I'm not
fluent in.

At the moment, this shouldn't make any difference. But I guess in the
future, there may be a scaler that's available at 3x and 4x, but not 2x,
or something like that.
2021-09-02 13:24:06 +02:00
Torbjörn Andersson b5f27b5950 SDL: Set better default scaler for high-resolution games
Now that we have higher scale factors than 3, it makes sense to try and
figure out a default scaler for high-resolution games that approximate
the window size of a low resolution game.

That also means that we are not necessarily restricted to the normal
scaler, since AdvMame has both 2x and 4x versions.
2021-09-02 13:24:06 +02:00
Thierry Crozat 478fbbbe9b SDL: Fix the default scale factor for high resolution games
This fixes bug #12847: HQ filter broken when applied as a global setting
2021-08-26 18:32:21 +01:00
Le Philousophe 68a327ecb1 BACKENDS: Harden grabOverlay in all platforms
Use specific copy code where applicable and replace duplicated code by
calls to copyBlit which optimizes blitting
2021-08-04 13:27:07 +02:00
Thierry Crozat ec06d940a2 BACKENDS: Explicitly use ellipsis for OSD text if needed
This is the default, so this commit does not change the behaviour.
But this will allow to change the default at a later stage.
2021-08-01 17:22:13 +02:00
Paul Gilbert baccbedf50 GRAPHICS: Changed surface classes sizes from uint16 to int16 2021-07-04 18:24:27 -07:00
Torbjörn Andersson 5c8bd3b687 SURFACESDL: Fix grabOverlay() regression
The grabOverlay() function would only copy half the width of the
overlay. This was probably more or less visible in any game that could
show a ScummVM dialog (e.g. the pause dialog in SCUMM games, or any
message box in the Hugo games).

Is crossBlit() overkill here? Probably, but it should fall back on
copyBlit() if the source and destination formats are the same.

Besides, this way perhaps I will finally get some more feedback on how
to fix the regression.
2021-06-30 19:15:51 +02:00
Orgad Shaneh 780c4568c1 GUI: Fix compiler warning
../scummvm/gui/options.cpp: In member function 'virtual void GUI::OptionsDialog::apply()':
../scummvm/gui/options.cpp:647:82: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
  647 |     else if (scalerPlugins[defaultScaler]->get<ScalerPluginObject>().getFactor() != g_system->getDefaultScaleFactor())
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-06-24 11:34:45 +03:00
Cameron Cawley ac9980a9dd SDL: Fix the default scale factor for high resolution games 2021-06-23 23:31:49 +01:00
Cameron Cawley da5d773924 BACKENDS: Add getDefaultScaler and getDefaultScaleFactor to OSystem 2021-06-23 21:29:53 +02:00
Cameron Cawley 7ed5984e2f SDL: Add some validation to setScaler() 2021-06-23 21:29:53 +02:00
Cameron Cawley 0e6b9c2bb6 SDL: Begin refactoring the API for selecting scalers 2021-06-23 21:29:53 +02:00
Martin Gerhardy 5af1192580 BACKENDS: fixed segfault in EventRecorder with buffer out of bounds writes
==3124361== Invalid write of size 8
==3124361==    at 0x483F803: memmove (vg_replace_strmem.c:1270)
==3124361==    by 0x4DBF61: SurfaceSdlGraphicsManager::grabOverlay(void*, int) const (surfacesdl-graphics.cpp:1753)
==3124361==    by 0x482051: ModularGraphicsBackend::grabOverlay(void*, int) (modular-backend.cpp:215)
==3124361==    by 0x434EE1: GUI::ThemeEngine::clearAll() (ThemeEngine.cpp:376)
==3124361==    by 0x40128E: GUI::EventRecorder::preDrawOverlayGui() (EventRecorder.cpp:558)
==3124361==    by 0x481DB2: ModularGraphicsBackend::updateScreen() (modular-backend.cpp:173)
==3124361==    by 0x559967: Graphics::Screen::updateScreen() (screen.cpp:62)
==3124361==    by 0x55991C: Graphics::Screen::update() (screen.cpp:56)
==3124361==    by 0x38AFC7: TwinE::TwineScreen::update() (twine.cpp:126)
==3124361==    by 0x3B8759: TwinE::Screens::adjustPalette(unsigned char, unsigned char, unsigned char, unsigned int const*, int) (screens.cpp:150)
==3124361==    by 0x3B8A89: TwinE::Screens::fadeToPal(unsigned int const*) (screens.cpp:207)
==3124361==    by 0x3B8403: TwinE::Screens::loadImage(int, int, bool) (screens.cpp:80)
==3124361==  Address 0x31453050 is 16 bytes after a block of size 512,000 alloc'd
==3124361==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==3124361==    by 0x55B38C: Graphics::Surface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (surface.cpp:75)
==3124361==    by 0x551111: Graphics::ManagedSurface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (managed_surface.cpp:153)
==3124361==    by 0x4352D5: GUI::ThemeEngine::setGraphicsMode(GUI::ThemeEngine::GraphicsMode) (ThemeEngine.cpp:453)
==3124361==    by 0x434A52: GUI::ThemeEngine::init() (ThemeEngine.cpp:324)
==3124361==    by 0x43501B: GUI::ThemeEngine::refresh() (ThemeEngine.cpp:394)
==3124361==    by 0x405780: GUI::GuiManager::screenChange() (gui-manager.cpp:603)
==3124361==    by 0x405C6B: GUI::GuiManager::processEvent(Common::Event const&, GUI::Dialog*) (gui-manager.cpp:677)
==3124361==    by 0x404EBA: GUI::GuiManager::runLoop() (gui-manager.cpp:429)
==3124361==    by 0x3FD847: GUI::Dialog::runModal() (dialog.cpp:77)
==3124361==    by 0x36D747: launcherDialog() (main.cpp:106)
==3124361==    by 0x36FF92: scummvm_main (main.cpp:552)

It looks like the _videoMode.overlayHeight in SurfaceSdlGraphicsManager::grabOverlay and ThemeEngine::_backBuffer::h are somehow out of sync after
starting the game in a different resolution as the gui was started with. So the overlayHeight is updated - but the backbuffer (Surface) is not resized.

This is with event recorder being active - right after starting the game and switching the resolution.
2021-06-19 14:34:52 +02:00
athrxx ff3d0e83c2 GRAPHICS: fix Edge scaler glitch (bug no. 12553)
Force the creation of a new screen buffer for the scaler after leaving the overlay. The whole "old source" code looks a bit unfinished. Anyway, this fix should only kick in for one particular scaler and one particular situation and one particular backend. So I guess it is safe enough...
2021-05-28 20:26:28 +02:00
Thierry Crozat bf406f66c0 BACKENDS: SDL: Do not allocate memory in SurfaceSdlGraphicsManager::getSupportedGraphicsModes 2021-05-08 21:58:30 +01:00
Martin Gerhardy 9d82fa51df COMMON: removed USE_TTS check from engines
OSystem now just returns a nullptr if there is no text to speech manager instance
(because none is compiled into the binary, or the system doesn't provide support
for it). This removed the need for the engine authors to add scummvm osystem compile
time options checks into their engine code
2021-05-03 14:13:41 +03:00
SupSuper 60f1fd98aa SDL: Use the window display index when querying display modes 2021-05-01 11:22:22 +03:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00