[Scummvm-cvs-logs] scummvm master -> 52d81727a3c4ee5a5737b10366951021066eda13

fingolfin max at quendi.de
Tue May 17 16:30:40 CEST 2011


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2149edbe5d M4: Fix leak in Console::cmdDumpFile
d84ae94b54 SWORD1: Const correctness, code cleanup & simplification
183e018c19 AGOS: cleanup
d020922846 SCUMM: Make REDUCE_MEMORY_USAGE slightly more effecive (saving ~1kb ram)
52d81727a3 GUI: Trying to clarify my comment on ctrl-a/ctrl-e *sigh*


Commit: 2149edbe5d5c4699eaaf826c7a769ab764548eac
    https://github.com/scummvm/scummvm/commit/2149edbe5d5c4699eaaf826c7a769ab764548eac
Author: Max Horn (max at quendi.de)
Date: 2011-05-17T06:04:07-07:00

Commit Message:
M4: Fix leak in Console::cmdDumpFile

Changed paths:
    engines/m4/console.cpp
    engines/m4/m4.cpp
    engines/m4/m4.h



diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp
index b6d8093..6f45f11 100644
--- a/engines/m4/console.cpp
+++ b/engines/m4/console.cpp
@@ -147,12 +147,12 @@ bool Console::cmdDumpFile(int argc, const char **argv) {
 		DebugPrintf("If uncompress is 1, the file is uncompressed (for MADS games)\n");
 	} else {
 		if (argc == 2) {
-			_vm->dumpFile(strdup(argv[1]));
+			_vm->dumpFile(argv[1], false);
 		} else {
 			if (argc == 3 && atoi(argv[2]) == 1)
-				_vm->dumpFile(strdup(argv[1]), true);
+				_vm->dumpFile(argv[1], true);
 			else
-				_vm->dumpFile(strdup(argv[1]));
+				_vm->dumpFile(argv[1], false);
 		}
 	}
 	return true;
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 881a523..d456acc 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -255,7 +255,7 @@ void MadsM4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool cal
 
 #define DUMP_BUFFER_SIZE 1024
 
