[Scummvm-cvs-logs] SF.net SVN: scummvm: [23582] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Jul 23 17:08:59 CEST 2006
Revision: 23582
Author: fingolfin
Date: 2006-07-23 08:08:48 -0700 (Sun, 23 Jul 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23582&view=rev
Log Message:
-----------
String class usage cleanup
Modified Paths:
--------------
scummvm/trunk/common/hashmap.cpp
scummvm/trunk/engines/gob/gob.cpp
scummvm/trunk/engines/kyra/resource.cpp
scummvm/trunk/gui/ThemeClassic.cpp
scummvm/trunk/gui/ThemeNew.cpp
scummvm/trunk/gui/newgui.cpp
Modified: scummvm/trunk/common/hashmap.cpp
===================================================================
--- scummvm/trunk/common/hashmap.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/common/hashmap.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -57,21 +57,16 @@
uint hashit(const char *p) {
uint hash = 0;
byte c;
-
- hash = 0;
while ((c = *p++))
hash = (hash * 31 + c);
-
return hash;
}
uint hashit_lower(const char *p) {
uint hash = 0;
byte c;
-
while ((c = *p++))
hash = (hash * 31 + tolower(c));
-
return hash;
}
Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/engines/gob/gob.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -47,6 +47,8 @@
#include "gob/util.h"
#include "gob/music.h"
+#include "sound/mididrv.h"
+
namespace Gob {
enum {
@@ -228,7 +230,7 @@
else
error("GobEngine::init(): Unknown version of game engine");
if ((_features & Gob::GF_MAC) || (_features & Gob::GF_GOB1) || (_features & Gob::GF_GOB2)) {
- if (ConfMan.get("music_driver") == "null")
+ if (MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL)
_music = new Music_Dummy(this);
else
_music = new Music(this);
Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/engines/kyra/resource.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -373,12 +373,12 @@
bool PAKFile::openFile(Common::File &filehandle) {
filehandle.close();
- if (!filehandle.open(_physfile == "" ? _filename : _physfile)) {
+ if (!filehandle.open(_physfile.empty() ? _filename : _physfile)) {
debug(3, "couldn't open pakfile '%s'\n", _filename.c_str());
return false;
}
- if (_physfile != "") {
+ if (!_physfile.empty()) {
filehandle.seek(_physOffset, SEEK_CUR);
}
Modified: scummvm/trunk/gui/ThemeClassic.cpp
===================================================================
--- scummvm/trunk/gui/ThemeClassic.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/gui/ThemeClassic.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -296,7 +296,7 @@
_screen.drawLine(p0.x, p1.y, p1.x, p1.y, color);
}
- if (sel != "") {
+ if (!sel.empty()) {
Common::Rect text(r.left + 2, r.top + 3, r.right - 4, r.top + 3 + _font->getFontHeight());
_font->drawString(&_screen, sel, text.left, text.top, text.width(), color, convertAligment(align), deltax, false);
}
Modified: scummvm/trunk/gui/ThemeNew.cpp
===================================================================
--- scummvm/trunk/gui/ThemeNew.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/gui/ThemeNew.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -1309,7 +1309,7 @@
Common::String cacheFilename = genCacheFilename(filename);
Common::File fontFile;
- if (cacheFilename != "") {
+ if (!cacheFilename.empty()) {
if (fontFile.open(cacheFilename))
font = Graphics::NewFont::loadFromCache(fontFile);
if (font)
@@ -1368,7 +1368,7 @@
#endif
if (font) {
- if (cacheFilename != "") {
+ if (!cacheFilename.empty()) {
if (!Graphics::NewFont::cacheFontData(*font, cacheFilename)) {
warning("Couldn't create cache file for font '%s'", filename);
}
Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp 2006-07-23 15:01:21 UTC (rev 23581)
+++ scummvm/trunk/gui/newgui.cpp 2006-07-23 15:08:48 UTC (rev 23582)
@@ -60,7 +60,7 @@
}
void GuiObject::handleScreenChanged() {
- if (_name != "") {
+ if (!_name.empty()) {
if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR)
error("Undefined variable %s.x", _name.c_str());
if ((_y = g_gui.evaluator()->getVar(_name + ".y")) == EVAL_UNDEF_VAR)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list