22 #ifndef BACKENDS_PLATFORM_IPHONE_OSYS_MAIN_H 23 #define BACKENDS_PLATFORM_IPHONE_OSYS_MAIN_H 25 #include "graphics/surface.h" 26 #include "backends/platform/iphone/iphone_common.h" 27 #include "backends/modular-backend.h" 28 #include "common/events.h" 29 #include "audio/mixer_intern.h" 30 #include "backends/fs/posix/posix-fs-factory.h" 31 #include "graphics/palette.h" 33 #include <AudioToolbox/AudioQueue.h> 35 #define AUDIO_BUFFERS 3 36 #define WAVE_BUFFER_SIZE 2048 37 #define AUDIO_SAMPLE_RATE 44100 39 #define SCUMMVM_ROOT_PATH "/var/mobile/Library/ScummVM" 40 #define SCUMMVM_SAVE_PATH SCUMMVM_ROOT_PATH "/Savegames" 41 #define SCUMMVM_PREFS_PATH SCUMMVM_ROOT_PATH "/Preferences" 43 typedef void (*SoundProc)(
void *param, byte *buf,
int len);
44 typedef int (*TimerProc)(
int interval);
49 AudioQueueBufferRef buffers[AUDIO_BUFFERS];
50 AudioStreamBasicDescription dataFormat;
56 static SoundProc s_soundCallback;
57 static void *s_soundParam;
69 uint16 _gamePalette[256];
71 uint16 _gamePaletteRGBA5551[256];
73 struct timeval _startTime;
74 uint32 _timeSuspended;
76 bool _mouseCursorPaletteEnabled;
77 uint16 _mouseCursorPalette[256];
79 uint16 _mouseKeyColor;
81 bool _mouseNeedTextureUpdate;
85 long _queuedEventTime;
87 bool _secondaryTapped;
88 long _lastSecondaryDown;
89 long _lastSecondaryTap;
90 int _gestureStartX, _gestureStartY;
91 bool _mouseClickAndDragEnabled;
92 bool _touchpadModeEnabled;
98 int _timerCallbackNext;
99 int _timerCallbackTimer;
100 TimerProc _timerCallback;
104 ScreenOrientation _screenOrientation;
105 bool _fullScreenIsDirty;
106 bool _fullScreenOverlayIsDirty;
107 int _screenChangeCount;
114 virtual void initBackend();
116 virtual void engineInit();
117 virtual void engineDone();
119 virtual bool hasFeature(
Feature f);
120 virtual void setFeatureState(
Feature f,
bool enable);
121 virtual bool getFeatureState(
Feature f);
124 virtual void beginGFXTransaction();
127 virtual int16 getHeight();
128 virtual int16 getWidth();
138 virtual void setPalette(
const byte *colors, uint start, uint num);
139 virtual void grabPalette(byte *colors, uint start, uint num)
const;
142 virtual void copyRectToScreen(
const void *buf,
int pitch,
int x,
int y,
int w,
int h);
143 virtual void updateScreen();
145 virtual void unlockScreen();
146 virtual void setShakePos(
int shakeXOffset,
int shakeYOffset);
148 virtual void showOverlay();
149 virtual void hideOverlay();
151 virtual void clearOverlay();
153 virtual void copyRectToOverlay(
const void *buf,
int pitch,
int x,
int y,
int w,
int h);
154 virtual int16 getOverlayHeight();
155 virtual int16 getOverlayWidth();
158 virtual bool showMouse(
bool visible);
160 virtual void warpMouse(
int x,
int y);
161 virtual void setMouseCursor(
const void *buf, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor = 255,
bool dontScale =
false,
const Graphics::PixelFormat *format = NULL);
162 virtual void setCursorPalette(
const byte *colors, uint start, uint num);
165 virtual uint32 getMillis(
bool skipRecord =
false);
166 virtual void delayMillis(uint msecs);
169 static void mixCallback(
void *sys, byte *samples,
int len);
170 virtual void setupMixer(
void);
171 virtual void setTimerCallback(TimerProc callback,
int interval);
176 virtual void getTimeAndDate(
TimeDate &td,
bool skipRecord =
false)
const;
180 void startSoundsystem();
181 void stopSoundsystem();
188 void initVideoContext();
189 void updateOutputSurface();
191 void internUpdateScreen();
192 void dirtyFullScreen();
193 void dirtyFullOverlayScreen();
196 void updateMouseTexture();
197 static void AQBufferCallback(
void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
198 static int timerHandler(
int t);
201 void handleEvent_keyPressed(
Common::Event &event,
int keyPressed);
202 void handleEvent_orientationChanged(
int orientation);
204 bool handleEvent_mouseDown(
Common::Event &event,
int x,
int y);
205 bool handleEvent_mouseUp(
Common::Event &event,
int x,
int y);
207 bool handleEvent_secondMouseDown(
Common::Event &event,
int x,
int y);
208 bool handleEvent_secondMouseUp(
Common::Event &event,
int x,
int y);
210 bool handleEvent_mouseDragged(
Common::Event &event,
int x,
int y);
211 bool handleEvent_mouseSecondDragged(
Common::Event &event,
int x,
int y);
virtual PaletteManager * getPaletteManager()
Definition: osys_main.h:135
virtual int getScreenChangeID() const
Definition: osys_main.h:172
virtual bool isOverlayVisible() const
Definition: osys_main.h:150
Feature
Definition: system.h:334
Type
Definition: system.h:114
Definition: mixer_intern.h:58
TransactionError
Definition: system.h:1036
Definition: archive.h:151
Definition: ios7_osys_main.h:49
Definition: base-backend.h:43
PixelFormat format
Definition: surface.h:81
Definition: osys_main.h:53
Definition: ios7_common.h:70