[Scummvm-cvs-logs] CVS: scummvm x11.cpp,1.3,1.4

Lionel Ulmer bbrox at users.sourceforge.net
Sun Mar 17 03:10:02 CET 2002


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

Modified Files:
	x11.cpp 
Log Message:
Upgraded X11 'port' with the new API needed. Added also 'fake right mouse' and 'pixel hunting mode' for the iPAQ.



Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/x11.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** x11.cpp	6 Mar 2002 23:14:16 -0000	1.3
--- x11.cpp	17 Mar 2002 11:09:04 -0000	1.4
***************
*** 26,29 ****
--- 26,30 ----
  #include "gui.h"
  #include "sound.h"
+ #include "cdmusic.h"
  
  #include <sys/time.h>
***************
*** 68,71 ****
--- 69,74 ----
  
  static unsigned int scale;
+ static int fake_right_mouse = 0;
+ static int report_presses = 1;
  
  #define MAX_NUMBER_OF_DIRTY_SQUARES 32
***************
*** 182,191 ****
  }
  
  void cd_playtrack(int track, int offset, int delay) {
!   /* No CD on the iPAQ => stub function */
  }
  
  void BoxTest(int num) {
-   /* No debugger on the iPAQ => stub function */
  }
  
--- 185,201 ----
  }
  
+ /* No CD on the iPAQ => stub functions */
  void cd_playtrack(int track, int offset, int delay) {
! }
! void cd_play(int track, int num_loops, int start_frame) {
! }
! int cd_is_running(void) {
!   return 1;
! }
! void cd_stop(void) {
  }
  
+ /* No debugger on the iPAQ => stub function */
  void BoxTest(int num) {
  }
  
***************
*** 270,274 ****
  
  void setShakePos(Scumm *s, int shake_pos) {
! 
  }
  
--- 280,284 ----
  
  void setShakePos(Scumm *s, int shake_pos) {
!   warning("Unimplemented shaking !");
  }
  
***************
*** 470,473 ****
--- 480,505 ----
  }
  
+ void launcherLoop() {
+   int last_time, new_time;
+   int delta = 0;
+   last_time = get_ms_from_start();
+   
+   gui.launcher();
+   while (1) {
+     updateScreen(&scumm);
+     
+     new_time = get_ms_from_start();
+     waitForTimer(&scumm, delta * 15 + last_time - new_time);
+     last_time = get_ms_from_start();
+     
+     if (gui._active) {
+       gui.loop();
+       delta = 5;
+     } else {
+       error("gui closed!");
+     }
+   }
+ }
+ 
  /* This function waits for 'msec_delay' miliseconds and handles external events */
  void waitForTimer(Scumm *s, int msec_delay) {
***************
*** 536,540 ****
  
        case KeyPress:
! 	/* Do nothing for now... Will be useful to implement 'pixel hunting mode' */
  	break;
  
--- 568,580 ----
  
        case KeyPress:
! 	switch (event.xkey.keycode) {
! 	case 132:
! 	  report_presses = 0;
! 	  break;
! 	  
! 	case 133:
! 	  fake_right_mouse = 1;
! 	  break;
! 	}
  	break;
  
***************
*** 559,562 ****
--- 599,610 ----
  	  break;
  
+ 	case 132: /* 'Q' on the iPAQ */
+ 	  report_presses = 1;
+ 	  break;
+ 	  
+ 	case 133: /* Arrow on the iPAQ */
+ 	  fake_right_mouse = 0;
+ 	  break;
+ 
  	default: {
  	    KeySym xsym;
***************
*** 569,583 ****
  	
        case ButtonPress:
! 	if (event.xbutton.button == 1)
! 	  s->_leftBtnPressed |= msClicked|msDown;
! 	else if (event.xbutton.button == 3)
! 	  s->_rightBtnPressed |= msClicked|msDown;
  	break;
  
        case ButtonRelease:
! 	if (event.xbutton.button == 1)
! 	  s->_leftBtnPressed &= ~msDown;
! 	else if (event.xbutton.button == 3)
! 	  s->_rightBtnPressed &= ~msDown;
  	break;	
  
--- 617,643 ----
  	
        case ButtonPress:
! 	if (report_presses != 0) {
! 	  if (event.xbutton.button == 1) {
! 	    if (fake_right_mouse == 0) {
! 	      s->_leftBtnPressed |= msClicked|msDown;
! 	    } else {
! 	      s->_rightBtnPressed |= msClicked|msDown;
! 	    }
! 	  } else if (event.xbutton.button == 3)
! 	    s->_rightBtnPressed |= msClicked|msDown;
! 	}
  	break;
  
        case ButtonRelease:
! 	if (report_presses != 0) {
! 	  if (event.xbutton.button == 1) {
! 	    if (fake_right_mouse == 0) {
! 	      s->_leftBtnPressed &= ~msDown;
! 	    } else {
! 	      s->_rightBtnPressed &= ~msDown;
! 	    }
! 	  } else if (event.xbutton.button == 3)
! 	    s->_rightBtnPressed &= ~msDown;
! 	}
  	break;	
  
***************
*** 622,632 ****
    int last_time, new_time;
    
-   sound.initialize(&scumm, &snd_driv);
-   
    scumm._gui = &gui;
    scumm.scummMain(argc, argv);
    
-   if (!(scumm._features & GF_SMALL_HEADER))
-     gui.init(&scumm);
    num_of_dirty_square = 0;
  
--- 682,691 ----
    int last_time, new_time;
    
    scumm._gui = &gui;
+   gui.init(&scumm);
+   sound.initialize(&scumm, &snd_driv);  
    scumm.scummMain(argc, argv);
+   gui.init(&scumm);  /* Reinit GUI after loading a game */
    
    num_of_dirty_square = 0;
  





More information about the Scummvm-git-logs mailing list