2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
2016-12-30 00:00:30 +00:00
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
2003-09-25 16:20:34 +00:00
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2019-12-31 17:18:56 +00:00
|
|
|
// Copyright (c) 1995-2020 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2003-09-25 16:20:34 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//============================================================================
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
#ifndef FRAMEBUFFER_HXX
|
|
|
|
#define FRAMEBUFFER_HXX
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
#include <map>
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
class OSystem;
|
|
|
|
class Console;
|
2010-10-18 18:39:57 +00:00
|
|
|
class Settings;
|
2017-11-17 17:00:17 +00:00
|
|
|
class FBSurface;
|
|
|
|
class TIASurface;
|
2007-09-03 18:37:24 +00:00
|
|
|
|
2020-04-29 17:22:15 +00:00
|
|
|
#ifdef GUI_SUPPORT
|
|
|
|
#include "Font.hxx"
|
|
|
|
#endif
|
2007-09-03 18:37:24 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
#include "Rect.hxx"
|
2013-05-09 14:22:34 +00:00
|
|
|
#include "Variant.hxx"
|
2017-07-26 22:33:39 +00:00
|
|
|
#include "TIAConstants.hxx"
|
2020-10-23 12:57:06 +00:00
|
|
|
#include "FBBackend.hxx"
|
2017-11-16 17:01:20 +00:00
|
|
|
#include "FrameBufferConstants.hxx"
|
2017-12-21 01:26:22 +00:00
|
|
|
#include "EventHandlerConstants.hxx"
|
2020-10-13 13:17:37 +00:00
|
|
|
#include "VideoModeHandler.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "bspf.hxx"
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
/**
|
2009-01-19 16:52:32 +00:00
|
|
|
This class encapsulates all video buffers and is the basis for the video
|
2020-10-24 00:15:04 +00:00
|
|
|
display in Stella. The FBBackend object contained in this class is
|
|
|
|
platform-specific, and most rendering tasks are delegated to it.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2009-01-19 16:52:32 +00:00
|
|
|
The TIA is drawn here, and all GUI elements (ala ScummVM, which are drawn
|
|
|
|
into FBSurfaces), are in turn drawn here as well.
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
@author Stephen Anthony
|
|
|
|
*/
|
2003-10-17 18:02:16 +00:00
|
|
|
class FrameBuffer
|
2003-09-25 16:20:34 +00:00
|
|
|
{
|
2019-04-08 21:14:27 +00:00
|
|
|
public:
|
2019-05-18 08:30:23 +00:00
|
|
|
// Zoom level step interval
|
2019-05-18 23:18:13 +00:00
|
|
|
static constexpr float ZOOM_STEPS = 0.25;
|
2019-05-18 08:30:23 +00:00
|
|
|
|
2020-11-13 18:53:19 +00:00
|
|
|
enum UpdateMode {
|
|
|
|
NONE = 0,
|
|
|
|
REDRAW = 1,
|
|
|
|
RERENDER = 2
|
|
|
|
};
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
public:
|
2014-05-12 23:34:25 +00:00
|
|
|
FrameBuffer(OSystem& osystem);
|
2020-10-23 12:57:06 +00:00
|
|
|
~FrameBuffer();
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2020-10-23 12:57:06 +00:00
|
|
|
Initialize the framebuffer object (set up the underlying hardware).
|
|
|
|
Throws an exception upon encountering any errors.
|
2014-02-05 22:09:57 +00:00
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
void initialize();
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
(Re)creates the framebuffer display. This must be called before any
|
2003-10-26 19:40:39 +00:00
|
|
|
calls are made to derived methods.
|
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
@param title The title of the application / window
|
2020-10-13 23:56:05 +00:00
|
|
|
@param size The dimensions of the display
|
2019-05-11 17:03:07 +00:00
|
|
|
@param honourHiDPI If true, consult the 'hidpi' setting and enlarge
|
|
|
|
the display size accordingly; if false, use the
|
|
|
|
exact dimensions as given
|
2010-07-22 15:41:46 +00:00
|
|
|
|
|
|
|
@return Status of initialization (see FBInitStatus 'enum')
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2020-05-02 14:46:37 +00:00
|
|
|
FBInitStatus createDisplay(const string& title, BufferType type,
|
2020-10-13 23:56:05 +00:00
|
|
|
Common::Size size, bool honourHiDPI = true);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-02-21 02:23:57 +00:00
|
|
|
Updates the display, which depending on the current mode could mean
|
2018-07-25 11:18:21 +00:00
|
|
|
drawing the TIA, any pending menus, etc.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2020-11-13 18:53:19 +00:00
|
|
|
void update(UpdateMode mode = UpdateMode::NONE);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2018-05-23 22:13:43 +00:00
|
|
|
/**
|
|
|
|
There is a dedicated update method for emulation mode.
|
2020-11-13 07:58:19 +00:00
|
|
|
*/
|
2018-07-30 21:19:09 +00:00
|
|
|
void updateInEmulationMode(float framesPerSecond);
|
2018-05-23 22:13:43 +00:00
|
|
|
|
2020-11-13 07:58:19 +00:00
|
|
|
/**
|
2020-11-13 10:18:25 +00:00
|
|
|
Set pending rendering flag.
|
2020-11-13 07:58:19 +00:00
|
|
|
*/
|
2020-11-13 10:18:25 +00:00
|
|
|
void setPendingRender() { myPendingRender = true; }
|
2020-11-13 07:58:19 +00:00
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
/**
|
2020-11-12 09:43:04 +00:00
|
|
|
Shows a text message onscreen.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
@param message The message to be shown
|
2006-03-19 18:17:48 +00:00
|
|
|
@param position Onscreen position for the message
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
@param force Force showing this message, even if messages are disabled
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2020-11-12 09:43:04 +00:00
|
|
|
void showTextMessage(const string& message,
|
|
|
|
MessagePosition position = MessagePosition::BottomCenter,
|
|
|
|
bool force = false);
|
2020-05-13 07:32:11 +00:00
|
|
|
/**
|
2020-05-14 19:18:55 +00:00
|
|
|
Shows a message with a gauge bar onscreen.
|
2020-05-13 07:32:11 +00:00
|
|
|
|
|
|
|
@param message The message to be shown
|
2020-05-14 19:18:55 +00:00
|
|
|
@param valueText The value of the gauge bar as text
|
|
|
|
@param value The gauge bar percentage
|
|
|
|
@param minValue The minimal value of the gauge bar
|
|
|
|
@param maxValue The maximal value of the gauge bar
|
2020-05-13 07:32:11 +00:00
|
|
|
*/
|
2020-11-12 09:43:04 +00:00
|
|
|
void showGaugeMessage(const string& message, const string& valueText,
|
|
|
|
float value, float minValue = 0.F, float maxValue = 100.F);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2020-06-19 22:25:27 +00:00
|
|
|
bool messageShown() const;
|
2020-05-14 19:18:55 +00:00
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
/**
|
2008-05-20 13:42:50 +00:00
|
|
|
Toggles showing or hiding framerate statistics.
|
2005-08-29 18:36:42 +00:00
|
|
|
*/
|
2020-07-02 21:33:13 +00:00
|
|
|
void toggleFrameStats(bool toggle = true);
|
2008-05-20 13:42:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Shows a message containing frame statistics for the current frame.
|
|
|
|
*/
|
|
|
|
void showFrameStats(bool enable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enable/disable any pending messages. Disabled messages aren't removed
|
|
|
|
from the message queue; they're just not redrawn into the framebuffer.
|
|
|
|
*/
|
|
|
|
void enableMessages(bool enable);
|
2005-08-29 18:36:42 +00:00
|
|
|
|
2017-12-13 18:15:09 +00:00
|
|
|
/**
|
|
|
|
Reset 'Paused' display delay counter
|
|
|
|
*/
|
2017-12-15 17:10:40 +00:00
|
|
|
void setPauseDelay();
|
2017-12-13 18:15:09 +00:00
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
/**
|
2014-11-09 15:10:47 +00:00
|
|
|
Allocate a new surface. The FrameBuffer class takes all responsibility
|
|
|
|
for freeing this surface (ie, other classes must not delete it directly).
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
@param w The requested width of the new surface
|
|
|
|
@param h The requested height of the new surface
|
|
|
|
@param inter Interpolation mode
|
|
|
|
@param data If non-null, use the given data values as a static surface
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
@return A pointer to a valid surface object, or nullptr
|
2008-12-12 15:51:07 +00:00
|
|
|
*/
|
2019-12-13 21:46:08 +00:00
|
|
|
shared_ptr<FBSurface> allocateSurface(
|
|
|
|
int w,
|
|
|
|
int h,
|
2020-10-23 12:57:06 +00:00
|
|
|
ScalingInterpolation inter = ScalingInterpolation::none,
|
2019-12-13 21:46:08 +00:00
|
|
|
const uInt32* data = nullptr
|
|
|
|
);
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2019-12-26 20:58:55 +00:00
|
|
|
/**
|
|
|
|
Set up the TIA/emulation palette. Due to the way the palette is stored,
|
|
|
|
a call to this method implicitly calls setUIPalette() too.
|
|
|
|
|
|
|
|
@param rgb_palette The array of colors in R/G/B format
|
|
|
|
*/
|
|
|
|
void setTIAPalette(const PaletteArray& rgb_palette);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set palette for user interface.
|
|
|
|
*/
|
|
|
|
void setUIPalette();
|
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
/**
|
2008-06-19 12:01:31 +00:00
|
|
|
Returns the current dimensions of the framebuffer image.
|
|
|
|
Note that this will take into account the current scaling (if any)
|
|
|
|
as well as image 'centering'.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2020-10-16 16:49:15 +00:00
|
|
|
const Common::Rect& imageRect() const { return myActiveVidMode.imageR; }
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2008-06-19 12:01:31 +00:00
|
|
|
Returns the current dimensions of the framebuffer window.
|
|
|
|
This is the entire area containing the framebuffer image as well as any
|
|
|
|
'unusable' area.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2020-10-16 16:49:15 +00:00
|
|
|
const Common::Size& screenSize() const { return myActiveVidMode.screenS; }
|
|
|
|
const Common::Rect& screenRect() const { return myActiveVidMode.screenR; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
/**
|
2014-04-29 14:52:35 +00:00
|
|
|
Returns the current dimensions of the users' desktop.
|
2014-02-05 22:09:57 +00:00
|
|
|
*/
|
2019-05-02 20:28:39 +00:00
|
|
|
const Common::Size& desktopSize() const { return myDesktopSize; }
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-03-07 22:12:39 +00:00
|
|
|
Get the supported renderers for the video hardware.
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-03-07 22:12:39 +00:00
|
|
|
@return An array of supported renderers
|
2014-02-05 22:09:57 +00:00
|
|
|
*/
|
2014-03-07 22:12:39 +00:00
|
|
|
const VariantList& supportedRenderers() const { return myRenderers; }
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
/**
|
2019-05-18 23:18:13 +00:00
|
|
|
Get the minimum/maximum supported TIA zoom level (windowed mode)
|
|
|
|
for the framebuffer.
|
2014-05-12 23:34:25 +00:00
|
|
|
*/
|
2020-04-29 12:25:54 +00:00
|
|
|
float supportedTIAMinZoom() const { return myTIAMinZoom * hidpiScaleFactor(); }
|
2019-05-18 23:18:13 +00:00
|
|
|
float supportedTIAMaxZoom() const { return myTIAMaxZoom; }
|
2014-05-12 23:34:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the TIA surface associated with the framebuffer.
|
|
|
|
*/
|
|
|
|
TIASurface& tiaSurface() const { return *myTIASurface; }
|
|
|
|
|
2005-05-01 20:11:07 +00:00
|
|
|
/**
|
2014-04-28 16:47:10 +00:00
|
|
|
Toggles between fullscreen and window mode.
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2020-05-16 11:00:38 +00:00
|
|
|
void toggleFullscreen(bool toggle = true);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2020-05-24 08:03:53 +00:00
|
|
|
#ifdef ADAPTABLE_REFRESH_SUPPORT
|
|
|
|
/**
|
|
|
|
Toggles between adapt fullscreen refresh rate on and off.
|
|
|
|
*/
|
2020-05-24 15:40:59 +00:00
|
|
|
void toggleAdaptRefresh(bool toggle = true);
|
2020-05-24 08:03:53 +00:00
|
|
|
#endif
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2019-06-02 07:21:20 +00:00
|
|
|
Changes the fullscreen overscan.
|
2020-05-13 07:32:11 +00:00
|
|
|
|
2020-10-24 00:15:04 +00:00
|
|
|
@param direction +1 indicates increase, -1 indicates decrease
|
2019-06-02 07:21:20 +00:00
|
|
|
*/
|
2020-05-16 07:50:16 +00:00
|
|
|
void changeOverscan(int direction = +1);
|
2019-06-02 07:21:20 +00:00
|
|
|
|
|
|
|
/**
|
2020-10-24 00:15:04 +00:00
|
|
|
This method is called when the user wants to switch to the previous/next
|
2020-10-13 13:17:37 +00:00
|
|
|
available TIA video mode. In windowed mode, this typically means going
|
|
|
|
to the next/previous zoom level. In fullscreen mode, this typically
|
|
|
|
means switching between normal aspect and fully filling the screen.
|
2005-03-26 19:26:48 +00:00
|
|
|
|
2020-10-24 00:15:04 +00:00
|
|
|
@param direction +1 indicates next mode, -1 indicates previous mode
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2020-10-13 13:17:37 +00:00
|
|
|
void switchVideoMode(int direction = +1);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-14 04:08:15 +00:00
|
|
|
/**
|
|
|
|
Sets the state of the cursor (hidden or grabbed) based on the
|
|
|
|
current mode.
|
|
|
|
*/
|
|
|
|
void setCursorState();
|
|
|
|
|
2011-06-07 13:40:59 +00:00
|
|
|
/**
|
2017-11-23 21:13:37 +00:00
|
|
|
Sets the use of grabmouse.
|
|
|
|
*/
|
|
|
|
void enableGrabMouse(bool enable);
|
|
|
|
|
|
|
|
/**
|
2020-10-16 18:02:43 +00:00
|
|
|
Toggles the use of grabmouse (only has effect in emulation mode).
|
2011-06-07 13:40:59 +00:00
|
|
|
*/
|
2020-10-16 18:02:43 +00:00
|
|
|
void toggleGrabMouse();
|
2011-06-07 13:40:59 +00:00
|
|
|
|
2017-11-23 21:13:37 +00:00
|
|
|
/**
|
2020-10-16 18:02:43 +00:00
|
|
|
Query whether grabmouse is enabled.
|
2017-11-23 21:13:37 +00:00
|
|
|
*/
|
2020-10-16 18:02:43 +00:00
|
|
|
bool grabMouseEnabled() const { return myGrabMouse; }
|
2017-11-23 21:13:37 +00:00
|
|
|
|
Added new rendering modes to FrameBufferSoft, which don't use dirty
rectangle merging. This makes the 'dirtyrects' option more relevant,
since now if it's turned off, dirty rectangles are not merged, and
the screen is updated with SDL_Flip() instead of SDL_UpdateRects().
This new functionality is very similar to how z26 works, but
experiments on my Linux system show it to be twice as fast on
average :) Dirty rectangle merging now defaults to off. I'm
leaving it in, since it benefits people in some cases. Basically,
non-dirty-rect support is optimal when many things are changing
onscreen at once, at the cost of more constant and generally slightly
higher CPU usage. Dirty-rect support is optimal at larger resolutions,
where it's usually at least twice as fast as without, but is suboptimal
at larger resolutions when lots of stuff is changing. At some point in
the future, maybe Stella itself can automatically switch modes depending
on which is faster at any point in time.
Added "[..]" previous directory functionality to BrowserWidget, the same
as already in the LauncherDialog. Thanks for Alex and Lou for the
reminder.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-10 17:04:34 +00:00
|
|
|
/**
|
|
|
|
Informs the Framebuffer of a change in EventHandler state.
|
|
|
|
*/
|
2017-12-21 01:26:22 +00:00
|
|
|
void stateChanged(EventHandlerState state);
|
Added new rendering modes to FrameBufferSoft, which don't use dirty
rectangle merging. This makes the 'dirtyrects' option more relevant,
since now if it's turned off, dirty rectangles are not merged, and
the screen is updated with SDL_Flip() instead of SDL_UpdateRects().
This new functionality is very similar to how z26 works, but
experiments on my Linux system show it to be twice as fast on
average :) Dirty rectangle merging now defaults to off. I'm
leaving it in, since it benefits people in some cases. Basically,
non-dirty-rect support is optimal when many things are changing
onscreen at once, at the cost of more constant and generally slightly
higher CPU usage. Dirty-rect support is optimal at larger resolutions,
where it's usually at least twice as fast as without, but is suboptimal
at larger resolutions when lots of stuff is changing. At some point in
the future, maybe Stella itself can automatically switch modes depending
on which is faster at any point in time.
Added "[..]" previous directory functionality to BrowserWidget, the same
as already in the LauncherDialog. Thanks for Alex and Lou for the
reminder.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-10 17:04:34 +00:00
|
|
|
|
2019-05-13 17:04:39 +00:00
|
|
|
/**
|
|
|
|
Answer whether hidpi mode is allowed. In this mode, all FBSurfaces
|
|
|
|
are scaled to 2x normal size.
|
|
|
|
*/
|
|
|
|
bool hidpiAllowed() const { return myHiDPIAllowed; }
|
|
|
|
|
2019-05-11 17:03:07 +00:00
|
|
|
/**
|
|
|
|
Answer whether hidpi mode is enabled. In this mode, all FBSurfaces
|
|
|
|
are scaled to 2x normal size.
|
|
|
|
*/
|
|
|
|
bool hidpiEnabled() const { return myHiDPIEnabled; }
|
|
|
|
uInt32 hidpiScaleFactor() const { return myHiDPIEnabled ? 2 : 1; }
|
|
|
|
|
2020-05-02 14:46:37 +00:00
|
|
|
/**
|
2020-10-16 18:02:43 +00:00
|
|
|
These methods are used to load/save position and display of the
|
|
|
|
current window.
|
2020-05-02 14:46:37 +00:00
|
|
|
*/
|
|
|
|
string getPositionKey();
|
|
|
|
string getDisplayKey();
|
|
|
|
void saveCurrentWindowPosition();
|
|
|
|
|
2019-05-02 20:28:39 +00:00
|
|
|
#ifdef GUI_SUPPORT
|
|
|
|
/**
|
|
|
|
Get the font object(s) of the framebuffer
|
|
|
|
*/
|
|
|
|
const GUI::Font& font() const { return *myFont; }
|
|
|
|
const GUI::Font& infoFont() const { return *myInfoFont; }
|
|
|
|
const GUI::Font& smallFont() const { return *mySmallFont; }
|
|
|
|
const GUI::Font& launcherFont() const { return *myLauncherFont; }
|
2020-04-30 09:24:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the font description from the font name
|
|
|
|
|
|
|
|
@param name The settings name of the font
|
|
|
|
|
|
|
|
@return The description of the font
|
|
|
|
*/
|
|
|
|
FontDesc getFontDesc(const string& name) const;
|
2019-05-02 20:28:39 +00:00
|
|
|
#endif
|
|
|
|
|
2013-09-28 00:51:10 +00:00
|
|
|
/**
|
|
|
|
Shows or hides the cursor based on the given boolean value.
|
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
void showCursor(bool show) { myBackend->showCursor(show); }
|
2013-09-28 00:51:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Answers if the display is currently in fullscreen mode.
|
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
bool fullScreen() const { return myBackend->fullScreen(); }
|
2013-09-28 00:51:10 +00:00
|
|
|
|
2007-09-01 23:31:18 +00:00
|
|
|
/**
|
2009-01-03 22:57:12 +00:00
|
|
|
This method is called to retrieve the R/G/B data from the given pixel.
|
|
|
|
|
|
|
|
@param pixel The pixel containing R/G/B data
|
|
|
|
@param r The red component of the color
|
|
|
|
@param g The green component of the color
|
|
|
|
@param b The blue component of the color
|
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
void getRGB(uInt32 pixel, uInt8* r, uInt8* g, uInt8* b) const {
|
|
|
|
myBackend->getRGB(pixel, r, g, b);
|
|
|
|
}
|
2009-01-03 22:57:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This method is called to map a given R/G/B triple to the screen palette.
|
2007-09-01 23:31:18 +00:00
|
|
|
|
|
|
|
@param r The red component of the color.
|
|
|
|
@param g The green component of the color.
|
|
|
|
@param b The blue component of the color.
|
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
uInt32 mapRGB(uInt8 r, uInt8 g, uInt8 b) const {
|
|
|
|
return myBackend->mapRGB(r, g, b);
|
|
|
|
}
|
2007-09-01 23:31:18 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
/**
|
2014-06-13 13:35:41 +00:00
|
|
|
This method is called to get the specified ARGB data from the viewable
|
|
|
|
FrameBuffer area. Note that this isn't the same as any internal
|
|
|
|
surfaces that may be in use; it should return the actual data as it
|
|
|
|
is currently seen onscreen.
|
2008-06-13 13:14:52 +00:00
|
|
|
|
2014-06-13 13:35:41 +00:00
|
|
|
@param buffer The actual pixel data in ARGB8888 format
|
|
|
|
@param pitch The pitch (in bytes) for the pixel data
|
2014-06-19 16:45:07 +00:00
|
|
|
@param rect The bounding rectangle for the buffer
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
void readPixels(uInt8* buffer, uInt32 pitch, const Common::Rect& rect) const {
|
|
|
|
myBackend->readPixels(buffer, pitch, rect);
|
|
|
|
}
|
2019-05-17 20:19:27 +00:00
|
|
|
|
2017-11-26 22:24:05 +00:00
|
|
|
/**
|
|
|
|
Clear the framebuffer.
|
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
void clear() { myBackend->clear(); }
|
2017-11-26 22:24:05 +00:00
|
|
|
|
2020-03-30 22:46:20 +00:00
|
|
|
/**
|
2020-10-23 12:57:06 +00:00
|
|
|
Transform from window to renderer coordinates, x/y direction
|
2020-03-30 22:46:20 +00:00
|
|
|
*/
|
2020-10-23 12:57:06 +00:00
|
|
|
int scaleX(int x) const { return myBackend->scaleX(x); }
|
|
|
|
int scaleY(int y) const { return myBackend->scaleY(y); }
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
private:
|
2018-06-07 15:16:26 +00:00
|
|
|
/**
|
|
|
|
Calls 'free()' on all surfaces that the framebuffer knows about.
|
|
|
|
*/
|
|
|
|
void freeSurfaces();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Calls 'reload()' on all surfaces that the framebuffer knows about.
|
|
|
|
*/
|
|
|
|
void reloadSurfaces();
|
|
|
|
|
2020-10-24 00:15:04 +00:00
|
|
|
/**
|
|
|
|
Frees and reloads all surfaces that the framebuffer knows about.
|
|
|
|
*/
|
|
|
|
void resetSurfaces();
|
|
|
|
|
2020-11-12 09:43:04 +00:00
|
|
|
#ifdef GUI_SUPPORT
|
|
|
|
/**
|
|
|
|
Helps to create a basic message onscreen.
|
|
|
|
|
|
|
|
@param message The message to be shown
|
|
|
|
@param position Onscreen position for the message
|
|
|
|
@param force Force showing this message, even if messages are disabled
|
|
|
|
*/
|
|
|
|
void createMessage(const string& message, MessagePosition position,
|
|
|
|
bool force = false);
|
|
|
|
#endif
|
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
/**
|
2008-05-20 13:42:50 +00:00
|
|
|
Draw pending messages.
|
2018-07-25 11:18:21 +00:00
|
|
|
|
|
|
|
@return Indicates whether any changes actually occurred.
|
2005-08-29 18:36:42 +00:00
|
|
|
*/
|
2018-07-25 11:18:21 +00:00
|
|
|
bool drawMessage();
|
2005-08-29 18:36:42 +00:00
|
|
|
|
2020-11-13 15:00:19 +00:00
|
|
|
/**
|
|
|
|
Hide pending messages.
|
|
|
|
*/
|
|
|
|
void hideMessage();
|
|
|
|
|
2020-10-24 00:15:04 +00:00
|
|
|
/**
|
|
|
|
Draws the frame stats overlay.
|
|
|
|
*/
|
2020-10-13 13:17:37 +00:00
|
|
|
void drawFrameStats(float framesPerSecond);
|
2014-05-12 23:34:25 +00:00
|
|
|
|
2020-04-29 12:25:54 +00:00
|
|
|
/**
|
2020-10-13 13:17:37 +00:00
|
|
|
Build an applicable video mode based on the current settings in
|
2020-10-16 16:49:15 +00:00
|
|
|
effect, whether TIA mode is active, etc. Then tell the backend
|
|
|
|
to actually use the new mode.
|
2020-10-24 00:15:04 +00:00
|
|
|
|
|
|
|
@return Whether the operation succeeded or failed
|
2020-04-29 12:25:54 +00:00
|
|
|
*/
|
2020-10-16 16:49:15 +00:00
|
|
|
FBInitStatus applyVideoMode();
|
2020-04-29 12:25:54 +00:00
|
|
|
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
/**
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
Calculate the maximum level by which the base window can be zoomed and
|
2020-10-13 13:17:37 +00:00
|
|
|
still fit in the desktop screen.
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
*/
|
2020-10-13 13:17:37 +00:00
|
|
|
float maxWindowZoom(uInt32 baseWidth, uInt32 baseHeight) const;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
/**
|
2020-10-13 13:17:37 +00:00
|
|
|
Enables/disables fullscreen mode.
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
*/
|
2020-10-13 13:17:37 +00:00
|
|
|
void setFullscreen(bool enable);
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
|
2020-10-13 13:17:37 +00:00
|
|
|
#ifdef GUI_SUPPORT
|
2008-07-04 14:27:17 +00:00
|
|
|
/**
|
2020-10-13 13:17:37 +00:00
|
|
|
Setup the UI fonts
|
2008-07-04 14:27:17 +00:00
|
|
|
*/
|
2020-10-13 13:17:37 +00:00
|
|
|
void setupFonts();
|
|
|
|
#endif
|
2008-07-04 14:27:17 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
private:
|
|
|
|
// The parent system for the framebuffer
|
|
|
|
OSystem& myOSystem;
|
2019-05-17 20:19:27 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
// Backend used for all platform-specific graphics operations
|
|
|
|
unique_ptr<FBBackend> myBackend;
|
2019-05-17 20:19:27 +00:00
|
|
|
|
2006-12-11 00:15:34 +00:00
|
|
|
// Indicates the number of times the framebuffer was initialized
|
2019-12-29 00:44:52 +00:00
|
|
|
uInt32 myInitializedCount{0};
|
2006-12-11 00:15:34 +00:00
|
|
|
|
2007-01-30 17:13:10 +00:00
|
|
|
// Used to set intervals between messages while in pause mode
|
2019-12-29 00:44:52 +00:00
|
|
|
Int32 myPausedCount{0};
|
2007-01-30 17:13:10 +00:00
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
// Maximum dimensions of the desktop area
|
2019-05-11 17:03:07 +00:00
|
|
|
// Note that this takes 'hidpi' mode into account, so in some cases
|
|
|
|
// it will be less than the absolute desktop size
|
2019-05-02 20:28:39 +00:00
|
|
|
Common::Size myDesktopSize;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2019-05-11 17:03:07 +00:00
|
|
|
// Maximum absolute dimensions of the desktop area
|
|
|
|
Common::Size myAbsDesktopSize;
|
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
// The resolution of the attached displays in fullscreen mode
|
|
|
|
// The primary display is typically the first in the array
|
|
|
|
// Windowed modes use myDesktopSize directly
|
|
|
|
vector<Common::Size> myFullscreenDisplays;
|
|
|
|
|
2014-03-07 22:12:39 +00:00
|
|
|
// Supported renderers
|
|
|
|
VariantList myRenderers;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2020-11-13 10:18:25 +00:00
|
|
|
// Flag for pending render
|
|
|
|
bool myPendingRender{false};
|
|
|
|
|
2020-10-16 16:49:15 +00:00
|
|
|
// The VideoModeHandler class takes responsibility for all video
|
|
|
|
// mode functionality
|
2020-10-13 13:17:37 +00:00
|
|
|
VideoModeHandler myVidModeHandler;
|
|
|
|
VideoModeHandler::Mode myActiveVidMode;
|
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
// Type of the frame buffer
|
|
|
|
BufferType myBufferType{BufferType::None};
|
|
|
|
|
2019-05-02 20:28:39 +00:00
|
|
|
#ifdef GUI_SUPPORT
|
2014-02-05 22:09:57 +00:00
|
|
|
// The font object to use for the normal in-game GUI
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The info font object to use for the normal in-game GUI
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myInfoFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The font object to use when space is very limited
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> mySmallFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The font object to use for the ROM launcher
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myLauncherFont;
|
2019-05-02 20:28:39 +00:00
|
|
|
#endif
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
// The TIASurface class takes responsibility for TIA rendering
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<TIASurface> myTIASurface;
|
2014-05-12 23:34:25 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
// Used for onscreen messages and frame statistics
|
|
|
|
// (scanline count and framerate)
|
2006-03-19 18:17:48 +00:00
|
|
|
struct Message {
|
|
|
|
string text;
|
2019-12-29 00:44:52 +00:00
|
|
|
int counter{-1};
|
|
|
|
int x{0}, y{0}, w{0}, h{0};
|
|
|
|
MessagePosition position{MessagePosition::BottomCenter};
|
|
|
|
ColorId color{kNone};
|
2014-11-15 18:29:13 +00:00
|
|
|
shared_ptr<FBSurface> surface;
|
2019-12-29 00:44:52 +00:00
|
|
|
bool enabled{false};
|
2020-11-12 09:43:04 +00:00
|
|
|
bool dirty{false};
|
2020-05-13 07:32:11 +00:00
|
|
|
bool showGauge{false};
|
|
|
|
float value{0.0F};
|
|
|
|
string valueText;
|
2006-03-19 18:17:48 +00:00
|
|
|
};
|
2008-06-19 12:01:31 +00:00
|
|
|
Message myMsg;
|
|
|
|
Message myStatsMsg;
|
2019-12-29 00:44:52 +00:00
|
|
|
bool myStatsEnabled{false};
|
|
|
|
uInt32 myLastScanlines{0};
|
2018-01-18 22:06:51 +00:00
|
|
|
|
2019-12-29 00:44:52 +00:00
|
|
|
bool myGrabMouse{false};
|
|
|
|
bool myHiDPIAllowed{false};
|
|
|
|
bool myHiDPIEnabled{false};
|
2008-05-20 13:42:50 +00:00
|
|
|
|
2020-04-29 12:25:54 +00:00
|
|
|
// Minimum TIA zoom level that can be used for this framebuffer
|
|
|
|
float myTIAMinZoom{2.F};
|
2019-05-18 08:30:23 +00:00
|
|
|
// Maximum TIA zoom level that can be used for this framebuffer
|
2019-12-29 00:44:52 +00:00
|
|
|
float myTIAMaxZoom{1.F};
|
2014-05-12 23:34:25 +00:00
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
// Holds a reference to all the surfaces that have been created
|
2014-11-15 18:29:13 +00:00
|
|
|
vector<shared_ptr<FBSurface>> mySurfaceList;
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2020-10-23 12:57:06 +00:00
|
|
|
// Maximum message width [chars]
|
|
|
|
static constexpr int MESSAGE_WIDTH = 56;
|
|
|
|
// Maximum gauge bar width [chars]
|
|
|
|
static constexpr int GAUGEBAR_WIDTH = 30;
|
|
|
|
|
2019-12-26 20:58:55 +00:00
|
|
|
FullPaletteArray myFullPalette;
|
|
|
|
// Holds UI palette data (for each variation)
|
2020-10-13 13:17:37 +00:00
|
|
|
static UIPaletteArray ourStandardUIPalette, ourClassicUIPalette,
|
2020-10-16 16:49:15 +00:00
|
|
|
ourLightUIPalette, ourDarkUIPalette;
|
2015-04-26 19:02:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Following constructors and assignment operators not supported
|
|
|
|
FrameBuffer() = delete;
|
|
|
|
FrameBuffer(const FrameBuffer&) = delete;
|
|
|
|
FrameBuffer(FrameBuffer&&) = delete;
|
|
|
|
FrameBuffer& operator=(const FrameBuffer&) = delete;
|
|
|
|
FrameBuffer& operator=(FrameBuffer&&) = delete;
|
2005-03-28 00:04:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|