diff options
Diffstat (limited to 'backends/platform/psp/display_manager.cpp')
| -rw-r--r-- | backends/platform/psp/display_manager.cpp | 38 | 
1 files changed, 19 insertions, 19 deletions
diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 72a0acb632..5d75ac531e 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -128,24 +128,24 @@ void VramAllocator::deallocate(void *address) {  void MasterGuRenderer::setupCallbackThread() {  	DEBUG_ENTER_FUNC(); -	 +  	// start the thread that updates the display -	threadCreateAndStart("DisplayCbThread", PRIORITY_DISPLAY_THREAD, STACK_DISPLAY_THREAD);		 +	threadCreateAndStart("DisplayCbThread", PRIORITY_DISPLAY_THREAD, STACK_DISPLAY_THREAD);  }  // this function gets called by PspThread when starting the new thread  void MasterGuRenderer::threadFunction() {  	DEBUG_ENTER_FUNC(); -	 +  	// Create the callback. It should always get the pointer to MasterGuRenderer  	_callbackId = sceKernelCreateCallback("Display Callback", guCallback, this);  	if (_callbackId < 0) { -		PSP_ERROR("failed to create display callback\n");		 +		PSP_ERROR("failed to create display callback\n");  	} -	 +  	PSP_DEBUG_PRINT("created callback. Going to sleep\n"); -	sceKernelSleepThreadCB();	// sleep until we get a callback	 +	sceKernelSleepThreadCB();	// sleep until we get a callback  }  // This callback is called when the render is finished. It swaps the buffers @@ -153,12 +153,12 @@ int MasterGuRenderer::guCallback(int, int, void *__this) {  	MasterGuRenderer *_this = (MasterGuRenderer *)__this; -	sceGuSync(0, 0);				// make sure we wait for GU to finish		 +	sceGuSync(0, 0);				// make sure we wait for GU to finish  	sceDisplayWaitVblankStartCB();	// wait for v-blank without eating main thread cycles  	sceGuSwapBuffers();				// swap the back and front buffers  	_this->_renderFinished = true;	// Only this thread can set the variable to true -	 +  	return 0;  } @@ -214,7 +214,7 @@ inline void MasterGuRenderer::guPreRender() {  	DEBUG_ENTER_FUNC();  	_renderFinished = false;	// set to synchronize with callback thread -	 +  #ifdef ENABLE_RENDER_MEASURE  	_lastRenderTime = g_system->getMillis();  #endif /* ENABLE_RENDER_MEASURE */ @@ -243,7 +243,7 @@ inline void MasterGuRenderer::guPostRender() {  	else  		sceKernelNotifyCallback(_callbackId, 0);	// notify the callback. Nothing extra to pass  #else -	sceGuSync(0, 0);	 +	sceGuSync(0, 0);  #ifdef ENABLE_RENDER_MEASURE  	uint32 now = g_system->getMillis(); @@ -253,7 +253,7 @@ inline void MasterGuRenderer::guPostRender() {  	sceDisplayWaitVblankStart();  	sceGuSwapBuffers();  	_renderFinished = true; -#endif /* !USE_DISPLAY_CALLBACK */	 +#endif /* !USE_DISPLAY_CALLBACK */  }  void MasterGuRenderer::guShutDown() { @@ -281,7 +281,7 @@ void DisplayManager::init() {  #ifdef USE_DISPLAY_CALLBACK  	_masterGuRenderer.setupCallbackThread();  #endif -	 +  }  void DisplayManager::setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format) { @@ -351,10 +351,10 @@ void DisplayManager::calculateScaleParams() {  		break;  	case KEEP_ASPECT_RATIO:	{ // maximize the height while keeping aspect ratio  			float aspectRatio = (float)_displayParams.screenSource.width / (float)_displayParams.screenSource.height; -			 +  			_displayParams.screenOutput.height = PSP_SCREEN_HEIGHT;	// always full height  			_displayParams.screenOutput.width = (uint32)(PSP_SCREEN_HEIGHT * aspectRatio); -			 +  			if (_displayParams.screenOutput.width > PSP_SCREEN_WIDTH) // we can't have wider than the screen  				_displayParams.screenOutput.width = PSP_SCREEN_WIDTH;  		} @@ -366,7 +366,7 @@ void DisplayManager::calculateScaleParams() {  	default:  		PSP_ERROR("Unsupported graphics mode[%d].\n", _graphicsMode);  	} -	 +  	// calculate scale factors for X and Y  	_displayParams.scaleX = ((float)_displayParams.screenOutput.width) / _displayParams.screenSource.width;  	_displayParams.scaleY = ((float)_displayParams.screenOutput.height) / _displayParams.screenSource.height; @@ -381,9 +381,9 @@ bool DisplayManager::renderAll() {  	if (!_masterGuRenderer.isRenderFinished()) {  		PSP_DEBUG_PRINT("Callback render not finished.\n");  		return false;	// didn't render -	}	 +	}  #endif /* USE_DISPLAY_CALLBACK */ -	 +  	// This is cheaper than checking time, so we do it first  	if (!_screen->isDirty() &&  	        (!_overlay->isDirty()) && @@ -393,7 +393,7 @@ bool DisplayManager::renderAll() {  		return true;	// nothing to render  	} -	if (!isTimeToUpdate())  +	if (!isTimeToUpdate())  		return false;	// didn't render  	PSP_DEBUG_PRINT("screen[%s], overlay[%s], cursor[%s], keyboard[%s]\n", @@ -425,7 +425,7 @@ bool DisplayManager::renderAll() {  	_keyboard->setClean();  	_masterGuRenderer.guPostRender(); -	 +  	return true;	// rendered successfully  }  | 
