Libwiisprite Widescreen fix? March 04, 2009 09:23PM | Registered: 15 years ago Posts: 68 |
void GameWindow::InitVideo(){ // This Code is taken from many examples, but modified for this lib if(_initialized)return; // Start initializing VIDEO_Init(); _rmode = VIDEO_GetPreferredMode(NULL); if(_rmode == NULL){ exit(0); return; } if( CONF_GetAspectRatio() ) //Widescreen fix { _rmode->viWidth = 678; _rmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678)/2; }
void LayerManager::Draw(s32 x, s32 y) const{ // Since this manager is using a modified scissor box, we use the data + hardcoded values GX_SetScissorBoxOffset(-x,-y-5);// Original-31); Agoaj: Made this change for the widescreen fix. GX_SetScissor(0, 0, _width, _height); // Do the layers! for(u32 i = _size; i > 0; i--){ if(i == 0) break; if(_layers[i-1]) _layers[i-1]->Draw(-_x, (-_y)-31); // As strange as it might look like, this fixes everything. }
Re: Libwiisprite Widescreen fix? March 05, 2009 09:23AM | Registered: 15 years ago Posts: 68 |
void GameWindow::InitVideo(){ // This Code is taken from many examples, but modified for this lib if(_initialized)return; // Start initializing VIDEO_Init(); _rmode = VIDEO_GetPreferredMode(NULL); if(_rmode == NULL){ exit(0); return; } if( CONF_GetAspectRatio() ) //Widescreen fix { _rmode->viWidth = 720; _rmode->viXOrigin = (VI_MAX_WIDTH_PAL - 720)/2; } _rmode->fbWidth = 608; //More changes _rmode->efbHeight = 520;I don't know why changing the frame buffer to those particular values works the way it does. For me it fills the screen with a 640 x 480 sprite. I'm not sure if it's better this way or if I should change it so that a 720 x 480 fills the screen correctly.
void LayerManager::Draw(s32 x, s32 y) const{ // Since this manager is using a modified scissor box, we use the data + hardcoded values if(CONF_GetAspectRatio() ) GX_SetScissorBoxOffset(-x-14,-y-5);// Original-31); Agoaj: Made this change for the widescreen fix. else GX_SetScissorBoxOffset(-x,-y-5); // Do the layers! for(u32 i = _size; i > 0; i--){ if(i == 0) break; if(_layers[i-1]) _layers[i-1]->Draw(-_x, (-_y)-31); // As strange as it might look like, this fixes everything. }