2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// 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
|
|
|
|
//
|
2005-06-16 01:11:29 +00:00
|
|
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
|
|
|
// See the file "license" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2005-06-17 17:34:01 +00:00
|
|
|
// $Id: FrameBuffer.hxx,v 1.41 2005-06-17 17:34:01 stephena Exp $
|
2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
#ifndef FRAMEBUFFER_HXX
|
|
|
|
#define FRAMEBUFFER_HXX
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL_syswm.h>
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
#include "bspf.hxx"
|
2003-09-26 00:32:00 +00:00
|
|
|
#include "Event.hxx"
|
2003-10-17 18:02:16 +00:00
|
|
|
#include "MediaSrc.hxx"
|
2005-06-08 18:45:09 +00:00
|
|
|
#include "Font.hxx"
|
2005-03-13 03:38:41 +00:00
|
|
|
#include "GuiUtils.hxx"
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
class Console;
|
2005-02-21 02:23:57 +00:00
|
|
|
class OSystem;
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2005-06-08 18:45:09 +00:00
|
|
|
// Text alignment modes for drawString()
|
|
|
|
enum TextAlignment {
|
|
|
|
kTextAlignLeft,
|
|
|
|
kTextAlignCenter,
|
|
|
|
kTextAlignRight
|
|
|
|
};
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
/**
|
2003-10-26 19:40:39 +00:00
|
|
|
This class encapsulates the MediaSource and is the basis for the video
|
2005-02-21 02:23:57 +00:00
|
|
|
display in Stella. All graphics ports should derive from this class for
|
2003-10-26 19:40:39 +00:00
|
|
|
platform-specific video stuff.
|
|
|
|
|
2005-03-11 23:36:30 +00:00
|
|
|
All GUI elements (ala ScummVM) are drawn here as well.
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
@author Stephen Anthony
|
2005-06-17 17:34:01 +00:00
|
|
|
@version $Id: FrameBuffer.hxx,v 1.41 2005-06-17 17:34:01 stephena Exp $
|
2003-09-25 16:20:34 +00:00
|
|
|
*/
|
2003-10-17 18:02:16 +00:00
|
|
|
class FrameBuffer
|
2003-09-25 16:20:34 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2003-10-17 18:02:16 +00:00
|
|
|
Creates a new Frame Buffer
|
2003-09-25 16:20:34 +00:00
|
|
|
*/
|
2005-02-21 20:43:53 +00:00
|
|
|
FrameBuffer(OSystem* osystem);
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor
|
|
|
|
*/
|
2003-10-26 19:40:39 +00:00
|
|
|
virtual ~FrameBuffer();
|
|
|
|
|
|
|
|
/**
|
2005-02-22 18:41:16 +00:00
|
|
|
(Re)initializes the framebuffer display. This must be called before any
|
2003-10-26 19:40:39 +00:00
|
|
|
calls are made to derived methods.
|
|
|
|
|
2005-05-06 22:50:15 +00:00
|
|
|
@param title The title of the window
|
|
|
|
@param width The width of the framebuffer
|
|
|
|
@param height The height of the framebuffer
|
|
|
|
@param aspect Whether to use the aspect ratio setting
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-05-06 22:50:15 +00:00
|
|
|
void initialize(const string& title, uInt32 width, uInt32 height,
|
|
|
|
bool aspect = 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
|
|
|
|
drawing the mediasource, any pending menus, etc.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
|
|
|
void update();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows a message onscreen.
|
|
|
|
|
|
|
|
@param message The message to be shown
|
|
|
|
*/
|
|
|
|
void showMessage(const string& message);
|
|
|
|
|
|
|
|
/**
|
2005-03-28 00:04:54 +00:00
|
|
|
Returns the current width of the framebuffer *before* any scaling.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
@return The current unscaled width
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-03-28 00:04:54 +00:00
|
|
|
inline const uInt32 baseWidth() { return myBaseDim.w; }
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-03-28 00:04:54 +00:00
|
|
|
Returns the current height of the framebuffer *before* any scaling.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
@return The current unscaled height
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-03-28 00:04:54 +00:00
|
|
|
inline const uInt32 baseHeight() { return myBaseDim.h; }
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2005-03-28 00:04:54 +00:00
|
|
|
Returns the current width of the framebuffer image.
|
|
|
|
Note that this will take into account the current scaling (if any).
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
@return The current width
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-04-03 19:37:32 +00:00
|
|
|
inline const uInt32 imageWidth() { return myImageDim.w; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
2005-03-28 00:04:54 +00:00
|
|
|
Returns the current height of the framebuffer image.
|
|
|
|
Note that this will take into account the current scaling (if any).
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
@return The current height
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-04-03 19:37:32 +00:00
|
|
|
inline const uInt32 imageHeight() { return myImageDim.h; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2003-11-12 19:36:25 +00:00
|
|
|
/**
|
|
|
|
Sets the pause status. While pause is selected, the
|
|
|
|
MediaSource will not be updated.
|
|
|
|
|
|
|
|
@param status Toggle pause based on status
|
|
|
|
*/
|
|
|
|
void pause(bool status);
|
|
|
|
|
2003-11-24 14:51:06 +00:00
|
|
|
/**
|
2005-05-28 17:25:41 +00:00
|
|
|
Indicates that the window contents are dirty, and certain areas need
|
|
|
|
to be redrawn.
|
2005-02-18 21:26:31 +00:00
|
|
|
|
|
|
|
@param now Determine if the refresh should be done right away or in
|
|
|
|
the next frame
|
2003-11-24 14:51:06 +00:00
|
|
|
*/
|
2005-02-18 21:26:31 +00:00
|
|
|
void refresh(bool now = false)
|
|
|
|
{
|
2005-05-10 19:20:45 +00:00
|
|
|
// cerr << "refresh() " << myNumRedraws++ << endl;
|
2005-02-18 21:26:31 +00:00
|
|
|
theRedrawEntireFrameIndicator = true;
|
2005-05-28 17:25:41 +00:00
|
|
|
theOverlayChangedIndicator = true;
|
|
|
|
myOverlayRedraws = 2;
|
2005-05-31 17:57:50 +00:00
|
|
|
if(now) { myMessageTime = 0; update(); }
|
2005-02-18 21:26:31 +00:00
|
|
|
}
|
2003-11-24 14:51:06 +00:00
|
|
|
|
2005-06-17 17:34:01 +00:00
|
|
|
/**
|
|
|
|
Indicates that the emulation should advance one frame.
|
|
|
|
*/
|
|
|
|
void advance() { theFrameAdvanceIndicator = true; }
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2005-05-01 20:11:07 +00:00
|
|
|
Toggles between fullscreen and window mode.
|
|
|
|
Grabmouse activated when in fullscreen mode.
|
|
|
|
*/
|
|
|
|
void toggleFullscreen();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enables/disables fullscreen mode.
|
|
|
|
Grabmouse activated when in fullscreen mode.
|
2005-03-26 19:26:48 +00:00
|
|
|
|
2005-05-01 20:11:07 +00:00
|
|
|
@param enable Set the fullscreen mode to this value
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-05-01 20:11:07 +00:00
|
|
|
void setFullscreen(bool enable);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called when the user wants to resize the window.
|
2005-05-01 20:11:07 +00:00
|
|
|
Size = 'PreviousSize' means window should decrease in size
|
|
|
|
Size = 'NextSize' means window should increase in size
|
|
|
|
Size = 'GivenSize' means window should be resized to quantity given in 'zoom'
|
2005-03-26 19:26:48 +00:00
|
|
|
|
2005-05-01 20:11:07 +00:00
|
|
|
@param size Described above
|
|
|
|
@param zoom The zoom level to use if size is set to 'sGiven'
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-05-01 20:11:07 +00:00
|
|
|
void resize(Size size, Int8 zoom = 0);
|
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();
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
|
|
|
Shows or hides the cursor based on the given boolean value.
|
|
|
|
*/
|
|
|
|
void showCursor(bool show);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Grabs or ungrabs the mouse based on the given boolean value.
|
|
|
|
*/
|
|
|
|
void grabMouse(bool grab);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Answers if the display is currently in fullscreen mode.
|
|
|
|
*/
|
|
|
|
bool fullScreen();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Calculate the maximum window size that the current screen can hold.
|
2005-03-14 04:08:15 +00:00
|
|
|
Only works in X11/Win32 for now, otherwise always return 4.
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
|
|
|
uInt32 maxWindowSizeForScreen();
|
|
|
|
|
|
|
|
/**
|
2005-02-22 18:41:16 +00:00
|
|
|
Set the title for the main SDL window.
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-03-26 19:26:48 +00:00
|
|
|
void setWindowTitle(const string& title);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set up the palette for a screen of any depth > 8.
|
2005-05-05 00:10:49 +00:00
|
|
|
|
|
|
|
@param palette The array of colors
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2005-05-05 00:10:49 +00:00
|
|
|
void setPalette(const uInt32* palette);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-11 23:36:30 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a rectangular box with sides
|
2005-03-11 23:36:30 +00:00
|
|
|
at the specified coordinates.
|
|
|
|
|
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param w The width of the box
|
|
|
|
@param h The height of the box
|
|
|
|
@param colorA FIXME
|
|
|
|
@param colorB FIXME
|
|
|
|
*/
|
|
|
|
void box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|
|
|
OverlayColor colorA, OverlayColor colorB);
|
|
|
|
|
2005-04-04 02:19:22 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a framed rectangle.
|
2005-04-04 02:19:22 +00:00
|
|
|
I'm not exactly sure what it is, so I can't explain it :)
|
|
|
|
|
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param w The width of the area
|
|
|
|
@param h The height of the area
|
|
|
|
@param color The color of the surrounding frame
|
|
|
|
*/
|
|
|
|
void frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|
|
|
OverlayColor color);
|
|
|
|
|
2005-06-08 18:45:09 +00:00
|
|
|
/**
|
|
|
|
This method should be called to draw the specified string.
|
|
|
|
|
|
|
|
@param font The font to draw the string with
|
|
|
|
@param str The string to draw
|
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param w The width of the string area
|
|
|
|
@param h The height of the string area
|
|
|
|
@param color The color of the text
|
|
|
|
@param align The alignment of the text in the string width area
|
|
|
|
@param deltax
|
|
|
|
@param useEllipsis Whether to use '...' when the string is too long
|
|
|
|
*/
|
2005-06-14 01:11:48 +00:00
|
|
|
void drawString(const GUI::Font* font, const string& str, int x, int y, int w,
|
2005-06-08 18:45:09 +00:00
|
|
|
OverlayColor color, TextAlignment align = kTextAlignLeft,
|
|
|
|
int deltax = 0, bool useEllipsis = true);
|
|
|
|
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
public:
|
2003-10-26 19:40:39 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// The following methods are system-specific and must be implemented
|
|
|
|
// in derived classes.
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called to initialize the subsystem-specific video mode.
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
|
|
|
virtual bool initSubsystem() = 0;
|
|
|
|
|
2005-05-30 16:25:47 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called to set the aspect ratio of the screen.
|
2005-05-30 16:25:47 +00:00
|
|
|
*/
|
|
|
|
virtual void setAspectRatio() = 0;
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called whenever the screen needs to be recreated.
|
2005-02-21 02:23:57 +00:00
|
|
|
It updates the global screen variable.
|
|
|
|
*/
|
|
|
|
virtual bool createScreen() = 0;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-11 23:36:30 +00:00
|
|
|
/**
|
|
|
|
Switches between the filtering options in the video subsystem.
|
|
|
|
*/
|
|
|
|
virtual void toggleFilter() = 0;
|
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called anytime the MediaSource needs to be redrawn
|
2005-03-11 23:36:30 +00:00
|
|
|
to the screen.
|
|
|
|
*/
|
|
|
|
virtual void drawMediaSource() = 0;
|
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called before any drawing is done (per-frame).
|
2005-03-11 23:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual void preFrameUpdate() = 0;
|
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called after any drawing is done (per-frame).
|
2005-03-11 23:36:30 +00:00
|
|
|
*/
|
|
|
|
virtual void postFrameUpdate() = 0;
|
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called to get the specified scanline data.
|
2005-03-11 23:36:30 +00:00
|
|
|
|
|
|
|
@param row The row we are looking for
|
|
|
|
@param data The actual pixel data (in bytes)
|
|
|
|
*/
|
|
|
|
virtual void scanline(uInt32 row, uInt8* data) = 0;
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method is called to map a given r,g,b triple to the screen palette.
|
2005-02-21 02:23:57 +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.
|
2003-10-17 18:02:16 +00:00
|
|
|
*/
|
2005-02-21 02:23:57 +00:00
|
|
|
virtual Uint32 mapRGB(Uint8 r, Uint8 g, Uint8 b) = 0;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-02-22 18:41:16 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a horizontal line.
|
2005-03-11 23:36:30 +00:00
|
|
|
|
|
|
|
@param x The first x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param x2 The second x coordinate
|
|
|
|
@param color The color of the line
|
2005-02-22 18:41:16 +00:00
|
|
|
*/
|
2005-03-11 23:36:30 +00:00
|
|
|
virtual void hLine(uInt32 x, uInt32 y, uInt32 x2, OverlayColor color) = 0;
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a vertical line.
|
2005-03-11 23:36:30 +00:00
|
|
|
|
|
|
|
@param x The x coordinate
|
|
|
|
@param y The first y coordinate
|
|
|
|
@param y2 The second y coordinate
|
|
|
|
@param color The color of the line
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-03-12 01:47:15 +00:00
|
|
|
virtual void vLine(uInt32 x, uInt32 y, uInt32 y2, OverlayColor color) = 0;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a blended rectangle.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-11 23:36:30 +00:00
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param w The width of the box
|
|
|
|
@param h The height of the box
|
|
|
|
@param color FIXME
|
|
|
|
@param level FIXME
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-03-28 00:04:54 +00:00
|
|
|
virtual void blendRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|
|
|
OverlayColor color, uInt32 level = 3) = 0;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw a filled rectangle.
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-11 23:36:30 +00:00
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param w The width of the area
|
|
|
|
@param h The height of the area
|
|
|
|
@param color The color of the area
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-03-11 23:36:30 +00:00
|
|
|
virtual void fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
|
|
|
OverlayColor color) = 0;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw the specified character.
|
2005-03-11 23:36:30 +00:00
|
|
|
|
2005-06-08 18:45:09 +00:00
|
|
|
@param font The font to use to draw the character
|
2005-03-13 03:38:41 +00:00
|
|
|
@param c The character to draw
|
2005-03-11 23:36:30 +00:00
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
2005-03-13 03:38:41 +00:00
|
|
|
@param color The color of the character
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2005-06-14 01:11:48 +00:00
|
|
|
virtual void drawChar(const GUI::Font* font, uInt8 c, uInt32 x, uInt32 y,
|
2005-06-08 18:45:09 +00:00
|
|
|
OverlayColor color) = 0;
|
2005-03-11 23:36:30 +00:00
|
|
|
|
2005-03-26 19:26:48 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to draw the bitmap image.
|
2005-03-26 19:26:48 +00:00
|
|
|
|
|
|
|
@param bitmap The data to draw
|
|
|
|
@param x The x coordinate
|
|
|
|
@param y The y coordinate
|
|
|
|
@param color The color of the character
|
|
|
|
@param h The height of the data image
|
|
|
|
*/
|
|
|
|
virtual void drawBitmap(uInt32* bitmap, Int32 x, Int32 y, OverlayColor color,
|
|
|
|
Int32 h = 8) = 0;
|
2005-03-11 23:36:30 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
/**
|
2005-06-08 18:45:09 +00:00
|
|
|
This method should be called to translate the given coordinates
|
2005-03-28 00:04:54 +00:00
|
|
|
to their unzoomed/unscaled equivalents.
|
|
|
|
|
|
|
|
@param x X coordinate to translate
|
|
|
|
@param y Y coordinate to translate
|
|
|
|
*/
|
|
|
|
virtual void translateCoords(Int32* x, Int32* y) = 0;
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
protected:
|
2005-02-21 02:23:57 +00:00
|
|
|
// The parent system for the framebuffer
|
|
|
|
OSystem* myOSystem;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
// Dimensions of the base image, before zooming.
|
|
|
|
// All external GUI items should refer to these dimensions,
|
|
|
|
// since this is the *real* size of the image.
|
|
|
|
// The other sizes are simply scaled versions of these dimensions.
|
|
|
|
SDL_Rect myBaseDim;
|
|
|
|
|
|
|
|
// Dimensions of the actual image, after zooming
|
|
|
|
SDL_Rect myImageDim;
|
|
|
|
|
|
|
|
// Dimensions of the SDL window (not always the same as the image)
|
|
|
|
SDL_Rect myScreenDim;
|
|
|
|
|
|
|
|
// Dimensions of the desktop area
|
|
|
|
SDL_Rect myDesktopDim;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
// Indicates if the entire frame should be redrawn
|
|
|
|
bool theRedrawEntireFrameIndicator;
|
|
|
|
|
2005-06-17 17:34:01 +00:00
|
|
|
// Indicates if the emulation should advance by one frame
|
|
|
|
bool theFrameAdvanceIndicator;
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
// The SDL video buffer
|
|
|
|
SDL_Surface* myScreen;
|
|
|
|
|
|
|
|
// SDL initialization flags
|
|
|
|
uInt32 mySDLFlags;
|
|
|
|
|
|
|
|
// SDL palette
|
|
|
|
Uint32 myPalette[256];
|
|
|
|
|
2005-03-13 03:38:41 +00:00
|
|
|
// Holds the palette for GUI elements
|
|
|
|
uInt8 myGUIColors[5][3];
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
// Indicates the current zoom level of the SDL screen
|
|
|
|
uInt32 theZoomLevel;
|
|
|
|
|
|
|
|
// Indicates the maximum zoom of the SDL screen
|
|
|
|
uInt32 theMaxZoomLevel;
|
|
|
|
|
|
|
|
// The aspect ratio of the window
|
|
|
|
float theAspectRatio;
|
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
private:
|
2005-02-22 18:41:16 +00:00
|
|
|
/**
|
|
|
|
Set the icon for the main SDL window.
|
|
|
|
*/
|
|
|
|
void setWindowIcon();
|
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
private:
|
|
|
|
// Indicates the current framerate of the system
|
|
|
|
uInt32 myFrameRate;
|
|
|
|
|
|
|
|
// Indicates the current pause status
|
|
|
|
bool myPauseStatus;
|
|
|
|
|
|
|
|
// Indicates if the menus should be redrawn
|
2005-05-28 17:25:41 +00:00
|
|
|
bool theOverlayChangedIndicator;
|
2005-03-28 00:04:54 +00:00
|
|
|
|
|
|
|
// Message timer
|
|
|
|
Int32 myMessageTime;
|
|
|
|
|
|
|
|
// Message text
|
|
|
|
string myMessageText;
|
|
|
|
|
|
|
|
// Number of times menu have been drawn
|
2005-05-28 17:25:41 +00:00
|
|
|
uInt32 myOverlayRedraws;
|
2005-03-28 00:04:54 +00:00
|
|
|
|
2005-04-24 01:57:47 +00:00
|
|
|
// Indicates how many times the framebuffer has been redrawn
|
|
|
|
// Used only for debugging purposes
|
|
|
|
uInt32 myNumRedraws;
|
2005-03-28 00:04:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|