-void MadsM4Engine::dumpFile(const char* filename, bool uncompress) {
+void MadsM4Engine::dumpFile(const char *filename, bool uncompress) {
 	Common::DumpFile f;
 	byte buffer[DUMP_BUFFER_SIZE];
 	Common::SeekableReadStream *fileS = res()->get(filename);
diff --git a/engines/m4/m4.h b/engines/m4/m4.h
index 4c693d7..4c9b100 100644
--- a/engines/m4/m4.h
+++ b/engines/m4/m4.h
@@ -165,7 +165,7 @@ public:
 	ResourceManager *res() const { return _resourceManager; }
 	MidiPlayer *midi() { return _midi; }
 	Common::SaveFileManager *saveManager() { return _saveFileMan; }
-	void dumpFile(const char* filename, bool uncompress = false);
+	void dumpFile(const char *filename, bool uncompress);
 	void eventHandler();
 	bool delay(int duration, bool keyAborts = true, bool clickAborts = true);
 	void loadMenu(MenuType menuType, bool loadSaveFromHotkey = false,


Commit: d84ae94b54e0aa2bdea740736dc65e35081c6f51
    https://github.com/scummvm/scummvm/commit/d84ae94b54e0aa2bdea740736dc65e35081c6f51
Author: Max Horn (max at quendi.de)
Date: 2011-05-17T06:05:20-07:00

Commit Message:
SWORD1: Const correctness, code cleanup & simplification

Changed paths:
    engines/sword1/animation.cpp
    engines/sword1/animation.h
    engines/sword1/text.cpp
    engines/sword1/text.h



diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index dd9a9da..b66cc6b 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -126,7 +126,7 @@ bool MoviePlayer::load(uint32 id) {
 					continue;
 				}
 
-				_movieTexts.push_back(new MovieText(startFrame, endFrame, ptr));
+				_movieTexts.push_back(MovieText(startFrame, endFrame, ptr));
 				lastEnd = endFrame;
 			}
 			f.close();
@@ -161,8 +161,7 @@ void MoviePlayer::play() {
 
 	_textMan->releaseText(2, false);
 
-	while (!_movieTexts.empty())
-		delete _movieTexts.remove_at(_movieTexts.size() - 1);
+	_movieTexts.clear();
 
 	while (_snd->isSoundHandleActive(*_bgSoundHandle))
 		_system->delayMillis(100);
@@ -179,8 +178,8 @@ void MoviePlayer::play() {
 
 void MoviePlayer::performPostProcessing(byte *screen) {
 	if (!_movieTexts.empty()) {
-		if (_decoder->getCurFrame() == _movieTexts[0]->_startFrame) {
-			_textMan->makeTextSprite(2, (uint8 *)_movieTexts[0]->_text, 600, LETTER_COL);
+		if (_decoder->getCurFrame() == _movieTexts.front()._startFrame) {
+			_textMan->makeTextSprite(2, (const uint8 *)_movieTexts.front()._text.c_str(), 600, LETTER_COL);
 
 			FrameHeader *frame = _textMan->giveSpriteData(2);
 			_textWidth = frame->width;
@@ -188,9 +187,9 @@ void MoviePlayer::performPostProcessing(byte *screen) {
 			_textX = 320 - _textWidth / 2;
 			_textY = 420 - _textHeight;
 		}
-		if (_decoder->getCurFrame() == _movieTexts[0]->_endFrame) {
+		if (_decoder->getCurFrame() == _movieTexts.front()._endFrame) {
 			_textMan->releaseText(2, false);
-			delete _movieTexts.remove_at(0);
+			_movieTexts.pop_front();
 		}
 	}
 
diff --git a/engines/sword1/animation.h b/engines/sword1/animation.h
index 2fb274e..fc3061b 100644
--- a/engines/sword1/animation.h
+++ b/engines/sword1/animation.h
@@ -27,7 +27,7 @@
 #include "video/smk_decoder.h"
 #include "video/video_decoder.h"
 
-#include "common/array.h"
+#include "common/list.h"
 
 #include "audio/audiostream.h"
 
@@ -45,14 +45,11 @@ class MovieText {
 public:
 	uint16 _startFrame;
 	uint16 _endFrame;
-	char *_text;
-	MovieText(int startFrame, int endFrame, const char *text) {
+	Common::String _text;
+	MovieText(int startFrame, int endFrame, const Common::String &text) {
 		_startFrame = startFrame;
 		_endFrame = endFrame;
-		_text = strdup(text);
-	}
-	~MovieText() {
-		free(_text);
+		_text = text;
 	}
 };
 
@@ -80,7 +77,7 @@ protected:
 	Text *_textMan;
 	Audio::Mixer *_snd;
 	OSystem *_system;
-	Common::Array<MovieText *> _movieTexts;
+	Common::List<MovieText> _movieTexts;
 	int _textX, _textY, _textWidth, _textHeight;
 	byte _white, _black;
 	DecoderType _decoderType;
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index 695b7bd..2d4b070 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -73,7 +73,7 @@ uint32 Text::lowTextManager(uint8 *ascii, int32 width, uint8 pen) {
 	return textObjId;
 }
 
-void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) {
+void Text::makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen) {
 	LineInfo lines[MAX_LINES];
 	uint16 numLines = analyzeSentence(text, maxWidth, lines);
 
@@ -115,7 +115,7 @@ uint16 Text::charWidth(uint8 ch) {
 	return _resMan->getUint16(_resMan->fetchFrame(_font, ch - SPACE)->width);
 }
 
-uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) {
+uint16 Text::analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *line) {
 	uint16 lineNo = 0;
 
 	bool firstWord = true;
diff --git a/engines/sword1/text.h b/engines/sword1/text.h
index 1afa0c7..2224fbc 100644
--- a/engines/sword1/text.h
+++ b/engines/sword1/text.h
@@ -49,11 +49,11 @@ public:
 	~Text();
 	FrameHeader *giveSpriteData(uint32 textTarget);
 	uint32 lowTextManager(uint8 *text, int32 width, uint8 pen);
-	void makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen);
+	void makeTextSprite(uint8 slot, const uint8 *text, uint16 maxWidth, uint8 pen);
 	void releaseText(uint32 id, bool updateCount = true);
 
 private:
-	uint16 analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *info);
+	uint16 analyzeSentence(const uint8 *text, uint16 maxWidth, LineInfo *info);
 	uint16 charWidth(uint8 ch);
 	uint16 copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen);
 	uint8 *_font;


Commit: 183e018c198d9e3e74440d8d4c29783523b7bb6e
    https://github.com/scummvm/scummvm/commit/183e018c198d9e3e74440d8d4c29783523b7bb6e
Author: Max Horn (max at quendi.de)
Date: 2011-05-17T06:36:25-07:00

Commit Message:
AGOS: cleanup

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/detection.cpp
    engines/agos/feeble.cpp
    engines/agos/pn.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 7e4c564..4d87990 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -56,8 +56,8 @@ static const GameSpecificSettings puzzlepack_settings = {
 };
 
 #ifdef ENABLE_AGOS2
-AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system)
-	: AGOSEngine_PuzzlePack(system) {
+AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_PuzzlePack(system, gd) {
 
 	_iconToggleCount = 0;
 	_voiceCount = 0;
@@ -67,24 +67,24 @@ AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system)
 	_tSecondCount = 0;
 }
 
-AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
-	: AGOSEngine_Feeble(system) {
+AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Feeble(system, gd) {
 
 	_oopsValid = false;
 	_gameTime = 0;
 }
 #endif
 
-AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)
-	: AGOSEngine_Simon1(system) {
+AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Simon1(system, gd) {
 }
 
-AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system)
-	: AGOSEngine_Waxworks(system) {
+AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Waxworks(system, gd) {
 }
 
-AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system)
-	: AGOSEngine_Elvira2(system) {
+AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Elvira2(system, gd) {
 
 	_boxCR = false;
 	_boxLineCount = 0;
@@ -100,16 +100,16 @@ AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system)
 	memset(_lineCounts, 0, sizeof(_lineCounts));
 }
 
-AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system)
-	: AGOSEngine_Elvira1(system) {
+AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Elvira1(system, gd) {
 }
 
-AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system)
-	: AGOSEngine(system) {
+AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine(system, gd) {
 }
 
-AGOSEngine::AGOSEngine(OSystem *syst)
-	: Engine(syst), _rnd("agos") {
+AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
+	: Engine(system), _rnd("agos"), _gameDescription(gd) {
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 60836b8..aa68a05 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -176,6 +176,7 @@ class Debugger;
 #endif
 
 class AGOSEngine : public Engine {
+protected:
 	friend class Debugger;
 
 	// Engine APIs
@@ -193,7 +194,6 @@ class AGOSEngine : public Engine {
 	virtual void syncSoundSettings();
 	virtual void pauseEngineIntern(bool pause);
 
-public:
 	virtual void setupOpcodes();
 	uint16 _numOpcodes, _opcode;
 
@@ -205,8 +205,9 @@ public:
 
 	virtual void setupVideoOpcodes(VgaOpcodeProc *op);
 
-	const AGOSGameDescription *_gameDescription;
+	const AGOSGameDescription * const _gameDescription;
 
+public:
 	virtual void setupGame();
 
 	int getGameId() const;
@@ -584,7 +585,7 @@ protected:
 	byte _hebrewCharWidths[32];
 
 public:
-	AGOSEngine(OSystem *syst);
+	AGOSEngine(OSystem *system, const AGOSGameDescription *gd);
 	virtual ~AGOSEngine();
 
 	byte *_curSfxFile;
@@ -1281,7 +1282,7 @@ class AGOSEngine_PN : public AGOSEngine {
 	void setupBoxes();
 	int readfromline();
 public:
-	AGOSEngine_PN(OSystem *system);
+	AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd);
 	~AGOSEngine_PN();
 
 	virtual void setupGame();
@@ -1523,7 +1524,7 @@ protected:
 
 class AGOSEngine_Elvira1 : public AGOSEngine {
 public:
-	AGOSEngine_Elvira1(OSystem *system);
+	AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_Elvira1();
 
 	virtual void setupGame();
@@ -1604,7 +1605,7 @@ protected:
 
 class AGOSEngine_Elvira2 : public AGOSEngine_Elvira1 {
 public:
-	AGOSEngine_Elvira2(OSystem *system);
+	AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_Elvira2();
 
 	virtual void setupGame();
@@ -1699,7 +1700,7 @@ protected:
 
 class AGOSEngine_Waxworks : public AGOSEngine_Elvira2 {
 public:
-	AGOSEngine_Waxworks(OSystem *system);
+	AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_Waxworks();
 
 	virtual void setupGame();
@@ -1766,7 +1767,7 @@ protected:
 
 class AGOSEngine_Simon1 : public AGOSEngine_Waxworks {
 public:
-	AGOSEngine_Simon1(OSystem *system);
+	AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_Simon1();
 
 	virtual void setupGame();
@@ -1837,7 +1838,7 @@ protected:
 
 class AGOSEngine_Simon2 : public AGOSEngine_Simon1 {
 public:
-	AGOSEngine_Simon2(OSystem *system);
+	AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_Simon2();
 
 	virtual void setupGame();
@@ -1884,7 +1885,7 @@ protected:
 #ifdef ENABLE_AGOS2
 class AGOSEngine_Feeble : public AGOSEngine_Simon2 {
 public:
-	AGOSEngine_Feeble(OSystem *system);
+	AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd);
 	~AGOSEngine_Feeble();
 
 	virtual void setupGame();
@@ -2023,7 +2024,7 @@ protected:
 
 class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble {
 public:
-	AGOSEngine_FeebleDemo(OSystem *system);
+	AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd);
 
 protected:
 	bool _filmMenuUsed;
@@ -2044,7 +2045,7 @@ protected:
 
 class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble {
 public:
-	AGOSEngine_PuzzlePack(OSystem *system);
+	AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_PuzzlePack();
 
 	virtual void setupGame();
@@ -2103,7 +2104,7 @@ protected:
 
 class AGOSEngine_DIMP : public AGOSEngine_PuzzlePack {
 public:
-	AGOSEngine_DIMP(OSystem *system);
+	AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd);
 	//~AGOSEngine_DIMP();
 
 	virtual void setupOpcodes();
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index dfd4660..629a5d6 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -148,44 +148,41 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
 
 	switch (gd->gameType) {
 	case AGOS::GType_PN:
-		*engine = new AGOS::AGOSEngine_PN(syst);
+		*engine = new AGOS::AGOSEngine_PN(syst, gd);
 		break;
 	case AGOS::GType_ELVIRA1:
-		*engine = new AGOS::AGOSEngine_Elvira1(syst);
+		*engine = new AGOS::AGOSEngine_Elvira1(syst, gd);
 		break;
 	case AGOS::GType_ELVIRA2:
-		*engine = new AGOS::AGOSEngine_Elvira2(syst);
+		*engine = new AGOS::AGOSEngine_Elvira2(syst, gd);
 		break;
 	case AGOS::GType_WW:
-		*engine = new AGOS::AGOSEngine_Waxworks(syst);
+		*engine = new AGOS::AGOSEngine_Waxworks(syst, gd);
 		break;
 	case AGOS::GType_SIMON1:
-		*engine = new AGOS::AGOSEngine_Simon1(syst);
+		*engine = new AGOS::AGOSEngine_Simon1(syst, gd);
 		break;
 	case AGOS::GType_SIMON2:
-		*engine = new AGOS::AGOSEngine_Simon2(syst);
+		*engine = new AGOS::AGOSEngine_Simon2(syst, gd);
 		break;
 #ifdef ENABLE_AGOS2
 	case AGOS::GType_FF:
 		if (gd->features & GF_DEMO)
-			*engine = new AGOS::AGOSEngine_FeebleDemo(syst);
+			*engine = new AGOS::AGOSEngine_FeebleDemo(syst, gd);
 		else
-			*engine = new AGOS::AGOSEngine_Feeble(syst);
+			*engine = new AGOS::AGOSEngine_Feeble(syst, gd);
 		break;
 	case AGOS::GType_PP:
 		if (gd->gameId == GID_DIMP)
-			*engine = new AGOS::AGOSEngine_DIMP(syst);
+			*engine = new AGOS::AGOSEngine_DIMP(syst, gd);
 		else
-			*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
+			*engine = new AGOS::AGOSEngine_PuzzlePack(syst, gd);
 		break;
 #endif
 	default:
 		res = false;
 		error("AGOS engine: unknown gameType");
 	}
-	if (res) {
-		((AGOS::AGOSEngine *)*engine)->_gameDescription = gd;
-	}
 
 	return res;
 }
diff --git a/engines/agos/feeble.cpp b/engines/agos/feeble.cpp
index 64d2002..4c82b7e 100644
--- a/engines/agos/feeble.cpp
+++ b/engines/agos/feeble.cpp
@@ -32,8 +32,8 @@
 
 namespace AGOS {
 
-AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system)
-	: AGOSEngine_Simon2(system) {
+AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Simon2(system, gd) {
 
 	_interactiveVideo = 0;
 	_moviePlayer = 0;
@@ -108,8 +108,8 @@ void AGOSEngine_Feeble::stopInteractiveVideo() {
 	}
 }
 
-AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system)
-	: AGOSEngine_Feeble(system) {
+AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine_Feeble(system, gd) {
 
 	_filmMenuUsed = 0;
 }
diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp
index 9efed90..667a5c3 100644
--- a/engines/agos/pn.cpp
+++ b/engines/agos/pn.cpp
@@ -27,8 +27,8 @@
 
 namespace AGOS {
 
-AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
-	: AGOSEngine(system) {
+AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd)
+	: AGOSEngine(system, gd) {
 
 	_stackbase = 0;
 	_tagOfActiveDoline = 0;


Commit: d0209228467f548e748146e1c72e72ac9cccc89f
    https://github.com/scummvm/scummvm/commit/d0209228467f548e748146e1c72e72ac9cccc89f
Author: Max Horn (max at quendi.de)
Date: 2011-05-17T06:50:11-07:00

Commit Message:
SCUMM: Make REDUCE_MEMORY_USAGE slightly more effecive (saving ~1kb ram)

Changed paths:
    engines/scumm/script.cpp
    engines/scumm/script.h



diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index cd9a0ed..cfc4b3c 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -494,7 +494,11 @@ void ScummEngine::executeOpcode(byte i) {
 }
 
 const char *ScummEngine::getOpcodeDesc(byte i) {
+#ifndef REDUCE_MEMORY_USAGE
 	return _opcodes[i].desc;
+#else
+	return "";
+#endif
 }
 
 byte ScummEngine::fetchScriptByte() {
diff --git a/engines/scumm/script.h b/engines/scumm/script.h
index e576c9b..7b2c625 100644
--- a/engines/scumm/script.h
+++ b/engines/scumm/script.h
@@ -27,14 +27,19 @@
 
 namespace Scumm {
 
-
 typedef Common::Functor0<void> Opcode;
 
 struct OpcodeEntry : Common::NonCopyable {
 	Opcode *proc;
+#ifndef REDUCE_MEMORY_USAGE
 	const char *desc;
+#endif
 
+#ifndef REDUCE_MEMORY_USAGE
 	OpcodeEntry() : proc(0), desc(0) {}
+#else
+	OpcodeEntry() : proc(0) {}
+#endif
 	~OpcodeEntry() {
 		setProc(0, 0);
 	}
@@ -44,7 +49,9 @@ struct OpcodeEntry : Common::NonCopyable {
 			delete proc;
 			proc = p;
 		}
+#ifndef REDUCE_MEMORY_USAGE
 		desc = d;
+#endif
 	}
 };
 


Commit: 52d81727a3c4ee5a5737b10366951021066eda13
    https://github.com/scummvm/scummvm/commit/52d81727a3c4ee5a5737b10366951021066eda13
Author: Max Horn (max at quendi.de)
Date: 2011-05-17T07:27:10-07:00

Commit Message:
GUI: Trying to clarify my comment on ctrl-a/ctrl-e *sigh*

Changed paths:
    gui/widgets/editable.cpp



diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp
index de331d9..4a0ee54 100644
--- a/gui/widgets/editable.cpp
+++ b/gui/widgets/editable.cpp
@@ -182,9 +182,19 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
 		break;
 
 #ifdef MACOSX
-	// Mac OS X GUI style shortcuts: Ctrl-A goes to start of line, Ctrl-e to end of line.
-	// TODO: Should we disable these on Windows? There, Ctrl-A usually means
-	// "select all".
+	// Let ctrl-a / ctrl-e move the caret to the start / end of the line.
+	//
+	// These shortcuts go back a long time for command line programs. As
+	// for edit fields in GUIs, they are supported natively on Mac OS X,
+	// which is why I enabled these shortcuts there.
+	// On other systems (Windows, Gnome), Ctrl-A by default means
+	// "select all", which is why I didn't enable the shortcuts there
+	// for now, to avoid potential confusion.
+	//
+	// But since we don't support text selection, and since at least Gnome
+	// can be configured to also support ctrl-a and ctrl-e, we may want
+	// to extend this code to other targets, maybe even all. I'll leave
+	// this to other porters to decide, though.
 	case Common::KEYCODE_a:
 	case Common::KEYCODE_e:
 		if (state.flags & Common::KBD_CTRL) {






More information about the Scummvm-git-logs mailing list