[Scummvm-cvs-logs] scummvm master -> 19303c49cf8284a7c56f08f0902a8c4cf71f8f32

bluegr bluegr at gmail.com
Thu Dec 24 17:31:41 CET 2015


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

Summary:
c0f3131fbe LAB: Reorganize the code a bit in getMsg()
19303c49cf LAB: Rename closeFont() to freeFont()


Commit: c0f3131fbe5b0e297c49791a19274638e2ca8d76
    https://github.com/scummvm/scummvm/commit/c0f3131fbe5b0e297c49791a19274638e2ca8d76
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T18:30:41+02:00

Commit Message:
LAB: Reorganize the code a bit in getMsg()

Changed paths:
    engines/lab/interface.cpp



diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index 6f01562..4d00d7a 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -135,18 +135,20 @@ IntuiMessage *EventManager::getMsg() {
 		_leftClick = _rightClick = false;
 		return &message;
 	} else if (_keyPressed.keycode != Common::KEYCODE_INVALID) {
-		message._code = _keyPressed.keycode;
-		_keyPressed.keycode = Common::KEYCODE_INVALID;
-
-		Button *curButton = checkNumButtonHit(_screenButtonList, message._code);
+		Button *curButton = checkNumButtonHit(_screenButtonList, _keyPressed.keycode);
 
 		if (curButton) {
 			message._msgClass = kMessageButtonUp;
 			message._code = curButton->_buttonId;
-		} else
+		} else {
 			message._msgClass = kMessageRawKey;
+			message._code = _keyPressed.keycode;
+		}
 
 		message._qualifier = _keyPressed.flags;
+
+		_keyPressed.keycode = Common::KEYCODE_INVALID;
+
 		return &message;
 	} else
 		return nullptr;


Commit: 19303c49cf8284a7c56f08f0902a8c4cf71f8f32
    https://github.com/scummvm/scummvm/commit/19303c49cf8284a7c56f08f0902a8c4cf71f8f32
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-12-24T18:30:54+02:00

Commit Message:
LAB: Rename closeFont() to freeFont()

Changed paths:
    engines/lab/dispman.cpp
    engines/lab/dispman.h
    engines/lab/engine.cpp
    engines/lab/intro.cpp
    engines/lab/special.cpp



diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index 5a9d525..097521f 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -507,7 +507,7 @@ void DisplayMan::checkerboardEffect(uint16 penColor, uint16 x1, uint16 y1, uint1
 	}
 }
 
-void DisplayMan::closeFont(TextFont **font) {
+void DisplayMan::freeFont(TextFont **font) {
 	if (*font) {
 		if ((*font)->_data)
 			delete[] (*font)->_data;
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
index 5778952..2cf58c3 100644
--- a/engines/lab/dispman.h
+++ b/engines/lab/dispman.h
@@ -239,7 +239,7 @@ public:
 	/**
 	 * Closes a font and frees all memory associated with it.
 	 */
-	void closeFont(TextFont **font);
+	void freeFont(TextFont **font);
 
 	/**
 	 * Returns the length of a text in the specified font.
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 8d859bc..021456f 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -1077,7 +1077,7 @@ void LabEngine::go() {
 
 	_event->initMouse();
 	if (_msgFont)
-		_graphics->closeFont(&_msgFont);
+		_graphics->freeFont(&_msgFont);
 
 	if (getPlatform() != Common::kPlatformAmiga)
 		_msgFont = _resource->getFont("F:AvanteG.12");
@@ -1092,7 +1092,7 @@ void LabEngine::go() {
 	_event->mouseShow();
 	mainGameLoop();
 
-	_graphics->closeFont(&_msgFont);
+	_graphics->freeFont(&_msgFont);
 	_graphics->freePict();
 
 	freeScreens();
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index 5ed604c..8971c96 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -47,7 +47,7 @@ Intro::Intro(LabEngine *vm) : _vm(vm) {
 }
 
 Intro::~Intro() {
-	_vm->_graphics->closeFont(&_font);
+	_vm->_graphics->freeFont(&_font);
 }
 
 void Intro::introEatMessages() {
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index dd2ee1c..81d6bea 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -49,7 +49,7 @@ void LabEngine::doNotes() {
 	Common::Rect textRect = Common::Rect(_utils->vgaScaleX(25) + _utils->svgaCord(15), _utils->vgaScaleY(50), _utils->vgaScaleX(295) - _utils->svgaCord(15), _utils->vgaScaleY(148));
 	_graphics->flowText(noteFont, -2 + _utils->svgaCord(1), 0, 0, false, false, true, true, textRect, noteText.c_str());
 	_graphics->setPalette(_anim->_diffPalette, 256);
-	_graphics->closeFont(&noteFont);
+	_graphics->freeFont(&noteFont);
 }
 
 void LabEngine::doWestPaper() {
@@ -58,7 +58,7 @@ void LabEngine::doWestPaper() {
 
 	Common::Rect textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(77) + _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(91));
 	_graphics->flowText(paperFont, 0, 0, 0, false, true, false, true, textRect, paperText.c_str());
-	_graphics->closeFont(&paperFont);
+	_graphics->freeFont(&paperFont);
 
 	paperFont = _resource->getFont("F:News32.fon");
 	paperText = _resource->getText("Lab:Rooms/Headline");
@@ -76,7 +76,7 @@ void LabEngine::doWestPaper() {
 	} else
 		y = 115 - _utils->svgaCord(5);
 
-	_graphics->closeFont(&paperFont);
+	_graphics->freeFont(&paperFont);
 
 	paperFont = _resource->getFont("F:Note.fon");
 	paperText = _resource->getText("Lab:Rooms/Col1");
@@ -85,13 +85,13 @@ void LabEngine::doWestPaper() {
 	paperText = _resource->getText("Lab:Rooms/Col2");
 	_graphics->flowText(paperFont, -4, 0, 0, false, false, false, true, _utils->vgaRectScale(162, y, 275, 148), paperText.c_str());
 
-	_graphics->closeFont(&paperFont);
+	_graphics->freeFont(&paperFont);
 	_graphics->setPalette(_anim->_diffPalette, 256);
 }
 
 void LabEngine::loadJournalData() {
 	if (_journalFont)
-		_graphics->closeFont(&_journalFont);
+		_graphics->freeFont(&_journalFont);
 
 	_journalFont = _resource->getFont("F:Journal.fon");
 	updateMusicAndEvents();
@@ -280,7 +280,7 @@ void LabEngine::doJournal() {
 	_blankJournal = _journalBackImage->_imageData = nullptr;
 
 	_event->freeButtonList(&_journalButtonList);
-	_graphics->closeFont(&_journalFont);
+	_graphics->freeFont(&_journalFont);
 
 	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	_graphics->blackScreen();
@@ -457,7 +457,7 @@ void LabEngine::doMonitor(const Common::String background, const Common::String
 	processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
 	_graphics->fade(false);
 	_event->mouseHide();
-	_graphics->closeFont(&monitorFont);
+	_graphics->freeFont(&monitorFont);
 
 	_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
 	_graphics->blackAllScreen();






More information about the Scummvm-git-logs mailing list