[Scummvm-cvs-logs] SF.net SVN: scummvm:[44594] scummvm/trunk/engines/sci/gui
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Oct 4 12:46:25 CEST 2009
Revision: 44594
http://scummvm.svn.sourceforge.net/scummvm/?rev=44594&view=rev
Author: m_kiewitz
Date: 2009-10-04 10:46:25 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
SCI/newgui: onControl implemented
Modified Paths:
--------------
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui/gui.h
scummvm/trunk/engines/sci/gui/gui_gfx.cpp
scummvm/trunk/engines/sci/gui/gui_gfx.h
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-04 10:42:18 UTC (rev 44593)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-04 10:46:25 UTC (rev 44594)
@@ -228,7 +228,6 @@
void SciGUI::drawPicture(sciResourceId pictureId, uint16 style, uint16 flags, int16 EGApaletteNo) {
bool addToFlag = flags ? true : false;
-
sciPort *oldPort = _gfx->SetPort((sciPort *)_windowMgr->_picWind);
if (_windowMgr->isFrontWindow(_windowMgr->_picWind)) {
@@ -317,6 +316,15 @@
_gfx->animatePalette(fromColor, toColor, speed);
}
+int16 SciGUI::onControl(byte screenMask, Common::Rect rect) {
+ sciPort *oldPort = _gfx->SetPort((sciPort *)_windowMgr->_picWind);
+ int16 result;
+
+ result = _gfx->onControl(screenMask, rect);
+ _gfx->SetPort(oldPort);
+ return result;
+}
+
void SciGUI::moveCursor(int16 x, int16 y) {
Common::Point newPos;
sciPort *curPort = _gfx->GetPort();
Modified: scummvm/trunk/engines/sci/gui/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2009-10-04 10:42:18 UTC (rev 44593)
+++ scummvm/trunk/engines/sci/gui/gui.h 2009-10-04 10:46:25 UTC (rev 44594)
@@ -74,6 +74,8 @@
virtual int16 paletteFind(int r, int g, int b);
virtual void paletteAnimate(int fromColor, int toColor, int speed);
+ virtual int16 onControl(byte screenMask, Common::Rect rect);
+
virtual void moveCursor(int16 x, int16 y);
private:
Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-04 10:42:18 UTC (rev 44593)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-04 10:46:25 UTC (rev 44594)
@@ -1268,4 +1268,30 @@
_palSchedules.push_back(sched);
}
+int16 SciGUIgfx::onControl(uint16 screenMask, Common::Rect rect) {
+ Common::Rect outRect(rect.left, rect.top, rect.right, rect.bottom);
+ int16 x, y;
+ int16 result = 0;
+
+ outRect.clip(_curPort->rect);
+ if (outRect.isEmpty()) // nothing to control
+ return 0;
+ OffsetRect(outRect);
+
+ if (screenMask & SCI_SCREEN_MASK_PRIORITY) {
+ for (y = outRect.top; y < outRect.bottom; y++) {
+ for (x = outRect.left; x < outRect.right; x++) {
+ result |= 1 << _screen->Get_Priority(x, y);
+ }
+ }
+ } else {
+ for (y = outRect.top; y < outRect.bottom; y++) {
+ for (x = outRect.left; x < outRect.right; x++) {
+ result |= 1 << _screen->Get_Control(x, y);
+ }
+ }
+ }
+ return result;
+}
+
} // end of namespace Sci
Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h 2009-10-04 10:42:18 UTC (rev 44593)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h 2009-10-04 10:46:25 UTC (rev 44594)
@@ -112,6 +112,8 @@
void animatePalette(byte fromColor, byte toColor, int speed);
+ int16 onControl(uint16 screenMask, Common::Rect rect);
+
sciPort *_menuPort;
uint32 _sysTicks;
int32 _sysSpeed; // ticker timer in ms
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