[Scummvm-cvs-logs] scummvm master -> 6e4217e1ba1df9fd2ee4cd0d61151ed7dfc53021

sev- sev at scummvm.org
Sun Jul 14 18:37:21 CEST 2013


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

Summary:
aaaf466c71 RECORDER: Fix CID 1046886. Uninit class variables.
c1397788f2 RECORDER: Fix CID 1046884. Uninitialized class variables.
977038e847 RECORDER: Rename class variable in accoudance with our code style.
e3a11085a9 RECORDER: Fix CID 1046888. Wrong check.
51046d0ce7 RECORDER: Fix CID 1046881. Unused value
6751a385a8 RECORDER: Fix CID 1046883. Uninitialized variables
9efff8f350 RECORDER: Rename class variables in accoudance with our code style
54d0eef6f2 RECORDER: Fix CID 1046882. Uninitalized variables
6e4217e1ba RECORDER: Fix CID 1046887. Missing break in switch


Commit: aaaf466c7122f6c595d86a0145b1f0472c8b6d31
    https://github.com/scummvm/scummvm/commit/aaaf466c7122f6c595d86a0145b1f0472c8b6d31
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:03:29-07:00

Commit Message:
RECORDER: Fix CID 1046886. Uninit class variables.

Changed paths:
    common/recorderfile.cpp



diff --git a/common/recorderfile.cpp b/common/recorderfile.cpp
index 60c47e1..e6838ed 100644
--- a/common/recorderfile.cpp
+++ b/common/recorderfile.cpp
@@ -39,6 +39,12 @@ PlaybackFile::PlaybackFile() : _tmpRecordFile(_tmpBuffer, kRecordBuffSize), _tmp
 	_writeStream = NULL;
 	_screenshotsFile = NULL;
 	_mode = kClosed;
