[Scummvm-cvs-logs] CVS: scummvm/mac mac.cpp,1.10,1.11

Mutwin Kraus mutle at users.sourceforge.net
Tue Apr 9 11:42:47 CEST 2002


Update of /cvsroot/scummvm/scummvm/mac
In directory usw-pr-cvs1:/tmp/cvs-serv7666/scummvm/mac

Modified Files:
	mac.cpp 
Log Message:
Fixed the bug that Keydowns weren't recoginzed, added MapKey and changed some accesses3 to the scumm class...

Index: mac.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/mac/mac.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mac.cpp	7 Apr 2002 18:32:07 -0000	1.10
--- mac.cpp	9 Apr 2002 18:24:08 -0000	1.11
***************
*** 114,118 ****
  	bool terminated;
  public:
- 	Scumm *_scumm;
  	byte *_vgabuf;
  	GWorldPtr	screenBuf;
--- 114,117 ----
***************
*** 199,207 ****
  			
  			case kEventWindowHandleContentClick:
- 				//debug(1, "Sending MouseDown");
  				if(CommandKeyDown())
! 					wm->_scumm->_rightBtnPressed |= msClicked|msDown;
  				else
! 					wm->_scumm->_leftBtnPressed |= msClicked|msDown;
  			break;
  			
--- 198,211 ----
  			
  			case kEventWindowHandleContentClick:
  				if(CommandKeyDown())
! 					scumm->_rightBtnPressed |= msClicked|msDown;
  				else
! 					scumm->_leftBtnPressed |= msClicked|msDown;
! 				
! 				if(wm->wPtr != FrontWindow())
! 				{
! 					ActivateWindow(wm->wPtr, true);
! 					BringToFront(wm->wPtr);
! 				}
  			break;
  			
***************
*** 214,217 ****
--- 218,239 ----
  }
  
+ char mapKey(char key, char code, byte mod)
+ {
+ 	switch(code)
+ 	{
+ 		case 0x35:
+ 			key = 27;
+ 		break;
+ 		
+ 		case 0x31:
+ 			key = 32;
+ 		break;
+ 		
+ 		case 0x60:
+ 			key = 601;
+ 	}
+ 	return key;
+ }
+ 
  static pascal OSStatus EventHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* userData )
  {
***************
*** 233,244 ****
  				
  				case kOpenGameCmd:
! 					wm->_scumm->_saveLoadSlot = 0;
! 					wm->_scumm->_saveLoadFlag = 2;
  				break;
  				
  				case kSaveGameCmd:
! 					wm->_scumm->_saveLoadSlot = 0;
! 					sprintf(wm->_scumm->_saveLoadName, "Quicksave %d", wm->_scumm->_saveLoadSlot);
! 					wm->_scumm->_saveLoadFlag = 1;
  				break;
  				
--- 255,266 ----
  				
  				case kOpenGameCmd:
! 					scumm->_saveLoadSlot = 0;
! 					scumm->_saveLoadFlag = 2;
  				break;
  				
  				case kSaveGameCmd:
! 					scumm->_saveLoadSlot = 0;
! 					sprintf(scumm->_saveLoadName, "Quicksave %d", scumm->_saveLoadSlot);
! 					scumm->_saveLoadFlag = 1;
  				break;
  				
***************
*** 261,268 ****
  			if(GetEventKind(inEvent) == kEventRawKeyDown)
  			{
! 				char key;
  				
  				GetEventParameter(inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key);
! 				wm->_scumm->_keyPressed = (int)key;
  			}
  		break;
--- 283,293 ----
  			if(GetEventKind(inEvent) == kEventRawKeyDown)
  			{
! 				char	key;
! 				UInt32	mod, code;
  				
+ 				GetEventParameter(inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(UInt32), NULL, &code);
  				GetEventParameter(inEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(char), NULL, &key);
! 				GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &mod);
! 				scumm->_keyPressed = (int)mapKey(key, code, mod);
  			}
  		break;
***************
*** 279,288 ****
  				{
  					ActivateWindow(theWin, true);
  				}
  			break;
  			
  			case kEventMouseUp:
