2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-04-21 17:46:42 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 01:34:18 +00:00
|
|
|
*
|
2002-04-21 17:46:42 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:18 +00:00
|
|
|
*
|
2002-04-21 17:46:42 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-04-21 17:46:42 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-09-08 01:08:12 +00:00
|
|
|
#ifndef COMMON_SYSTEM_H
|
|
|
|
#define COMMON_SYSTEM_H
|
2002-06-02 20:28:09 +00:00
|
|
|
|
2003-08-01 12:21:04 +00:00
|
|
|
#include "common/scummsys.h"
|
2007-03-17 10:36:14 +00:00
|
|
|
#include "common/noncopyable.h"
|
2010-05-04 11:59:22 +00:00
|
|
|
#include "common/list.h" // For OSystem::getSupportedFormats()
|
2011-04-28 16:58:45 +00:00
|
|
|
#include "graphics/pixelformat.h"
|
2005-01-01 19:19:06 +00:00
|
|
|
|
2006-10-21 12:03:43 +00:00
|
|
|
namespace Audio {
|
2011-04-25 19:29:26 +00:00
|
|
|
class Mixer;
|
2006-10-21 12:03:43 +00:00
|
|
|
}
|
|
|
|
|
2005-05-08 21:39:05 +00:00
|
|
|
namespace Graphics {
|
2011-04-25 19:29:26 +00:00
|
|
|
struct Surface;
|
2005-05-10 23:17:38 +00:00
|
|
|
}
|
2005-05-08 21:39:05 +00:00
|
|
|
|
2005-05-10 23:17:38 +00:00
|
|
|
namespace Common {
|
2011-04-25 19:29:26 +00:00
|
|
|
class EventManager;
|
2011-04-24 08:34:27 +00:00
|
|
|
struct Rect;
|
2011-04-25 19:29:26 +00:00
|
|
|
class SaveFileManager;
|
|
|
|
class SearchSet;
|
2011-04-24 08:34:27 +00:00
|
|
|
class String;
|
2011-04-29 16:15:49 +00:00
|
|
|
#if defined(USE_TASKBAR)
|
2011-06-16 15:24:38 +00:00
|
|
|
class TaskbarManager;
|
2011-04-29 16:15:49 +00:00
|
|
|
#endif
|
2011-07-07 00:47:46 +00:00
|
|
|
#if defined(USE_UPDATES)
|
|
|
|
class UpdateManager;
|
|
|
|
#endif
|
2011-04-25 19:29:26 +00:00
|
|
|
class TimerManager;
|
|
|
|
class SeekableReadStream;
|
|
|
|
class WriteStream;
|
2012-02-13 00:20:02 +00:00
|
|
|
#ifdef ENABLE_KEYMAPPER
|
2012-02-24 19:23:55 +00:00
|
|
|
class HardwareInputSet;
|
2012-02-09 07:26:29 +00:00
|
|
|
class Keymap;
|
2012-02-15 05:02:23 +00:00
|
|
|
class KeymapperDefaultBindings;
|
2012-02-13 00:20:02 +00:00
|
|
|
#endif
|
2005-05-10 23:17:38 +00:00
|
|
|
}
|
2004-02-24 22:39:42 +00:00
|
|
|
|
2010-11-08 23:07:42 +00:00
|
|
|
class AudioCDManager;
|
2008-02-23 23:03:08 +00:00
|
|
|
class FilesystemFactory;
|
2011-02-07 17:52:38 +00:00
|
|
|
class PaletteManager;
|
2008-02-23 23:03:08 +00:00
|
|
|
|
2009-10-08 19:41:38 +00:00
|
|
|
/**
|
|
|
|
* A structure describing time and date. This is a clone of struct tm
|
|
|
|
* from time.h. We roll our own since not all systems provide time.h.
|
|
|
|
* We also do not imitate all files of struct tm, only those we
|
|
|
|
* actually need.
|
|
|
|
*
|
|
|
|
* @note For now, the members are named exactly as in struct tm to ease
|
|
|
|
* the transition.
|
|
|
|
*/
|
|
|
|
struct TimeDate {
|
|
|
|
int tm_sec; ///< seconds (0 - 60)
|
|
|
|
int tm_min; ///< minutes (0 - 59)
|
|
|
|
int tm_hour; ///< hours (0 - 23)
|
|
|
|
int tm_mday; ///< day of month (1 - 31)
|
|
|
|
int tm_mon; ///< month of year (0 - 11)
|
|
|
|
int tm_year; ///< year - 1900
|
2012-06-10 00:20:19 +00:00
|
|
|
int tm_wday; ///< days since Sunday (0 - 6)
|
2009-10-08 19:41:38 +00:00
|
|
|
};
|
|
|
|
|
2010-11-18 19:12:14 +00:00
|
|
|
namespace LogMessageType {
|
|
|
|
|
|
|
|
enum Type {
|
2011-06-06 10:26:01 +00:00
|
|
|
kInfo,
|
2010-11-18 19:12:14 +00:00
|
|
|
kError,
|
|
|
|
kWarning,
|
|
|
|
kDebug
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace LogMessageType
|
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
/**
|
2003-05-29 22:34:35 +00:00
|
|
|
* Interface for ScummVM backends. If you want to port ScummVM to a system
|
|
|
|
* which is not currently covered by any of our backends, this is the place
|
|
|
|
* to start. ScummVM will create an instance of a subclass of this interface
|
|
|
|
* and use it to interact with the system.
|
|
|
|
*
|
|
|
|
* In particular, a backend provides a video surface for ScummVM to draw in;
|
2003-09-27 16:54:11 +00:00
|
|
|
* methods to create timers, to handle user input events,
|
2003-05-29 22:34:35 +00:00
|
|
|
* control audio CD playback, and sound output.
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2007-03-17 10:36:14 +00:00
|
|
|
class OSystem : Common::NonCopyable {
|
2005-01-09 01:41:43 +00:00
|
|
|
protected:
|
2007-03-17 00:07:34 +00:00
|
|
|
OSystem();
|
|
|
|
virtual ~OSystem();
|
2005-01-09 01:41:43 +00:00
|
|
|
|
2011-06-06 13:02:33 +00:00
|
|
|
protected:
|
|
|
|
/**
|
2011-06-06 21:25:37 +00:00
|
|
|
* @name Module slots
|
|
|
|
*
|
|
|
|
* For backend authors only, the following pointers (= "slots) to various
|
|
|
|
* subsystem managers / factories / etc. can and should be set to
|
|
|
|
* a suitable instance of the respective type.
|
|
|
|
*
|
|
|
|
* For some of the slots, a default instance is set if your backend
|
|
|
|
* does not do so. For details, please look at the documentation of
|
|
|
|
* each slot.
|
|
|
|
*
|
|
|
|
* A backend may setup slot values in its initBackend() method,
|
|
|
|
* its constructor or somewhere in between. But it must a slot's value
|
|
|
|
* no later than in its initBackend() implementation, because
|
|
|
|
* OSystem::initBackend() will create any default instances if
|
|
|
|
* none has been set yet (and for other slots, will verify that
|
|
|
|
* one has been set; if not, an error may be generated).
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
2011-06-08 12:39:30 +00:00
|
|
|
* No default value is provided for _audiocdManager by OSystem.
|
|
|
|
* However, BaseBackend::initBackend() does set a default value
|
|
|
|
* if none has been set before.
|
2011-06-06 13:02:33 +00:00
|
|
|
*
|
2011-06-06 21:25:37 +00:00
|
|
|
* @note _audiocdManager is deleted by the OSystem destructor.
|
2011-06-06 13:02:33 +00:00
|
|
|
*/
|
|
|
|
AudioCDManager *_audiocdManager;
|
|
|
|
|
2011-06-06 13:51:46 +00:00
|
|
|
/**
|
2011-06-06 21:25:37 +00:00
|
|
|
* No default value is provided for _eventManager by OSystem.
|
|
|
|
* However, BaseBackend::initBackend() does set a default value
|
|
|
|
* if none has been set before.
|
2011-06-06 13:51:46 +00:00
|
|
|
*
|
2011-06-06 21:25:37 +00:00
|
|
|
* @note _eventManager is deleted by the OSystem destructor.
|
2011-06-06 13:51:46 +00:00
|
|
|
*/
|
|
|
|
Common::EventManager *_eventManager;
|
2011-06-06 21:25:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* No default value is provided for _timerManager by OSystem.
|
|
|
|
*
|
|
|
|
* @note _timerManager is deleted by the OSystem destructor.
|
|
|
|
*/
|
|
|
|
Common::TimerManager *_timerManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* No default value is provided for _savefileManager by OSystem.
|
|
|
|
*
|
|
|
|
* @note _savefileManager is deleted by the OSystem destructor.
|
|
|
|
*/
|
|
|
|
Common::SaveFileManager *_savefileManager;
|
|
|
|
|
2011-06-16 15:24:38 +00:00
|
|
|
#if defined(USE_TASKBAR)
|
|
|
|
/**
|
2011-07-05 22:33:19 +00:00
|
|
|
* No default value is provided for _taskbarManager by OSystem.
|
2011-06-16 15:24:38 +00:00
|
|
|
*
|
2011-07-05 22:33:19 +00:00
|
|
|
* @note _taskbarManager is deleted by the OSystem destructor.
|
2011-06-16 15:24:38 +00:00
|
|
|
*/
|
|
|
|
Common::TaskbarManager *_taskbarManager;
|
|
|
|
#endif
|
|
|
|
|
2011-07-07 00:47:46 +00:00
|
|
|
#if defined(USE_UPDATES)
|
|
|
|
/**
|
|
|
|
* No default value is provided for _updateManager by OSystem.
|
|
|
|
*
|
|
|
|
* @note _updateManager is deleted by the OSystem destructor.
|
|
|
|
*/
|
|
|
|
Common::UpdateManager *_updateManager;
|
|
|
|
#endif
|
|
|
|
|
2011-06-06 21:25:37 +00:00
|
|
|
/**
|
|
|
|
* No default value is provided for _fsFactory by OSystem.
|
|
|
|
*
|
|
|
|
* Note that _fsFactory is typically required very early on,
|
|
|
|
* so it usually should be set in the backends constructor or shortly
|
|
|
|
* thereafter, and before initBackend() is called.
|
|
|
|
*
|
|
|
|
* @note _fsFactory is deleted by the OSystem destructor.
|
|
|
|
*/
|
|
|
|
FilesystemFactory *_fsFactory;
|
|
|
|
|
|
|
|
//@}
|
|
|
|
|
2003-11-02 02:18:16 +00:00
|
|
|
public:
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-19 20:22:50 +00:00
|
|
|
/**
|
|
|
|
* The following method is called once, from main.cpp, after all
|
|
|
|
* config data (including command line params etc.) are fully loaded.
|
2006-10-22 15:42:29 +00:00
|
|
|
*
|
|
|
|
* @note Subclasses should always invoke the implementation of their
|
2007-03-17 00:07:34 +00:00
|
|
|
* parent class. They should do so near the end of their own
|
2006-10-22 15:42:29 +00:00
|
|
|
* implementation.
|
2005-04-19 20:22:50 +00:00
|
|
|
*/
|
2011-06-06 13:02:33 +00:00
|
|
|
virtual void initBackend();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2007-07-01 20:28:57 +00:00
|
|
|
/**
|
|
|
|
* Allows the backend to perform engine specific init.
|
|
|
|
* Called just before the engine is run.
|
|
|
|
*/
|
|
|
|
virtual void engineInit() { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allows the backend to perform engine specific de-init.
|
|
|
|
* Called after the engine finishes.
|
|
|
|
*/
|
|
|
|
virtual void engineDone() { }
|
|
|
|
|
2004-03-15 00:45:45 +00:00
|
|
|
/** @name Feature flags */
|
2004-02-24 22:39:42 +00:00
|
|
|
//@{
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
/**
|
2004-02-24 22:39:42 +00:00
|
|
|
* A feature in this context means an ability of the backend which can be
|
|
|
|
* either on or off. Examples include:
|
|
|
|
* - fullscreen mode
|
|
|
|
* - aspect ration correction
|
|
|
|
* - a virtual keyboard for text entry (on PDAs)
|
2011-06-03 21:52:54 +00:00
|
|
|
*
|
|
|
|
* One has to distinguish between the *availability* of a feature,
|
|
|
|
* which can be checked using hasFeature(), and its *state*.
|
|
|
|
* For example, the SDL backend *has* the kFeatureFullscreenMode,
|
|
|
|
* so hasFeature returns true for it. On the other hand,
|
|
|
|
* fullscreen mode may be active or not; this can be determined
|
|
|
|
* by checking the state via getFeatureState(). Finally, to
|
|
|
|
* switch between fullscreen and windowed mode, use setFeatureState().
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
enum Feature {
|
2004-03-13 15:12:23 +00:00
|
|
|
/**
|
2011-06-03 21:52:54 +00:00
|
|
|
* If supported, this feature flag can be used to switch between
|
|
|
|
* windowed and fullscreen mode.
|
2004-03-13 15:12:23 +00:00
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
kFeatureFullscreenMode,
|
2004-03-13 15:12:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Control aspect ratio correction. Aspect ratio correction is used to
|
|
|
|
* correct games running at 320x200 (i.e with an aspect ratio of 8:5),
|
|
|
|
* but which on their original hardware were displayed with the
|
|
|
|
* standard 4:3 ratio (that is, the original graphics used non-square
|
|
|
|
* pixels). When the backend support this, then games running at
|
|
|
|
* 320x200 pixels should be scaled up to 320x240 pixels. For all other
|
|
|
|
* resolutions, ignore this feature flag.
|
2011-06-03 21:52:54 +00:00
|
|
|
* @note Backend implementors can find utility functions in common/scaler.h
|
|
|
|
* which can be used to implement aspect ratio correction. In
|
2004-03-13 15:12:23 +00:00
|
|
|
* stretch200To240() can stretch a rect, including (very fast)
|
2011-06-03 21:52:54 +00:00
|
|
|
* particular, interpolation, and works in-place.
|
2004-03-13 15:12:23 +00:00
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
kFeatureAspectRatioCorrection,
|
2004-03-13 15:12:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine whether a virtual keyboard is too be shown or not.
|
|
|
|
* This would mostly be implemented by backends for hand held devices,
|
|
|
|
* like PocketPC, Palms, Symbian phones like the P800, Zaurus, etc.
|
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
kFeatureVirtualKeyboard,
|
2004-03-13 15:12:23 +00:00
|
|
|
|
2005-02-17 23:01:00 +00:00
|
|
|
/**
|
2011-06-03 22:14:09 +00:00
|
|
|
* Backends supporting this feature allow specifying a custom palette
|
|
|
|
* for the cursor. The custom palette is used if the feature state
|
|
|
|
* is set to true by the client code via setFeatureState().
|
|
|
|
*
|
2005-02-17 23:01:00 +00:00
|
|
|
* It is currently used only by some Macintosh versions of Humongous
|
2011-06-03 22:14:09 +00:00
|
|
|
* Entertainment games. If the backend doesn't implement this feature
|
|
|
|
* then the engine switches to b/w versions of cursors.
|
2009-06-10 15:11:17 +00:00
|
|
|
* The GUI also relies on this feature for mouse cursors.
|
2005-02-17 23:01:00 +00:00
|
|
|
*/
|
2011-06-03 21:30:55 +00:00
|
|
|
kFeatureCursorPalette,
|
2005-04-19 20:35:48 +00:00
|
|
|
|
|
|
|
/**
|
2011-06-03 21:52:54 +00:00
|
|
|
* A backend have this feature if its overlay pixel format has an alpha
|
|
|
|
* channel which offers at least 3-4 bits of accuracy (as opposed to
|
|
|
|
* just a single alpha bit).
|
|
|
|
*
|
|
|
|
* This feature has no associated state.
|
2005-04-19 20:35:48 +00:00
|
|
|
*/
|
2006-10-02 04:46:50 +00:00
|
|
|
kFeatureOverlaySupportsAlpha,
|
|
|
|
|
|
|
|
/**
|
2011-06-03 21:52:54 +00:00
|
|
|
* Client code can set the state of this feature to true in order to
|
|
|
|
* iconify the application window.
|
2006-10-02 04:46:50 +00:00
|
|
|
*/
|
2007-06-03 18:44:03 +00:00
|
|
|
kFeatureIconifyWindow,
|
|
|
|
|
|
|
|
/**
|
2011-06-03 21:52:54 +00:00
|
|
|
* Setting the state of this feature to true tells the backend to disable
|
|
|
|
* all key filtering/mapping, in cases where it would be beneficial to do so.
|
|
|
|
* As an example case, this is used in the AGI engine's predictive dialog.
|
2007-06-03 18:44:03 +00:00
|
|
|
* When the dialog is displayed this feature is set so that backends with
|
|
|
|
* phone-like keypad temporarily unmap all user actions which leads to
|
|
|
|
* comfortable word entry. Conversely, when the dialog exits the feature
|
|
|
|
* is set to false.
|
2011-06-03 21:52:54 +00:00
|
|
|
*
|
|
|
|
* TODO: The word 'beneficial' above is very unclear. Beneficial to
|
|
|
|
* whom and for what??? Just giving an example is not enough.
|
|
|
|
*
|
2008-01-27 19:47:41 +00:00
|
|
|
* TODO: Fingolfin suggests that the way the feature is used can be
|
2007-06-03 18:44:03 +00:00
|
|
|
* generalized in this sense: Have a keyboard mapping feature, which the
|
|
|
|
* engine queries for to assign keys to actions ("Here's my default key
|
|
|
|
* map for these actions, what do you want them set to?").
|
|
|
|
*/
|
2011-06-03 10:08:37 +00:00
|
|
|
kFeatureDisableKeyFiltering,
|
|
|
|
|
|
|
|
/**
|
2011-06-03 21:52:54 +00:00
|
|
|
* The presence of this feature indicates whether the displayLogFile()
|
|
|
|
* call is supported.
|
|
|
|
*
|
|
|
|
* This feature has no associated state.
|
2011-06-03 10:08:37 +00:00
|
|
|
*/
|
|
|
|
kFeatureDisplayLogFile
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
/**
|
2004-02-24 22:39:42 +00:00
|
|
|
* Determine whether the backend supports the specified feature.
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
virtual bool hasFeature(Feature f) { return false; }
|
2003-05-29 21:45:26 +00:00
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
/**
|
|
|
|
* En-/disable the specified feature. For example, this may be used to
|
|
|
|
* enable fullscreen mode, or to deactivate aspect correction, etc.
|
|
|
|
*/
|
|
|
|
virtual void setFeatureState(Feature f, bool enable) {}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
/**
|
|
|
|
* Query the state of the specified feature. For example, test whether
|
|
|
|
* fullscreen mode is active or not.
|
|
|
|
*/
|
|
|
|
virtual bool getFeatureState(Feature f) { return false; }
|
2003-05-29 22:34:35 +00:00
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
//@}
|
2003-09-20 00:47:18 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
|
2004-03-28 12:15:49 +00:00
|
|
|
|
2005-04-03 21:38:39 +00:00
|
|
|
/**
|
|
|
|
* @name Graphics
|
|
|
|
*
|
|
|
|
* 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.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
|
|
|
*
|
2005-04-03 21:38:39 +00:00
|
|
|
* The graphics visible to the user in the end are actually
|
|
|
|
* composed in three layers: the game graphics, the overlay
|
|
|
|
* graphics, and the mouse.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2010-04-20 21:18:37 +00:00
|
|
|
* 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.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2007-11-13 09:42:42 +00:00
|
|
|
* 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
|
2005-04-03 21:38:39 +00:00
|
|
|
* 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.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2005-04-03 21:38:39 +00:00
|
|
|
* 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.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2005-04-03 21:38:39 +00:00
|
|
|
* Putting this together, a pixel (x,y) of the game graphics is
|
2007-11-13 09:42:42 +00:00
|
|
|
* transformed to a rectangle of height p_h and width p_w
|
2005-04-03 21:38:39 +00:00
|
|
|
* 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).
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
|
|
|
*
|
2005-04-03 21:38:39 +00:00
|
|
|
* The next layer is the overlay. It is composed over the game
|
2012-06-13 03:06:58 +00:00
|
|
|
* graphics. Historically the overlay size had always been a
|
|
|
|
* multiple of the game resolution, for example when the game
|
|
|
|
* resolution was 320x200 and the user selected a 2x scaler and did
|
|
|
|
* not enable aspect ratio correction it had a size of 640x400.
|
|
|
|
* An exception was the aspect ratio correction, which did allow
|
|
|
|
* for non multiples of the vertical resolution of the game screen.
|
|
|
|
* Nowadays the overlay size does not need to have any relation to
|
|
|
|
* the game resolution though, for example the overlay resolution
|
|
|
|
* might be the same as the physical screen resolution.
|
2012-06-13 02:57:55 +00:00
|
|
|
* The overlay is forced to a 16bpp mode right now.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2005-04-03 21:38:39 +00:00
|
|
|
* 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
|
2010-04-20 21:18:37 +00:00
|
|
|
* SDL backend, it really is a separate layer. The mouse can
|
|
|
|
* have a palette of its own, if the backend supports it.
|
2011-08-06 16:53:21 +00:00
|
|
|
*
|
|
|
|
* On a note for OSystem users here. We do not require our graphics
|
|
|
|
* to be thread safe and in fact most/all backends using OpenGL are
|
|
|
|
* not. So do *not* try to call any of these functions from a timer
|
|
|
|
* and/or audio callback (like readBuffer of AudioStreams).
|
2005-04-03 21:38:39 +00:00
|
|
|
*/
|
2003-05-29 22:34:35 +00:00
|
|
|
//@{
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
|
|
|
* Description of a graphics mode.
|
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
struct GraphicsMode {
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
|
|
|
* The 'name' of the graphics mode. This name is matched when selecting
|
|
|
|
* a mode via the command line, or via the config file.
|
|
|
|
* Examples: "1x", "advmame2x", "hq3x"
|
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
const char *name;
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
|
|
|
* Human readable description of the scaler.
|
|
|
|
* Examples: "Normal (no scaling)", "AdvMAME2x", "HQ3x"
|
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
const char *description;
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
|
|
|
* ID of the graphics mode. How to use this is completely up to the
|
|
|
|
* backend. This value will be passed to the setGraphicsMode(int)
|
|
|
|
* method by client code.
|
|
|
|
*/
|
2004-02-24 22:39:42 +00:00
|
|
|
int id;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a list of all graphics modes supported by this backend.
|
|
|
|
* This can be both video modes as well as graphic filters/scalers;
|
|
|
|
* it is completely up to the backend maintainer to decide what is
|
|
|
|
* appropriate here and what not.
|
|
|
|
* The list is terminated by an all-zero entry.
|
|
|
|
* @return a list of supported graphics modes
|
|
|
|
*/
|
|
|
|
virtual const GraphicsMode *getSupportedGraphicsModes() const = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
|
|
|
* Return the ID of the 'default' graphics mode. What exactly this means
|
|
|
|
* is up to the backend. This mode is set by the client code when no user
|
|
|
|
* overrides are present (i.e. if no custom graphics mode is selected via
|
|
|
|
* the command line or a config file).
|
2004-03-15 02:09:28 +00:00
|
|
|
*
|
2004-03-15 00:45:45 +00:00
|
|
|
* @return the ID of the 'default' graphics mode
|
|
|
|
*/
|
|
|
|
virtual int getDefaultGraphicsMode() const = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
/**
|
|
|
|
* Switch to the specified graphics mode. If switching to the new mode
|
|
|
|
* failed, this method returns false.
|
2004-03-15 02:09:28 +00:00
|
|
|
*
|
2004-02-24 22:39:42 +00:00
|
|
|
* @param mode the ID of the new graphics mode
|
|
|
|
* @return true if the switch was successful, false otherwise
|
|
|
|
*/
|
|
|
|
virtual bool setGraphicsMode(int mode) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Switch to the graphics mode with the given name. If 'name' is unknown,
|
|
|
|
* or if switching to the new mode failed, this method returns false.
|
2004-03-15 02:09:28 +00:00
|
|
|
*
|
2004-03-15 00:55:44 +00:00
|
|
|
* @param name the name of the new graphics mode
|
2004-02-24 22:39:42 +00:00
|
|
|
* @return true if the switch was successful, false otherwise
|
2004-03-15 00:45:45 +00:00
|
|
|
* @note This is implemented via the setGraphicsMode(int) method, as well
|
|
|
|
* as getSupportedGraphicsModes() and getDefaultGraphicsMode().
|
|
|
|
* In particular, backends do not have to overload this!
|
2004-02-24 22:39:42 +00:00
|
|
|
*/
|
2004-03-15 00:45:45 +00:00
|
|
|
bool setGraphicsMode(const char *name);
|
2004-02-24 22:39:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine which graphics mode is currently active.
|
2011-04-29 11:51:57 +00:00
|
|
|
* @return the ID of the active graphics mode
|
2004-02-24 22:39:42 +00:00
|
|
|
*/
|
|
|
|
virtual int getGraphicsMode() const = 0;
|
|
|
|
|
2010-07-30 03:06:57 +00:00
|
|
|
/**
|
|
|
|
* Sets the graphics scale factor to x1. Games with large screen sizes
|
|
|
|
* reset the scale to x1 so the screen will not be too big when starting
|
|
|
|
* the game.
|
|
|
|
*/
|
2011-06-08 10:10:14 +00:00
|
|
|
virtual void resetGraphicsScale() {}
|
2010-07-30 03:06:57 +00:00
|
|
|
|
2009-08-21 18:16:37 +00:00
|
|
|
#ifdef USE_RGB_COLOR
|
2009-06-10 05:35:18 +00:00
|
|
|
/**
|
2009-06-25 08:55:16 +00:00
|
|
|
* Determine the pixel format currently in use for screen rendering.
|
|
|
|
* @return the active screen pixel format.
|
2009-06-10 05:35:18 +00:00
|
|
|
* @see Graphics::PixelFormat
|
|
|
|
*/
|
|
|
|
virtual Graphics::PixelFormat getScreenFormat() const = 0;
|
2009-06-16 09:04:37 +00:00
|
|
|
|
|
|
|
/**
|
2010-01-25 01:39:44 +00:00
|
|
|
* Returns a list of all pixel formats supported by the backend.
|
|
|
|
* The first item in the list must be directly supported by hardware,
|
|
|
|
* and provide the largest color space of those formats with direct
|
|
|
|
* hardware support. It is also strongly recommended that remaining
|
|
|
|
* formats should be placed in order of descending preference for the
|
2009-06-25 08:55:16 +00:00
|
|
|
* backend to use.
|
|
|
|
*
|
|
|
|
* EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware
|
|
|
|
* and provides conversion from equivalent RGB(A) modes should order its list
|
2009-07-07 07:50:40 +00:00
|
|
|
* 1) Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24)
|
|
|
|
* 2) Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0)
|
|
|
|
* 3) Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0)
|
|
|
|
* 4) Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0)
|
2009-07-08 16:07:58 +00:00
|
|
|
* 5) Graphics::PixelFormat::createFormatCLUT8()
|
2009-06-25 08:55:16 +00:00
|
|
|
*
|
2009-06-16 09:04:37 +00:00
|
|
|
* @see Graphics::PixelFormat
|
2009-06-25 08:55:16 +00:00
|
|
|
*
|
2010-01-25 01:39:44 +00:00
|
|
|
* @note Backends supporting RGB color should accept game data in RGB color
|
2009-07-06 07:40:28 +00:00
|
|
|
* order, even if hardware uses BGR or some other color order.
|
2009-06-16 09:04:37 +00:00
|
|
|
*/
|
2010-06-15 12:21:08 +00:00
|
|
|
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0;
|
2009-06-30 07:30:57 +00:00
|
|
|
#else
|
|
|
|
inline Graphics::PixelFormat getScreenFormat() const {
|
2009-07-08 16:07:58 +00:00
|
|
|
return Graphics::PixelFormat::createFormatCLUT8();
|
2009-06-30 07:30:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline Common::List<Graphics::PixelFormat> getSupportedFormats() const {
|
|
|
|
Common::List<Graphics::PixelFormat> list;
|
2009-07-08 16:07:58 +00:00
|
|
|
list.push_back(Graphics::PixelFormat::createFormatCLUT8());
|
2009-06-30 07:30:57 +00:00
|
|
|
return list;
|
|
|
|
};
|
2009-06-10 05:35:18 +00:00
|
|
|
#endif
|
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
/**
|
2009-06-23 02:02:51 +00:00
|
|
|
* Set the size and color format of the virtual screen. Typical sizes include:
|
2004-02-24 22:39:42 +00:00
|
|
|
* - 320x200 (e.g. for most SCUMM games, and Simon)
|
|
|
|
* - 320x240 (e.g. for FM-TOWN SCUMM games)
|
|
|
|
* - 640x480 (e.g. for Curse of Monkey Island)
|
2004-03-15 02:09:28 +00:00
|
|
|
*
|
2004-03-15 00:45:45 +00:00
|
|
|
* This is the resolution for which the client code generates data;
|
|
|
|
* this is not necessarily equal to the actual display size. For example,
|
2004-03-16 08:24:58 +00:00
|
|
|
* a backend may magnify the graphics to fit on screen (see also the
|
2004-03-15 00:45:45 +00:00
|
|
|
* GraphicsMode); stretch the data to perform aspect ratio correction;
|
|
|
|
* or shrink it to fit on small screens (in cell phones).
|
2004-03-15 02:09:28 +00:00
|
|
|
*
|
2009-06-23 02:02:51 +00:00
|
|
|
* Typical formats include:
|
|
|
|
* CLUT8 (e.g. 256 color, for most games)
|
|
|
|
* RGB555 (e.g. 16-bit color, for later SCUMM HE games)
|
|
|
|
* RGB565 (e.g. 16-bit color, for Urban Runner)
|
|
|
|
*
|
|
|
|
* This is the pixel format for which the client code generates data;
|
|
|
|
* this is not necessarily equal to the hardware pixel format. For example,
|
|
|
|
* a backend may perform color lookup of 8-bit graphics before pushing
|
2009-09-24 16:30:10 +00:00
|
|
|
* a screen to hardware, or correct the ARGB color order.
|
2009-06-23 02:02:51 +00:00
|
|
|
*
|
2004-03-15 00:45:45 +00:00
|
|
|
* @param width the new virtual screen width
|
|
|
|
* @param height the new virtual screen height
|
2009-06-23 02:02:51 +00:00
|
|
|
* @param format the new virtual screen pixel format
|
2004-02-24 22:39:42 +00:00
|
|
|
*/
|
2009-06-30 07:30:57 +00:00
|
|
|
virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2006-08-04 13:10:28 +00:00
|
|
|
/**
|
|
|
|
* Return an int value which is changed whenever any screen
|
|
|
|
* parameters (like the resolution) change. That is, whenever a
|
|
|
|
* EVENT_SCREEN_CHANGED would be sent. You can track this value
|
|
|
|
* in your code to detect screen changes in case you do not have
|
|
|
|
* full control over the event loop(s) being used (like the GUI
|
|
|
|
* code).
|
|
|
|
*
|
|
|
|
* @return an integer which can be used to track screen changes
|
|
|
|
*
|
|
|
|
* @note Backends which generate EVENT_SCREEN_CHANGED events MUST
|
|
|
|
* overload this method appropriately.
|
|
|
|
*/
|
|
|
|
virtual int getScreenChangeID() const { return 0; }
|
|
|
|
|
2004-11-22 23:25:08 +00:00
|
|
|
/**
|
|
|
|
* Begin a new GFX transaction, which is a sequence of GFX mode changes.
|
|
|
|
* The idea behind GFX transactions is to make it possible to activate
|
|
|
|
* several different GFX changes at once as a "batch" operation. For
|
|
|
|
* example, assume we are running in 320x200 with a 2x scaler (thus using
|
|
|
|
* 640x400 pixels in total). Now, we want to switch to 640x400 with the 1x
|
|
|
|
* scaler. Without transactions, we have to choose whether we want to first
|
|
|
|
* switch the scaler mode, or first to 640x400 mode. In either case,
|
|
|
|
* depending on the backend implementation, some ugliness may result.
|
|
|
|
* E.g. the window might briefly switch to 320x200 or 1280x800.
|
|
|
|
* Using transactions, this can be avoided.
|
|
|
|
*
|
|
|
|
* @note Transaction support is optional, and the default implementations
|
|
|
|
* of the relevant methods simply do nothing.
|
|
|
|
* @see endGFXTransaction
|
|
|
|
*/
|
2007-04-25 19:31:23 +00:00
|
|
|
virtual void beginGFXTransaction() {}
|
2004-11-22 23:25:08 +00:00
|
|
|
|
2008-11-14 22:08:10 +00:00
|
|
|
/**
|
|
|
|
* This type is able to save the different errors which can happen while
|
|
|
|
* changing GFX config values inside GFX transactions.
|
|
|
|
*
|
|
|
|
* endGFXTransaction returns a ORed combination of the '*Failed' values
|
|
|
|
* if any problem occures, on success 0.
|
|
|
|
*
|
|
|
|
* @see endGFXTransaction
|
|
|
|
*/
|
|
|
|
enum TransactionError {
|
2008-12-22 11:22:15 +00:00
|
|
|
kTransactionSuccess = 0, /**< Everything fine (use EQUAL check for this one!) */
|
2009-07-15 13:10:29 +00:00
|
|
|
kTransactionAspectRatioFailed = (1 << 0), /**< Failed switching aspect ratio correction mode */
|
|
|
|
kTransactionFullscreenFailed = (1 << 1), /**< Failed switching fullscreen mode */
|
|
|
|
kTransactionModeSwitchFailed = (1 << 2), /**< Failed switching the GFX graphics mode (setGraphicsMode) */
|
Merged revisions 42463,42468-42484,42486-42488,42490-42495,42498-42507,42510-42513,42516-42518,42521-42525,42527-42531,42533,42536-42540,42543,42545,42548,42551-42552,42558-42561,42563-42565,42570,42572 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r42463 | drmccoy | 2009-07-14 09:42:37 +1000 (Tue, 14 Jul 2009) | 1 line
Allow resource loading from EXT even if the TOT has none again
........
r42468 | fingolfin | 2009-07-14 18:36:06 +1000 (Tue, 14 Jul 2009) | 1 line
TINSEL: Don't use ioFailed to check if a file was opened succesfuly
........
r42469 | drmccoy | 2009-07-14 18:57:55 +1000 (Tue, 14 Jul 2009) | 1 line
Removing ioFailed() usage and fixing a leak in case of error
........
r42470 | joostp | 2009-07-14 19:44:56 +1000 (Tue, 14 Jul 2009) | 2 lines
commit peres' patch for #2813472: BASS: "showgrid" enabled triggers an assert
........
r42471 | dreammaster | 2009-07-14 20:26:56 +1000 (Tue, 14 Jul 2009) | 1 line
Bugfix for player being able to walk through some objects against room walls
........
r42472 | dreammaster | 2009-07-14 20:55:51 +1000 (Tue, 14 Jul 2009) | 1 line
Bugfix to cursor updates - it previously required that both X and Y positions had changed before a cursor change could occur
........
r42473 | joostp | 2009-07-14 21:15:21 +1000 (Tue, 14 Jul 2009) | 2 lines
add workaround for #2687172: BASS: Occasional loss of speech
........
r42474 | Kirben | 2009-07-14 22:34:42 +1000 (Tue, 14 Jul 2009) | 1 line
Add workaround for bug #1538873 - SIMON1 (French): Text wrongly displayed.
........
r42475 | vinterstum | 2009-07-14 22:55:54 +1000 (Tue, 14 Jul 2009) | 1 line
Updated xcode project
........
r42476 | strangerke | 2009-07-14 23:25:38 +1000 (Tue, 14 Jul 2009) | 1 line
Add detection for Playtoons CK 3 (FR)
........
r42477 | buddha_ | 2009-07-14 23:48:31 +1000 (Tue, 14 Jul 2009) | 1 line
Fix some typos and grammar in sword1's Sound::checkSpeechFileEndianness-function's comments.
........
r42478 | Kirben | 2009-07-14 23:50:17 +1000 (Tue, 14 Jul 2009) | 1 line
Change key combination to dump all script, due to conflict.
........
r42479 | vinterstum | 2009-07-14 23:52:11 +1000 (Tue, 14 Jul 2009) | 1 line
Split the iPhone OSystem class up into several files
........
r42480 | Kirben | 2009-07-14 23:53:54 +1000 (Tue, 14 Jul 2009) | 1 line
Update workaround for bug #1538873, which effects the Polish version of Simon the Sorcerer 2 too.
........
r42481 | Kirben | 2009-07-14 23:55:10 +1000 (Tue, 14 Jul 2009) | 1 line
Remove last ioFailed() usage in AGOS game engine.
........
r42482 | buddha_ | 2009-07-15 01:02:17 +1000 (Wed, 15 Jul 2009) | 1 line
Partially fix automatic restarting of AGI games (Addresses bug #2798797 ('AGI: larry 1 doesn't restart after dying') but doesn't fully fix it. There seems to be more to the problem still. Automatic restarting after dying of an STD doesn't take away the STD-condition and Larry continues to die in a loop).
........
r42483 | strangerke | 2009-07-15 01:48:05 +1000 (Wed, 15 Jul 2009) | 1 line
Add detection for Playtoons 4 EN_ANY as supplied by goodoldgeorg in bug #2820006
........
r42484 | eriktorbjorn | 2009-07-15 02:45:18 +1000 (Wed, 15 Jul 2009) | 3 lines
Got rid of ioFailed(). I haven't actually tested it, but we don't use the MPEG
decoder at the moment, and it was only used in the BACKEND_8BIT case anyway.
........
r42486 | lordhoto | 2009-07-15 04:14:20 +1000 (Wed, 15 Jul 2009) | 1 line
Got rid of ioFailed in font code, also added another check for err() when loading bdf fonts from text files.
........
r42487 | lordhoto | 2009-07-15 04:15:07 +1000 (Wed, 15 Jul 2009) | 1 line
Fix possible memory leak.
........
r42488 | fingolfin | 2009-07-15 04:24:20 +1000 (Wed, 15 Jul 2009) | 1 line
Got rid of some more ioFailed uses (also fixed a potential leak in graphics/font.cpp, and handle eos correctly in the FLAC code)
........
r42490 | lordhoto | 2009-07-15 05:32:25 +1000 (Wed, 15 Jul 2009) | 2 lines
Replaced char usage by int8, since char is unsigned on Linux/PPC by default.
........
r42491 | fingolfin | 2009-07-15 07:46:23 +1000 (Wed, 15 Jul 2009) | 1 line
AGOS: Cleanup PN code a bit, trying to make sense out of it
........
r42492 | fingolfin | 2009-07-15 07:50:22 +1000 (Wed, 15 Jul 2009) | 1 line
AGOS: Fixed potential OOBA crash in AGOSEngine_PN::opn_opcode26
........
r42493 | lordhoto | 2009-07-15 08:47:33 +1000 (Wed, 15 Jul 2009) | 1 line
Fix graphics glitch in LoL PC98 intro.
........
r42494 | fingolfin | 2009-07-15 09:03:25 +1000 (Wed, 15 Jul 2009) | 1 line
AGOS: Some more cleanup and added some comments to the PN code
........
r42495 | buddha_ | 2009-07-15 09:03:40 +1000 (Wed, 15 Jul 2009) | 1 line
Remove ioFailed() usage from AGI engine.
........
r42498 | Kirben | 2009-07-15 12:06:26 +1000 (Wed, 15 Jul 2009) | 1 line
Fix bug #2821215 - DIG: Skipping planetarium animation disables F5 menu.
........
r42499 | Kirben | 2009-07-15 15:00:59 +1000 (Wed, 15 Jul 2009) | 1 line
Hack is no longer required, due to revision 42498.
........
r42500 | dreammaster | 2009-07-15 18:55:12 +1000 (Wed, 15 Jul 2009) | 1 line
Created a system for inserting arbitrary code fragments into game scripts, and added an initial fragment to fix the bug of being stuck in the past in the DW1 SCN version
........
r42501 | fingolfin | 2009-07-15 20:04:50 +1000 (Wed, 15 Jul 2009) | 1 line
Got rid of two more ioFailed uses
........
r42502 | buddha_ | 2009-07-15 23:04:17 +1000 (Wed, 15 Jul 2009) | 1 line
Remove ioFailed() usage from Cine engine.
........
r42503 | buddha_ | 2009-07-15 23:10:29 +1000 (Wed, 15 Jul 2009) | 1 line
Fix some typos in TransactionError-enumeration's comments.
........
r42504 | Kirben | 2009-07-15 23:19:49 +1000 (Wed, 15 Jul 2009) | 1 line
Fix recent PN regression in vc32_saveScreen().
........
r42505 | Kirben | 2009-07-15 23:53:18 +1000 (Wed, 15 Jul 2009) | 1 line
Add Discworld 1/2.
........
r42506 | Kirben | 2009-07-15 23:58:23 +1000 (Wed, 15 Jul 2009) | 1 line
Add Cruise for a Corpse and games from MADE engine.
........
r42507 | lordhoto | 2009-07-16 01:51:47 +1000 (Thu, 16 Jul 2009) | 1 line
Bugfix: Disallow GMM Save/Load while in kyragem scene.
........
r42510 | lordhoto | 2009-07-16 03:07:45 +1000 (Thu, 16 Jul 2009) | 1 line
Fix "search" filter being settings lost in launcher, when using the "Edit Game..." menu for example.
........
r42511 | lordhoto | 2009-07-16 03:23:27 +1000 (Thu, 16 Jul 2009) | 1 line
Fix bug, which caused the ListWidget to draw a widget background around the selected item, when the ListWidget had no focus.
........
r42512 | lordhoto | 2009-07-16 04:05:37 +1000 (Thu, 16 Jul 2009) | 1 line
For a smoother user experience, use different colors for inverted text of the ListWidget, depending on whether the widget has focus or not.
........
r42513 | lordhoto | 2009-07-16 04:08:54 +1000 (Thu, 16 Jul 2009) | 1 line
Fix formatting of some switch statements.
........
r42516 | robinwatts | 2009-07-16 06:51:31 +1000 (Thu, 16 Jul 2009) | 4 lines
New ARM code blending Smartphone landscale scaler for WinCE port. Seems to work
in my mockup - I don't have a smartphone resolution device to test it.
........
r42517 | lordhoto | 2009-07-16 08:19:16 +1000 (Thu, 16 Jul 2009) | 1 line
Fix ugly spacing between tabs in classic theme (as reported by sunmax on -devel).
........
r42518 | lordhoto | 2009-07-16 08:19:31 +1000 (Thu, 16 Jul 2009) | 1 line
Slightly brighten up the active tab color in the modern theme.
........
r42521 | dreammaster | 2009-07-16 12:27:26 +1000 (Thu, 16 Jul 2009) | 1 line
Game script fix for bug #2525010 - in the GRA version, the luggage blocked Rincewind's exit from the Inn, leaving him in a non-walkable area
........
r42522 | dreammaster | 2009-07-16 14:06:35 +1000 (Thu, 16 Jul 2009) | 1 line
Added no blocking fix for Present Outside Inn scene as well
........
r42523 | thebluegr | 2009-07-16 18:13:08 +1000 (Thu, 16 Jul 2009) | 1 line
Added a detection entry for Pepper's Adventures in Time, and fixed an issue with _gfxop_set_pic(), which was causing crashes in that game
........
r42524 | thebluegr | 2009-07-16 18:17:38 +1000 (Thu, 16 Jul 2009) | 1 line
Added the French version of KQ5 floppy (bug report #2812611)
........
r42525 | thebluegr | 2009-07-16 18:21:06 +1000 (Thu, 16 Jul 2009) | 1 line
Added missing information for the newly-added version of Pepper
........
r42527 | dreammaster | 2009-07-16 19:31:31 +1000 (Thu, 16 Jul 2009) | 1 line
Added game script fix for bug #2680397 - game hang when using the brochure on the Beekeeper
........
r42528 | dreammaster | 2009-07-16 19:53:19 +1000 (Thu, 16 Jul 2009) | 1 line
Prior script fix also fixes bug #2820788, with stealing wizard's mallets
........
r42529 | tanoku | 2009-07-16 21:37:36 +1000 (Thu, 16 Jul 2009) | 2 lines
Fixed issue with beveled shapes being drawn outside their shapes. Possible regressions.
........
r42530 | lordhoto | 2009-07-16 21:41:45 +1000 (Thu, 16 Jul 2009) | 1 line
Formatting.
........
r42531 | lordhoto | 2009-07-16 21:42:07 +1000 (Thu, 16 Jul 2009) | 1 line
Update classic and builtin theme after r42529.
........
r42533 | thebluegr | 2009-07-16 22:43:42 +1000 (Thu, 16 Jul 2009) | 1 line
Added a proper fix for Pepper (the previous one caused regressions in KQ6)
........
r42536 | eriktorbjorn | 2009-07-17 03:26:44 +1000 (Fri, 17 Jul 2009) | 2 lines
Fixed GCC warning.
........
r42537 | tanoku | 2009-07-17 03:29:31 +1000 (Fri, 17 Jul 2009) | 2 lines
Fixed bug 2820514 ("Help dialog causes crash")
........
r42538 | lordhoto | 2009-07-17 03:39:16 +1000 (Fri, 17 Jul 2009) | 1 line
Formatting fixes.
........
r42539 | lordhoto | 2009-07-17 03:44:05 +1000 (Fri, 17 Jul 2009) | 1 line
This commit is just for DrMcCoy. (forgot to fix two usages of whitespaces instead of tabs for indentation -.-)
........
r42540 | tanoku | 2009-07-17 03:51:12 +1000 (Fri, 17 Jul 2009) | 2 lines
Fixed bug: In-game console doesn't stay centered when switching resolutions on the fly.
........
r42543 | lordhoto | 2009-07-17 07:47:57 +1000 (Fri, 17 Jul 2009) | 1 line
Fix bug in "KyraEngine_v2::runSceneScript6", fixes text line Zanthia says, when picking up the spellbook page in the town.
........
r42545 | Kirben | 2009-07-17 10:10:10 +1000 (Fri, 17 Jul 2009) | 1 line
Fix using subtitles only setting in The Dig.
........
r42548 | Kirben | 2009-07-17 10:25:27 +1000 (Fri, 17 Jul 2009) | 1 line
Fix bug #2821986 - COMI: setting to 'subtitles only' does not disable speech.
........
r42551 | drmccoy | 2009-07-17 10:55:42 +1000 (Fri, 17 Jul 2009) | 1 line
Added some more debug warnings when resources can't be loaded
........
r42552 | drmccoy | 2009-07-17 10:55:56 +1000 (Fri, 17 Jul 2009) | 1 line
Making TOTResourceItem::size unsigned, fixing a graphics bug that crept in
........
r42558 | dreammaster | 2009-07-17 15:10:24 +1000 (Fri, 17 Jul 2009) | 1 line
Added an explicit break out of the event processing loop for mouse buttons and/or key-presses - this should allow stylus-based systems to properly process 'mouse down' events before the 'mouse up' is processed
........
r42559 | Kirben | 2009-07-17 16:26:37 +1000 (Fri, 17 Jul 2009) | 1 line
Fix input glitch regression, after pausing in PN.
........
r42560 | Kirben | 2009-07-17 19:56:03 +1000 (Fri, 17 Jul 2009) | 1 line
Fix bug #2822956 - ELVIRA2: Crash at the beginning (regression).
........
r42561 | Kirben | 2009-07-17 20:48:30 +1000 (Fri, 17 Jul 2009) | 1 line
Correct error in saveBackGround.
........
r42563 | lordhoto | 2009-07-17 23:35:56 +1000 (Fri, 17 Jul 2009) | 1 line
Replace LGPL header by GPL header.
........
r42564 | lordhoto | 2009-07-17 23:50:59 +1000 (Fri, 17 Jul 2009) | 3 lines
- Moved SoundAdlibPC definition to new header file sound_adlib.h
- Made the future versions of sound.h GPL only
- sound_adlib.h is dual licensed under GPL and LGPL (so AdPlug can still benefit from future changes)
........
r42565 | lordhoto | 2009-07-18 00:05:22 +1000 (Sat, 18 Jul 2009) | 1 line
Cleanup.
........
r42570 | drmccoy | 2009-07-18 05:22:12 +1000 (Sat, 18 Jul 2009) | 1 line
Adding a workaround for the vanishing Coh Cott bug (#1972466), which is actually an error in that video file
........
r42572 | drmccoy | 2009-07-18 06:03:41 +1000 (Sat, 18 Jul 2009) | 1 line
/Finally/ fixing the longstanding flicker bug in Woodruff. I was completely mistaken about its cause, too
........
svn-id: r42576
2009-07-18 00:53:31 +00:00
|
|
|
kTransactionSizeChangeFailed = (1 << 3), /**< Failed switching the screen dimensions (initSize) */
|
2009-07-09 09:06:31 +00:00
|
|
|
kTransactionFormatNotSupported = (1 << 4) /**< Failed setting the color format */
|
2008-11-14 22:08:10 +00:00
|
|
|
};
|
2004-11-22 23:25:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* End (and thereby commit) the current GFX transaction.
|
|
|
|
* @see beginGFXTransaction
|
2008-11-14 22:08:10 +00:00
|
|
|
* @see kTransactionError
|
|
|
|
* @return returns a ORed combination of TransactionError values or 0 on success
|
2004-11-22 23:25:08 +00:00
|
|
|
*/
|
2008-11-14 22:08:10 +00:00
|
|
|
virtual TransactionError endGFXTransaction() { return kTransactionSuccess; }
|
2004-11-22 23:25:08 +00:00
|
|
|
|
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
/**
|
2004-03-15 00:45:45 +00:00
|
|
|
* Returns the currently set virtual screen height.
|
2004-02-24 22:39:42 +00:00
|
|
|
* @see initSize
|
2004-03-15 00:45:45 +00:00
|
|
|
* @return the currently set virtual screen height
|
2003-05-29 22:34:35 +00:00
|
|
|
*/
|
2004-03-15 00:45:45 +00:00
|
|
|
virtual int16 getHeight() = 0;
|
2003-05-29 22:34:35 +00:00
|
|
|
|
|
|
|
/**
|
2004-03-15 00:45:45 +00:00
|
|
|
* Returns the currently set virtual screen width.
|
2004-02-24 22:39:42 +00:00
|
|
|
* @see initSize
|
2004-03-15 00:45:45 +00:00
|
|
|
* @return the currently set virtual screen width
|
2003-05-29 22:34:35 +00:00
|
|
|
*/
|
2004-03-15 00:45:45 +00:00
|
|
|
virtual int16 getWidth() = 0;
|
2003-05-29 22:34:35 +00:00
|
|
|
|
2004-03-15 00:45:45 +00:00
|
|
|
/**
|
2011-02-07 17:52:38 +00:00
|
|
|
* Return the palette manager singleton. For more information, refer
|
|
|
|
* to the PaletteManager documentation.
|
2004-03-15 00:45:45 +00:00
|
|
|
*/
|
2011-02-07 17:52:38 +00:00
|
|
|
virtual PaletteManager *getPaletteManager() = 0;
|
2003-05-29 22:34:35 +00:00
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
/**
|
2004-03-15 00:45:45 +00:00
|
|
|
* Blit a bitmap to the virtual screen.
|
|
|
|
* The real screen will not immediately be updated to reflect the changes.
|
|
|
|
* Client code has to to call updateScreen to ensure any changes are
|
|
|
|
* visible to the user. This can be used to optimize drawing and reduce
|
|
|
|
* flicker.
|
2010-04-20 21:18:37 +00:00
|
|
|
* If the current pixel format has one byte per pixel, the graphics data
|
|
|
|
* uses 8 bits per pixel, using the palette specified via setPalette.
|
|
|
|
* If more than one byte per pixel is in use, the graphics data uses the
|
|
|
|
* pixel format returned by getScreenFormat.
|
2005-11-08 22:28:31 +00:00
|
|
|
*
|
|
|
|
* @param buf the buffer containing the graphics data source
|
|
|
|
* @param pitch the pitch of the buffer (number of bytes in a scanline)
|
|
|
|
* @param x the x coordinate of the destination rectangle
|
|
|
|
* @param y the y coordinate of the destination rectangle
|
|
|
|
* @param w the width of the destination rectangle
|
|
|
|
* @param h the height of the destination rectangle
|
|
|
|
*
|
|
|
|
* @note The specified destination rectangle must be completly contained
|
|
|
|
* in the visible screen space, and must be non-empty. If not, a
|
|
|
|
* backend may or may not perform clipping, trigger an assert or
|
|
|
|
* silently corrupt memory.
|
|
|
|
*
|
2004-02-28 12:58:13 +00:00
|
|
|
* @see updateScreen
|
2010-04-20 21:18:37 +00:00
|
|
|
* @see getScreenFormat
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2012-06-16 00:18:01 +00:00
|
|
|
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) = 0;
|
2005-05-08 21:39:05 +00:00
|
|
|
|
|
|
|
/**
|
2007-06-19 22:39:59 +00:00
|
|
|
* Lock the active screen framebuffer and return a Graphics::Surface
|
|
|
|
* representing it. The caller can then perform arbitrary graphics
|
|
|
|
* transformations on the framebuffer (blitting, scrolling, etc.).
|
|
|
|
* Must be followed by matching call to unlockScreen(). Calling code
|
|
|
|
* should make sure to only lock the framebuffer for the briefest
|
|
|
|
* periods of time possible, as the whole system is potentially stalled
|
|
|
|
* while the lock is active.
|
2010-04-20 21:18:37 +00:00
|
|
|
* Returns 0 if an error occurred. Otherwise a surface with the pixel
|
|
|
|
* format described by getScreenFormat is returned.
|
2005-05-08 21:39:05 +00:00
|
|
|
*
|
2007-06-19 22:39:59 +00:00
|
|
|
* The returned surface must *not* be deleted by the client code.
|
2010-04-20 21:18:37 +00:00
|
|
|
*
|
|
|
|
* @see getScreenFormat
|
2005-05-08 21:39:05 +00:00
|
|
|
*/
|
2007-06-19 22:39:59 +00:00
|
|
|
virtual Graphics::Surface *lockScreen() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock the screen framebuffer, and mark it as dirty (i.e. during the
|
|
|
|
* next updateScreen() call, the whole screen will be updated.
|
|
|
|
*/
|
|
|
|
virtual void unlockScreen() = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-11-22 23:25:08 +00:00
|
|
|
/**
|
2009-02-15 21:20:21 +00:00
|
|
|
* Fills the screen with a given color value.
|
|
|
|
*
|
|
|
|
* @note We are using uint32 here even though currently
|
|
|
|
* we only support 8bpp indexed mode. Thus the value should
|
|
|
|
* be always inside [0, 255] for now.
|
2004-11-22 23:25:08 +00:00
|
|
|
*/
|
2009-02-15 21:20:21 +00:00
|
|
|
virtual void fillScreen(uint32 col) = 0;
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2007-06-19 22:39:59 +00:00
|
|
|
/**
|
|
|
|
* Flush the whole screen, that is render the current content of the screen
|
2009-02-24 21:15:23 +00:00
|
|
|
* framebuffer to the display.
|
|
|
|
*
|
2009-02-24 21:22:04 +00:00
|
|
|
* This method could be called very often by engines. Backends are hence
|
|
|
|
* supposed to only perform any redrawing if it is necessary, and otherwise
|
2010-04-20 21:18:37 +00:00
|
|
|
* return immediately. See
|
|
|
|
* <http://wiki.scummvm.org/index.php/HOWTO-Backends#updateScreen.28.29_method>
|
2007-06-19 22:39:59 +00:00
|
|
|
*/
|
2004-02-28 12:58:13 +00:00
|
|
|
virtual void updateScreen() = 0;
|
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
/**
|
2007-08-11 08:05:03 +00:00
|
|
|
* Set current shake position, a feature needed for some SCUMM screen
|
|
|
|
* effects. The effect causes the displayed graphics to be shifted upwards
|
|
|
|
* by the specified (always positive) offset. The area at the bottom of the
|
|
|
|
* screen which is moved into view by this is filled with black. This does
|
|
|
|
* not cause any graphic data to be lost - that is, to restore the original
|
|
|
|
* view, the game engine only has to call this method again with offset
|
|
|
|
* equal to zero. No calls to copyRectToScreen are necessary.
|
2003-05-29 22:34:35 +00:00
|
|
|
* @param shakeOffset the shake offset
|
2004-02-28 12:58:13 +00:00
|
|
|
*
|
2007-08-11 08:05:03 +00:00
|
|
|
* @note This is currently used in the SCUMM, QUEEN and KYRA engines.
|
2003-05-29 22:34:35 +00:00
|
|
|
*/
|
2004-09-28 20:19:37 +00:00
|
|
|
virtual void setShakePos(int shakeOffset) = 0;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 09:40:44 +00:00
|
|
|
/**
|
|
|
|
* Sets the area of the screen that has the focus. For example, when a character
|
|
|
|
* is speaking, they will have the focus. Allows for pan-and-scan style views
|
2008-01-27 19:47:41 +00:00
|
|
|
* where the backend could follow the speaking character or area of interest on
|
2006-07-09 09:40:44 +00:00
|
|
|
* the screen.
|
|
|
|
*
|
|
|
|
* The backend is responsible for clipping the rectangle and deciding how best to
|
|
|
|
* zoom the screen to show any shape and size rectangle the engine provides.
|
|
|
|
*
|
|
|
|
* @param rect A rectangle on the screen to be focused on
|
|
|
|
* @see clearFocusRectangle
|
2008-01-27 19:47:41 +00:00
|
|
|
*/
|
2006-07-09 09:40:44 +00:00
|
|
|
virtual void setFocusRectangle(const Common::Rect& rect) {}
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 09:40:44 +00:00
|
|
|
/**
|
|
|
|
* Clears the focus set by a call to setFocusRectangle(). This allows the engine
|
|
|
|
* to clear the focus during times when no particular area of the screen has the
|
|
|
|
* focus.
|
|
|
|
* @see setFocusRectangle
|
|
|
|
*/
|
|
|
|
virtual void clearFocusRectangle() {}
|
2003-05-29 22:34:35 +00:00
|
|
|
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/**
|
|
|
|
* @name Overlay
|
|
|
|
* In order to be able to display dialogs atop the game graphics, backends
|
|
|
|
* must provide an overlay mode.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2012-06-13 02:57:55 +00:00
|
|
|
* The overlay is currently forced at 16 bpp.
|
2005-04-03 21:07:49 +00:00
|
|
|
*
|
|
|
|
* For 'coolness' we usually want to have an overlay which is blended over
|
|
|
|
* the game graphics. On backends which support alpha blending, this is
|
2012-06-13 02:57:55 +00:00
|
|
|
* no issue; but on other systems this needs some trickery.
|
2005-07-30 21:11:48 +00:00
|
|
|
*
|
2005-04-03 21:07:49 +00:00
|
|
|
* Essentially, we fake (alpha) blending on these systems by copying the
|
2007-08-11 08:05:03 +00:00
|
|
|
* current game graphics into the overlay buffer when activating the overlay,
|
|
|
|
* then manually compose whatever graphics we want to show in the overlay.
|
|
|
|
* This works because we assume the game to be "paused" whenever an overlay
|
|
|
|
* is active.
|
2005-04-03 21:07:49 +00:00
|
|
|
*/
|
2004-03-28 12:15:49 +00:00
|
|
|
//@{
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/** Activate the overlay mode. */
|
2004-03-28 16:30:50 +00:00
|
|
|
virtual void showOverlay() = 0;
|
2005-04-03 21:07:49 +00:00
|
|
|
|
|
|
|
/** Deactivate the overlay mode. */
|
2004-03-28 16:30:50 +00:00
|
|
|
virtual void hideOverlay() = 0;
|
2005-04-03 21:07:49 +00:00
|
|
|
|
2008-11-03 13:44:59 +00:00
|
|
|
/**
|
|
|
|
* Returns the pixel format description of the overlay.
|
|
|
|
* @see Graphics::PixelFormat
|
|
|
|
*/
|
|
|
|
virtual Graphics::PixelFormat getOverlayFormat() const = 0;
|
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/**
|
|
|
|
* Reset the overlay.
|
|
|
|
*
|
|
|
|
* After calling this method while the overlay mode is active, the user
|
|
|
|
* should be seeing only the game graphics. How this is achieved depends
|
|
|
|
* on how the backend implements the overlay. Either it sets all pixels of
|
|
|
|
* the overlay to be transparent (when alpha blending is used).
|
|
|
|
*
|
|
|
|
* Or, in case of fake alpha blending, it might just put a copy of the
|
|
|
|
* current game graphics screen into the overlay.
|
|
|
|
*/
|
2004-03-28 16:30:50 +00:00
|
|
|
virtual void clearOverlay() = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/**
|
|
|
|
* Copy the content of the overlay into a buffer provided by the caller.
|
2005-04-03 21:38:39 +00:00
|
|
|
* This is only used to implement fake alpha blending.
|
2005-04-03 21:07:49 +00:00
|
|
|
*/
|
2012-06-16 02:17:14 +00:00
|
|
|
virtual void grabOverlay(void *buf, int pitch) = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/**
|
2005-07-30 21:11:48 +00:00
|
|
|
* Blit a graphics buffer to the overlay.
|
2005-04-03 21:07:49 +00:00
|
|
|
* In a sense, this is the reverse of grabOverlay.
|
2009-01-30 16:16:52 +00:00
|
|
|
*
|
|
|
|
* @param buf the buffer containing the graphics data source
|
2012-06-16 02:17:14 +00:00
|
|
|
* @param pitch the pitch of the buffer (number of bytes in a scanline)
|
2009-01-30 16:16:52 +00:00
|
|
|
* @param x the x coordinate of the destination rectangle
|
|
|
|
* @param y the y coordinate of the destination rectangle
|
|
|
|
* @param w the width of the destination rectangle
|
|
|
|
* @param h the height of the destination rectangle
|
|
|
|
*
|
2005-04-03 21:07:49 +00:00
|
|
|
* @see copyRectToScreen
|
|
|
|
* @see grabOverlay
|
|
|
|
*/
|
2012-06-16 02:17:14 +00:00
|
|
|
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) = 0;
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2005-04-03 21:07:49 +00:00
|
|
|
/**
|
|
|
|
* Return the height of the overlay.
|
|
|
|
* @see getHeight
|
|
|
|
*/
|
2009-01-30 16:23:41 +00:00
|
|
|
virtual int16 getOverlayHeight() = 0;
|
2005-04-03 21:07:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the width of the overlay.
|
|
|
|
* @see getWidth
|
|
|
|
*/
|
2009-01-30 16:23:41 +00:00
|
|
|
virtual int16 getOverlayWidth() = 0;
|
2005-04-03 21:07:49 +00:00
|
|
|
|
2004-03-28 12:15:49 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 15:33:37 +00:00
|
|
|
/** @name Mouse
|
|
|
|
* This is the lower level implementation as provided by the
|
|
|
|
* backends. The engines should use the Graphics::CursorManager
|
|
|
|
* class instead of using it directly.
|
|
|
|
*/
|
2003-05-29 22:34:35 +00:00
|
|
|
//@{
|
|
|
|
|
2009-06-29 23:23:29 +00:00
|
|
|
/**
|
|
|
|
* Show or hide the mouse cursor.
|
|
|
|
*
|
|
|
|
* Currently the backend is not required to immediately draw the
|
|
|
|
* mouse cursor on showMouse(true).
|
|
|
|
*
|
|
|
|
* TODO: We might want to reconsider this fact,
|
|
|
|
* check Graphics::CursorManager::showMouse for some details about
|
|
|
|
* this.
|
|
|
|
*
|
|
|
|
* @see Graphics::CursorManager::showMouse
|
|
|
|
*/
|
2004-03-28 16:30:50 +00:00
|
|
|
virtual bool showMouse(bool visible) = 0;
|
2003-11-08 22:43:46 +00:00
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
/**
|
|
|
|
* Move ("warp") the mouse cursor to the specified position in virtual
|
2004-03-15 02:09:28 +00:00
|
|
|
* screen coordinates.
|
|
|
|
* @param x the new x position of the mouse
|
2008-05-19 23:22:11 +00:00
|
|
|
* @param y the new y position of the mouse
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2004-03-28 16:30:50 +00:00
|
|
|
virtual void warpMouse(int x, int y) = 0;
|
2003-11-08 22:43:46 +00:00
|
|
|
|
2004-03-15 02:09:28 +00:00
|
|
|
/**
|
|
|
|
* Set the bitmap used for drawing the cursor.
|
|
|
|
*
|
2010-01-07 15:28:58 +00:00
|
|
|
* @param buf the pixmap data to be used
|
2005-02-17 23:01:00 +00:00
|
|
|
* @param w width of the mouse cursor
|
|
|
|
* @param h height of the mouse cursor
|
|
|
|
* @param hotspotX horizontal offset from the left side to the hotspot
|
|
|
|
* @param hotspotY vertical offset from the top side to the hotspot
|
2010-01-07 15:28:58 +00:00
|
|
|
* @param keycolor transparency color value. This should not exceed the maximum color value of the specified format.
|
|
|
|
* In case it does the behavior is undefined. The backend might just error out or simply ignore the
|
|
|
|
* value. (The SDL backend will just assert to prevent abuse of this).
|
2012-06-03 00:02:57 +00:00
|
|
|
* @param dontScale Whether the cursor should never be scaled. An exception are high ppi displays, where the cursor
|
|
|
|
* would be too small to notice otherwise, these are allowed to scale the cursor anyway.
|
2010-01-08 20:15:42 +00:00
|
|
|
* @param format pointer to the pixel format which cursor graphic uses (0 means CLUT8)
|
2004-03-15 02:09:28 +00:00
|
|
|
*/
|
2012-06-16 01:10:43 +00:00
|
|
|
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) = 0;
|
2009-06-05 08:09:37 +00:00
|
|
|
|
2005-03-12 16:33:03 +00:00
|
|
|
/**
|
|
|
|
* Replace the specified range of cursor the palette with new colors.
|
|
|
|
* The palette entries from 'start' till (start+num-1) will be replaced - so
|
|
|
|
* a full palette update is accomplished via start=0, num=256.
|
|
|
|
*
|
2011-06-03 21:30:55 +00:00
|
|
|
* Backends which implement it should have kFeatureCursorPalette flag set
|
2005-03-12 16:33:03 +00:00
|
|
|
*
|
|
|
|
* @see setPalette
|
2011-06-03 21:30:55 +00:00
|
|
|
* @see kFeatureCursorPalette
|
2005-03-12 16:33:03 +00:00
|
|
|
*/
|
2007-04-25 19:31:23 +00:00
|
|
|
virtual void setCursorPalette(const byte *colors, uint start, uint num) {}
|
2005-03-12 16:33:03 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
//@}
|
|
|
|
|
2004-03-28 12:15:49 +00:00
|
|
|
|
|
|
|
|
2003-09-27 16:54:11 +00:00
|
|
|
/** @name Events and Time */
|
2003-05-29 22:34:35 +00:00
|
|
|
//@{
|
|
|
|
|
2013-05-16 21:18:09 +00:00
|
|
|
/** Get the number of milliseconds since the program was started.
|
|
|
|
|
|
|
|
@param skipRecord Skip recording of this value by event recorder.
|
|
|
|
This could be needed particularly when we are in
|
|
|
|
an on-screen GUI loop where player can pause
|
|
|
|
the recording.
|
|
|
|
*/
|
|
|
|
virtual uint32 getMillis(bool skipRecord = false) = 0;
|
2003-11-08 22:43:46 +00:00
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
/** Delay/sleep for the specified amount of milliseconds. */
|
2004-09-28 20:19:37 +00:00
|
|
|
virtual void delayMillis(uint msecs) = 0;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-05-15 11:36:56 +00:00
|
|
|
/**
|
|
|
|
* Get the current time and date, in the local timezone.
|
|
|
|
* Corresponds on many systems to the combination of time()
|
|
|
|
* and localtime().
|
|
|
|
*/
|
2009-10-08 19:41:38 +00:00
|
|
|
virtual void getTimeAndDate(TimeDate &t) const = 0;
|
2003-11-08 22:43:46 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
/**
|
2007-03-17 00:07:34 +00:00
|
|
|
* Return the timer manager singleton. For more information, refer
|
|
|
|
* to the TimerManager documentation.
|
2003-05-29 22:34:35 +00:00
|
|
|
*/
|
2013-05-16 21:18:09 +00:00
|
|
|
virtual Common::TimerManager *getTimerManager();
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2007-03-17 00:07:34 +00:00
|
|
|
/**
|
|
|
|
* Return the event manager singleton. For more information, refer
|
|
|
|
* to the EventManager documentation.
|
|
|
|
*/
|
2011-06-06 13:51:46 +00:00
|
|
|
inline Common::EventManager *getEventManager() {
|
|
|
|
return _eventManager;
|
|
|
|
}
|
2007-03-17 00:07:34 +00:00
|
|
|
|
2012-02-13 00:20:02 +00:00
|
|
|
#ifdef ENABLE_KEYMAPPER
|
2009-05-10 22:05:04 +00:00
|
|
|
/**
|
2012-02-24 19:23:55 +00:00
|
|
|
* Register hardware inputs with keymapper
|
2012-02-15 23:22:41 +00:00
|
|
|
* IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
|
|
|
|
* this, please talk to tsoliman and/or LordHoto.
|
2009-05-10 22:05:04 +00:00
|
|
|
*
|
2012-02-24 19:23:55 +00:00
|
|
|
* @return HardwareInputSet with all keys and recommended mappings
|
2009-05-10 22:05:04 +00:00
|
|
|
*
|
|
|
|
* See keymapper documentation for further reference.
|
|
|
|
*/
|
2012-02-24 19:23:55 +00:00
|
|
|
virtual Common::HardwareInputSet *getHardwareInputSet() { return 0; }
|
2009-05-10 22:05:04 +00:00
|
|
|
|
2012-02-09 07:26:29 +00:00
|
|
|
/**
|
|
|
|
* Return a platform-specific global keymap
|
2012-02-15 23:22:41 +00:00
|
|
|
* IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
|
|
|
|
* this, please talk to tsoliman and/or LordHoto.
|
2012-02-09 07:26:29 +00:00
|
|
|
*
|
|
|
|
* @return Keymap with actions appropriate for the platform
|
|
|
|
*
|
|
|
|
* The caller will use and delete the return object.
|
|
|
|
*
|
|
|
|
* See keymapper documentation for further reference.
|
|
|
|
*/
|
|
|
|
virtual Common::Keymap *getGlobalKeymap() { return 0; }
|
2012-02-15 05:02:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return platform-specific default keybindings
|
2012-02-15 23:22:41 +00:00
|
|
|
* IMPORTANT NOTE: This is part of the WIP Keymapper. If you plan to use
|
|
|
|
* this, please talk to tsoliman and/or LordHoto.
|
2012-02-15 05:02:23 +00:00
|
|
|
*
|
|
|
|
* @return KeymapperDefaultBindings populated with keybindings
|
|
|
|
*
|
|
|
|
* See keymapper documentation for further reference.
|
|
|
|
*/
|
|
|
|
virtual Common::KeymapperDefaultBindings *getKeymapperDefaultBindings() { return 0; }
|
2012-02-13 00:20:02 +00:00
|
|
|
#endif
|
2003-05-29 22:34:35 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-03-28 12:15:49 +00:00
|
|
|
/**
|
|
|
|
* @name 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.
|
2007-12-22 13:16:01 +00:00
|
|
|
* 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).
|
2004-03-28 12:15:49 +00:00
|
|
|
*
|
|
|
|
* Hence backends which do not use threads to implement the timers simply
|
|
|
|
* can use dummy implementations for these methods.
|
|
|
|
*/
|
|
|
|
//@{
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2009-01-30 03:35:47 +00:00
|
|
|
typedef struct OpaqueMutex *MutexRef;
|
2004-03-28 12:15:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new mutex.
|
2010-06-15 12:33:20 +00:00
|
|
|
* @return the newly created mutex, or 0 if an error occurred.
|
2004-03-28 12:15:49 +00:00
|
|
|
*/
|
2004-12-05 17:42:20 +00:00
|
|
|
virtual MutexRef createMutex() = 0;
|
2004-03-28 12:15:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Lock the given mutex.
|
2007-12-22 13:16:01 +00:00
|
|
|
*
|
|
|
|
* @note ScummVM code assumes that the mutex implementation supports
|
|
|
|
* recursive locking. That is, a thread may lock a mutex twice w/o
|
|
|
|
* deadlocking. In case of a multilock, the mutex has to be unlocked
|
|
|
|
* as many times as it was locked befored it really becomes unlocked.
|
|
|
|
*
|
2004-03-28 12:15:49 +00:00
|
|
|
* @param mutex the mutex to lock.
|
|
|
|
*/
|
|
|
|
virtual void lockMutex(MutexRef mutex) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock the given mutex.
|
|
|
|
* @param mutex the mutex to unlock.
|
|
|
|
*/
|
|
|
|
virtual void unlockMutex(MutexRef mutex) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete the given mutex. Make sure the mutex is unlocked before you delete it.
|
|
|
|
* If you delete a locked mutex, the behavior is undefined, in particular, your
|
|
|
|
* program may crash.
|
|
|
|
* @param mutex the mutex to delete.
|
|
|
|
*/
|
|
|
|
virtual void deleteMutex(MutexRef mutex) = 0;
|
|
|
|
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
/** @name Sound */
|
|
|
|
//@{
|
2003-11-08 22:43:46 +00:00
|
|
|
|
2003-06-09 01:19:25 +00:00
|
|
|
/**
|
2007-06-20 17:52:24 +00:00
|
|
|
* Return the audio mixer. For more information, refer to the
|
2006-10-22 15:42:29 +00:00
|
|
|
* Audio::Mixer documentation.
|
2003-06-09 01:19:25 +00:00
|
|
|
*/
|
2006-10-22 15:42:29 +00:00
|
|
|
virtual Audio::Mixer *getMixer() = 0;
|
2004-02-24 22:39:42 +00:00
|
|
|
|
|
|
|
//@}
|
2004-03-28 12:15:49 +00:00
|
|
|
|
2003-05-29 21:45:26 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
|
2010-06-09 20:09:57 +00:00
|
|
|
/** @name Audio CD */
|
2003-05-29 21:45:26 +00:00
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
2010-06-09 20:09:57 +00:00
|
|
|
* Return the audio cd manager. For more information, refer to the
|
|
|
|
* AudioCDManager documentation.
|
2003-05-29 21:45:26 +00:00
|
|
|
*/
|
2011-06-06 13:02:33 +00:00
|
|
|
inline AudioCDManager *getAudioCDManager() {
|
|
|
|
return _audiocdManager;
|
|
|
|
}
|
2004-02-24 22:39:42 +00:00
|
|
|
|
2004-02-28 12:58:13 +00:00
|
|
|
//@}
|
2003-05-29 21:45:26 +00:00
|
|
|
|
2002-04-16 12:18:50 +00:00
|
|
|
|
2002-05-14 18:14:16 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
/** @name Miscellaneous */
|
|
|
|
//@{
|
|
|
|
/** Quit (exit) the application. */
|
|
|
|
virtual void quit() = 0;
|
|
|
|
|
2010-11-18 19:12:14 +00:00
|
|
|
/**
|
|
|
|
* Signals that a fatal error inside the client code has happened.
|
|
|
|
*
|
|
|
|
* This should quit the application.
|
|
|
|
*/
|
|
|
|
virtual void fatalError();
|
|
|
|
|
2004-02-24 22:39:42 +00:00
|
|
|
/**
|
2004-03-28 20:31:18 +00:00
|
|
|
* Set a window caption or any other comparable status display to the
|
2009-06-28 19:58:11 +00:00
|
|
|
* given value. The caption must be a pure ISO LATIN 1 string. Passing a
|
|
|
|
* string with a different encoding may lead to unexpected behavior,
|
|
|
|
* even crashes.
|
2006-02-20 13:09:39 +00:00
|
|
|
*
|
2009-06-28 19:58:11 +00:00
|
|
|
* @param caption the window caption to use, as an ISO LATIN 1 string
|
2004-02-24 22:39:42 +00:00
|
|
|
*/
|
|
|
|
virtual void setWindowCaption(const char *caption) {}
|
2004-03-28 20:31:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Display a message in an 'on screen display'. That is, display it in a
|
|
|
|
* fashion where it is visible on or near the screen (e.g. in a transparent
|
|
|
|
* rectangle over the regular screen content; or in a message box beneath
|
|
|
|
* it; etc.).
|
|
|
|
*
|
2011-05-22 20:57:53 +00:00
|
|
|
* The message is expected to be provided in the current TranslationManager
|
|
|
|
* charset.
|
2009-06-28 19:58:11 +00:00
|
|
|
*
|
2010-12-08 01:35:34 +00:00
|
|
|
* @note There is a default implementation in BaseBackend which uses a
|
|
|
|
* TimedMessageDialog to display the message. Hence implementing
|
|
|
|
* this is optional.
|
2004-03-28 20:31:18 +00:00
|
|
|
*
|
|
|
|
* @param msg the message to display on screen
|
|
|
|
*/
|
2009-01-30 03:35:47 +00:00
|
|
|
virtual void displayMessageOnOSD(const char *msg) = 0;
|
2004-03-28 20:31:18 +00:00
|
|
|
|
2006-10-22 15:42:29 +00:00
|
|
|
/**
|
|
|
|
* Return the SaveFileManager, used to store and load savestates
|
|
|
|
* and other modifiable persistent game data. For more information,
|
2007-03-24 23:35:48 +00:00
|
|
|
* refer to the SaveFileManager documentation.
|
2006-10-22 15:42:29 +00:00
|
|
|
*/
|
2013-05-16 21:18:09 +00:00
|
|
|
Common::SaveFileManager *getSavefileManager();
|
2006-10-21 12:03:43 +00:00
|
|
|
|
2011-04-29 16:15:49 +00:00
|
|
|
#if defined(USE_TASKBAR)
|
2011-03-31 10:35:16 +00:00
|
|
|
/**
|
|
|
|
* Returns the TaskbarManager, used to handle progress bars,
|
|
|
|
* icon overlay, tasks and recent items list on the taskbar.
|
|
|
|
*
|
|
|
|
* @return the TaskbarManager for the current architecture
|
|
|
|
*/
|
2011-06-16 15:24:38 +00:00
|
|
|
virtual Common::TaskbarManager *getTaskbarManager() {
|
|
|
|
return _taskbarManager;
|
|
|
|
}
|
2011-04-29 16:15:49 +00:00
|
|
|
#endif
|
2011-03-31 10:35:16 +00:00
|
|
|
|
2011-07-07 00:47:46 +00:00
|
|
|
#if defined(USE_UPDATES)
|
|
|
|
/**
|
|
|
|
* Returns the UpdateManager, used to handle auto-updating,
|
|
|
|
* and updating of ScummVM in general.
|
|
|
|
*
|
|
|
|
* @return the UpdateManager for the current architecture
|
|
|
|
*/
|
|
|
|
virtual Common::UpdateManager *getUpdateManager() {
|
|
|
|
return _updateManager;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-02-23 23:03:08 +00:00
|
|
|
/**
|
|
|
|
* Returns the FilesystemFactory object, depending on the current architecture.
|
|
|
|
*
|
2008-08-03 16:54:18 +00:00
|
|
|
* @return the FSNode factory for the current architecture
|
2008-02-23 23:03:08 +00:00
|
|
|
*/
|
2011-06-06 21:25:37 +00:00
|
|
|
virtual FilesystemFactory *getFilesystemFactory();
|
2008-02-23 23:03:08 +00:00
|
|
|
|
2008-09-07 21:30:55 +00:00
|
|
|
/**
|
|
|
|
* Add system specific Common::Archive objects to the given SearchSet.
|
|
|
|
* E.g. on Unix the dir corresponding to DATA_PATH (if set), or on
|
|
|
|
* Mac OS X the 'Resource' dir in the app bundle.
|
|
|
|
*
|
|
|
|
* @todo Come up with a better name. This one sucks.
|
|
|
|
*
|
2008-09-07 21:59:25 +00:00
|
|
|
* @param s the SearchSet to which the system specific dirs, if any, are added
|
|
|
|
* @param priority the priority with which those dirs are added
|
2008-09-07 21:30:55 +00:00
|
|
|
*/
|
2008-09-27 18:32:01 +00:00
|
|
|
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) {}
|
2008-09-07 21:30:55 +00:00
|
|
|
|
2008-08-03 16:54:18 +00:00
|
|
|
/**
|
|
|
|
* Open the default config file for reading, by returning a suitable
|
|
|
|
* ReadStream instance. It is the callers responsiblity to delete
|
|
|
|
* the stream after use.
|
|
|
|
*/
|
2011-06-06 13:30:21 +00:00
|
|
|
virtual Common::SeekableReadStream *createConfigReadStream();
|
2008-08-03 16:54:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Open the default config file for writing, by returning a suitable
|
|
|
|
* WriteStream instance. It is the callers responsiblity to delete
|
|
|
|
* the stream after use.
|
|
|
|
*
|
|
|
|
* May return 0 to indicate that writing to config file is not possible.
|
|
|
|
*/
|
2011-06-06 13:30:21 +00:00
|
|
|
virtual Common::WriteStream *createConfigWriteStream();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the default file name (or even path) where the user configuration
|
|
|
|
* of ScummVM will be saved.
|
|
|
|
* Note that not all ports may use this.
|
|
|
|
*/
|
|
|
|
virtual Common::String getDefaultConfigFileName();
|
2007-10-28 12:04:38 +00:00
|
|
|
|
2010-11-18 19:12:14 +00:00
|
|
|
/**
|
|
|
|
* Logs a given message.
|
|
|
|
*
|
|
|
|
* It is up to the backend where to log the different messages.
|
|
|
|
* The backend should aim at using a non-buffered output for it
|
|
|
|
* so that no log data is lost in case of a crash.
|
|
|
|
*
|
|
|
|
* The default implementation outputs them on stdout/stderr.
|
|
|
|
*
|
|
|
|
* @param type the type of the message
|
|
|
|
* @param message the message itself
|
|
|
|
*/
|
2011-06-06 09:05:23 +00:00
|
|
|
virtual void logMessage(LogMessageType::Type type, const char *message) = 0;
|
2010-11-18 19:12:14 +00:00
|
|
|
|
2011-06-03 10:08:37 +00:00
|
|
|
/**
|
|
|
|
* Open the log file in a way that allows the user to review it,
|
|
|
|
* and possibly email it (or parts of it) to the ScummVM team,
|
|
|
|
* e.g. as part of a bug report.
|
|
|
|
*
|
|
|
|
* On a desktop operating system, this would typically launch
|
|
|
|
* some kind of (external) text editor / viewer.
|
|
|
|
* On a phone, it might also cause a context switch to another
|
2011-06-06 15:56:36 +00:00
|
|
|
* application. Finally, on some ports, it might not be supported
|
2011-06-03 10:08:37 +00:00
|
|
|
* at all, and so do nothing.
|
|
|
|
*
|
|
|
|
* The kFeatureDisplayLogFile feature flag can be used to
|
|
|
|
* test whether this call has been implemented by the active
|
|
|
|
* backend.
|
|
|
|
*
|
|
|
|
* @return true if all seems to have gone fine, false if an error occurred
|
|
|
|
*
|
|
|
|
* @note An error could mean that the log file did not exist,
|
|
|
|
* or the editor could not launch. However, a return value of true does
|
2011-06-06 15:56:36 +00:00
|
|
|
* not guarantee that the user actually will see the log file.
|
|
|
|
*
|
|
|
|
* @note It is up to the backend to ensure that the system is in a state
|
|
|
|
* that allows the user to actually see the displayed log files. This
|
|
|
|
* might for example require leaving fullscreen mode.
|
2011-06-03 10:08:37 +00:00
|
|
|
*/
|
|
|
|
virtual bool displayLogFile() { return false; }
|
|
|
|
|
2010-11-25 18:40:56 +00:00
|
|
|
/**
|
|
|
|
* Returns the locale of the system.
|
|
|
|
*
|
|
|
|
* This returns the currently set up locale of the system, on which
|
|
|
|
* ScummVM is run.
|
|
|
|
*
|
2010-11-28 02:12:33 +00:00
|
|
|
* The format of the locale is language_country. These should match
|
|
|
|
* the POSIX locale values.
|
2010-11-25 18:40:56 +00:00
|
|
|
*
|
2010-11-28 02:12:33 +00:00
|
|
|
* For information about POSIX locales read here:
|
|
|
|
* http://en.wikipedia.org/wiki/Locale#POSIX-type_platforms
|
2011-02-07 17:52:38 +00:00
|
|
|
*
|
2010-11-28 02:12:33 +00:00
|
|
|
* The default implementation returns "en_US".
|
2010-11-25 18:40:56 +00:00
|
|
|
*
|
|
|
|
* @return locale of the system
|
|
|
|
*/
|
2010-11-28 02:12:33 +00:00
|
|
|
virtual Common::String getSystemLanguage() const;
|
2010-11-25 18:40:56 +00:00
|
|
|
|
2003-05-29 22:34:35 +00:00
|
|
|
//@}
|
2002-03-21 01:03:27 +00:00
|
|
|
};
|
2002-04-12 21:26:59 +00:00
|
|
|
|
2005-01-09 01:41:43 +00:00
|
|
|
|
2011-05-25 15:17:11 +00:00
|
|
|
/** The global OSystem instance. Initialized in main(). */
|
2006-04-02 14:16:31 +00:00
|
|
|
extern OSystem *g_system;
|
2004-02-24 22:39:42 +00:00
|
|
|
|
2005-07-30 21:11:48 +00:00
|
|
|
#endif
|