aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/commandLine.cpp20
-rw-r--r--base/main.cpp20
-rw-r--r--base/plugins.cpp4
-rw-r--r--base/plugins.h6
-rw-r--r--base/version.h8
-rw-r--r--common/archive.cpp2
-rw-r--r--common/config-manager.cpp4
-rw-r--r--common/config-manager.h4
-rw-r--r--common/fs.h2
-rw-r--r--common/hash-str.h8
-rw-r--r--common/hashmap.cpp8
-rw-r--r--common/hashmap.h12
-rw-r--r--common/list.h2
-rw-r--r--common/memorypool.cpp2
-rw-r--r--common/memstream.h4
-rw-r--r--common/recorderfile.cpp6
-rw-r--r--common/rect.h8
-rw-r--r--common/serializer.h10
-rw-r--r--common/str.cpp8
-rw-r--r--common/str.h2
-rw-r--r--common/stream.cpp6
-rw-r--r--common/updates.cpp2
-rw-r--r--common/updates.h2
-rw-r--r--common/ustr.cpp4
-rw-r--r--common/xmlparser.cpp2
-rw-r--r--common/zlib.cpp4
-rw-r--r--graphics/VectorRenderer.h2
-rw-r--r--graphics/VectorRendererSpec.cpp26
-rw-r--r--graphics/fonts/bdf.h4
-rw-r--r--graphics/nine_patch.cpp2
-rw-r--r--graphics/primitives.cpp62
-rw-r--r--graphics/scaler.cpp14
-rw-r--r--graphics/scaler/intern.h12
-rw-r--r--graphics/scaler/scalebit.cpp42
-rw-r--r--graphics/sjis.cpp22
35 files changed, 170 insertions, 176 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index e1576a0fad..bd8b9d07ac 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -241,7 +241,7 @@ void registerDefaults() {
ConfMan.registerDefault("boot_param", 0);
ConfMan.registerDefault("dump_scripts", false);
ConfMan.registerDefault("save_slot", -1);
- ConfMan.registerDefault("autosave_period", 5 * 60); // By default, trigger autosave every 5 minutes
+ ConfMan.registerDefault("autosave_period", 5 * 60); // By default, trigger autosave every 5 minutes
#if defined(ENABLE_SCUMM) || defined(ENABLE_SWORD2)
ConfMan.registerDefault("object_labels", true);
@@ -308,7 +308,7 @@ void registerDefaults() {
// Use this for options which have an *optional* value
#define DO_OPTION_OPT(shortCmd, longCmd, defaultVal) \
- if (isLongCmd ? (!strcmp(s+2, longCmd) || !memcmp(s+2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
+ if (isLongCmd ? (!strcmp(s + 2, longCmd) || !memcmp(s + 2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
s += 2; \
if (isLongCmd) { \
s += sizeof(longCmd) - 1; \
@@ -337,7 +337,7 @@ void registerDefaults() {
// Use this for boolean options; this distinguishes between "-x" and "-X",
// resp. between "--some-option" and "--no-some-option".
#define DO_OPTION_BOOL(shortCmd, longCmd) \
- if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-" longCmd)) : (tolower(s[1]) == shortCmd)) { \
+ if (isLongCmd ? (!strcmp(s + 2, longCmd) || !strcmp(s + 2, "no-" longCmd)) : (tolower(s[1]) == shortCmd)) { \
bool boolValue = (Common::isLower(s[1]) != 0); \
s += 2; \
if (isLongCmd) { \
@@ -350,7 +350,7 @@ void registerDefaults() {
// Use this for options which never have a value, i.e. for 'commands', like "--help".
#define DO_COMMAND(shortCmd, longCmd) \
- if (isLongCmd ? (!strcmp(s+2, longCmd)) : (tolower(s[1]) == shortCmd)) { \
+ if (isLongCmd ? (!strcmp(s + 2, longCmd)) : (tolower(s[1]) == shortCmd)) { \
s += 2; \
if (isLongCmd) \
s += sizeof(longCmd) - 1; \
@@ -383,7 +383,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
// argv[0] contains the name of the executable.
if (argv[0]) {
s = strrchr(argv[0], '/');
- s_appName = s ? (s+1) : argv[0];
+ s_appName = s ? (s + 1) : argv[0];
}
// We store all command line settings into a string map.
@@ -746,7 +746,7 @@ static Common::Error listSaves(const char *target) {
gameid = domain->getVal("gameid");
if (gameid.empty())
gameid = target;
- gameid.toLowercase(); // Normalize it to lower case
+ gameid.toLowercase(); // Normalize it to lower case
// Find the plugin that will handle the specified gameid
const Plugin *plugin = nullptr;
@@ -754,7 +754,7 @@ static Common::Error listSaves(const char *target) {
if (!plugin) {
return Common::Error(Common::kEnginePluginNotFound,
- Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
+ Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
}
const MetaEngine &metaEngine = plugin->get<MetaEngine>();
@@ -762,7 +762,7 @@ static Common::Error listSaves(const char *target) {
if (!metaEngine.hasFeature(MetaEngine::kSupportsListSaves)) {
// TODO: Include more info about the target (desc, engine name, ...) ???
return Common::Error(Common::kEnginePluginNotSupportSaves,
- Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
+ Common::String::format("target '%s', gameid '%s", target, gameid.c_str()));
} else {
// Query the plugin for a list of saved games
SaveStateList saveList = metaEngine.listSaves(target);
@@ -821,7 +821,7 @@ static void listAudioDevices() {
static GameList getGameList(const Common::FSNode &dir) {
Common::FSList files;
- //Collect all files from directory
+ // Collect all files from directory
if (!dir.getChildren(files, Common::FSNode::kListAll)) {
printf("Path %s does not exist or is not a directory.\n", dir.getPath().c_str());
return GameList();
@@ -1043,7 +1043,7 @@ void upgradeTargets() {
if (gameid.empty()) {
gameid = name;
}
- gameid.toLowercase(); // TODO: Is this paranoia? Maybe we should just assume all lowercase, always?
+ gameid.toLowercase(); // TODO: Is this paranoia? Maybe we should just assume all lowercase, always?
Common::FSNode dir(path);
Common::FSList files;
diff --git a/base/main.cpp b/base/main.cpp
index f529f3ec08..8e783c9776 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -213,7 +213,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
caption = EngineMan.findGame(ConfMan.get("gameid")).description();
}
if (caption.empty())
- caption = ConfMan.getActiveDomainName(); // Use the domain (=target) name
+ caption = ConfMan.getActiveDomainName(); // Use the domain (=target) name
if (!caption.empty()) {
system.setWindowCaption(caption.c_str());
}
@@ -394,7 +394,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
if (settings.contains("debuglevel")) {
gDebugLevel = (int)strtol(settings["debuglevel"].c_str(), 0, 10);
printf("Debuglevel (from command line): %d\n", gDebugLevel);
- settings.erase("debuglevel"); // This option should not be passed to ConfMan.
+ settings.erase("debuglevel"); // This option should not be passed to ConfMan.
} else if (ConfMan.hasKey("debuglevel"))
gDebugLevel = ConfMan.getInt("debuglevel");
@@ -535,12 +535,12 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
g_eventRec.deinit();
#endif
- #if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES)
+#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES)
// do our best to prevent fragmentation by unloading as soon as we can
PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
// reallocate the config manager to get rid of any fragmentation
ConfMan.defragment();
- #endif
+#endif
// Did an error occur ?
if (result.getCode() != Common::kNoError && result.getCode() != Common::kUserCanceled) {
@@ -549,20 +549,20 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
}
// Quit unless an error occurred, or Return to launcher was requested
- #ifndef FORCE_RTL
+#ifndef FORCE_RTL
if (result.getCode() == Common::kNoError && !g_system->getEventManager()->shouldRTL())
break;
- #endif
+#endif
// Reset RTL flag in case we want to load another engine
g_system->getEventManager()->resetRTL();
- #ifdef FORCE_RTL
+#ifdef FORCE_RTL
g_system->getEventManager()->resetQuit();
- #endif
- #ifdef ENABLE_EVENTRECORDER
+#endif
+#ifdef ENABLE_EVENTRECORDER
if (g_eventRec.checkForContinueGame()) {
continue;
}
- #endif
+#endif
// At this point, we usually return to the launcher. However, the
// game may have requested that one or more other games be "chained"
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 18755003b4..b8f63fd443 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -257,7 +257,7 @@ void PluginManagerUncached::init() {
unloadAllPlugins();
_allEnginePlugins.clear();
- unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins
+ unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins
for (ProviderList::iterator pp = _providers.begin();
pp != _providers.end();
@@ -362,7 +362,7 @@ bool PluginManagerUncached::loadNextPlugin() {
return true;
}
}
- return false; // no more in list
+ return false; // no more in list
}
/**
diff --git a/base/plugins.h b/base/plugins.h
index ce45f7102a..3ad2875906 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -179,9 +179,9 @@ public:
//unloadPlugin();
}
-// virtual bool isLoaded() const = 0; // TODO
- virtual bool loadPlugin() = 0; // TODO: Rename to load() ?
- virtual void unloadPlugin() = 0; // TODO: Rename to unload() ?
+// virtual bool isLoaded() const = 0; // TODO
+ virtual bool loadPlugin() = 0; // TODO: Rename to load() ?
+ virtual void unloadPlugin() = 0; // TODO: Rename to unload() ?
/**
* The following functions query information from the plugin object once
diff --git a/base/version.h b/base/version.h
index 2e362b5c72..74a0e72254 100644
--- a/base/version.h
+++ b/base/version.h
@@ -23,10 +23,10 @@
#ifndef BASE_VERSION_H
#define BASE_VERSION_H
-extern const char *gScummVMVersion; // e.g. "0.4.1"
-extern const char *gScummVMBuildDate; // e.g. "2003-06-24"
+extern const char *gScummVMVersion; // e.g. "0.4.1"
+extern const char *gScummVMBuildDate; // e.g. "2003-06-24"
extern const char *gScummVMVersionDate; // e.g. "0.4.1 (2003-06-24)"
-extern const char *gScummVMFullVersion; // e.g. "ScummVM 0.4.1 (2003-06-24)"
-extern const char *gScummVMFeatures; // e.g. "ALSA MPEG2 zLib"
+extern const char *gScummVMFullVersion; // e.g. "ScummVM 0.4.1 (2003-06-24)"
+extern const char *gScummVMFeatures; // e.g. "ALSA MPEG2 zLib"
#endif
diff --git a/common/archive.cpp b/common/archive.cpp
index 5a339900b6..b4fc7c12c7 100644
--- a/common/archive.cpp
+++ b/common/archive.cpp
@@ -267,7 +267,7 @@ SeekableReadStream *SearchSet::createReadStreamForMember(const String &name) con
SearchManager::SearchManager() {
- clear(); // Force a reset
+ clear(); // Force a reset
}
void SearchManager::clear() {
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index fdd0c6f033..082f261f51 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -85,7 +85,7 @@ void ConfigManager::loadDefaultConfigFile() {
// Open the default config file
assert(g_system);
SeekableReadStream *stream = g_system->createConfigReadStream();
- _filename.clear(); // clear the filename to indicate that we are using the default config file
+ _filename.clear(); // clear the filename to indicate that we are using the default config file
// ... load it, if available ...
if (stream) {
@@ -321,7 +321,7 @@ void ConfigManager::flushToDisk() {
void ConfigManager::writeDomain(WriteStream &stream, const String &name, const Domain &domain) {
if (domain.empty())
- return; // Don't bother writing empty domains.
+ return; // Don't bother writing empty domains.
// WORKAROUND: Fix for bug #1972625 "ALL: On-the-fly targets are
// written to the config file": Do not save domains that came from
diff --git a/common/config-manager.h b/common/config-manager.h
index 669faaaf88..58f4373dde 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -171,7 +171,7 @@ public:
DomainMap::iterator beginGameDomains() { return _gameDomains.begin(); }
DomainMap::iterator endGameDomains() { return _gameDomains.end(); }
- static void defragment(); // move in memory to reduce fragmentation
+ static void defragment(); // move in memory to reduce fragmentation
void copyFrom(ConfigManager &source);
private:
@@ -185,7 +185,7 @@ private:
Domain _transientDomain;
DomainMap _gameDomains;
- DomainMap _miscDomains; // Any other domains
+ DomainMap _miscDomains; // Any other domains
Domain _appDomain;
Domain _defaultsDomain;
diff --git a/common/fs.h b/common/fs.h
index f516bf7a9c..ed287cc17a 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -269,7 +269,7 @@ public:
class FSDirectory : public Archive {
FSNode _node;
- String _prefix; // string that is prepended to each cache item key
+ String _prefix; // string that is prepended to each cache item key
void setPrefix(const String &prefix);
// Caches are case insensitive, clashes are dealt with when creating
diff --git a/common/hash-str.h b/common/hash-str.h
index 82af6cca93..fcd41ab6a7 100644
--- a/common/hash-str.h
+++ b/common/hash-str.h
@@ -29,11 +29,10 @@
namespace Common {
uint hashit(const char *str);
-uint hashit_lower(const char *str); // Generate a hash based on the lowercase version of the string
+uint hashit_lower(const char *str); // Generate a hash based on the lowercase version of the string
inline uint hashit(const String &str) { return hashit(str.c_str()); }
inline uint hashit_lower(const String &str) { return hashit_lower(str.c_str()); }
-
// FIXME: The following functors obviously are not consistently named
struct CaseSensitiveString_EqualTo {
@@ -53,8 +52,6 @@ struct IgnoreCase_Hash {
uint operator()(const String& x) const { return hashit_lower(x.c_str()); }
};
-
-
// Specalization of the Hash functor for String objects.
// We do case sensitve hashing here, because that is what
// the default EqualTo is compatible with. If one wants to use
@@ -78,9 +75,6 @@ struct Hash<const char *> {
// String map -- by default case insensitive
typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
-
-
} // End of namespace Common
-
#endif
diff --git a/common/hashmap.cpp b/common/hashmap.cpp
index 99840993ce..e9eac9fc94 100644
--- a/common/hashmap.cpp
+++ b/common/hashmap.cpp
@@ -95,10 +95,10 @@ void updateHashCollisionStats(int collisions, int dummyHits, int lookups, int ar
g_size / g_totalHashmaps, g_max_size,
g_capacity / g_totalHashmaps, g_max_capacity);
debug(" %d less than %d; %d less than %d; %d less than %d; %d less than %d",
- g_stats[0], 2*8/3,
- g_stats[1],2*16/3,
- g_stats[2],2*32/3,
- g_stats[3],2*64/3);
+ g_stats[0], 2 * 8 / 3,
+ g_stats[1], 2 * 16 / 3,
+ g_stats[2], 2 * 32 / 3,
+ g_stats[3], 2 * 64 / 3);
// TODO:
// * Should record the maximal size of the map during its lifetime, not that at its death
diff --git a/common/hashmap.h b/common/hashmap.h
index d7ba100571..08651a8b01 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -355,7 +355,7 @@ HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
delete[] _storage;
#ifdef DEBUG_HASH_COLLISIONS
extern void updateHashCollisionStats(int, int, int, int, int);
- updateHashCollisionStats(_collisions, _dummyHits, _lookups, _mask+1, _size);
+ updateHashCollisionStats(_collisions, _dummyHits, _lookups, _mask + 1, _size);
#endif
}
@@ -369,9 +369,9 @@ HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t &map) {
_mask = map._mask;
- _storage = new Node *[_mask+1];
+ _storage = new Node *[_mask + 1];
assert(_storage != NULL);
- memset(_storage, 0, (_mask+1) * sizeof(Node *));
+ memset(_storage, 0, (_mask + 1) * sizeof(Node *));
// Simply clone the map given to us, one by one.
_size = 0;
@@ -418,7 +418,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::clear(bool shrinkArray) {
template<class Key, class Val, class HashFunc, class EqualFunc>
void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
- assert(newCapacity > _mask+1);
+ assert(newCapacity > _mask + 1);
#ifndef NDEBUG
const size_type old_size = _size;
@@ -487,7 +487,7 @@ typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, Has
_lookups++;
debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
- (const void *)this, _mask+1, _size);
+ (const void *)this, _mask + 1, _size);
#endif
return ctr;
@@ -525,7 +525,7 @@ typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, Has
_lookups++;
debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
- (const void *)this, _mask+1, _size);
+ (const void *)this, _mask + 1, _size);
#endif
if (!found && first_free != _mask + 1)
diff --git a/common/list.h b/common/list.h
index 1bb4a2a5df..31cf161d22 100644
--- a/common/list.h
+++ b/common/list.h
@@ -170,7 +170,7 @@ public:
const_iterator i2;
const_iterator e2 = list.end();
- for (i = begin(), i2 = list.begin(); (i != e) && (i2 != e2) ; ++i, ++i2) {
+ for (i = begin(), i2 = list.begin(); (i != e) && (i2 != e2); ++i, ++i2) {
static_cast<Node *>(i._node)->_data = static_cast<const Node *>(i2._node)->_data;
}
diff --git a/common/memorypool.cpp b/common/memorypool.cpp
index 1a9bfe2e29..b947b38306 100644
--- a/common/memorypool.cpp
+++ b/common/memorypool.cpp
@@ -64,7 +64,7 @@ void MemoryPool::allocPage() {
// Allocate a new page
page.numChunks = _chunksPerPage;
- assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
+ assert(page.numChunks * _chunkSize < 16*1024*1024); // Refuse to allocate pages bigger than 16 MB
page.start = ::malloc(page.numChunks * _chunkSize);
assert(page.start);
diff --git a/common/memstream.h b/common/memstream.h
index f6bf990208..0d7375b6b5 100644
--- a/common/memstream.h
+++ b/common/memstream.h
@@ -289,8 +289,8 @@ public:
return dataSize;
}
- int32 pos() const { return _pos - _length; } //'read' position in the stream
- int32 size() const { return _size; } //that's also 'write' position in the stream, as it's append-only
+ int32 pos() const { return _pos - _length; } // 'read' position in the stream
+ int32 size() const { return _size; } // that's also 'write' position in the stream, as it's append-only
bool seek(int32, int) { return false; }
bool eos() const { return _eos; }
void clearErr() { _eos = false; }
diff --git a/common/recorderfile.cpp b/common/recorderfile.cpp
index 7552cd45b3..3db017ea8b 100644
--- a/common/recorderfile.cpp
+++ b/common/recorderfile.cpp
@@ -335,7 +335,7 @@ RecorderEvent PlaybackFile::getNextEvent() {
case kScreenShotTag:
_readStream->seek(-4, SEEK_CUR);
header.len = _readStream->readUint32BE();
- _readStream->skip(header.len-8);
+ _readStream->skip(header.len - 8);
break;
case kMD5Tag:
checkRecordedMD5();
@@ -575,7 +575,7 @@ int PlaybackFile::getScreensCount() {
int result = 0;
while (skipToNextScreenshot()) {
uint32 size = _readStream->readUint32BE();
- _readStream->skip(size-8);
+ _readStream->skip(size - 8);
++result;
}
return result;
@@ -612,7 +612,7 @@ Graphics::Surface *PlaybackFile::getScreenShot(int number) {
return Graphics::loadThumbnail(*_readStream, thumbnail) ? thumbnail : NULL;
} else {
uint32 size = _readStream->readUint32BE();
- _readStream->skip(size-8);
+ _readStream->skip(size - 8);
screenCount++;
}
}
diff --git a/common/rect.h b/common/rect.h
index 6c4292c7af..135076bf1e 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -40,10 +40,10 @@ struct Point {
Point() : x(0), y(0) {}
Point(int16 x1, int16 y1) : x(x1), y(y1) {}
- bool operator==(const Point &p) const { return x == p.x && y == p.y; }
- bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
- Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
- Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
+ bool operator==(const Point &p) const { return x == p.x && y == p.y; }
+ bool operator!=(const Point &p) const { return x != p.x || y != p.y; }
+ Point operator+(const Point &delta) const { return Point(x + delta.x, y + delta.y); }
+ Point operator-(const Point &delta) const { return Point(x - delta.x, y - delta.y); }
void operator+=(const Point &delta) {
x += delta.x;
diff --git a/common/serializer.h b/common/serializer.h
index e8db40923a..18fb38563b 100644
--- a/common/serializer.h
+++ b/common/serializer.h
@@ -34,7 +34,7 @@ namespace Common {
template<typename T> \
void syncAs ## SUFFIX(T &val, Version minVersion = 0, Version maxVersion = kLastVersion) { \
if (_version < minVersion || _version > maxVersion) \
- return; \
+ return; \
if (_loadStream) \
val = static_cast<T>(_loadStream->read ## SUFFIX()); \
else { \
@@ -178,7 +178,7 @@ public:
*/
void skip(uint32 size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
_bytesSynced += size;
if (isLoading())
@@ -194,7 +194,7 @@ public:
*/
void syncBytes(byte *buf, uint32 size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
if (isLoading())
_loadStream->read(buf, size);
@@ -217,7 +217,7 @@ public:
*/
bool matchBytes(const char *magic, byte size, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return true; // Ignore anything which is not supposed to be present in this save game version
+ return true; // Ignore anything which is not supposed to be present in this save game version
bool match;
if (isSaving()) {
@@ -238,7 +238,7 @@ public:
*/
void syncString(String &str, Version minVersion = 0, Version maxVersion = kLastVersion) {
if (_version < minVersion || _version > maxVersion)
- return; // Ignore anything which is not supposed to be present in this save game version
+ return; // Ignore anything which is not supposed to be present in this save game version
if (isLoading()) {
char c;
diff --git a/common/str.cpp b/common/str.cpp
index 2ef67175cd..7d40aebf94 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -63,7 +63,7 @@ void String::initWithCStr(const char *str, uint32 len) {
if (len >= _builtinCapacity) {
// Not enough internal storage, so allocate more
- _extern._capacity = computeCapacity(len+1);
+ _extern._capacity = computeCapacity(len + 1);
_extern._refCount = 0;
_str = new char[_extern._capacity];
assert(_str != 0);
@@ -593,7 +593,7 @@ String String::vformat(const char *fmt, va_list args) {
// vsnprintf didn't have enough space, so grow buffer
output.ensureCapacity(len, false);
scumm_va_copy(va, args);
- int len2 = vsnprintf(output._str, len+1, fmt, va);
+ int len2 = vsnprintf(output._str, len + 1, fmt, va);
va_end(va);
assert(len == len2);
output._size = len2;
@@ -741,7 +741,7 @@ String lastPathComponent(const String &path, const char sep) {
const char *last = str + path.size();
// Skip over trailing slashes
- while (last > str && *(last-1) == sep)
+ while (last > str && *(last - 1) == sep)
--last;
// Path consisted of only slashes -> return empty string
@@ -1010,7 +1010,7 @@ int scumm_strnicmp(const char *s1, const char *s2, uint n) {
byte l1, l2;
do {
if (n-- == 0)
- return 0; // no difference found so far -> signal equality
+ return 0; // no difference found so far -> signal equality
// Don't use ++ inside tolower, in case the macro uses its
// arguments more than once.
diff --git a/common/str.h b/common/str.h
index fd77fa90c8..cf7fc34f6b 100644
--- a/common/str.h
+++ b/common/str.h
@@ -285,7 +285,7 @@ public:
* except that it stores the result in (variably sized) String
* instead of a fixed size buffer.
*/
- static String format(const char *fmt, ...) GCC_PRINTF(1,2);
+ static String format(const char *fmt, ...) GCC_PRINTF(1, 2);
/**
* Print formatted data into a String object. Similar to vsprintf,
diff --git a/common/stream.cpp b/common/stream.cpp
index 8d93888020..0a5fa94ac3 100644
--- a/common/stream.cpp
+++ b/common/stream.cpp
@@ -99,7 +99,7 @@ bool MemoryReadStream::seek(int32 offs, int whence) {
// Reset end-of-stream flag on a successful seek
_eos = false;
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
bool MemoryWriteStreamDynamic::seek(int32 offs, int whence) {
@@ -124,7 +124,7 @@ bool MemoryWriteStreamDynamic::seek(int32 offs, int whence) {
// Post-Condition
assert(_pos <= _size);
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
#pragma mark -
@@ -413,7 +413,7 @@ BufferedSeekableReadStream::BufferedSeekableReadStream(SeekableReadStream *paren
bool BufferedSeekableReadStream::seek(int32 offset, int whence) {
// If it is a "local" seek, we may get away with "seeking" around
// in the buffer only.
- _eos = false; // seeking always cancels EOS
+ _eos = false; // seeking always cancels EOS
int relOffset = 0;
switch (whence) {
diff --git a/common/updates.cpp b/common/updates.cpp
index 087002a7d3..4e4ed53b8f 100644
--- a/common/updates.cpp
+++ b/common/updates.cpp
@@ -47,7 +47,7 @@ int UpdateManager::normalizeInterval(int interval) {
val++;
}
- return val[-1]; // Return maximal acceptable value
+ return val[-1]; // Return maximal acceptable value
}
const char *UpdateManager::updateIntervalToString(int interval) {
diff --git a/common/updates.h b/common/updates.h
index 3a3049d4df..812aac718e 100644
--- a/common/updates.h
+++ b/common/updates.h
@@ -50,7 +50,7 @@ public:
kUpdateIntervalNotSupported = 0,
kUpdateIntervalOneDay = 86400,
kUpdateIntervalOneWeek = 604800,
- kUpdateIntervalOneMonth = 2628000 // average seconds per month (60*60*24*365)/12
+ kUpdateIntervalOneMonth = 2628000 // average seconds per month (60*60*24*365)/12
};
UpdateManager() {}
diff --git a/common/ustr.cpp b/common/ustr.cpp
index 35b5502a6d..e5c674f595 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -239,7 +239,7 @@ void U32String::ensureCapacity(uint32 new_size, bool keep_old) {
if (new_size < curCapacity)
newCapacity = curCapacity;
else
- newCapacity = MAX(curCapacity * 2, computeCapacity(new_size+1));
+ newCapacity = MAX(curCapacity * 2, computeCapacity(new_size + 1));
// Allocate new storage
newStorage = new value_type[newCapacity];
@@ -316,7 +316,7 @@ void U32String::initWithCStr(const value_type *str, uint32 len) {
if (len >= _builtinCapacity) {
// Not enough internal storage, so allocate more
- _extern._capacity = computeCapacity(len+1);
+ _extern._capacity = computeCapacity(len + 1);
_extern._refCount = 0;
_str = new value_type[_extern._capacity];
assert(_str != 0);
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index 4470180710..84646ffa95 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -373,7 +373,7 @@ bool XMLParser::parse() {
break;
}
} else {
- ParserNode *node = allocNode(); //new ParserNode;
+ ParserNode *node = allocNode(); // new ParserNode;
node->name = _token;
node->ignore = false;
node->header = activeHeader;
diff --git a/common/zlib.cpp b/common/zlib.cpp
index 39130beb4e..8ea5d6c424 100644
--- a/common/zlib.cpp
+++ b/common/zlib.cpp
@@ -281,7 +281,7 @@ public:
_wrapped->seek(0, SEEK_SET);
_zlibErr = inflateReset(&_stream);
if (_zlibErr != Z_OK)
- return false; // FIXME: STREAM REWRITE
+ return false; // FIXME: STREAM REWRITE
_stream.next_in = _buf;
_stream.avail_in = 0;
}
@@ -297,7 +297,7 @@ public:
}
_eos = false;
- return true; // FIXME: STREAM REWRITE
+ return true; // FIXME: STREAM REWRITE
}
};
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 2b84c21894..2abe0e0759 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -437,7 +437,7 @@ public:
void drawCallback_ALPHABITMAP(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) {
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
- blitAlphaBitmap(step.blitAlphaSrc, Common::Rect(x, y, x + w, y + h), step.autoscale, step.xAlign, step.yAlign); //TODO
+ blitAlphaBitmap(step.blitAlphaSrc, Common::Rect(x, y, x + w, y + h), step.autoscale, step.xAlign, step.yAlign); // TODO
}
void drawCallback_CROSS(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) {
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index c66bb2e9af..e308dde821 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -419,7 +419,7 @@ inline frac_t fp_sqroot(uint32 x) {
x--; px -= pitch; \
} \
a2 = (T >> 8); \
- a1 = ~a2; \
+ a1 = ~a2; \
} while (0)
@@ -2680,7 +2680,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
int gradient = (dx << 8) / (dy + 0x100);
int interx = (x1 << 8) + gradient;
#else
- double gradient = dx / (dy+1);
+ double gradient = dx / (dy + 1);
double interx = x1 + gradient;
#endif
@@ -2846,7 +2846,7 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
break;
case kFillForeground:
case kFillBackground:
- colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right+1, y_right, _clippingArea);
+ colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right + 1, y_right, _clippingArea);
blendPixelPtrClip(ptr_right, color, rfpart(intery), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(intery), x_left, y_left);
break;
@@ -2905,7 +2905,7 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
break;
case kFillForeground:
case kFillBackground:
- colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right+1, y_right, _clippingArea);
+ colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right + 1, y_right, _clippingArea);
blendPixelPtrClip(ptr_right, color, rfpart(interx), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(interx), x_left, y_left);
break;
@@ -2953,7 +2953,7 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
break;
case kFillForeground:
case kFillBackground:
- colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right+1, y_right, _clippingArea);
+ colorFillClip<PixelType>(ptr_right + 1, ptr_left, color, x_right + 1, y_right, _clippingArea);
blendPixelPtrClip(ptr_right, color, rfpart(interx), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(interx), x_left, y_left);
break;
@@ -3061,10 +3061,10 @@ drawBorderRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color,
BE_RESET();
r--;
- int alphaStep_tr = ((alpha_t - alpha_r)/(y+1));
- int alphaStep_br = ((alpha_r - alpha_b)/(y+1));
- int alphaStep_bl = ((alpha_b - alpha_l)/(y+1));
- int alphaStep_tl = ((alpha_l - alpha_t)/(y+1));
+ int alphaStep_tr = ((alpha_t - alpha_r) / (y + 1));
+ int alphaStep_br = ((alpha_r - alpha_b) / (y + 1));
+ int alphaStep_bl = ((alpha_b - alpha_l) / (y + 1));
+ int alphaStep_tl = ((alpha_l - alpha_t) / (y + 1));
// Avoid blending the last pixels twice, since we have an alpha
while (x++ < (y - 2)) {
@@ -3970,10 +3970,10 @@ drawBorderRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color,
px = pitch * x;
py = 0;
- int alphaStep_tr = ((alpha_t - alpha_r)/(x+1));
- int alphaStep_br = ((alpha_r - alpha_b)/(x+1));
- int alphaStep_bl = ((alpha_b - alpha_l)/(x+1));
- int alphaStep_tl = ((alpha_l - alpha_t)/(x+1));
+ int alphaStep_tr = ((alpha_t - alpha_r) / (x + 1));
+ int alphaStep_br = ((alpha_r - alpha_b) / (x + 1));
+ int alphaStep_bl = ((alpha_b - alpha_l) / (x + 1));
+ int alphaStep_tl = ((alpha_l - alpha_t) / (x + 1));
while (x > y++) {
WU_ALGORITHM();
diff --git a/graphics/fonts/bdf.h b/graphics/fonts/bdf.h
index d99b5fd401..c903d52c55 100644
--- a/graphics/fonts/bdf.h
+++ b/graphics/fonts/bdf.h
@@ -85,9 +85,9 @@ private:
};
#define DEFINE_FONT(n) \
- const BdfFont *n = 0; \
+ const BdfFont *n = 0; \
void create_##n() { \
- n = new BdfFont(desc, DisposeAfterUse::NO); \
+ n = new BdfFont(desc, DisposeAfterUse::NO); \
}
#define FORWARD_DECLARE_FONT(n) \
diff --git a/graphics/nine_patch.cpp b/graphics/nine_patch.cpp
index 56e1202be3..ce82fff61e 100644
--- a/graphics/nine_patch.cpp
+++ b/graphics/nine_patch.cpp
@@ -156,7 +156,7 @@ NinePatchBitmap::NinePatchBitmap(Graphics::TransparentSurface *bmp, bool owns_bi
bmp->format.colorToARGB(*(uint32 *)bmp->getBasePtr(x, y), a, r, g, b); \
if (a != 0 && r + g + b + a != 4) goto bad_bitmap;
- _check_pixel(0,0);
+ _check_pixel(0, 0);
_check_pixel(bmp->w - 1, 0);
_check_pixel(0, bmp->h - 1);
_check_pixel(bmp->w - 1, bmp->h - 1);
diff --git a/graphics/primitives.cpp b/graphics/primitives.cpp
index 8663a61606..76c44b650d 100644
--- a/graphics/primitives.cpp
+++ b/graphics/primitives.cpp
@@ -262,13 +262,13 @@ void drawRoundRect(Common::Rect &rect, int arc, int color, bool filled, void (*p
do {
if (filled) {
- drawHLine(rect.left+x+r, rect.right-x-r, rect.top-y+r-stop, color, plotProc, data);
- drawHLine(rect.left+x+r, rect.right-x-r, rect.bottom+y-r+stop, color, plotProc, data);
+ drawHLine(rect.left + x + r, rect.right - x - r, rect.top - y + r - stop, color, plotProc, data);
+ drawHLine(rect.left + x + r, rect.right - x - r, rect.bottom + y - r + stop, color, plotProc, data);
} else {
- (*plotProc)(rect.left+x+r, rect.top-y+r-stop, color, data);
- (*plotProc)(rect.right-x-r, rect.top-y+r-stop, color, data);
- (*plotProc)(rect.left+x+r, rect.bottom+y-r+stop, color, data);
- (*plotProc)(rect.right-x-r, rect.bottom+y-r+stop, color, data);
+ (*plotProc)(rect.left + x + r, rect.top - y + r - stop, color, data);
+ (*plotProc)(rect.right - x - r, rect.top - y + r - stop, color, data);
+ (*plotProc)(rect.left + x + r, rect.bottom + y - r + stop, color, data);
+ (*plotProc)(rect.right - x - r, rect.bottom + y - r + stop, color, data);
lastx = x;
lasty = y;
@@ -284,15 +284,15 @@ void drawRoundRect(Common::Rect &rect, int arc, int color, bool filled, void (*p
x = lastx;
y = lasty;
- drawHLine(rect.left+x+r, rect.right-x-r, rect.top-y+r-stop, color, plotProc, data);
- drawHLine(rect.left+x+r, rect.right-x-r, rect.bottom+y-r+stop, color, plotProc, data);
+ drawHLine(rect.left + x + r, rect.right - x - r, rect.top - y + r - stop, color, plotProc, data);
+ drawHLine(rect.left + x + r, rect.right - x - r, rect.bottom + y - r + stop, color, plotProc, data);
}
for (int i = 0; i < dy; i++) {
if (filled) {
drawHLine(rect.left, rect.right, rect.top + r + i, color, plotProc, data);
} else {
- (*plotProc)(rect.left, rect.top + r + i, color, data);
+ (*plotProc)(rect.left, rect.top + r + i, color, data);
(*plotProc)(rect.right, rect.top + r + i, color, data);
}
}
@@ -307,13 +307,13 @@ void drawRoundRect(Common::Rect &rect, int arc, int color, bool filled, void (*p
do {
if (filled) {
- drawVLine(rect.left-x+r-stop, rect.top+y+r, rect.bottom-y-r, color, plotProc, data);
- drawVLine(rect.right+x-r+stop, rect.top+y+r, rect.bottom-y-r, color, plotProc, data);
+ drawVLine(rect.left - x + r - stop, rect.top + y + r, rect.bottom - y - r, color, plotProc, data);
+ drawVLine(rect.right + x - r + stop, rect.top + y + r, rect.bottom - y - r, color, plotProc, data);
} else {
- (*plotProc)(rect.left-x+r-stop, rect.top+y+r, color, data);
- (*plotProc)(rect.left-x+r-stop, rect.bottom-y-r, color, data);
- (*plotProc)(rect.right+x-r+stop, rect.top+y+r, color, data);
- (*plotProc)(rect.right+x-r+stop, rect.bottom-y-r, color, data);
+ (*plotProc)(rect.left - x + r - stop, rect.top + y + r, color, data);
+ (*plotProc)(rect.left - x + r - stop, rect.bottom - y - r, color, data);
+ (*plotProc)(rect.right + x - r + stop, rect.top + y + r, color, data);
+ (*plotProc)(rect.right + x - r + stop, rect.bottom - y - r, color, data);
lastx = x;
lasty = y;
@@ -329,15 +329,15 @@ void drawRoundRect(Common::Rect &rect, int arc, int color, bool filled, void (*p
if (!filled) {
x = lastx;
y = lasty;
- drawVLine(rect.left-x+r-stop, rect.top+y+r, rect.bottom-y-r, color, plotProc, data);
- drawVLine(rect.right+x-r+stop, rect.top+y+r, rect.bottom-y-r, color, plotProc, data);
+ drawVLine(rect.left - x + r - stop, rect.top + y + r, rect.bottom - y - r, color, plotProc, data);
+ drawVLine(rect.right + x - r + stop, rect.top + y + r, rect.bottom - y - r, color, plotProc, data);
}
for (int i = 0; i < dx; i++) {
if (filled) {
drawVLine(rect.left + r + i, rect.top, rect.bottom, color, plotProc, data);
} else {
- (*plotProc)(rect.left + r + i, rect.top, color, data);
+ (*plotProc)(rect.left + r + i, rect.top, color, data);
(*plotProc)(rect.left + r + i, rect.bottom, color, data);
}
}
@@ -385,14 +385,14 @@ void drawPolygonScan(int *polyX, int *polyY, int npoints, Common::Rect &bbox, in
// http://members.chello.at/easyfilter/bresenham.html
void drawEllipse(int x0, int y0, int x1, int y1, int color, bool filled, void (*plotProc)(int, int, int, void *), void *data) {
- int a = abs(x1-x0), b = abs(y1-y0), b1 = b&1; /* values of diameter */
- long dx = 4*(1-a)*b*b, dy = 4*(b1+1)*a*a; /* error increment */
- long err = dx+dy+b1*a*a, e2; /* error of 1.step */
+ int a = abs(x1 - x0), b = abs(y1 - y0), b1 = b & 1; /* values of diameter */
+ long dx = 4 * (1 - a) * b * b, dy = 4 * (b1 + 1) * a * a; /* error increment */
+ long err = dx + dy + b1 * a * a, e2; /* error of 1.step */
if (x0 > x1) { x0 = x1; x1 += a; } /* if called with swapped points */
if (y0 > y1) y0 = y1; /* .. exchange them */
- y0 += (b+1)/2; y1 = y0-b1; /* starting pixel */
- a *= 8*a; b1 = 8*b*b;
+ y0 += (b + 1) / 2; y1 = y0 - b1; /* starting pixel */
+ a *= 8 * a; b1 = 8 * b * b;
do {
if (filled) {
@@ -411,15 +411,15 @@ void drawEllipse(int x0, int y0, int x1, int y1, int color, bool filled, void (*
while (y0-y1 < b) { /* too early stop of flat ellipses a=1 */
if (filled) {
- drawHLine(x0-1, x0-1, y0, color, plotProc, data); /* -> finish tip of ellipse */
- drawHLine(x1+1, x1+1, y0, color, plotProc, data);
- drawHLine(x0-1, x0-1, y1, color, plotProc, data);
- drawHLine(x1+1, x1+1, y1, color, plotProc, data);
+ drawHLine(x0 - 1, x0 - 1, y0, color, plotProc, data); /* -> finish tip of ellipse */
+ drawHLine(x1 + 1, x1 + 1, y0, color, plotProc, data);
+ drawHLine(x0 - 1, x0 - 1, y1, color, plotProc, data);
+ drawHLine(x1 + 1, x1 + 1, y1, color, plotProc, data);
} else {
- (*plotProc)(x0-1, y0, color, data); /* -> finish tip of ellipse */
- (*plotProc)(x1+1, y0, color, data);
- (*plotProc)(x0-1, y1, color, data);
- (*plotProc)(x1+1, y1, color, data);
+ (*plotProc)(x0 - 1, y0, color, data); /* -> finish tip of ellipse */
+ (*plotProc)(x1 + 1, y0, color, data);
+ (*plotProc)(x0 - 1, y1, color, data);
+ (*plotProc)(x1 + 1, y1, color, data);
}
y0++;
y1--;
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 745988cbd9..a3ac7fc107 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -107,12 +107,12 @@ void InitLUT(Graphics::PixelFormat format) {
hqx_low2bits = (3 << format.rShift) | (3 << format.gShift) | (3 << format.bShift),
hqx_low3bits = (7 << format.rShift) | (7 << format.gShift) | (7 << format.bShift),
- hqx_highbits = format.RGBToColor(255,255,255) ^ hqx_lowbits;
+ hqx_highbits = format.RGBToColor(255, 255, 255) ^ hqx_lowbits;
// FIXME: The following code only does the right thing
// if the color order is RGB or BGR, i.e., green is in the middle.
- hqx_greenMask = format.RGBToColor(0,255,0);
- hqx_redBlueMask = format.RGBToColor(255,0,255);
+ hqx_greenMask = format.RGBToColor( 0, 255, 0);
+ hqx_redBlueMask = format.RGBToColor(255, 0, 255);
hqx_green_redBlue_Mask = (hqx_greenMask << 16) | hqx_redBlueMask;
#endif
@@ -145,10 +145,10 @@ void InitScalers(uint32 BitFormat) {
#endif
// Build dotmatrix lookup table for the DotMatrix scaler.
- g_dotmatrix[0] = g_dotmatrix[10] = format.RGBToColor(0, 63, 0);
- g_dotmatrix[1] = g_dotmatrix[11] = format.RGBToColor(0, 0, 63);
- g_dotmatrix[2] = g_dotmatrix[8] = format.RGBToColor(63, 0, 0);
- g_dotmatrix[4] = g_dotmatrix[6] =
+ g_dotmatrix[0] = g_dotmatrix[10] = format.RGBToColor( 0, 63, 0);
+ g_dotmatrix[1] = g_dotmatrix[11] = format.RGBToColor( 0, 0, 63);
+ g_dotmatrix[2] = g_dotmatrix[ 8] = format.RGBToColor(63, 0, 0);
+ g_dotmatrix[4] = g_dotmatrix[ 6] =
g_dotmatrix[12] = g_dotmatrix[14] = format.RGBToColor(63, 63, 63);
}
diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h
index eddc3c7f3d..213b69b049 100644
--- a/graphics/scaler/intern.h
+++ b/graphics/scaler/intern.h
@@ -195,18 +195,18 @@ static inline bool diffYUV(int yuv1, int yuv2) {
int mask;
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;
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;
return false;
diff --git a/graphics/scaler/scalebit.cpp b/graphics/scaler/scalebit.cpp
index c8b54f4b25..bcba5793e2 100644
--- a/graphics/scaler/scalebit.cpp
+++ b/graphics/scaler/scalebit.cpp
@@ -47,17 +47,17 @@
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row) {
switch (pixel) {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
- case 1 : scale2x_8_mmx(DST(8,0), DST(8,1), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
- case 2 : scale2x_16_mmx(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
- case 4 : scale2x_32_mmx(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
+ case 1: scale2x_8_mmx( DST( 8,0), DST( 8,1), SRC( 8,0), SRC( 8,1), SRC( 8,2), pixel_per_row); break;
+ case 2: scale2x_16_mmx(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
+ case 4: scale2x_32_mmx(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
#elif defined(USE_ARM_SCALER_ASM)
- case 1 : scale2x_8_arm(DST(8,0), DST(8,1), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
- case 2 : scale2x_16_arm(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
- case 4 : scale2x_32_arm(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
+ case 1: scale2x_8_arm( DST( 8,0), DST( 8,1), SRC( 8,0), SRC( 8,1), SRC( 8,2), pixel_per_row); break;
+ case 2: scale2x_16_arm(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
+ case 4: scale2x_32_arm(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
#else
- case 1 : scale2x_8_def(DST(8,0), DST(8,1), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
- case 2 : scale2x_16_def(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
- case 4 : scale2x_32_def(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
+ case 1: scale2x_8_def( DST( 8,0), DST( 8,1), SRC( 8,0), SRC( 8,1), SRC( 8,2), pixel_per_row); break;
+ case 2: scale2x_16_def(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
+ case 4: scale2x_32_def(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
#endif
}
}
@@ -67,9 +67,9 @@ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const
*/
static inline void stage_scale3x(void* dst0, void* dst1, void* dst2, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row) {
switch (pixel) {
- case 1 : scale3x_8_def(DST(8,0), DST(8,1), DST(8,2), SRC(8,0), SRC(8,1), SRC(8,2), pixel_per_row); break;
- case 2 : scale3x_16_def(DST(16,0), DST(16,1), DST(16,2), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
- case 4 : scale3x_32_def(DST(32,0), DST(32,1), DST(32,2), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
+ case 1: scale3x_8_def( DST( 8,0), DST( 8,1), DST( 8,2), SRC( 8,0), SRC( 8,1), SRC( 8,2), pixel_per_row); break;
+ case 2: scale3x_16_def(DST(16,0), DST(16,1), DST(16,2), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
+ case 4: scale3x_32_def(DST(32,0), DST(32,1), DST(32,2), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
}
}
@@ -281,12 +281,12 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
return -1;
switch (scale) {
- case 2 :
- case 3 :
+ case 2:
+ case 3:
if (height < 2)
return -1;
break;
- case 4 :
+ case 4:
if (height < 4)
return -1;
break;
@@ -294,14 +294,14 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
switch (scale) {
- case 2 :
- case 4 :
+ case 2:
+ case 4:
if (width < (16 / pixel))
return -1;
if (width % (8 / pixel) != 0)
return -1;
break;
- case 3 :
+ case 3:
if (width < 2)
return -1;
break;
@@ -329,13 +329,13 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height)
{
switch (scale) {
- case 2 :
+ case 2:
scale2x(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
break;
- case 3 :
+ case 3:
scale3x(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
break;
- case 4 :
+ case 4:
scale4x(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
break;
}
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 45cf1cee90..877f314c69 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -334,16 +334,16 @@ const uint8 *FontTowns::getCharData(uint16 ch) const {
if (f >= 0xe0 && f <= 0xea) kanjiType = EKANJI;
if ((f > 0xe8 || (f == 0xe8 && base >= 0x9f)) || (f > 0x90 || (f == 0x90 && base >= 0x9f))) {
- c = 48; //correction
- p = -8; //correction
+ c = 48; // correction
+ p = -8; // correction
}
- if (kanjiType == KANA) {//Kana
+ if (kanjiType == KANA) {
chunk_f = (f - 0x81) * 2;
- } else if (kanjiType == KANJI) {//Standard Kanji
+ } else if (kanjiType == KANJI) { // Standard Kanji
p += f - 0x88;
chunk_f = c + 2 * p;
- } else if (kanjiType == EKANJI) {//Enhanced Kanji
+ } else if (kanjiType == EKANJI) { // Enhanced Kanji
p += f - 0xe0;
chunk_f = c + 2 * p;
}
@@ -360,37 +360,37 @@ const uint8 *FontTowns::getCharData(uint16 ch) const {
switch (base) {
case 0x3f:
- cr = 0; //3f
+ cr = 0; // 3f
if (kanjiType == KANA) chunk = 1;
else if (kanjiType == KANJI) chunk = 31;
else if (kanjiType == EKANJI) chunk = 111;
break;
case 0x5f:
- cr = 0; //5f
+ cr = 0; // 5f
if (kanjiType == KANA) chunk = 17;
else if (kanjiType == KANJI) chunk = 47;
else if (kanjiType == EKANJI) chunk = 127;
break;
case 0x7f:
- cr = -1; //80
+ cr = -1; // 80
if (kanjiType == KANA) chunk = 9;
else if (kanjiType == KANJI) chunk = 63;
else if (kanjiType == EKANJI) chunk = 143;
break;
case 0x9f:
- cr = 1; //9e
+ cr = 1; // 9e
if (kanjiType == KANA) chunk = 2;
else if (kanjiType == KANJI) chunk = 32;
else if (kanjiType == EKANJI) chunk = 112;
break;
case 0xbf:
- cr = 1; //be
+ cr = 1; // be
if (kanjiType == KANA) chunk = 18;
else if (kanjiType == KANJI) chunk = 48;
else if (kanjiType == EKANJI) chunk = 128;
break;
case 0xdf:
- cr = 1; //de
+ cr = 1; // de
if (kanjiType == KANA) chunk = 10;
else if (kanjiType == KANJI) chunk = 64;
else if (kanjiType == EKANJI) chunk = 144;