! 				wm->_scumm->_rightBtnPressed &= ~msDown;
! 				wm->_scumm->_leftBtnPressed &= ~msDown;
  			break;
  			
--- 304,314 ----
  				{
  					ActivateWindow(theWin, true);
+ 					BringToFront(theWin);
  				}
  			break;
  			
  			case kEventMouseUp:
! 				scumm->_rightBtnPressed &= ~msDown;
! 				scumm->_leftBtnPressed &= ~msDown;
  			break;
  			
***************
*** 321,328 ****
  	Rect			rectWin;
  	
! 	_scumm->_scale = scale;
  	
! 	DEST_WIDTH = 320 * _scumm->_scale;
! 	DEST_HEIGHT = 200 * _scumm->_scale;
  	
  	MenuRef AppleMenu = GetMenu(1000);
--- 347,354 ----
  	Rect			rectWin;
  	
! 	scumm->_scale = scale;
  	
! 	DEST_WIDTH = 320 * scumm->_scale;
! 	DEST_HEIGHT = 200 * scumm->_scale;
  	
  	MenuRef AppleMenu = GetMenu(1000);
***************
*** 379,389 ****
  void WndMan::ChangeScaling(short scaling)
  {
! 	_scumm->_scale = scaling;
  	scale = scaling;
  	
  	Rect rectWin;
  	
! 	DEST_WIDTH = 320 * _scumm->_scale;
! 	DEST_HEIGHT = 200 * _scumm->_scale;
  	
  	SetRect(&rectWin, 0, 0, DEST_WIDTH, DEST_HEIGHT);
--- 405,415 ----
  void WndMan::ChangeScaling(short scaling)
  {
! 	scumm->_scale = scaling;
  	scale = scaling;
  	
  	Rect rectWin;
  	
! 	DEST_WIDTH = 320 * scumm->_scale;
! 	DEST_HEIGHT = 200 * scumm->_scale;
  	
  	SetRect(&rectWin, 0, 0, DEST_WIDTH, DEST_HEIGHT);
***************
*** 795,801 ****
        if(controlID.id == 'okay')
        {
!         wm->_scumm->_noSubtitles = (Boolean)!GetControlValue(checkBoxControlRef);
          short scale = GetControlValue(radioGroupRef);
!         if(scale != wm->_scumm->_scale)
          	wm->ChangeScaling(scale);
          short music_vol = GetControlValue(musicVolumeSlider);
--- 821,827 ----
        if(controlID.id == 'okay')
        {
!         scumm->_noSubtitles = (Boolean)!GetControlValue(checkBoxControlRef);
          short scale = GetControlValue(radioGroupRef);
!         if(scale != scumm->_scale)
          	wm->ChangeScaling(scale);
          short music_vol = GetControlValue(musicVolumeSlider);
***************
*** 847,851 ****
      AutoEmbedControl(checkBoxControlRef, prefsWin);
      
!     if(wm->_scumm->_noSubtitles)
      	SetControlValue(checkBoxControlRef, false);
      
--- 873,877 ----
      AutoEmbedControl(checkBoxControlRef, prefsWin);
      
!     if(scumm->_noSubtitles)
      	SetControlValue(checkBoxControlRef, false);
      
***************
*** 876,880 ****
      AutoEmbedControl(radioButton, prefsWin);
      
!     SetControlValue(radioGroupRef, wm->_scumm->_scale);
      
      SetRect(&rect, 5, 110, 175, 146);
--- 902,906 ----
      AutoEmbedControl(radioButton, prefsWin);
      
!     SetControlValue(radioGroupRef, scumm->_scale);
      
      SetRect(&rect, 5, 110, 175, 146);
***************
*** 998,1002 ****
  	
  	wm->_vgabuf = (byte*)calloc(320,200);
- 	wm->_scumm = scumm;
  	
  	InitScummStuff();
--- 1024,1027 ----
***************
*** 1006,1010 ****
  	gui.init(scumm);
  	
! 	setWindowName(wm->_scumm);
  	
  	RunApplicationEventLoop();
--- 1031,1035 ----
  	gui.init(scumm);
  	
! 	setWindowName(scumm);
  	
  	RunApplicationEventLoop();





More information about the Scummvm-git-logs mailing list