Commit Graph
137148 Commits
Author SHA1 Message Date
Cameron Cawley 6a6cdc2bce GRAPHICS: Use override and final keywords 2021-03-15 16:48:40 +02:00
Cameron Cawley e50e010a9e SDL: Fix compilation when building without RGB colour support 2021-03-15 16:48:40 +02:00
Cameron Cawley 12878afc06 SDL: Fix building without scalers 2021-03-15 16:48:40 +02:00
Cameron Cawley 97e176a098 GRAPHICS: Increase the number of extra pixels required by AdvMame4x 2021-03-15 16:48:40 +02:00
Cameron Cawley 9030ac7305 GRAPHICS: Remove unused code 2021-03-15 16:48:40 +02:00
Johannes Schickel 5df18f7d86 GRAPHICS: Take advantage of ColorMasks::PixelType in scaler code. 2021-03-15 16:48:40 +02:00
Johannes Schickel 5dc207a386 SDL: Properly handle extra pixels for scalers in showOverlay. 2021-03-15 16:48:40 +02:00
Johannes Schickel 088119b57c GRAPHICS: Very small cleanup for Edge scaler code. 2021-03-15 16:48:40 +02:00
Johannes Schickel 8825c9e3b4 GRAPHICS: Keep destination buffer in SourceScaler instead of SDL backend. 2021-03-15 16:48:40 +02:00
Johannes Schickel 5420a7f6bd GRAPHICS: Add a default implementation for ScalerPluginObject::getFactor. 2021-03-15 16:48:40 +02:00
Johannes Schickel 23bee4de30 SDL: Properly look up the normal scaler plugin. 2021-03-15 16:48:40 +02:00
Johannes Schickel abbdadf869 GRAPHICS: Add possibility to search for a scaler via its name. 2021-03-15 16:48:40 +02:00
Johannes Schickel e8d0182cd5 SDL: Take advantage that each ScalerPluginObject can use a scale factor of 1. 2021-03-15 16:48:40 +02:00
Johannes Schickel 6942dba3da GRAPHICS: Let each scaler handle 1x scaling. 2021-03-15 16:48:40 +02:00
Johannes Schickel b225858e41 GRAPHICS: Let ScalerPluginObject::setFactor return the old factor.
This simplifies things a bit.
2021-03-15 16:48:40 +02:00
Johannes Schickel ee438bebc2 SDL: Disable more AR related code when USE_ASPECT is not defined. 2021-03-15 16:48:40 +02:00
Cameron Cawley b78323897d SDL: Fix compilation 2021-03-15 16:48:40 +02:00
Martin T. H. Sandsmark 9296b92d8f fix crash on exit 2021-03-15 16:48:40 +02:00
Martin T. H. Sandsmark ab000b6ae3 fix cursor 2021-03-15 16:48:40 +02:00
Martin T. H. Sandsmark fcff230fe8 fix build 2021-03-15 16:48:40 +02:00
Martin T. H. Sandsmark f4f9957f85 scalerplugin: port to new plugin api 2021-03-15 16:48:40 +02:00
Eric Culp 39608f391c SDL,GRAPHICS: Add option for AR correction without scalers 2021-03-15 16:48:40 +02:00
Eric Culp 4674c7c7b0 GRAPHICS: Check bytesPerPixel when USE_SCALERS is undefined 2021-03-15 16:48:40 +02:00
Eric Culp b80c7908fa SDL: Update comments for scaling mouse cursor 2021-03-15 16:48:40 +02:00
Eric Culp d8240fa734 SDL: Initialize plugins when formats change. 2021-03-15 16:48:40 +02:00
Eric Culp c7121fae65 SDL: Fix formatting for pointers. 2021-03-15 16:48:40 +02:00
Eric Culp e35a7c72c0 SDL: Cache default graphics mode upon initialization. 2021-03-15 16:48:40 +02:00
Eric Culp 88363d5d36 SDL: Fix error when USE_SCALERS is undefined 2021-03-15 16:48:40 +02:00
Eric Culp f172718b79 CONFIGURE: Added configure option for Edge2x-3x scaler plugin 2021-03-15 16:48:40 +02:00
Eric Culp f9569ea2ff SDL: Fix formatting 2021-03-15 16:48:40 +02:00
Eric Culp ee008a44b1 SDL: Formatting fix 2021-03-15 16:48:40 +02:00
Eric Culp cbf9072e45 SDL: Fix leaks related to graphics modes
supportedGraphicsModes() now returns to OSystem_SDL a pointer to a deep copy of
surfacesdl's internal graphics mode array. Therefore each can free its
own copy without interfering with the other's.
2021-03-15 16:48:40 +02:00
Eric Culp ab8dd417a9 SDL: Use enableSource() when scaling to the overlay
This fixes an issue where the screen would have little or no changes
and nothing would be drawn to the overlay.
2021-03-15 16:48:40 +02:00
Eric Culp 853d545284 SDL: Make sure normal scaler plugin is initialized
If a game and graphics mode were chosen from the command line, the normal
plugin might not have been loaded and it would crash upon being used to
scale the cursor. Now the normal plugin is initialized with the first
plugin to be initialized.
2021-03-15 16:48:40 +02:00
Eric Culp a41cd52bbf SDL: Use a simple blit function instead of normal scaler plugin
For places where a blit is needed and no scaling is required, this
function is used instead.
2021-03-15 16:48:40 +02:00
Eric Culp 3e9bd387e7 GRAPHICS: Clean up Edge plugin source
Add static keyword to some functions.

