diff options
| author | Joost Peters | 2003-06-05 21:46:59 +0000 | 
|---|---|---|
| committer | Joost Peters | 2003-06-05 21:46:59 +0000 | 
| commit | 717bdd92239a65923d9a96b5e59bef325e46ac6c (patch) | |
| tree | c2474f65276672c5b01f918ad54b08781ed8f478 | |
| parent | 4a934a5519484031c4d9a644837ca6ad3d7a753c (diff) | |
| download | scummvm-rg350-717bdd92239a65923d9a96b5e59bef325e46ac6c.tar.gz scummvm-rg350-717bdd92239a65923d9a96b5e59bef325e46ac6c.tar.bz2 scummvm-rg350-717bdd92239a65923d9a96b5e59bef325e46ac6c.zip | |
fixed mouse cursor/transparency
svn-id: r8336
| -rw-r--r-- | sky/mouse.cpp | 13 | ||||
| -rw-r--r-- | sky/mouse.h | 3 | 
2 files changed, 15 insertions, 1 deletions
| diff --git a/sky/mouse.cpp b/sky/mouse.cpp index 57b2edfff1..3be31a37dd 100644 --- a/sky/mouse.cpp +++ b/sky/mouse.cpp @@ -168,6 +168,18 @@ void SkyMouse::drawNewMouse() {  	//drawMouse();  } +//original sky uses different colors for transparency than our backends do, +//so we simply swap our "transparent"-white with another one. +void SkyMouse::fixMouseTransparency(byte *mouseData) { +	for (int i = 0; i < (_mouseWidth * _mouseHeight); i++) { +		if (mouseData[i] == 255) +			mouseData[i] = 242; +		else +			if (mouseData[i] == 0) +				mouseData[i] = 255; +	} +} +  void SkyMouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) {  	SkyState::_systemVars.mouseFlag |= MF_IN_INT;  	_mouseType2 = frameNum; @@ -182,6 +194,7 @@ void SkyMouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) {  	//_system->set_mouse_cursor(_mouseData2, _mouseWidth, _mouseHeight, mouseX, mouseY);  	// there's something wrong about the mouse's hotspot. using 0/0 works fine. +	fixMouseTransparency(_mouseData2);  	_system->set_mouse_cursor(_mouseData2, _mouseWidth, _mouseHeight, 0, 0);  	if (frameNum == MOUSE_BLANK) _system->show_mouse(false);  	else _system->show_mouse(true); diff --git a/sky/mouse.h b/sky/mouse.h index 842d939324..5de4dc7dab 100644 --- a/sky/mouse.h +++ b/sky/mouse.h @@ -54,7 +54,8 @@ protected:  	void pointerEngine(void);  	void buttonEngine1(void); - +	void fixMouseTransparency(byte *mouseData); +	  	uint16 _eMouseB;  	uint16 _bMouseB; | 
