Commit graph

25 commits

Author SHA1 Message Date
Matthew Jimenez
b940265816 IMAGE: Use palette class in Cinepak decoder.
The Cinepak decoder had an unweighted euclidean color distance calculation for palette matching. This was moved and rewritten to a color distance method on the palette class.
2025-03-05 13:37:01 +02:00
Matthew Jimenez
4a01560a44 IMAGE: Replace palette byte arrays with Palette class 2025-02-27 00:04:00 +02:00
Matthew Jimenez
1e99ce9d43 GRAPHICS: Use constexpr for palette constants 2025-02-26 11:11:43 +02:00
Matthew Jimenez
6c661eb473 GRAPHICS: Define color distance methods for palette 2024-12-26 10:59:48 +02:00
Paul Gilbert
1f65be27d9 GRAPHICS: Palette constants cleanup, added Palette methods to ManagedSurface 2024-06-02 10:55:01 -07:00
Paul Gilbert
2027813d67 GRAPHICS: Added Palette::createEGAPalette method 2024-06-01 11:26:17 -07:00
Paul Gilbert
dafc55d8b9 GRAPHICS: Add copy operator to Palette 2024-04-29 22:13:00 -07:00
Matthew Jimenez
771dc751db GRAPHICS: Switch ManagedSurface to use Palette class 2024-03-18 21:06:04 +02:00
Matthew Jimenez
5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Matthew Jimenez
8af5e55712 GRAPHICS: Define Palette class and use in PaletteLookup 2024-03-11 01:02:15 +01:00
Cameron Cawley
dae8cf474c GRAPHICS: Add a function for creating maps to PaletteLookup 2023-11-11 23:01:16 +01:00
AndywinXp
e024c5c81d GRAPHICS: Add naive algorithm option for PaletteLookup 2022-07-17 13:17:41 +02:00
Eugene Sandulenko
c87c02c5ae
GRAPHICS: Return flag if palette was updated for the palette lookup 2022-07-04 01:36:18 +02:00
Eugene Sandulenko
5abc6bda81
GRAPHICS: Added palette lookup class 2022-07-03 12:50:06 +02:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Bartosz Gentkowski
a35cbeab46 DOXYGEN: Add doxy groups to remaining headers in 'graphics'
To make sure that they appear in the graphics group
in the doc structure.
2020-12-01 23:24:37 +00: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
Johannes Schickel
53332e8066 GRAPHICS: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
75ee5af7c9 GRAPHICS: Remove leftover RGBA reference in PaletteManager documentation. 2011-02-20 21:38:40 +01:00
Johannes Schickel
292f197142 GRAPHICS: Remove note about alpha channel removal in PaletteManager. 2011-02-19 23:45:03 +01:00
Johannes Schickel
18ff02a2fa GRAPHICS: Update PaletteManager documentation for RGBA->RGB change. 2011-02-14 17:08:31 +01:00
Max Horn
ab039812e7 COMMON: OSystem now has a PaletteManager
svn-id: r55806
2011-02-07 17:52:38 +00:00