Rename functions to camelCase style.
2021-03-15 16:48:40 +02:00
Eric Culp 4c4028cf1d GRAPHICS: Various formatting fixes 2021-03-15 16:48:40 +02:00
Eric Culp 4c967c5fbc GRAPHICS,SDL: Revision to scaler API
oldSrcScale() is now unified with scale(). Use enableSource(bool enable)
to switch functionality. Partial screen updates are also posible because
of this.

initialize() had its prototype changes although it is functionally the
same.

setSource() no longer has a type parameter, removing support for
multiple source surfaces. They weren't useful anyway.

useOldSrc() was renamed to useOldSource() to conform to the names of
other functions.
2021-03-15 16:48:40 +02:00
Eric Culp cb5c323b54 GRAPHICS: Constify the src in setSource 2021-03-15 16:48:40 +02:00
Eric Culp c5c5662330 GRAPHICS,SDL: Change oldSrcScale api
More bookkeeping is kept in common scaler code instead of the backend.
Plugins inheriting SourceScaler will have this functionality.

TODO: Some new functions may still be able to be combined to simplify
the API.
2021-03-15 16:48:40 +02:00
Eric Culp c915efa452 GRAPHICS: Respect alpha and rgba formats in interpolation and conversion 2021-03-15 16:48:40 +02:00
Eric Culp 179705071d GRAPHICS: Fix Edge3x scaler 2021-03-15 16:48:40 +02:00
Eric Culp 56d078e732 SDL: Fix assignment of variable
GCC seemed to allow the previous syntax but clang rejected it.
2021-03-15 16:48:40 +02:00
Eric Culp 86c2307351 GRAPHICS: Add some 32bpp abilty to Edge scalers
It is still broken, but it seems to be close.
2021-03-15 16:48:40 +02:00
Eric Culp 8baa92a190 SDL: Fix overlay while using oldSrcScale
The _destbuffer was overwriting _hwscreen even when the overlay was
visible.
2021-03-15 16:48:40 +02:00
Eric Culp 6cfba9d567 SDL: Only update if a change was made when using oldSrcScale 2021-03-15 16:48:40 +02:00
Eric Culp 1e724e6640 GRAPHICS: Use new oldSrcScale API for EdgePlugin 2021-03-15 16:48:40 +02:00
Eric Culp 3b408c2d87 SDL: Use an extra buffer for oldSrcScale so it is not confused by AR
If the two source images match, the scaler assumes there is not update
and does not draw to the surface. However, AR correction depends on a
redraw, so the scaler always writes to _destbuffer which is then copied
to _hwscreen to be AR corrected.
2021-03-15 16:48:40 +02:00
Eric Culp e2484a0fba SDL: Swap and lock the old screen 2021-03-15 16:48:40 +02:00
Eric Culp cfbc3e91cf SDL: Use oldSrcScale for scaler plugins that support it 2021-03-15 16:48:40 +02:00