• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 ... 364 365 366 367 368 Next »

[fix] Fragile (and maybe others), source included
View New Posts | View Today's Posts

Pages (5): « Previous 1 2 3 4 5
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
[fix] Fragile (and maybe others), source included
06-08-2009, 05:44 PM
#41
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
LuisR14 that just causes OpenGL to render black Tongue
Find
Reply
06-09-2009, 02:50 AM
#42
LuisR14
Unregistered
 
woops left something in "comments" Tongue (but why not just use my version (in my previous post))

Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
    char pixels [3];
    int x, y;
    
    for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
        for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
            glReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
            glReadPixels( x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
            glReadPixels( x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
            if( (pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) )
                return false;
        }
    }
    return true;
}

void Renderer::SwapBuffers()
{
    // [ fix for Fragile by kamui_kun ...
    bool pass = false;
    
    if( Renderer::IsBlack() )
        pass = true;
    
    // ...]
    
    ...
    
    if( !pass )
        OpenGL_SwapBuffers();
    
    ...
}
Reply
06-09-2009, 03:15 AM
#43
val532 Offline
A french
***
Posts: 98
Threads: 7
Joined: Mar 2009
I haven't Fragile but for other game emu is 100% on my CPU and the screen is blak.
Excuse me for my bad English I'm a little French, which uses google translated most of the time.
Find
Reply
06-10-2009, 11:02 AM
#44
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
Yeah as i said it causes the rendering to stay black.
Find
Reply
06-10-2009, 12:29 PM
#45
LuisR14
Unregistered
 
hmm strange Undecided, i'm gonna have to look more into it later Undecided
Reply
06-10-2009, 02:37 PM
#46
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
This is what causes it

for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
Find
Reply
06-10-2009, 03:10 PM
#47
LuisR14
Unregistered
 
that shouldn't be causing it, since it's doing it correctly Undecided
Reply
06-10-2009, 04:26 PM
#48
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
lReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]); << it doesn't like it
Find
Reply
06-10-2009, 04:45 PM
#49
LuisR14
Unregistered
 
hmmm, might you try this Undecided

Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
    char pixels [3] = {'', '', ''};
    int x, y;
    
    for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
        for( x = 0; x < (int)OpenGL_GetBackbufferWidth(); x++ ) {
            glReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
            glReadPixels( x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
            glReadPixels( x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
            if( (pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) )
                return false;
        }
    }
    return true;
}

void Renderer::SwapBuffers()
{
    // [ fix for Fragile by kamui_kun ...
    bool pass = false;
    
    if( Renderer::IsBlack() )
        pass = true;
    
    // ...]
    
    ...
    
    if( !pass )
        OpenGL_SwapBuffers();
    
    ...
}
Reply
06-10-2009, 06:19 PM
#50
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
Nooooooo
glReadPixels seems to have a problem with large areas
Find
Reply
« Next Oldest | Next Newest »
Pages (5): « Previous 1 2 3 4 5


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode