49 Commits

Author SHA1 Message Date
Le Philousophe be80eedd91 COMMON: Make getOverlayHeight and getOverlayWidth constant
This is cleaner and may allow some optimizations.
This was also already the case for modular graphics backends.
2025-07-13 17:26:37 +02:00
elasota 3db67a33ac GRAPHICS: Add support for pixels with masks and inverted pixels 2023-02-19 23:51:09 +01: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 abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +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
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
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Cameron Cawley 5a47b09455 BACKENDS: Move default implementations of getScreenPixelBuffer into BaseBackend 2020-10-10 18:00:17 +02:00
Eugene Sandulenko 737473895f DC: Fix compilation 2020-10-10 10:22:41 +02:00
Cameron Cawley e92ac655be BACKENDS: Add default implementation for GraphicsMode functions 2019-12-15 16:06:56 +02:00
sluicebox 4b4b33fad3 DC: Implement horizontal shake 2019-11-19 00:20:40 +01:00
sluicebox b8390fa161 GRAPHICS: Add interface for horizontal shake 2019-11-19 00:20:40 +01:00
Colin Snover bda253b1ac BACKENDS: Constify PaletteManager::grabPalette implementations 2017-10-15 13:47:19 -05:00
Johannes Schickel b4e5531352 DC: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel 30d2eb7a97 DC: Do not access Surface::pixels directly. 2013-08-06 03:51:12 +02:00
Johannes Schickel aec9b9e22a ALL: Let overlay related methods in OSystem take a void * and use a proper pitch values.
This is a first step to get rid of OverlayColor, which is a requirement for
proper 4Bpp overlay support.
2012-06-16 04:17:14 +02:00
Johannes Schickel d27d951d0b BACKENDS: Make OSystem::setMouseCursor take a "const void *" buffer.
This is mainly for consistency with OSystem::copyRectToScreen.
2012-06-16 03:28:42 +02:00
Johannes Schickel 31880186e1 BACKENDS: Let copyRectToScreen take a "const void *" instead of "const byte *" as buffer.
This removes the need to convert the parameter to copyRectToScreen to
"const byte *", which is commonly used in games, which use Graphics::Surface
to store their graphics data.
2012-06-16 02:18:01 +02:00
Johannes Schickel a401f0a19e ALL: Replace cursorTargetScale in OSystem API with a simple "do not scale" logic.
All uses of the old target scale API actually wanted to disallow scaling of
the mouse cursor. This commit adapts our API to this and thus simplifies
backend implementations.

Some backends, most notable the Wii and Android, did some implementation of
the cursor target scale, which I didn't adapt yet. I added a TODO for the
porters there.
2012-06-03 02:02:57 +02:00
Tarek Soliman a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'

This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
2012-02-15 10:07:10 -06:00
Christoph Mallon 23a0f5318c JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
Max Horn ce32745d9c BACKENDS: Replace OSystem::disableCursorPalette by setFeatureState calls 2011-06-04 11:55:56 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Johannes Schickel da734a4af0 ALL/GRAPHICS: Remove Surface::bytesPerPixel. 2011-04-17 21:27:34 +02:00
Johannes Schickel 462f06d806 DC: Adapt to setPalette/grabPalette RGBA->RGB change.
This change is not tested, but should hopefully work fine.
2011-02-16 00:04:25 +01:00
Max Horn 703f0ca29c SYSTEM: Unify OSystem::getSupportedFormats() signature
svn-id: r49838
2010-06-15 12:21:08 +00:00
Max Horn 9fb27a26f8 Remove unnecessary #includes
svn-id: r48185
2010-03-08 10:28:14 +00:00
Torbjörn Andersson 9a85b1284b Silenced some more cppcheck style warnings.
svn-id: r47628
2010-01-28 05:20:52 +00:00
Marcus Comstedt 8fd29ecf9f Fixed some warnings.
svn-id: r44877
2009-10-10 14:55:56 +00:00
Marcus Comstedt f517f32902 RGB support.
svn-id: r44874
2009-10-10 14:26:53 +00:00
Eugene Sandulenko 95c5d24044 Second attempt to fix DC and iPhone backends compilation
svn-id: r43651
2009-08-22 14:52:26 +00:00
Eugene Sandulenko ad507d3387 Attempt to fix DC and iPhone backends compilation
svn-id: r43650
2009-08-22 13:34:38 +00:00
Marcus Comstedt 415d0c5b03 Refresh the screen if pollEvent() is called without updateScreen() being called for a long time.
svn-id: r42139
2009-07-05 14:57:03 +00:00
Marcus Comstedt e3ca4afb59 Fixed some warnings.
svn-id: r39590
2009-03-21 15:47:45 +00:00
Marcus Comstedt da142af5d4 Changed grabOverlay() and copyRectToOverlay() to use OverlayColor instead of int16.
svn-id: r39493
2009-03-17 22:09:33 +00:00
Johannes Schickel 49d90127b9 Removed OSystem_Dreamcast::fillScreen implementation after discussing it with Marcus.
svn-id: r38327
2009-02-15 23:01:27 +00:00
Johannes Schickel 5417f6bacb - Replace OSystem::clearScreen with OSystem::fillScreen as discussed on -devel.
- Update BaseBackend and DC port to properly implement OSystem::fillScreen (now only PalmOS has to be updated).
- Update all client code which relied on OSystem::clearScreen so far.

svn-id: r38304
2009-02-15 21:20:21 +00:00
Marcus Comstedt f90e4545c2 Merged r36175 from branch-0-13-0:
Fixed alpha blending in the UI dialogs by adding alpha
computation to the blendPixelPtr() function.  To minimize
impact, pre-multiplied alpha is assumed, meaning that the
blending of the R, G and B components is the same both
with and without hardware alpha.

svn-id: r36177
2009-02-01 14:56:19 +00:00
Max Horn 0034aa3b9c Got rid of several occurrences of gBitFormat
svn-id: r35995
2009-01-22 04:59:09 +00:00
Jordi Vilalta Prat 66e9d4f5e8 Removed trailing spaces.
svn-id: r30664
2008-01-27 19:47:41 +00:00
Nicola Mettifogo 258901bab9 Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
svn-id: r28966
2007-09-19 08:40:12 +00:00
Max Horn 3abc11611e Code formatting fixes
svn-id: r28945
2007-09-18 20:16:33 +00:00
Max Horn 41c68ac3e4 Removed various obsolete methods from OSystem (screenToOverlayX/Y, overlayToScreenX/Y)
svn-id: r27961
2007-07-08 12:02:38 +00:00
Max Horn e2ad271bd8 Removing non-ASCII chars from source code
svn-id: r27818
2007-07-01 12:47:07 +00:00
Max Horn b51f2f3212 Implemented the OSystem framebuffer API, as discussed on scummvm-devel. All changes are just fine, and won't cause any compile problems or regressions, despite the fact that I can't test most of the non-SDL backend changes, at an improbability level of two to the power of two hundred and seventy-six thousand to one against - possibly much higher. Anything you still can't cope with is therefore your own problem. Please relax.
svn-id: r27548
2007-06-19 22:39:59 +00:00
Max Horn 218e132e37 Updated legal headers in source files, based on what Pidgin (the IM client formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots
svn-id: r27024
2007-05-30 21:56:52 +00:00
Marcus Comstedt 43fac9ab3d Check for degenerated rect in copyRectTo*.
svn-id: r24452
2006-10-22 17:32:04 +00:00
Marcus Comstedt 25f68b08ab Moved backends/dc into new platform directory.
svn-id: r23357
2006-06-30 20:21:42 +00:00