diff options
author | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
commit | 6b4484472b79dc7ea7d1ce545a28fba7d3b7696f (patch) | |
tree | c44c4e61f18ddd537f7082cb48869cf33d422fbd /common | |
parent | 86ab70b149e5cd00cf54f2e41896e2c4e16795e4 (diff) | |
download | scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.gz scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.bz2 scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.zip |
Remove trailing whitespaces.
svn-id: r18604
Diffstat (limited to 'common')
35 files changed, 231 insertions, 231 deletions
diff --git a/common/array.h b/common/array.h index 63b7fca533..b3c1c5d176 100644 --- a/common/array.h +++ b/common/array.h @@ -128,8 +128,8 @@ public: _size = 0; _capacity = 0; } - - bool isEmpty() const { + + bool isEmpty() const { return (_size == 0); } diff --git a/common/config-file.cpp b/common/config-file.cpp index 46e5a68672..99a50014f3 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -79,7 +79,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { KeyValue kv; String comment; int lineno = 0; - + // TODO: Detect if a section occurs multiple times (or likewise, if // a key occurs multiple times inside one section). @@ -114,7 +114,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { error("Config file buggy: Invalid character '%c' occured in section name in line %d", *p, lineno); *p = 0; - + // Previous section is finished now, store it. if (!section.name.isEmpty()) _sections.push_back(section); @@ -123,7 +123,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { section.keys.clear(); section.comment = comment; comment.clear(); - + assert(isValidName(section.name)); } else { // Skip leading & trailing whitespaces @@ -150,11 +150,11 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) { comment.clear(); assert(isValidName(kv.key)); - + section.keys.push_back(kv); } } - + // Save last section if (!section.name.isEmpty()) _sections.push_back(section); @@ -220,7 +220,7 @@ bool ConfigFile::hasSection(const String §ion) const { void ConfigFile::renameSection(const String &oldName, const String &newName) { assert(isValidName(oldName)); assert(isValidName(newName)); - + //Section *os = getSection(oldName); Section *ns = getSection(newName); if (ns) { @@ -237,7 +237,7 @@ void ConfigFile::renameSection(const String &oldName, const String &newName) { bool ConfigFile::hasKey(const String &key, const String §ion) const { assert(isValidName(key)); assert(isValidName(section)); - + const Section *s = getSection(section); if (!s) return false; diff --git a/common/config-file.h b/common/config-file.h index 000e8ea437..3101628b55 100644 --- a/common/config-file.h +++ b/common/config-file.h @@ -79,9 +79,9 @@ public: public: ConfigFile(); ~ConfigFile(); - + // TODO: Maybe add a copy constructor etc.? - + /** * Check whether the given string is a valid section or key name. * For that, it must only consist of letters, numbers, dashes and @@ -97,7 +97,7 @@ public: bool loadFromStream(SeekableReadStream &stream); bool saveToFile(const String &filename); bool saveToStream(WriteStream &stream); - + bool hasSection(const String §ion) const; void removeSection(const String §ion); void renameSection(const String &oldName, const String &newName); @@ -113,7 +113,7 @@ public: private: List<Section> _sections; - + Section *getSection(const String §ion); const Section *getSection(const String §ion) const; }; diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 5120f53230..ae152bc825 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -127,7 +127,7 @@ void ConfigManager::loadFile(const String &filename) { String domain; String comment; int lineno = 0; - + // TODO: Detect if a domain occurs multiple times (or likewise, if // a key occurs multiple times inside one domain). @@ -162,7 +162,7 @@ void ConfigManager::loadFile(const String &filename) { default: error("Config file buggy: Invalid character '%c' occured in domain name in line %d", *p, lineno); } - + // Store domain comment if (_globalDomains.contains(domain)) { _globalDomains[domain].setDomainComment(comment); @@ -170,7 +170,7 @@ void ConfigManager::loadFile(const String &filename) { _gameDomains[domain].setDomainComment(comment); } comment.clear(); - + _domainSaveOrder.push_back(domain); } else { // Skip leading & trailing whitespaces @@ -216,7 +216,7 @@ void ConfigManager::flushToDisk() { if (!(cfg_file = fopen(_filename.c_str(), "w"))) { warning("Unable to write configuration file: %s", _filename.c_str()); } else { - + // First write the domains in _domainSaveOrder, in that order. // Note: It's possible for _domainSaveOrder to list domains which // are not present anymore. @@ -236,7 +236,7 @@ void ConfigManager::flushToDisk() { if (!_domainSaveOrder.contains(d->_key)) writeDomain(cfg_file, d->_key, d->_value); } - + // Finally write the remaining game domains for (d = _gameDomains.begin(); d != _gameDomains.end(); ++d) { if (!_domainSaveOrder.contains(d->_key)) @@ -250,14 +250,14 @@ void ConfigManager::flushToDisk() { void ConfigManager::writeDomain(FILE *file, const String &name, const Domain &domain) { if (domain.isEmpty()) return; // Don't bother writing empty domains. - + String comment; - + // Write domain comment (if any) comment = domain.getDomainComment(); if (!comment.isEmpty()) fprintf(file, "%s", comment.c_str()); - + // Write domain start fprintf(file, "[%s]\n", name.c_str()); @@ -287,13 +287,13 @@ bool ConfigManager::hasKey(const String &key) const { // 2) Active game domain (if any) // 3) All global domains // The defaults domain is explicitly *not* checked. - + if (_transientDomain.contains(key)) return true; if (!_activeDomain.isEmpty() && _gameDomains[_activeDomain].contains(key)) return true; - + DomainMap::const_iterator iter; for (iter = _globalDomains.begin(); iter != _globalDomains.end(); ++iter) { if (iter->_value.contains(key)) @@ -313,7 +313,7 @@ bool ConfigManager::hasKey(const String &key, const String &dom) const { return _gameDomains[dom].contains(key); if (_globalDomains.contains(dom)) return _globalDomains[dom].contains(key); - + return false; } @@ -342,7 +342,7 @@ const String & ConfigManager::get(const String &key, const String &domain) const // 1) Transient domain // 2) Active game domain (if any) // 3) All global domains - // 4) The defaults + // 4) The defaults if ((domain.isEmpty() || domain == kTransientDomain) && _transientDomain.contains(key)) @@ -365,7 +365,7 @@ const String & ConfigManager::get(const String &key, const String &domain) const int ConfigManager::getInt(const String &key, const String &dom) const { String value(get(key, dom)); char *errpos; - + // For now, be tolerant against missing config keys. Strictly spoken, it is // a bug in the calling code to retrieve an int for a key which isn't even // present... and a default value of 0 seems rather arbitrary. @@ -399,7 +399,7 @@ void ConfigManager::set(const String &key, const String &value, const String &do if (dom.isEmpty()) { // Remove the transient domain value _transientDomain.remove(key); - + if (_activeDomain.isEmpty()) _globalDomains[kApplicationDomain][key] = value; else @@ -486,7 +486,7 @@ void ConfigManager::renameGameDomain(const String &oldName, const String &newNam assert(isValidDomainName(newName)); _gameDomains[newName].merge(_gameDomains[oldName]); - + _gameDomains.remove(oldName); } diff --git a/common/config-manager.h b/common/config-manager.h index c8e6045056..71ea453add 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -46,9 +46,9 @@ typedef Map<String, String, IgnoreCaseComparator> StringMap; * of some specific (or any) configuration key changes. */ class ConfigManager : public Singleton<ConfigManager> { - + public: - + class Domain : public StringMap { private: StringMap _keyValueComments; @@ -121,12 +121,12 @@ private: void loadFile(const String &filename); void writeDomain(FILE *file, const String &name, const Domain &domain); - + Domain _transientDomain; DomainMap _gameDomains; DomainMap _globalDomains; Domain _defaultsDomain; - + StringList _domainSaveOrder; String _activeDomain; diff --git a/common/debugger.h b/common/debugger.h index bf028a9cb5..6fb865f579 100644 --- a/common/debugger.h +++ b/common/debugger.h @@ -35,7 +35,7 @@ class Debugger { public: Debugger(); virtual ~Debugger(); - + int DebugPrintf(const char *format, ...); #ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :) @@ -50,7 +50,7 @@ public: protected: typedef bool (T::*DebugProc)(int argc, const char **argv); - + enum { DVAR_BYTE, DVAR_INT, @@ -58,18 +58,18 @@ protected: DVAR_INTARRAY, DVAR_STRING }; - + struct DVar { char name[30]; void *variable; int type, optional; }; - + struct DCmd { char name[30]; DebugProc function; }; - + int _frame_countdown, _dvar_count, _dcmd_count; DVar _dvars[256]; DCmd _dcmds[256]; diff --git a/common/endian.h b/common/endian.h index e802001cb5..d331afaf60 100644 --- a/common/endian.h +++ b/common/endian.h @@ -174,6 +174,6 @@ FORCEINLINE uint32 READ_BE_UINT24(const void *ptr) { const byte *b = (const byte*)ptr; return (b[0] << 16) + (b[1] << 8) + (b[2]); } - + #endif diff --git a/common/file.h b/common/file.h index 6c853812d7..3246464c7e 100644 --- a/common/file.h +++ b/common/file.h @@ -33,10 +33,10 @@ class File : public SeekableReadStream, public WriteStream { protected: /** POSIX file handle to the actual file; 0 if no file is open. */ FILE *_handle; - + /** Status flag which tells about recent I/O failures. */ bool _ioFailed; - + /** Simple ref-counter for File objects. */ int32 _refcount; @@ -51,10 +51,10 @@ public: kFileReadMode = 1, kFileWriteMode = 2 }; - + static void addDefaultDirectory(const String &directory); static void resetDefaultDirectories(); - + File(); virtual ~File(); diff --git a/common/list.h b/common/list.h index d49a6bf0bc..bd1be508d7 100644 --- a/common/list.h +++ b/common/list.h @@ -28,7 +28,7 @@ namespace Common { /** * Simple double linked list, modelled after the list template of the standard - * C++ library. + * C++ library. */ template <class T> class List { @@ -41,11 +41,11 @@ public: NodeBase *_prev; NodeBase *_next; }; - + template <class T2> struct Node : public NodeBase { T2 _data; - + Node<T2>(const T2 &x) : _data(x) {} }; @@ -53,7 +53,7 @@ public: class Iterator { friend class List<T>; NodeBase *_node; - + explicit Iterator<T2>(NodeBase *node) : _node(node) {} public: Iterator<T2>() : _node(0) {} @@ -91,11 +91,11 @@ public: T2* operator->() const { return &(operator*()); } - + bool operator==(const Iterator<T2>& x) const { return _node == x._node; } - + bool operator!=(const Iterator<T2>& x) const { return _node != x._node; } @@ -141,7 +141,7 @@ public: void insert(iterator pos, const T& element) { NodeBase *newNode = new Node<T>(element); - + newNode->_next = pos._node; newNode->_prev = pos._node->_prev; newNode->_prev->_next = newNode; @@ -196,7 +196,7 @@ public: else erase(i, end()); } - + return *this; } @@ -210,8 +210,8 @@ public: void clear() { erase(begin(), end()); } - - bool isEmpty() const { + + bool isEmpty() const { return (_anchor == _anchor->_next); } diff --git a/common/map.h b/common/map.h index 0dac581bd2..1af77ce25b 100644 --- a/common/map.h +++ b/common/map.h @@ -45,7 +45,7 @@ struct DefaultComparator { * balanced. Ultimately this template should be reimplemented, e.g. using * a red-black tree. Or if one day using Std C++ lib becomes acceptable, * we can use that. - * @todo Having unit tests for this class would be very desirable. There are a + * @todo Having unit tests for this class would be very desirable. There are a * big number of things which can go wrong in this code. */ template <class Key, class Value, class Comparator = DefaultComparator<Key> > @@ -59,7 +59,7 @@ protected: Node() : _parent(0), _left(0), _right(0) {} Node(const Key &key, Node *parent) : _parent(parent), _left(0), _right(0), _key(key) {} }; - + Node *_root; Node *_header; @@ -73,7 +73,7 @@ public: protected: Node *_node; const_iterator(Node *node) : _node(node) {} - + public: const_iterator() : _node(0) {} @@ -109,7 +109,7 @@ public: _header = new Node(); _header->_right = _header->_left = _header; } - + #ifndef __SYMBIAN32__ virtual ~Map<Key, Value, Comparator>() #else @@ -199,7 +199,7 @@ public: parent->_left = rep; else parent->_right = rep; - + // Finally free the allocated memory delete node; } diff --git a/common/md5.cpp b/common/md5.cpp index 37d7602690..43bda31d85 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -118,7 +118,7 @@ static void md5_process(md5_context *ctx, const uint8 data[64]) { P(B, C, D, A, 12, 20, 0x8D2A4C8A); #undef F - + #define F(x, y, z) (x ^ y ^ z) P(A, B, C, D, 5, 4, 0xFFFA3942); @@ -245,9 +245,9 @@ bool md5_file(const char *name, uint8 digest[16], const char *directory, uint32 return false; } - if (!restricted || sizeof(buf) <= length) + if (!restricted || sizeof(buf) <= length) readlen = sizeof(buf); - else + else readlen = length; md5_starts(&ctx); @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) { for (j = 0; j < 16; j++) { printf("%02x", md5sum[j]); } - + printf(" %s\n", argv[i]); } } diff --git a/common/mutex.cpp b/common/mutex.cpp index 512dd67f76..abb3001747 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -62,7 +62,7 @@ StackLock::~StackLock() { void StackLock::lock() { if (_mutexName != NULL) debug(6, "Locking mutex %s", _mutexName); - + g_system->lockMutex(_mutex); } diff --git a/common/rect.h b/common/rect.h index b124bcd7a3..afa1aa09cf 100644 --- a/common/rect.h +++ b/common/rect.h @@ -47,18 +47,18 @@ struct Point { This small class is an helper for rectangles. Note: This implementation is built around the assumption that (top,left) is - part of the rectangle, but (bottom,right) is not! This is reflected in + part of the rectangle, but (bottom,right) is not! This is reflected in various methods, including contains(), intersects() and others. - + Another very wide spread approach to rectangle classes treats (bottom,right) also as a part of the rectangle. - + Coneptually, both are sound, but the approach we use saves many intermediate computations (like computing the height in our case is done by doing this: height = bottom - top; while in the alternate system, it would be height = bottom - top + 1; - + When writing code using our Rect class, always keep this principle in mind! */ struct Rect { @@ -72,7 +72,7 @@ struct Rect { } int16 width() const { return right - left; } int16 height() const { return bottom - top; } - + void setWidth(int16 aWidth) { right = left + aWidth; } @@ -84,8 +84,8 @@ struct Rect { /*! @brief check if given position is inside this rectangle @param x the horizontal position to check - @param y the vertical position to check - + @param y the vertical position to check + @return true if the given position is inside this rectangle, false otherwise */ bool contains(int16 x, int16 y) const { @@ -93,9 +93,9 @@ struct Rect { } /*! @brief check if given point is inside this rectangle - + @param p the point to check - + @return true if the given point is inside this rectangle, false otherwise */ bool contains(const Point & p) const { @@ -103,9 +103,9 @@ struct Rect { } /*! @brief check if given rectangle intersects with this rectangle - + @param r the rectangle to check - + @return true if the given rectangle is inside the rectangle, false otherwise */ bool intersects(const Rect & r) const { @@ -113,7 +113,7 @@ struct Rect { } /*! @brief extend this rectangle so that it contains r - + @param r the rectangle to extend by */ void extend(const Rect & r) { @@ -122,9 +122,9 @@ struct Rect { top = MIN(top, r.top); bottom = MAX(bottom, r.bottom); } - + /*! @brief extend this rectangle in all four directions by the given number of pixels - + @param offset the size to grow by */ void grow(int16 offset) { @@ -133,7 +133,7 @@ struct Rect { bottom += offset; right += offset; } - + void clip(const Rect & r) { assert(isValidRect()); assert(r.isValidRect()); @@ -150,22 +150,22 @@ struct Rect { if (right > r.right) right = r.right; else if (right < r.left) right = r.left; } - + void clip(int maxw, int maxh) { clip(Rect(0, 0, maxw, maxh)); } - + bool isValidRect() const { return (left <= right && top <= bottom); } - + void moveTo(int16 x, int16 y) { bottom += y - top; right += x - left; top = y; left = x; } - + void moveTo(const Point & p) { moveTo(p.x, p.y); } diff --git a/common/savefile.cpp b/common/savefile.cpp index bdfa34ebec..3f332af9d3 100644 --- a/common/savefile.cpp +++ b/common/savefile.cpp @@ -43,7 +43,7 @@ const char *SaveFileManager::getSavePath() const { // Try to use game specific savepath from config dir = ConfMan.get("savepath").c_str(); - + // Work around a bug (#999122) in the original 0.6.1 release of // ScummVM, which would insert a bad savepath value into config files. if (0 == strcmp(dir, "None")) { @@ -127,7 +127,7 @@ public: // hackish here and remove the const qualifier. // Note that gzwrite's buf param is declared as "const voidp" // which you might think is the same as "const void *" but it - // is not - rather it is equal to "void const *" which is the + // is not - rather it is equal to "void const *" which is the // same as "void *". Hrmpf int ret = ::gzwrite(fh, const_cast<void *>(dataPtr), dataSize); if (ret <= 0) diff --git a/common/savefile.h b/common/savefile.h index 1151e82cd9..e1a5f88901 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -36,7 +36,7 @@ namespace Common { class InSaveFile : public Common::ReadStream { public: virtual ~InSaveFile() {} - + /** * Skip over the specified (positive) amount of bytes in the input stream. */ diff --git a/common/scaler.cpp b/common/scaler.cpp index 17dcf837ea..4b30b1b9b1 100644 --- a/common/scaler.cpp +++ b/common/scaler.cpp @@ -44,10 +44,10 @@ extern "C" { // FIXME/TODO: The following two tables suck up 512 KB. // They should at least be allocated on the heap, to reduce the size of the -// binary. +// binary. // // Note: a memory lookup table is *not* necessarily faster than computing -// these things on the fly, because of its size. Both tables together, plus +// these things on the fly, because of its size. Both tables together, plus // the code, plus the input/output GFX data, won't fit in the cache on many // systems, so main memory has to be accessed, which is about the worst thing // that can happen to code which tries to be fast... @@ -64,7 +64,7 @@ extern "C" { // size of the lookup tables at the cost of some additional computations? That // might actually result in a speedup, too, if done right (and the code code // might actually be suitable for AltiVec/MMX/SSE speedup). -// +// // Of course, the above is largely a conjecture, and the actual speed // differences are likely to vary a lot between different architectures and // CPUs. @@ -108,7 +108,7 @@ void InitLUT(uint32 BitFormat) { int r, g, b; int Y, u, v; int gInc, gShift; - + for (int i = 0; i < 65536; i++) { LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3); } @@ -159,7 +159,7 @@ void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit r = dstPtr; for (int i = 0; i < width; ++i, r += 4) { uint32 color = *(((const uint16 *)srcPtr) + i); - + color |= color << 16; *(uint32 *)(r) = color; @@ -259,7 +259,7 @@ void AdvMame3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPi } template<int bitFormat> -void TV2xTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, +void TV2xTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { const uint32 nextlineSrc = srcPitch / sizeof(uint16); const uint16 *p = (const uint16 *)srcPtr; diff --git a/common/scaler/2xsai.cpp b/common/scaler/2xsai.cpp index 93bbcd3bd1..efeb5b0234 100644 --- a/common/scaler/2xsai.cpp +++ b/common/scaler/2xsai.cpp @@ -24,7 +24,7 @@ -static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) { +static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) { const bool ac = (A==C); const bool bc = (B==C); const int x1 = ac; @@ -51,7 +51,7 @@ void Super2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uin const uint16 *bP; uint16 *dP; const uint32 nextlineSrc = srcPitch >> 1; - + while (height--) { bP = (const uint16 *)srcPtr; dP = (uint16 *)dstPtr; diff --git a/common/scaler/aspect.cpp b/common/scaler/aspect.cpp index 95098b8b34..aa819b18aa 100644 --- a/common/scaler/aspect.cpp +++ b/common/scaler/aspect.cpp @@ -121,7 +121,7 @@ void makeRectStretchable(int &x, int &y, int &w, int &h) { // Finally force the width to be even, since we blit 2 pixels at a time. // While this means we may sometimes blit one column more than necessary, - // this should actually be faster than having the check for the + // this should actually be faster than having the check for the if (w & 1) w++; #endif diff --git a/common/scaler/hq2x.cpp b/common/scaler/hq2x.cpp index fd6d2eb094..5f1eab6ec8 100644 --- a/common/scaler/hq2x.cpp +++ b/common/scaler/hq2x.cpp @@ -56,16 +56,16 @@ static bool isAltiVecAvailable() { } #else -#include <sys/sysctl.h> +#include <sys/sysctl.h> static bool isAltiVecAvailable() { - int selectors[2] = { CTL_HW, HW_VECTORUNIT }; - int hasVectorUnit = 0; - size_t length = sizeof(hasVectorUnit); - int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; + int hasVectorUnit = 0; + size_t length = sizeof(hasVectorUnit); + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); if ( 0 == error ) - return hasVectorUnit != 0; - return false; + return hasVectorUnit != 0; + return false; } #endif #endif @@ -140,7 +140,7 @@ void HQ2x_555(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit #ifdef HAS_ALTIVEC #define USE_ALTIVEC 1 - + #define bitFormat 565 void HQ2x_565_Altivec(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { #include "common/scaler/hq2x.h" diff --git a/common/scaler/hq2x.h b/common/scaler/hq2x.h index 1cfd7058a0..1d8f260452 100644 --- a/common/scaler/hq2x.h +++ b/common/scaler/hq2x.h @@ -33,7 +33,7 @@ const uint32 nextlineDst = dstPitch / sizeof(uint16); uint16 *q = (uint16 *)dstPtr; - + // +----+----+----+ // | | | | // | w1 | w2 | w3 | @@ -104,7 +104,7 @@ | | | | | | w20| w21| w22| w23| +----+----+----+----+ - + In the previous loop iteration, w11 was the center point, and our vectors contain the following data from the previous iteration: vecYUV5555 = { w11, w11, w11, w11 } @@ -124,14 +124,14 @@ vecYUV5555 = { vecYUV6789[0], vecYUV6789[0], vecYUV6789[0], vecYUV6789[0] } vecYUV1234 = { vecYUV1234[1], vecYUV1234[2], vTmp[1], vTmp[0] } vecYUV6789 = { vTmp[2], vecYUV6789[2], vecYUV6789[3], vTmp[3] } - + Beautiful, isn't it? :-) */ // Load the new values into a temporary vector (see above for an explanation) const int tmpArr[4] = {YUV(4), YUV(3), YUV(6), YUV(9)}; vector signed char vTmp = *(const vector signed char *)tmpArr; - + // Next update the data vectors vecYUV5555 = (vector signed char)vec_splat((vector unsigned int)vecYUV6789, 0); vecYUV1234 = vec_perm(vecYUV1234, vTmp, vPermuteToV1234); @@ -140,17 +140,17 @@ // Compute the absolute difference between the center point's YUV and the outer points const vector signed char vDiff1 = vec_abs(vec_sub(vecYUV5555, vecYUV1234)); const vector signed char vDiff2 = vec_abs(vec_sub(vecYUV5555, vecYUV6789)); - + // Compare the difference to the threshold (byte-wise) const vector bool char vCmp1 = vec_cmpgt((vector unsigned char)vDiff1, vThreshold); const vector bool char vCmp2 = vec_cmpgt((vector unsigned char)vDiff2, vThreshold); - + // Convert all non-zero (long) vector elements to 0xF...F, keep 0 at 0. // Then and in the patter masks. The idea is that for 0 components, we get 0, // while for the other components we get exactly the mask value. const vector signed int vPattern1 = vec_and(vec_cmpgt((vector unsigned int)vCmp1, (vector unsigned int)0), vPatternMask1); const vector signed int vPattern2 = vec_and(vec_cmpgt((vector unsigned int)vCmp2, (vector unsigned int)0), vPatternMask2); - + // Now sum up the components of all vectors. Since our pattern mask values // are all "orthogonal", this is effectively the same as ORing them all // together. In the end, the rightmost word of vSum contains the 'pattern' diff --git a/common/scaler/hq3x.cpp b/common/scaler/hq3x.cpp index 43bc0dd432..4cb21ad9c2 100644 --- a/common/scaler/hq3x.cpp +++ b/common/scaler/hq3x.cpp @@ -55,16 +55,16 @@ static bool isAltiVecAvailable() { } #else -#include <sys/sysctl.h> +#include <sys/sysctl.h> static bool isAltiVecAvailable() { - int selectors[2] = { CTL_HW, HW_VECTORUNIT }; - int hasVectorUnit = 0; - size_t length = sizeof(hasVectorUnit); - int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; + int hasVectorUnit = 0; + size_t length = sizeof(hasVectorUnit); + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); if ( 0 == error ) - return hasVectorUnit != 0; - return false; + return hasVectorUnit != 0; + return false; } #endif #endif @@ -141,7 +141,7 @@ void HQ3x_555(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit #ifdef HAS_ALTIVEC #define USE_ALTIVEC 1 - + #define bitFormat 565 void HQ3x_565_Altivec(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { #include "common/scaler/hq3x.h" diff --git a/common/scaler/hq3x.h b/common/scaler/hq3x.h index eaf67d7bb9..7437652f35 100644 --- a/common/scaler/hq3x.h +++ b/common/scaler/hq3x.h @@ -27,7 +27,7 @@ */ register int w1, w2, w3, w4, w5, w6, w7, w8, w9; - + const uint32 nextlineSrc = srcPitch / sizeof(uint16); const uint16 *p = (const uint16 *)srcPtr; @@ -49,7 +49,7 @@ #ifdef USE_ALTIVEC // The YUV threshold. static const vector unsigned char vThreshold = (vector unsigned char)((vector unsigned int)0x00300706); - + // Bit pattern mask. static const vector signed int vPatternMask1 = (vector signed int)(0x01,0x02,0x04,0x08); static const vector signed int vPatternMask2 = (vector signed int)(0x10,0x20,0x40,0x80); @@ -105,7 +105,7 @@ | | | | | | w20| w21| w22| w23| +----+----+----+----+ - + In the previous loop iteration, w11 was the center point, and our vectors contain the following data from the previous iteration: vecYUV5555 = { w11, w11, w11, w11 } @@ -125,14 +125,14 @@ vecYUV5555 = { vecYUV6789[0], vecYUV6789[0], vecYUV6789[0], vecYUV6789[0] } vecYUV1234 = { vecYUV1234[1], vecYUV1234[2], vTmp[1], vTmp[0] } vecYUV6789 = { vTmp[2], vecYUV6789[2], vecYUV6789[3], vTmp[3] } - + Beautiful, isn't it? :-) */ // Load the new values into a temporary vector (see above for an explanation) const int tmpArr[4] = {YUV(4), YUV(3), YUV(6), YUV(9)}; vector signed char vTmp = *(const vector signed char *)tmpArr; - + // Next update the data vectors vecYUV5555 = (vector signed char)vec_splat((vector unsigned int)vecYUV6789, 0); vecYUV1234 = vec_perm(vecYUV1234, vTmp, vPermuteToV1234); @@ -141,17 +141,17 @@ // Compute the absolute difference between the center point's YUV and the outer points const vector signed char vDiff1 = vec_abs(vec_sub(vecYUV5555, vecYUV1234)); const vector signed char vDiff2 = vec_abs(vec_sub(vecYUV5555, vecYUV6789)); - + // Compare the difference to the threshold (byte-wise) const vector bool char vCmp1 = vec_cmpgt((vector unsigned char)vDiff1, vThreshold); const vector bool char vCmp2 = vec_cmpgt((vector unsigned char)vDiff2, vThreshold); - + // Convert all non-zero (long) vector elements to 0xF...F, keep 0 at 0. // Then and in the patter masks. The idea is that for 0 components, we get 0, // while for the other components we get exactly the mask value. const vector signed int vPattern1 = vec_and(vec_cmpgt((vector unsigned int)vCmp1, (vector unsigned int)0), vPatternMask1); const vector signed int vPattern2 = vec_and(vec_cmpgt((vector unsigned int)vCmp2, (vector unsigned int)0), vPatternMask2); - + // Now sum up the components of all vectors. Since our pattern mask values // are all "orthogonal", this is effectively the same as ORing them all // together. In the end, the rightmost word of vSum contains the 'pattern' diff --git a/common/scaler/intern.h b/common/scaler/intern.h index fd0ac33778..9c59535923 100644 --- a/common/scaler/intern.h +++ b/common/scaler/intern.h @@ -121,23 +121,23 @@ static inline bool diffYUV(int yuv1, int yuv2) { static const int trY = 0x00300000; static const int trU = 0x00000700; static const int trV = 0x00000006; - + int diff; int mask; - + diff = ((yuv1 & Ymask) - (yuv2 & Ymask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise - diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trY) return true; diff = ((yuv1 & Umask) - (yuv2 & Umask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise - diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trU) return true; diff = ((yuv1 & Vmask) - (yuv2 & Vmask)); - mask = diff >> 31; // -1 if value < 0, 0 otherwise - diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value if (diff > trV) return true; return false; diff --git a/common/scaler/thumbnail.cpp b/common/scaler/thumbnail.cpp index bdbd5d0104..8ada19a670 100644 --- a/common/scaler/thumbnail.cpp +++ b/common/scaler/thumbnail.cpp @@ -31,11 +31,11 @@ template<int bitFormat> uint16 quadBlockInterpolate(const uint8* src, uint32 srcPitch) { uint16 colorx1y1 = *(((const uint16*)src)); uint16 colorx2y1 = *(((const uint16*)src) + 1); - + uint16 colorx1y2 = *(((const uint16*)(src + srcPitch))); uint16 colorx2y2 = *(((const uint16*)(src + srcPitch)) + 1); - - return Q_INTERPOLATE<bitFormat>(colorx1y1, colorx2y1, colorx1y2, colorx2y2); + + return Q_INTERPOLATE<bitFormat>(colorx1y1, colorx2y1, colorx1y2, colorx2y2); } template<int bitFormat> @@ -62,7 +62,7 @@ void createThumbnail_4(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 uint16 downleft = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * x, srcPitch); uint16 downright = quadBlockInterpolate<bitFormat>(src + srcPitch * 2 + 2 * (x + 2), srcPitch); - *((uint16*)dstPtr) = Q_INTERPOLATE<bitFormat>(upleft, upright, downleft, downright); + *((uint16*)dstPtr) = Q_INTERPOLATE<bitFormat>(upleft, upright, downleft, downright); } dstPtr += (dstPitch - 2 * width / 4); src += 4 * srcPitch; @@ -73,9 +73,9 @@ void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 ds // only 1/2 and 1/4 downscale supported if (width != 320 && width != 640) return; - + int downScaleMode = (width == 320) ? 2 : 4; - + if (downScaleMode == 2) { if (gBitFormat == 565) createThumbnail_2<565>(src, srcPitch, dstPtr, dstPitch, width, height); @@ -93,74 +93,74 @@ void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 ds /** * Copies the current screen contents to a new surface, using RGB565 format. * WARNING: surf->free() must be called by the user to avoid leaking. - * + * * @param surf the surfce to store the data in it */ static bool grabScreen565(Graphics::Surface *surf) { Graphics::Surface screen; if (!g_system->grabRawScreen(&screen)) return false; - + assert(screen.bytesPerPixel == 1 && screen.pixels != 0); - + byte palette[256 * 4]; g_system->grabPalette(&palette[0], 0, 256); - + surf->create(screen.w, screen.h, 2); - + for (uint y = 0; y < screen.h; ++y) { for (uint x = 0; x < screen.w; ++x) { byte r, g, b; r = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4]; g = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4 + 1]; b = palette[((uint8*)screen.pixels)[y * screen.pitch + x] * 4 + 2]; - + ((uint16*)surf->pixels)[y * surf->w + x] = (((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F); } } - + screen.free(); return true; } bool createThumbnailFromScreen(Graphics::Surface* surf) { assert(surf); - + int screenWidth = g_system->getWidth(); int screenHeight = g_system->getHeight(); - + Graphics::Surface screen; if (!grabScreen565(&screen)) return false; uint16 width = screenWidth; - + if (screenWidth < 320) { // Special case to handle MM NES (uses a screen width of 256) width = 320; - + // center MM NES screen Graphics::Surface newscreen; newscreen.create(width, screen.h, screen.bytesPerPixel); - + uint8 *dst = (uint8*)newscreen.getBasePtr((320 - screenWidth) / 2, 0); uint8 *src = (uint8*)screen.getBasePtr(0, 0); uint16 height = screen.h; - + while (height--) { memcpy(dst, src, screen.pitch); dst += newscreen.pitch; src += screen.pitch; } - + screen.free(); screen = newscreen; } else if (screenWidth == 720) { // Special case to handle Hercules mode width = 640; screenHeight = 400; - + // cut off menu and so on.. Graphics::Surface newscreen; newscreen.create(width, 400, screen.bytesPerPixel); @@ -177,16 +177,16 @@ bool createThumbnailFromScreen(Graphics::Surface* surf) { screen.free(); screen = newscreen; } - + uint16 newHeight = !(screenHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1; - + int gBitFormatBackUp = gBitFormat; gBitFormat = 565; surf->create(kThumbnailWidth, newHeight, sizeof(uint16)); - createThumbnail((const uint8*)screen.pixels, width * sizeof(uint16), (uint8*)surf->pixels, surf->pitch, width, screenHeight); + createThumbnail((const uint8*)screen.pixels, width * sizeof(uint16), (uint8*)surf->pixels, surf->pitch, width, screenHeight); gBitFormat = gBitFormatBackUp; - + screen.free(); - + return true; } diff --git a/common/scummsys.h b/common/scummsys.h index f0cf21ae46..b2952dd72c 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -68,7 +68,7 @@ typedef signed char int8; typedef signed short int16; typedef signed long int32; - + #define START_PACK_STRUCTS pack(push, 1) #define END_PACK_STRUCTS pack(pop) @@ -108,14 +108,14 @@ #ifndef CONFIG_H #ifdef X11_BACKEND - + // You need to set this manually if necessary // #define SCUMM_LITTLE_ENDIAN - + #else /* need this for the SDL_BYTEORDER define */ #include <SDL_byteorder.h> - + #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define SCUMM_LITTLE_ENDIAN #elif SDL_BYTEORDER == SDL_BIG_ENDIAN @@ -155,12 +155,12 @@ #include <PalmOS.h> #include "globals.h" #include "extend.h" - + #define STRINGBUFLEN 256 #define scumm_stricmp stricmp #define scumm_strnicmp strnicmp - + #define SCUMM_BIG_ENDIAN #define SCUMM_NEED_ALIGNMENT @@ -172,7 +172,7 @@ typedef signed char int8; typedef signed short int16; typedef signed long int32; - + #define START_PACK_STRUCTS pack (1) #define END_PACK_STRUCTS pack () @@ -222,7 +222,7 @@ #elif defined __GP32__ //ph0x #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define scumm_stricmp stricmp #define scumm_strnicmp strnicmp @@ -242,7 +242,7 @@ #define END_PACK_STRUCTS pack(pop) #elif defined __PLAYSTATION2__ #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define scumm_stricmp strcasecmp #define scumm_strnicmp strncasecmp @@ -300,12 +300,12 @@ #define scumm_stricmp strcasecmp #define scumm_strnicmp strncasecmp - #define CDECL + #define CDECL #define SCUMM_NEED_ALIGNMENT - #define SCUMM_LITTLE_ENDIAN + #define SCUMM_LITTLE_ENDIAN #define CHECK_HEAP #define SMALL_SCREEN_DEVICE - + #define FORCEINLINE inline #define _HEAPOK 0 typedef unsigned char byte; @@ -316,7 +316,7 @@ typedef signed char int8; typedef signed short int int16; typedef signed long int int32; - + #define START_PACK_STRUCTS pack (push,1) #define END_PACK_STRUCTS pack(pop) #else @@ -329,7 +329,7 @@ // #if defined(__GNUC__) #define GCC_PACK __attribute__((packed)) - #define NORETURN __attribute__((__noreturn__)) + #define NORETURN __attribute__((__noreturn__)) #else #define GCC_PACK #endif diff --git a/common/singleton.h b/common/singleton.h index dec2844124..f378ec8f7b 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -34,7 +34,7 @@ class Singleton private: Singleton<T>(const Singleton<T>&); Singleton<T>& operator= (const Singleton<T>&); - + static T* _singleton; /** @@ -52,7 +52,7 @@ public: static T* makeInstance() { return new T(); } - + public: static T& instance() { @@ -74,7 +74,7 @@ protected: #else virtual ~Singleton<T>() { } #endif - + typedef T SingletonBaseType; }; diff --git a/common/stack.h b/common/stack.h index 0c5346585c..3738ef2745 100644 --- a/common/stack.h +++ b/common/stack.h @@ -37,7 +37,7 @@ protected: int _size; public: FixedStack<T, MAX_SIZE>() : _size(0) {} - + bool empty() const { return _size <= 0; } @@ -80,7 +80,7 @@ protected: Array<T> _stack; public: Stack<T>() {} - + bool empty() const { return _stack.isEmpty(); } diff --git a/common/str.cpp b/common/str.cpp index 429e64d88e..481d3e3ddc 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -221,7 +221,7 @@ void String::toUppercase() { } void String::ensureCapacity(int new_len, bool keep_old) { - // If there is not enough space, or if we are not the only owner + // If there is not enough space, or if we are not the only owner // of the current data, then we have to reallocate it. if (new_len <= _capacity && *_refCount == 1) return; diff --git a/common/str.h b/common/str.h index 5c04f85f59..2c68630507 100644 --- a/common/str.h +++ b/common/str.h @@ -43,7 +43,7 @@ public: String(const char *str, int len = -1); String(const String &str); virtual ~String(); - + String &operator =(const char *str); String &operator =(const String &str); String &operator =(char c); @@ -78,7 +78,7 @@ public: assert(_str && idx >= 0 && idx < _len); return _str[idx]; } - + void deleteLastChar(); void deleteChar(int p); void clear(); diff --git a/common/stream.cpp b/common/stream.cpp index 7c184b08b1..a3d44b108d 100644 --- a/common/stream.cpp +++ b/common/stream.cpp @@ -78,14 +78,14 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { // Unix and OS X use LF line breaks // Macintosh before OS X uses CR line breaks - + c = readByte(); if (eos() || ioFailed()) { return 0; } while (!eos() && len + 1 < bufSize) { - + if (ioFailed()) return 0; @@ -101,7 +101,7 @@ char *SeekableReadStream::readLine(char *buf, size_t bufSize) { *p++ = c; len++; - + c = readByte(); } diff --git a/common/stream.h b/common/stream.h index d3f47b1b5d..a89e5475dd 100644 --- a/common/stream.h +++ b/common/stream.h @@ -40,12 +40,12 @@ public: * Returns true if any I/O failure occured. * This flag is never cleared automatically. In order to clear it, * client code has to call clearIOFailed() explicitly. - * + * * @todo Instead of returning a plain bool, maybe we should define * a list of error codes which can be returned here. */ virtual bool ioFailed() const { return false; } - + /** * Reset the I/O error status. */ @@ -114,7 +114,7 @@ public: void writeSint32BE(int32 value) { writeUint32BE((uint32)value); } - + void writeString(const String &str); }; @@ -205,16 +205,16 @@ public: */ class SeekableReadStream : public ReadStream { public: - + virtual uint32 pos() const = 0; virtual uint32 size() const = 0; virtual void seek(int32 offs, int whence = SEEK_SET) = 0; - + /** * Read one line of text from a CR or CR/LF terminated plain text file. - * This method is a rough analog of the (f)gets function. - * + * This method is a rough analog of the (f)gets function. + * * @param buf the buffer to store into * @param bufSize the size of the buffer * @return a pointer to the read string, or NULL if an error occured diff --git a/common/system.h b/common/system.h index 4b72c3ec5f..de866efeb3 100644 --- a/common/system.h +++ b/common/system.h @@ -52,16 +52,16 @@ protected: friend class Common::Singleton<SingletonBaseType>; public: - + /** * The following method is called once, from main.cpp, after all * config data (including command line params etc.) are fully loaded. */ virtual void initBackend() { } - + /** @name Feature flags */ //@{ - + /** * A feature in this context means an ability of the backend which can be * either on or off. Examples include: @@ -102,10 +102,10 @@ public: * This flag is a bit more obscure: it gives a hint to the backend that * the frontend code is very inefficient in doing screen updates. So * the frontend might do a lot of fullscreen blits even though only a - * tiny portion of the actual screen data changed. In that case, it + * tiny portion of the actual screen data changed. In that case, it * might pay off for the backend to compute which parts actual changed, * and then only mark those as dirty. - * Implementing this is purely optional, and no harm should arise + * Implementing this is purely optional, and no harm should arise * when not doing so (except for decreased speed in said frontends). */ kFeatureAutoComputeDirtyRects, @@ -123,7 +123,7 @@ public: */ kFeatureOverlaySupportsAlpha }; - + /** * Determine whether the backend supports the specified feature. */ @@ -134,7 +134,7 @@ public: * enable fullscreen mode, or to deactivate aspect correction, etc. */ virtual void setFeatureState(Feature f, bool enable) {} - + /** * Query the state of the specified feature. For example, test whether * fullscreen mode is active or not. @@ -153,19 +153,19 @@ public: * 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. They are always 8bpp, and * 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 8bpp data into the * game layer. Let W and H denote the width and height of the * game graphics. - * + * * Before the user sees these graphics, they may undergo certain * transformations; for example, the may be scaled to better fit * on the visible screen; or aspect ratio correction may be @@ -173,20 +173,20 @@ public: * 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 widht 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 @@ -196,9 +196,9 @@ public: * 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. - * - * + * physical size as the game graphics. + * + * * 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 @@ -247,7 +247,7 @@ public: * @return a list of supported graphics modes */ virtual const GraphicsMode *getSupportedGraphicsModes() const = 0; - + /** * 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 @@ -257,7 +257,7 @@ public: * @return the ID of the 'default' graphics mode */ virtual int getDefaultGraphicsMode() const = 0; - + /** * Switch to the specified graphics mode. If switching to the new mode * failed, this method returns false. @@ -367,7 +367,7 @@ public: * API are probably going to remove it. */ virtual void setPalette(const byte *colors, uint start, uint num) = 0; - + /** * Grabs a specified part of the currently active palette. * The format is the same as for setPalette. @@ -397,7 +397,7 @@ public: * @return true if all went well, false if an error occured */ virtual bool grabRawScreen(Graphics::Surface *surf) { return false; } - + /** * Clear the screen to black. */ @@ -408,7 +408,7 @@ public: /** * 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 + * 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 by black. This does not cause any graphic data to * be lost - that is, to restore the original view, the game engine only has to @@ -429,7 +429,7 @@ public: * @name Overlay * In order to be able to display dialogs atop the game graphics, backends * must provide an overlay mode. - * + * * While the game graphics are always 8 bpp, the overlay can be 8 or 16 bpp. * Depending on which it is, OverlayColor is 8 or 16 bit. * @@ -437,13 +437,13 @@ public: * the game graphics. On backends which support alpha blending, this is * no issue; but on other systems (in particular those which only support * 8bpp), this needs some trickery. - * + * * Essentially, we fake (alpha) blending on these systems by copying the * game graphics into the overlay buffer, then manually compose whatever * graphics we want to show in the overlay. */ //@{ - + /** Activate the overlay mode. */ virtual void showOverlay() = 0; @@ -462,21 +462,21 @@ public: * current game graphics screen into the overlay. */ virtual void clearOverlay() = 0; - + /** * Copy the content of the overlay into a buffer provided by the caller. * This is only used to implement fake alpha blending. */ virtual void grabOverlay(OverlayColor *buf, int pitch) = 0; - + /** - * Blit a graphics buffer to the overlay. + * Blit a graphics buffer to the overlay. * In a sense, this is the reverse of grabOverlay. * @see copyRectToScreen * @see grabOverlay */ virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) = 0; - + /** * Return the height of the overlay. * @see getHeight @@ -555,8 +555,8 @@ public: /** Show or hide the mouse cursor. */ virtual bool showMouse(bool visible) = 0; - /** - * Move ("warp") the mouse cursor to the specified position in virtual + /** + * Move ("warp") the mouse cursor to the specified position in virtual * screen coordinates. * @param x the new x position of the mouse * @param y the new x position of the mouse @@ -693,7 +693,7 @@ public: */ int keycode; /** - * ASCII-value of the pressed key (if any). + * ASCII-value of the pressed key (if any). * This depends on modifiers, i.e. pressing the 'A' key results in * different values here depending on the status of shift, alt and * caps lock. @@ -701,7 +701,7 @@ public: */ uint16 ascii; /** - * Status of the modifier keys. Bits are set in this for each + * Status of the modifier keys. Bits are set in this for each * pressed modifier * @see KBD_CTRL, KBD_ALT, KBD_SHIFT */ @@ -767,7 +767,7 @@ public: * can use dummy implementations for these methods. */ //@{ - + typedef Common::MutexRef MutexRef; /** @@ -851,7 +851,7 @@ public: virtual bool pollCD() = 0; /** - * Start audio CD playback. + * Start audio CD playback. * @param track the track to play. * @param num_loops how often playback should be repeated (-1 = infinitely often). * @param start_frame the frame at which playback should start (75 frames = 1 second). @@ -909,4 +909,4 @@ public: #define g_system (&OSystem::instance()) -#endif +#endif diff --git a/common/timer.cpp b/common/timer.cpp index 41cd1b34d9..f079bbbc09 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -51,7 +51,7 @@ Timer::Timer(OSystem *system) : } Timer::~Timer() { - // Remove the timer callback. + // Remove the timer callback. // Note: backends *must* gurantee that after this method call returns, // the handler is not in use anymore; else race condtions could occurs. _system->setTimerCallback(0, 0); diff --git a/common/util.cpp b/common/util.cpp index a4a4f0e715..7db2998e4f 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -52,7 +52,7 @@ void hexdump(const byte * data, int len, int bytesPerLine) { offset += bytesPerLine; } - if (len <= 0) + if (len <= 0) return; printf("%06x: ", offset); @@ -187,7 +187,7 @@ Platform parsePlatform(const String &str) { return kPlatformUnknown; const char *s = str.c_str(); - + // Handle some special case separately, for compatibility with old config // files. if (!strcmp(s, "1")) diff --git a/common/util.h b/common/util.h index b257f408e5..7f8c810fcf 100644 --- a/common/util.h +++ b/common/util.h @@ -154,7 +154,7 @@ extern Platform parsePlatform(const String &str); extern const char *getPlatformCode(Platform id); extern const char *getPlatformDescription(Platform id); -/** +/** * List of render modes. It specifies which original graphics mode * to use. Some targets used postprocessing dithering routines for * reducing color depth of final image which let it to be rendered on |