+
+	_recordFile = 0;
+	_headerDumped = false;
+	_recordCount = 0;
+	_eventsSize = 0;
+	memset(_tmpBuffer, kRecordBuffSize, 1);
 }
 
 PlaybackFile::~PlaybackFile() {


Commit: c1397788f240bb029ece9d0a551f702eb08e043a
    https://github.com/scummvm/scummvm/commit/c1397788f240bb029ece9d0a551f702eb08e043a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:14:00-07:00

Commit Message:
RECORDER: Fix CID 1046884. Uninitialized class variables.

Changed paths:
    gui/EventRecorder.cpp



diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 47358a0..8917eac 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -77,6 +77,19 @@ EventRecorder::EventRecorder() {
 	_initialized = false;
 	_needRedraw = false;
 	_fastPlayback = false;
+
+	_fakeTimer = 0;
+	_savedState = false;
+	_needcontinueGame = false;
+	_temporarySlot = 0;
+	_realSaveManager = 0;
+	_realMixerManager = 0;
+	controlPanel = 0;
+	_lastMillis = 0;
+	_lastScreenshotTime = 0;
+	_screenshotPeriod = 0;
+	_playbackFile = 0;
+	
 	DebugMan.addDebugChannel(kDebugLevelEventRec, "EventRec", "Event recorder debug level");
 }
 


Commit: 977038e847f9e08280e9accae2db28b3f5d40abc
    https://github.com/scummvm/scummvm/commit/977038e847f9e08280e9accae2db28b3f5d40abc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:16:01-07:00

Commit Message:
RECORDER: Rename class variable in accoudance with our code style.

Changed paths:
    gui/EventRecorder.cpp
    gui/EventRecorder.h



diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 8917eac..b62399d 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -84,7 +84,7 @@ EventRecorder::EventRecorder() {
 	_temporarySlot = 0;
 	_realSaveManager = 0;
 	_realMixerManager = 0;
-	controlPanel = 0;
+	_controlPanel = 0;
 	_lastMillis = 0;
 	_lastScreenshotTime = 0;
 	_screenshotPeriod = 0;
@@ -109,8 +109,8 @@ void EventRecorder::deinit() {
 	_recordMode = kPassthrough;
 	delete _fakeMixerManager;
 	_fakeMixerManager = NULL;
-	controlPanel->close();
-	delete controlPanel;
+	_controlPanel->close();
+	delete _controlPanel;
 	debugC(1, kDebugLevelEventRec, "playback:action=stopplayback");
 	g_system->getEventManager()->getEventDispatcher()->unregisterSource(this);
 	_recordMode = kPassthrough;
@@ -140,7 +140,7 @@ void EventRecorder::processMillis(uint32 &millis, bool skipRecord) {
 		millisDelay = millis - _lastMillis;
 		_lastMillis = millis;
 		_fakeTimer += millisDelay;
-		controlPanel->setReplayedTime(_fakeTimer);
+		_controlPanel->setReplayedTime(_fakeTimer);
 		timerEvent.recordedtype = Common::kRecorderEventTypeTimer;
 		timerEvent.time = _fakeTimer;
 		_playbackFile->writeEvent(timerEvent);
@@ -163,7 +163,7 @@ void EventRecorder::processMillis(uint32 &millis, bool skipRecord) {
 			}
 		}
 		millis = _fakeTimer;
-		controlPanel->setReplayedTime(_fakeTimer);
+		_controlPanel->setReplayedTime(_fakeTimer);
 		break;
 	case kRecorderPlaybackPause:
 		millis = _fakeTimer;
@@ -222,12 +222,12 @@ void EventRecorder::togglePause() {
 	case kRecorderRecord:
 		oldState = _recordMode;
 		_recordMode = kRecorderPlaybackPause;
-		controlPanel->runModal();
+		_controlPanel->runModal();
 		_recordMode = oldState;
 		_initialized = true;
 		break;
 	case kRecorderPlaybackPause:
-		controlPanel->close();
+		_controlPanel->close();
 		break;
 	default:
 		break;
@@ -290,7 +290,7 @@ void EventRecorder::init(Common::String recordFileName, RecordMode mode) {
 		return;
 	}
 	if (_recordMode != kPassthrough) {
-		controlPanel = new GUI::OnScreenDialog(_recordMode == kRecorderRecord);
+		_controlPanel = new GUI::OnScreenDialog(_recordMode == kRecorderRecord);
 	}
 	if (_recordMode == kRecorderPlayback) {
 		applyPlaybackSettings();
@@ -452,8 +452,8 @@ Common::List<Common::Event> EventRecorder::mapEvent(const Common::Event &ev, Com
 		return Common::DefaultEventMapper::mapEvent(ev, source);
 		break;
 	case kRecorderRecord:
-		g_gui.processEvent(evt, controlPanel);
-		if (((evt.type == Common::EVENT_LBUTTONDOWN) || (evt.type == Common::EVENT_LBUTTONUP) || (evt.type == Common::EVENT_MOUSEMOVE)) && controlPanel->isMouseOver()) {
+		g_gui.processEvent(evt, _controlPanel);
+		if (((evt.type == Common::EVENT_LBUTTONDOWN) || (evt.type == Common::EVENT_LBUTTONUP) || (evt.type == Common::EVENT_MOUSEMOVE)) && _controlPanel->isMouseOver()) {
 			return Common::List<Common::Event>();
 		} else {
 			Common::RecorderEvent e;
@@ -466,13 +466,13 @@ Common::List<Common::Event> EventRecorder::mapEvent(const Common::Event &ev, Com
 		break;
 	case kRecorderPlaybackPause: {
 		Common::Event dialogEvent;
-		if (controlPanel->isEditDlgVisible()) {
+		if (_controlPanel->isEditDlgVisible()) {
 			dialogEvent = ev;
 		} else {
 			dialogEvent = evt;
 		}
-		g_gui.processEvent(dialogEvent, controlPanel->getActiveDlg());
-		if (((dialogEvent.type == Common::EVENT_LBUTTONDOWN) || (dialogEvent.type == Common::EVENT_LBUTTONUP) || (dialogEvent.type == Common::EVENT_MOUSEMOVE)) && controlPanel->isMouseOver()) {
+		g_gui.processEvent(dialogEvent, _controlPanel->getActiveDlg());
+		if (((dialogEvent.type == Common::EVENT_LBUTTONDOWN) || (dialogEvent.type == Common::EVENT_LBUTTONUP) || (dialogEvent.type == Common::EVENT_MOUSEMOVE)) && _controlPanel->isMouseOver()) {
 			return Common::List<Common::Event>();
 		}
 		return Common::DefaultEventMapper::mapEvent(dialogEvent, source);
@@ -562,7 +562,7 @@ void EventRecorder::preDrawOverlayGui() {
 		g_system->showOverlay();
 		g_gui.theme()->clearAll();
 		g_gui.theme()->openDialog(true, GUI::ThemeEngine::kShadingNone);
-		controlPanel->drawDialog();
+		_controlPanel->drawDialog();
 		g_gui.theme()->finishBuffering();
 		g_gui.theme()->updateScreen();
 		_recordMode = oldMode;
diff --git a/gui/EventRecorder.h b/gui/EventRecorder.h
index 3e32d89..60fe07f 100644
--- a/gui/EventRecorder.h
+++ b/gui/EventRecorder.h
@@ -193,7 +193,7 @@ private:
 	DefaultTimerManager *_timerManager;
 	RecorderSaveFileManager _fakeSaveManager;
 	NullSdlMixerManager *_fakeMixerManager;
-	GUI::OnScreenDialog *controlPanel;
+	GUI::OnScreenDialog *_controlPanel;
 	Common::RecorderEvent _nextEvent;
 
 	void setFileHeader();


Commit: e3a11085a9c07082dfebb8b4bcf4031ac0569df5
    https://github.com/scummvm/scummvm/commit/e3a11085a9c07082dfebb8b4bcf4031ac0569df5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:20:06-07:00

Commit Message:
RECORDER: Fix CID 1046888. Wrong check.

Changed paths:
    gui/EventRecorder.cpp



diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index b62399d..f2df146 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -331,7 +331,7 @@ bool EventRecorder::openRecordFile(const Common::String &fileName) {
 }
 
 bool EventRecorder::checkGameHash(const ADGameDescription *gameDesc) {
-	if ((gameDesc == NULL) && (_playbackFile->getHeader().hashRecords.size() != 0)) {
+	if (_playbackFile->getHeader().hashRecords.size() != 0) {
 		warning("Engine doesn't contain description table");
 		return false;
 	}


Commit: 51046d0ce722309a0a347849e0a60176e0b9069c
    https://github.com/scummvm/scummvm/commit/51046d0ce722309a0a347849e0a60176e0b9069c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:22:53-07:00

Commit Message:
RECORDER: Fix CID 1046881. Unused value

Changed paths:
    gui/onscreendialog.cpp



diff --git a/gui/onscreendialog.cpp b/gui/onscreendialog.cpp
index efe8038..84b84f0 100644
--- a/gui/onscreendialog.cpp
+++ b/gui/onscreendialog.cpp
@@ -97,18 +97,17 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
 	} else
 #endif
 	{
-		GUI::ButtonWidget *btn;
 		if (g_system->getOverlayWidth() > 320)
-			btn = new ButtonWidget(this, "OnScreenDialog.StopButton", "[ ]", _("Stop"), kStopCmd);
+			new ButtonWidget(this, "OnScreenDialog.StopButton", "[ ]", _("Stop"), kStopCmd);
 		else
-			btn = new ButtonWidget(this, "OnScreenDialog.StopButton", "[]", _("Stop"), kStopCmd);
+			new ButtonWidget(this, "OnScreenDialog.StopButton", "[]", _("Stop"), kStopCmd);
 
 		if (isRecord) {
-			btn = new ButtonWidget(this, "OnScreenDialog.EditButton", "E", _("Edit record description"), kEditCmd);
+			new ButtonWidget(this, "OnScreenDialog.EditButton", "E", _("Edit record description"), kEditCmd);
 		} else {
-			btn = new ButtonWidget(this, "OnScreenDialog.SwitchModeButton", "G", _("Switch to Game"), kSwitchModeCmd);
+			new ButtonWidget(this, "OnScreenDialog.SwitchModeButton", "G", _("Switch to Game"), kSwitchModeCmd);
 
-			btn = new ButtonWidget(this, "OnScreenDialog.FastReplayButton", ">>", _("Fast replay"), kFastModeCmd);
+			new ButtonWidget(this, "OnScreenDialog.FastReplayButton", ">>", _("Fast replay"), kFastModeCmd);
 		}
 	}
 


Commit: 6751a385a81902e03ad2d205133560b57bacaa21
    https://github.com/scummvm/scummvm/commit/6751a385a81902e03ad2d205133560b57bacaa21
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:24:47-07:00

Commit Message:
RECORDER: Fix CID 1046883. Uninitialized variables

Changed paths:
    gui/onscreendialog.cpp



diff --git a/gui/onscreendialog.cpp b/gui/onscreendialog.cpp
index 84b84f0..e508c64 100644
--- a/gui/onscreendialog.cpp
+++ b/gui/onscreendialog.cpp
@@ -116,6 +116,9 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
 	_enableDrag = false;
 	_mouseOver = false;
 	_editDlgShown = false;
+
+	lastTime = 0;
+	dlg = 0;
 }
 
 void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {


Commit: 9efff8f35012a6dc42d330b8155b1ed8918f8529
    https://github.com/scummvm/scummvm/commit/9efff8f35012a6dc42d330b8155b1ed8918f8529
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:27:13-07:00

Commit Message:
RECORDER: Rename class variables in accoudance with our code style

Changed paths:
    gui/onscreendialog.cpp
    gui/onscreendialog.h



diff --git a/gui/onscreendialog.cpp b/gui/onscreendialog.cpp
index e508c64..03a6f26 100644
--- a/gui/onscreendialog.cpp
+++ b/gui/onscreendialog.cpp
@@ -112,13 +112,13 @@ OnScreenDialog::OnScreenDialog(bool isRecord) : Dialog("OnScreenDialog") {
 	}
 
 
-	text = new GUI::StaticTextWidget(this, "OnScreenDialog.TimeLabel", "00:00:00");
+	_text = new GUI::StaticTextWidget(this, "OnScreenDialog.TimeLabel", "00:00:00");
 	_enableDrag = false;
 	_mouseOver = false;
 	_editDlgShown = false;
 
-	lastTime = 0;
-	dlg = 0;
+	_lastTime = 0;
+	_dlg = 0;
 }
 
 void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
@@ -130,20 +130,20 @@ void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 		close();
 		break;
 	case kEditCmd:
-		dlg = new EditRecordDialog(g_eventRec.getAuthor(), g_eventRec.getName(), g_eventRec.getNotes());
+		_dlg = new EditRecordDialog(g_eventRec.getAuthor(), g_eventRec.getName(), g_eventRec.getNotes());
 		CursorMan.lock(false);
 		g_eventRec.setRedraw(false);
 		g_system->showOverlay();
 		_editDlgShown = true;
-		dlg->runModal();
+		_dlg->runModal();
 		_editDlgShown = false;
 		g_system->hideOverlay();
 		g_eventRec.setRedraw(true);
 		CursorMan.lock(true);
-		g_eventRec.setAuthor(((EditRecordDialog *)dlg)->getAuthor());
-		g_eventRec.setName(((EditRecordDialog *)dlg)->getName());
-		g_eventRec.setNotes(((EditRecordDialog *)dlg)->getNotes());
-		delete dlg;
+		g_eventRec.setAuthor(((EditRecordDialog *)_dlg)->getAuthor());
+		g_eventRec.setName(((EditRecordDialog *)_dlg)->getName());
+		g_eventRec.setNotes(((EditRecordDialog *)_dlg)->getNotes());
+		delete _dlg;
 		break;
 	case kSwitchModeCmd:
 		if (g_eventRec.switchMode()) {
@@ -157,10 +157,10 @@ void OnScreenDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 }
 
 void OnScreenDialog::setReplayedTime(uint32 newTime) {
-	if (newTime - lastTime > 1000) {
+	if (newTime - _lastTime > 1000) {
 		uint32 seconds = newTime / 1000;
-		text->setLabel(Common::String::format("%.2d:%.2d:%.2d", seconds / 3600 % 24, seconds / 60 % 60, seconds % 60));
-		lastTime = newTime;
+		_text->setLabel(Common::String::format("%.2d:%.2d:%.2d", seconds / 3600 % 24, seconds / 60 % 60, seconds % 60));
+		_lastTime = newTime;
 	}
 }
 
@@ -220,7 +220,7 @@ void OnScreenDialog::close() {
 
 Dialog *OnScreenDialog::getActiveDlg() {
 	if (_editDlgShown) {
-		return dlg;
+		return _dlg;
 	} else {
 		return this;
 	}
diff --git a/gui/onscreendialog.h b/gui/onscreendialog.h
index 4f3839a..2fae14c 100644
--- a/gui/onscreendialog.h
+++ b/gui/onscreendialog.h
@@ -30,14 +30,16 @@ namespace GUI {
 
 class OnScreenDialog : public Dialog {
 private:
-	uint32 lastTime;
+	uint32 _lastTime;
 	bool _enableDrag;
 	bool _mouseOver;
 	bool _editDlgShown;
 	Common::Point _dragPoint;
-	GUI::StaticTextWidget *text;
-	Dialog *dlg;
+	GUI::StaticTextWidget *_text;
+	Dialog *_dlg;
+
 	bool isMouseOver(int x, int y);
+
 public:
 	OnScreenDialog(bool recordingMode);
 	~OnScreenDialog();
@@ -56,7 +58,7 @@ public:
 	bool isEditDlgVisible();
 	Dialog *getActiveDlg();
 protected:
-	virtual void	releaseFocus();
+	virtual void releaseFocus();
 };
 
 } // End of namespace GUI


Commit: 54d0eef6f23046376674c95bc7467216dc0d2766
    https://github.com/scummvm/scummvm/commit/54d0eef6f23046376674c95bc7467216dc0d2766
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:30:35-07:00

Commit Message:
RECORDER: Fix CID 1046882. Uninitalized variables

Changed paths:
    gui/recorderdialog.cpp



diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index 55f342d..e2e73a4 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -52,6 +52,12 @@ enum {
 };
 
 RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentScreenshot(0) {
+	_firstScreenshotUpdate = false;
+	_screenShotsCount = 0;
+	_currentScreenshotText = 0;
+	_authorText = 0;
+	_notesText = 0;
+
 	_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
 
 	new StaticTextWidget(this, "SaveLoadChooser.Title", _("Recorder or Playback Gameplay"));


Commit: 6e4217e1ba1df9fd2ee4cd0d61151ed7dfc53021
    https://github.com/scummvm/scummvm/commit/6e4217e1ba1df9fd2ee4cd0d61151ed7dfc53021
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-07-14T09:35:17-07:00

Commit Message:
RECORDER: Fix CID 1046887. Missing break in switch

Changed paths:
    gui/recorderdialog.cpp



diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index e2e73a4..59fd833 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -191,6 +191,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
 		break;
 	case kCloseCmd:
 		setResult(kRecordDialogClose);
+		break;
 	default:
 		Dialog::handleCommand(sender, cmd, data);
 		}






More information about the Scummvm-git-logs mailing list