22 #ifndef BACKENDS_GRAPHICS_ATARI_H 23 #define BACKENDS_GRAPHICS_ATARI_H 25 #include "backends/graphics/graphics.h" 26 #include "common/events.h" 28 #include "graphics/surface.h" 30 #include "atari-cursor.h" 31 #include "atari-pendingscreenchanges.h" 32 #include "atari-screen.h" 33 #include "atari-supervidel.h" 35 #define MAX_HZ_SHAKE 16 // Falcon only 36 #define MAX_V_SHAKE 16 51 {
"direct",
"Direct rendering", kDirectRendering },
52 {
"single",
"Single buffering", kSingleBuffering },
53 {
"triple",
"Triple buffering", kTripleBuffering },
54 {
nullptr,
nullptr, 0 }
58 int getDefaultGraphicsMode()
const override {
return kTripleBuffering; }
60 int getGraphicsMode()
const override {
return _currentState.mode; }
64 int getScreenChangeID()
const override {
return 0; }
66 void beginGFXTransaction()
override;
69 int16 getHeight()
const override {
return _currentState.height; }
70 int16 getWidth()
const override {
return _currentState.width; }
71 void setPalette(
const byte *colors, uint start, uint num)
override;
72 void grabPalette(byte *colors, uint start, uint num)
const override;
73 void copyRectToScreen(
const void *buf,
int pitch,
int x,
int y,
int w,
int h)
override;
75 void unlockScreen()
override;
76 void fillScreen(uint32 col)
override;
77 void fillScreen(
const Common::Rect &r, uint32 col)
override;
78 void updateScreen()
override;
79 void setShakePos(
int shakeXOffset,
int shakeYOffset)
override;
80 void setFocusRectangle(
const Common::Rect& rect)
override {}
81 void clearFocusRectangle()
override {}
83 void showOverlay(
bool inGUI)
override;
84 void hideOverlay()
override;
85 bool isOverlayVisible()
const override {
return _overlayState == kOverlayVisible; }
87 void clearOverlay()
override;
89 void copyRectToOverlay(
const void *buf,
int pitch,
int x,
int y,
int w,
int h)
override;
90 int16 getOverlayHeight()
const override {
return 480; }
91 int16 getOverlayWidth()
const override {
return _vgaMonitor ? 640 : 640*1.2; }
93 bool showMouse(
bool visible)
override;
94 void warpMouse(
int x,
int y)
override;
95 void setMouseCursor(
const void *buf, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor,
96 bool dontScale =
false,
const Graphics::PixelFormat *format = NULL,
const byte *mask = NULL)
override;
97 void setCursorPalette(
const byte *colors, uint start, uint num)
override;
100 if (isOverlayVisible()) {
101 return _screen[kOverlayBuffer]->cursor.getPosition();
104 return _screen[kFrontBuffer]->cursor.getPosition();
107 void updateMousePosition(
int deltaX,
int deltaY);
115 kDirectRendering = 0,
116 kSingleBuffering = 1,
120 enum CustomEventAction {
121 kActionToggleAspectRatioCorrection = 100,
124 void allocateSurfaces();
127 #ifndef DISABLE_FANCY_THEMES 128 int16 getMaximumScreenHeight()
const {
return 480; }
129 int16 getMaximumScreenWidth()
const {
return _tt ? 320 : (_vgaMonitor ? 640 : 640*1.2); }
131 int16 getMaximumScreenHeight()
const {
return _tt ? 480 : 240; }
132 int16 getMaximumScreenWidth()
const {
return _tt ? 320 : (_vgaMonitor ? 320 : 320*1.2); }
136 int x,
int y,
int w,
int h,
bool directRendering);
139 const byte *buf,
int pitch,
int x,
int y,
int w,
int h);
141 bool isOverlayDirectRendering()
const {
142 #ifndef DISABLE_FANCY_THEMES 144 extern bool g_gameEngineActive;
148 return !g_hasSuperVidel
149 #ifndef DISABLE_FANCY_THEMES 150 && (!g_gameEngineActive || _currentState.mode == kDirectRendering)
157 bool _vgaMonitor =
true;
160 struct GraphicsState {
162 : inTransaction(
false)
169 bool isValid()
const {
170 return mode != kUnknownMode && width > 0 && height > 0 && format.bytesPerPixel != 0;
179 GraphicsState _pendingState;
180 GraphicsState _currentState;
183 bool _aspectRatioCorrection =
false;
194 Screen *_screen[kBufferCount] = {};
204 int _overlayState = kOverlayHidden;
205 bool _ignoreHideOverlay =
true;
207 bool _ignoreCursorChanges =
false;
bool notifyEvent(const Common::Event &event) override
void grabPalette(byte *colors, uint start, uint num) const override
Feature
Definition: system.h:405
Definition: atari-screen.h:58
Definition: atari-surface.h:33
TransactionError
Definition: system.h:1168
void setPalette(const byte *colors, uint start, uint num) override
Definition: graphics.h:38
Definition: atari-pendingscreenchanges.h:31
Definition: atari-graphics.h:38
Definition: atari-screen.h:42