[Scummvm-cvs-logs] CVS: scummvm/mac mac.cpp,1.1,1.2

Mutwin Kraus mutle at users.sourceforge.net
Sun Mar 10 07:37:04 CET 2002


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

Modified Files:
	mac.cpp 
Log Message:
Scaling can now be changing during Runtime!

Index: mac.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/mac/mac.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mac.cpp	8 Mar 2002 17:23:12 -0000	1.1
--- mac.cpp	10 Mar 2002 15:36:32 -0000	1.2
***************
*** 21,26 ****
   */
  
- #define __APPLE__CW
- 
  #include <Carbon.h>
  #include <CarbonEvents.h>
--- 21,24 ----
***************
*** 116,119 ****
--- 114,118 ----
  	void init();
  	
+ 	void ChangeScaling(short scaling);
  	bool handleMessage();
  	void run();
***************
*** 325,330 ****
  	Rect			rectWin;
  	
! 	DEST_WIDTH = 320 * scale;
! 	DEST_HEIGHT = 200 * scale;
  	
  	MenuRef AppleMenu = GetMenu(1000);
--- 324,331 ----
  	Rect			rectWin;
  	
! 	_scumm->_scale = scale;
! 	
! 	DEST_WIDTH = 320 * _scumm->_scale;
! 	DEST_HEIGHT = 200 * _scumm->_scale;
  	
  	MenuRef AppleMenu = GetMenu(1000);
***************
*** 376,379 ****
--- 377,397 ----
  }
  
+ 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);
+ 	
+ 	SetWindowBounds(wPtr, kWindowContentRgn, &rectWin);
+ 	RepositionWindow(wPtr, NULL, kWindowCenterOnMainScreen);
+ 	dstRect = rectWin;
+ }
+ 
  bool WndMan::handleMessage()
  {
***************
*** 400,404 ****
  	CopyBits(GetPortBitMapForCopyBits(screenBuf),
  			GetPortBitMapForCopyBits(GetWindowPort(wPtr)), 
! 			&srcRect, &dstRect, srcCopy, 0L);	
  }
  
--- 418,422 ----
  	CopyBits(GetPortBitMapForCopyBits(screenBuf),
  			GetPortBitMapForCopyBits(GetWindowPort(wPtr)), 
! 			&srcRect, &dstRect, srcCopy, 0L);
  }
  
***************
*** 461,464 ****
--- 479,483 ----
  
  void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
+ 	s->_scale = scaleFactor;
  	wm->init();
  }
***************
*** 748,751 ****
--- 767,772 ----
  }
  
+ ControlRef radioGroupRef;
+ 
  OSStatus prefsEventHandler(EventHandlerCallRef eventHandlerCallRef,EventRef eventRef,
                               void *userData)
***************
*** 771,774 ****
--- 792,798 ----
        {
          wm->_scumm->_noSubtitles = (Boolean)!GetControlValue(checkBoxControlRef);
+         short scale = GetControlValue(radioGroupRef);
+         if(scale != wm->_scumm->_scale)
+         	wm->ChangeScaling(scale);
          QuitAppModalLoopForWindow((WindowRef)userData);
          DisposeWindow((WindowRef)userData);
***************
*** 809,812 ****
--- 833,857 ----
      	SetControlValue(checkBoxControlRef, false);
      
+     Rect RadioGroupRect;
+     SetRect(&RadioGroupRect, 120, 10, 290, 120);
+     CreateRadioGroupControl(prefsWin, &RadioGroupRect, &radioGroupRef);
+     AutoEmbedControl(radioGroupRef, prefsWin);
+     
+     ControlRef radioButton;
+     
+     Rect RadioButtonRect;	
+     SetRect(&RadioButtonRect, 125, 30, 285, 45);
+     CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 1x"), 0, true, &radioButton);
+     AutoEmbedControl(radioButton, prefsWin);
+     	
+     OffsetRect(&RadioButtonRect, 0, 20);
+     CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 2x"), 0, true, &radioButton);
+     AutoEmbedControl(radioButton, prefsWin);
+     
+     OffsetRect(&RadioButtonRect, 0, 20);
+     CreateRadioButtonControl(prefsWin, &RadioButtonRect, CFSTR("Scaling 3x"), 0, true, &radioButton);
+     AutoEmbedControl(radioButton, prefsWin);
+     
+     SetControlValue(radioGroupRef, wm->_scumm->_scale);
      InstallWindowEventHandler(prefsWin, NewEventHandlerUPP((EventHandlerProcPtr) prefsEventHandler),
                                GetEventTypeCount(dialogEvents),dialogEvents,prefsWin,NULL);





More information about the Scummvm-git-logs mailing list