src/video/bwindow/SDL_bmodes.cc
changeset 5925 262ce29aabf6
parent 5924 5fb68068019d
child 5926 d9d57de9fb4e
     1.1 --- a/src/video/bwindow/SDL_bmodes.cc	Mon Jul 25 13:47:19 2011 +0000
     1.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Mon Jul 25 16:46:55 2011 +0000
     1.3 @@ -118,20 +118,19 @@
     1.4  /* Later, there may be more than one monitor available */
     1.5  void BE_AddDisplay(BScreen *screen) {
     1.6  	SDL_VideoDisplay display;
     1.7 -	SDL_DisplayMode mode;
     1.8 +	SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1, sizeof(SDL_DisplayMode));
     1.9  	display_mode bmode;
    1.10  	screen->GetMode(&bmode);
    1.11  
    1.12 -	BE_BDisplayModeToSdlDisplayMode(&bmode, &mode);
    1.13 +	BE_BDisplayModeToSdlDisplayMode(&bmode, mode);
    1.14  	
    1.15  	SDL_zero(display);
    1.16 -	display.desktop_mode = mode;
    1.17 -	display.current_mode = mode;
    1.18 +	display.desktop_mode = *mode;
    1.19 +	display.current_mode = *mode;
    1.20  	SDL_AddVideoDisplay(&display);
    1.21  }
    1.22  
    1.23  int BE_InitModes(_THIS) {
    1.24 -	printf("Init Modes\n");
    1.25  	BScreen screen;
    1.26  	
    1.27  	/* Save the current display mode */
    1.28 @@ -144,6 +143,7 @@
    1.29  }
    1.30  
    1.31  int BE_QuitModes(_THIS) {
    1.32 +	printf(__FILE__": %d; Begin quit\n", __LINE__);
    1.33  	/* Restore the previous video mode */
    1.34  	BScreen screen;
    1.35  	display_mode *savedMode = _GetBeApp()->GetPrevMode();
    1.36 @@ -163,10 +163,9 @@
    1.37  }
    1.38  
    1.39  void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
    1.40 -	printf("Get Display Modes\n");
    1.41  	/* Get the current screen */
    1.42  	BScreen bscreen;
    1.43 -	
    1.44 +
    1.45  	/* Iterate through all of the modes */
    1.46  	SDL_DisplayMode mode;
    1.47  	display_mode this_bmode;
    1.48 @@ -188,7 +187,6 @@
    1.49  }
    1.50  
    1.51  int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
    1.52 -	printf("Set Display Modes\n");
    1.53  	/* Get the current screen */
    1.54  	BScreen bscreen;
    1.55  	
    1.56 @@ -212,7 +210,7 @@
    1.57  		return -1;
    1.58  	}
    1.59  	
    1.60 -	while(!bwin->Connected()) { snooze(1600); }
    1.61 +	while(!bwin->Connected()) { snooze(10); }
    1.62  
    1.63  	/* Make sure we have exclusive access to frame buffer data */
    1.64  	bwin->LockBuffer();
    1.65 @@ -228,7 +226,6 @@
    1.66  
    1.67  	/* Create a copy of the pixel buffer if it doesn't recycle */
    1.68  	*pixels = bwin->GetWindowFramebuffer();
    1.69 -	printf(__FILE__": %d; window frame buffer make\n", __LINE__);
    1.70  	if( bwin->CanTrashWindowBuffer() || (*pixels) == NULL) {
    1.71  		if( (*pixels) != NULL ) {
    1.72  			SDL_free(*pixels);
    1.73 @@ -236,11 +233,6 @@
    1.74  		*pixels = SDL_calloc((*pitch) * bwin->GetFbHeight() * 
    1.75  			bwin->GetBytesPerPx(), sizeof(uint8));
    1.76  		bwin->SetWindowFramebuffer((uint8*)(*pixels));
    1.77 -		if(*pixels) {
    1.78 -			printf(__FILE__": %d; Success!\n", __LINE__);
    1.79 -		} else {
    1.80 -			printf(__FILE__": %d; FAIL!\n", __LINE__);
    1.81 -		}
    1.82  	}
    1.83  
    1.84  	bwin->UnlockBuffer();
    1.85 @@ -283,7 +275,7 @@
    1.86  				clips[i].top * bufferPitch + clips[i].left * BPP;
    1.87  			windowpx = windowBaseAddress + 
    1.88  				clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
    1.89 -printf(__FILE__": %d\n\twindowpx = 0x%x\n\tbufferpx = 0x%x\n\twindowPitch = %i\n\tbufferPitch = %i\n", __LINE__, windowpx, bufferpx, windowPitch, bufferPitch);
    1.90 +
    1.91  			/* Copy each row of pixels from the window buffer into the frame
    1.92  			   buffer */
    1.93  			for(y = 0; y < height; ++y)