Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

OSystem_WINCE3 Class Reference

Inheritance diagram for OSystem_WINCE3:
Inheritance graph
Collaboration diagram for OSystem_WINCE3:
Collaboration graph

List of all members.


struct  zoneDesc

Public Types

Feature flags
enum  Feature {
  kFeatureFullscreenMode, kFeatureAspectRatioCorrection, kFeatureVirtualKeyboard, kFeatureCursorHasPalette,
  kFeatureOverlaySupportsAlpha, kFeatureIconifyWindow, kFeatureDisableKeyFiltering
Mutex handling

Historically, the OSystem API used to have a method which allowed creating threads. Hence mutex support was needed for thread syncing. To ease portability, though, we decided to remove the threading API. Instead, we now use timers (see setTimerCallback() and Common::Timer). But since those may be implemented using threads (and in fact, that's how our primary backend, the SDL one, does it on many systems), we still have to do mutex syncing in our timer callbacks. In addition, the sound mixer uses a mutex in case the backend runs it from a dedicated thread (as e.g. the SDL backend does).

Hence backends which do not use threads to implement the timers simply can use dummy implementations for these methods.

typedef struct OpaqueMutex * MutexRef

Public Member Functions

void add_left_click (bool pushed)
void add_right_click (bool pushed)
void addDirtyRect (int x, int y, int w, int h, bool mouseRect=false)
virtual void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
void beginGFXTransaction ()
void blitCursor ()
virtual void clearOverlay ()
virtual void closeMixer ()
void copyRectToOverlay (const OverlayColor *buf, int pitch, int x, int y, int w, int h)
void copyRectToScreen (const byte *src, int pitch, int x, int y, int w, int h)
createConfigReadStream ()
virtual Common::WriteStreamcreateConfigWriteStream ()
MutexRef createMutex ()
void deinit ()
void delayMillis (uint msecs)
void deleteMutex (MutexRef mutex)
void disableCursorPalette (bool disable)
virtual void displayMessageOnOSD (const char *msg)
void drawMouse ()
TransactionError endGFXTransaction ()
virtual void engineDone ()
void engineInit ()
void fillMouseEvent (Common::Event &event, int x, int y)
virtual void fillScreen (uint32 col)
virtual Common::EventManagergetEventManager ()
virtual FilesystemFactorygetFilesystemFactory ()
virtual int getGraphicsMode () const
virtual Common::HardwareKeySet * getHardwareKeySet ()
virtual int16 getHeight ()
uint32 getMillis ()
virtual Audio::MixergetMixer ()
virtual Graphics::PixelFormat getOverlayFormat () const
virtual int16 getOverlayHeight ()
virtual int16 getOverlayWidth ()
virtual Common::SaveFileManagergetSavefileManager ()
virtual int getScreenChangeID () const
void getTimeAndDate (TimeDate &t) const
virtual Common::TimerManagergetTimerManager ()
virtual int16 getWidth ()
virtual void grabOverlay (OverlayColor *buf, int pitch)
void grabPalette (byte *colors, uint start, uint num)
void hideOverlay ()
void initBackend ()
void initSize (uint w, uint h, const Graphics::PixelFormat *format)
void initZones ()
void internUpdateScreen ()
void loadDeviceConfiguration ()
void loadDeviceConfigurationElement (String element, int &value, int defaultValue)
void lockMutex (MutexRef mutex)
Graphics::SurfacelockScreen ()
void move_cursor_down ()
void move_cursor_left ()
void move_cursor_right ()
void move_cursor_up ()
void playCD (int track, int num_loops, int start_frame, int duration)
bool pollCD ()
bool pollEvent (Common::Event &event)
virtual void preprocessEvents (SDL_Event *event)
void quit ()
void setCursorPalette (const byte *colors, uint start, uint num)
void setGraphicsModeIntern ()
void setMouseCursor (const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format)
void setMousePos (int x, int y)
void setPalette (const byte *colors, uint start, uint num)
void setShakePos (int shake_pos)
void setupMixer ()
virtual void setWindowCaption (const char *caption)
bool showMouse (bool visible)
void showOverlay ()
void smartphone_rotate_display ()
void stopCD ()
void swap_freeLook ()
void swap_mouse_visibility ()
void swap_panel ()
void swap_panel_visibility ()
void swap_smartphone_keyboard ()
void swap_sound_master ()
void swap_zoom_down ()
void swap_zoom_up ()
void switch_zone ()
void undrawMouse ()
void unlockMutex (MutexRef mutex)
void unlockScreen ()
void updateCD ()
void updateScreen ()
void warpMouse (int x, int y)

Static Public Member Functions

static int getScreenHeight ()
static int getScreenWidth ()
static void initScreenInfos ()
static bool isOzone ()
static void mixCallback (void *s, byte *samples, int len)

Protected Types

enum  { kTransactionNone = 0, kTransactionActive = 1, kTransactionRollback = 2 }
enum  { NUM_DIRTY_RECT = 100, MAX_SCALING = 3 }
enum  { kMouseColorKey = 1 }

Protected Member Functions

virtual bool dispatchSDLEvent (SDL_Event &ev, Common::Event &event)
void drawToolbarMouse (SDL_Surface *surf, bool draw)
int effectiveScreenHeight () const
int getDefaultGraphicsMode () const
bool getFeatureState (Feature f)
const GraphicsModegetSupportedGraphicsModes () const
virtual bool handleJoyAxisMotion (SDL_Event &ev, Common::Event &event)
virtual bool handleJoyButtonDown (SDL_Event &ev, Common::Event &event)
virtual bool handleJoyButtonUp (SDL_Event &ev, Common::Event &event)
void handleKbdMouse ()
virtual bool handleKeyDown (SDL_Event &ev, Common::Event &event)
virtual bool handleKeyUp (SDL_Event &ev, Common::Event &event)
virtual bool handleMouseButtonDown (SDL_Event &ev, Common::Event &event)
virtual bool handleMouseButtonUp (SDL_Event &ev, Common::Event &event)
virtual bool handleMouseMotion (SDL_Event &ev, Common::Event &event)
bool handleScalerHotkeys (const SDL_KeyboardEvent &key)
bool hasFeature (Feature f)
bool hotswapGFXMode ()
void internDrawMouse ()
bool isScalerHotkey (const Common::Event &event)
bool loadGFXMode ()
bool openCD (int drive)
virtual bool remapKey (SDL_Event &ev, Common::Event &event)
bool saveScreenshot (const char *filename)
void setAspectRatioCorrection (bool enable)
void setFeatureState (Feature f, bool enable)
void setFullscreenMode (bool enable)
bool setGraphicsMode (int mode)
void setupIcon ()
void toggleMouseGrab ()
void unloadGFXMode ()

Protected Attributes

int _cdDuration
uint32 _cdEndTime
int _cdNumLoops
SDL_CD * _cdrom
int _cdStartFrame
uint32 _cdStopTime
int _cdTrack
SDL_Color _currentPalette [256]
int _currentShakePos
SDL_Color _cursorPalette [256]
bool _cursorPaletteDisabled
int _cursorTargetScale
SDL_Rect _dirtyRectList [NUM_DIRTY_RECT]
bool _forceFull
Graphics::Surface _framebuffer
MutexRef _graphicsMutex
SDL_Surface * _hwscreen
bool _inited
SDL_Joystick * _joystick
KbdMouse _km
bool _modeChanged
SDL_Rect _mouseBackup
MousePos _mouseCurState
byte * _mouseData
byte _mouseKeyColor
bool _mouseNeedsRedraw
SDL_Surface * _mouseOrigSurface
SDL_Surface * _mouseSurface
bool _mouseVisible
int _newShakePos
int _numDirtyRects
SDL_AudioSpec _obtainedRate
VideoState _oldVideoMode
Graphics::PixelFormat _overlayFormat
SDL_Surface * _overlayscreen
bool _overlayVisible
uint _paletteDirtyEnd
uint _paletteDirtyStart
ScalerProc * _scalerProc
int _scalerType
SDL_Surface * _screen
int _screenChangeCount
bool _screenIsLocked
bool _scrollLock
SDL_TimerID _timerID
SDL_Surface * _tmpscreen
SDL_Surface * _tmpscreen2
TransactionDetails _transactionDetails
int _transactionMode
VideoState _videoMode

Private Member Functions

void check_mappings ()
uint32 compute_sample_rate ()
void create_toolbar ()
void retrieve_mouse_location (int &x, int &y)
void update_game_settings ()
bool update_scalers ()

Static Private Member Functions

static void private_sound_proc (void *param, byte *buf, int len)

Private Attributes

bool _canBeAspectScaled
bool _closeClick
int _currentZone
SDL_Rect _dirtyRectOut [NUM_DIRTY_RECT]
bool _forceHideMouse
bool _forcePanelInvisible
bool _freeLook
bool _hasfocus
int _keyRepeat
int _keyRepeatTime
int _keyRepeatTrigger
int _lastKeyPressed
uint16 _mouseBackupDim
byte * _mouseBackupOld
uint16 * _mouseBackupToolbar
int _mouseHotspotX
int _mouseHotspotY
int _mouseXZone [TOTAL_ZONES]
int _mouseYZone [TOTAL_ZONES]
int _newOrientation
bool _noDoubleTapRMB
int _orientationLandscape
bool _panelInitialized
bool _panelStateForced
bool _panelVisible
bool _rbutton
int _repeatX
int _repeatY
String _saveActiveToolbar
bool _saveToolbarState
bool _saveToolbarZoom
int _scaleFactorXd
int _scaleFactorXm
int _scaleFactorYd
int _scaleFactorYm
bool _scalersChanged
int _stepX1
int _stepX2
int _stepX3
int _stepY1
int _stepY2
int _stepY3
long _tapTime
int _tapX
int _tapY
CEGUI::ToolbarHandler _toolbarHandler
SDL_Surface * _toolbarHigh
bool _toolbarHighDrawn
SDL_Surface * _toolbarLow
bool _unfilteredkeys
bool _usesEmulatedMouse
bool _zoomDown
bool _zoomUp

Static Private Attributes

static bool _isOzone
static int _platformScreenHeight
static int _platformScreenWidth
static bool _soundMaster = true
static zoneDesc _zones [TOTAL_ZONES]


The way graphics work in the class OSystem are meant to make it possible for game frontends to implement all they need in an efficient manner. The downside of this is that it may be rather complicated for backend authors to fully understand and implement the semantics of the OSystem interface.

The graphics visible to the user in the end are actually composed in three layers: the game graphics, the overlay graphics, and the mouse.

First, there are the game graphics. The methods in this section deal with them exclusively. In particular, the size of the game graphics is defined by a call to initSize(), and copyRectToScreen() blits the data in the current pixel format into the game layer. Let W and H denote the width and height of the game graphics.

Before the user sees these graphics, the backend may apply some transformations to it; for example, the may be scaled to better fit on the visible screen; or aspect ratio correction may be performed (see kFeatureAspectRatioCorrection). As a result of this, a pixel of the game graphics may occupy a region bigger than a single pixel on the screen. We define p_w and p_h to be the width resp. height of a game pixel on the screen.

In addition, there is a vertical "shake offset" (as defined by setShakePos) which is used in some games to provide a shaking effect. Note that shaking is applied to all three layers, i.e. also to the overlay and the mouse. We denote the shake offset by S.

Putting this together, a pixel (x,y) of the game graphics is transformed to a rectangle of height p_h and width p_w appearing at position (p_w * x, p_hw * (y + S)) on the real screen (in addition, a backend may choose to offset everything, e.g. to center the graphics on the screen).

The next layer is the overlay. It is composed over the game graphics. By default, it has exactly the same size and resolution as the game graphics. However, client code can specify an overlay scale (as an additional parameter to initSize()). This is meant to increase the resolution of the overlay while keeping its size the same as that of the game graphics. For example, if the overlay scale is 2, and the game graphics have a resolution of 320x200; then the overlay shall have a resolution of 640x400, but it still has the same physical size as the game graphics. The overlay usually uses 16bpp, but on some ports, only 8bpp are availble, so that is supported, too, via a compile time switch (see also the OverlayColor typedef in scummsys.h).

Finally, there is the mouse layer. This layer doesn't have to actually exist within the backend -- it all depends on how a backend chooses to implement mouse cursors, but in the default SDL backend, it really is a separate layer. The mouse can have a palette of its own, if the backend supports it. The scale of the mouse cursor is called 'cursorTargetScale'. This is meant as a hint to the backend. For example, let us assume the overlay is not visible, and the game graphics are displayed using a 2x scaler. If a mouse cursor with a cursorTargetScale of 1 is set, then it should be scaled by factor 2x, too, just like the game graphics. But if it has a cursorTargetScale of 2, then it shouldn't be scaled again by the game graphics scaler.

bool setGraphicsMode (const char *name)
Graphics::PixelFormat getScreenFormat () const
< Graphics::PixelFormat
getSupportedFormats () const
virtual void setFocusRectangle (const Common::Rect &rect)
virtual void clearFocusRectangle ()
enum  TransactionError {
  kTransactionSuccess = 0, kTransactionAspectRatioFailed = (1 << 0), kTransactionFullscreenFailed = (1 << 1), kTransactionModeSwitchFailed = (1 << 2),
  kTransactionSizeChangeFailed = (1 << 3), kTransactionFormatNotSupported = (1 << 4)

Detailed Description

Definition at line 46 of file wince-sdl.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index