Corrected framebuffer creation problem
authorNathan Heisey <nathanheisey@gmail.com>
Mon, 25 Jul 2011 13:47:19 +0000
changeset 59245fb68068019d
parent 5923 460ce3fb104c
child 5925 262ce29aabf6
Corrected framebuffer creation problem
src/video/bwindow/SDL_bmodes.cc
     1.1 --- a/src/video/bwindow/SDL_bmodes.cc	Fri Jul 22 16:54:23 2011 +0000
     1.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Mon Jul 25 13:47:19 2011 +0000
     1.3 @@ -228,13 +228,19 @@
     1.4  
     1.5  	/* Create a copy of the pixel buffer if it doesn't recycle */
     1.6  	*pixels = bwin->GetWindowFramebuffer();
     1.7 -	if( bwin->CanTrashWindowBuffer() ) {
     1.8 +	printf(__FILE__": %d; window frame buffer make\n", __LINE__);
     1.9 +	if( bwin->CanTrashWindowBuffer() || (*pixels) == NULL) {
    1.10  		if( (*pixels) != NULL ) {
    1.11  			SDL_free(*pixels);
    1.12  		}
    1.13  		*pixels = SDL_calloc((*pitch) * bwin->GetFbHeight() * 
    1.14  			bwin->GetBytesPerPx(), sizeof(uint8));
    1.15  		bwin->SetWindowFramebuffer((uint8*)(*pixels));
    1.16 +		if(*pixels) {
    1.17 +			printf(__FILE__": %d; Success!\n", __LINE__);
    1.18 +		} else {
    1.19 +			printf(__FILE__": %d; FAIL!\n", __LINE__);
    1.20 +		}
    1.21  	}
    1.22  
    1.23  	bwin->UnlockBuffer();
    1.24 @@ -269,6 +275,7 @@
    1.25  		/* Blit each clipping rectangle */
    1.26  		bscreen.WaitForRetrace();
    1.27  		for(i = 0; i < numClips; ++i) {
    1.28 +			clipping_rect rc = clips[i];
    1.29  			/* Get addresses of the start of each clipping rectangle */
    1.30  			int32 width = clips[i].right - clips[i].left + 1;
    1.31  			int32 height = clips[i].bottom - clips[i].top + 1;
    1.32 @@ -276,7 +283,7 @@
    1.33  				clips[i].top * bufferPitch + clips[i].left * BPP;
    1.34  			windowpx = windowBaseAddress + 
    1.35  				clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
    1.36 -
    1.37 +printf(__FILE__": %d\n\twindowpx = 0x%x\n\tbufferpx = 0x%x\n\twindowPitch = %i\n\tbufferPitch = %i\n", __LINE__, windowpx, bufferpx, windowPitch, bufferPitch);
    1.38  			/* Copy each row of pixels from the window buffer into the frame
    1.39  			   buffer */
    1.40  			for(y = 0; y < height; ++y)