void GBI_MakeCurrent( MicrocodeInfo *current ) { int i; if (current != GBI.top) { if (current == GBI.bottom) { GBI.bottom = current->higher; GBI.bottom->lower = NULL; } else { current->higher->lower = current->lower; current->lower->higher = current->higher; } current->higher = NULL; current->lower = GBI.top; GBI.top->higher = current; GBI.top = current; } if (!GBI.current || (GBI.current->type != current->type)) { for (i = 0; i <= 0xFF; i++) GBI.cmd[i] = GBI_Unknown; RDP_Init(); switch (current->type) { case F3D: F3D_Init(); break; case F3DEX: F3DEX_Init(); break; case F3DEX2: F3DEX2_Init(); break; case L3D: L3D_Init(); break; case L3DEX: L3DEX_Init(); break; case L3DEX2: L3DEX2_Init(); break; case S2DEX: S2DEX_Init(); break; case S2DEX2: S2DEX2_Init(); break; case F3DDKR: F3DDKR_Init(); break; case F3DWRUS: F3DWRUS_Init(); break; case F3DPD: F3DPD_Init(); break; case F3DCBFD: F3DCBFD_Init(); break; } } GBI.current = current; }
void GBI_MakeCurrent( MicrocodeInfo *current ) { int i; if (current != GBI.top) { if (current == GBI.bottom) { GBI.bottom = current->higher; GBI.bottom->lower = NULL; } else { current->higher->lower = current->lower; current->lower->higher = current->higher; } current->higher = NULL; current->lower = GBI.top; GBI.top->higher = current; GBI.top = current; } if (!GBI.current || (GBI.current->type != current->type)) { for (i = 0; i <= 0xFF; i++) GBI.cmd[i] = GBI_Unknown; RDP_Init(); switch (current->type) { case F3D: F3D_Init(); break; case F3DEX: F3DEX_Init(); break; case F3DEX2: F3DEX2_Init(); break; case L3D: L3D_Init(); break; case L3DEX: L3DEX_Init(); break; case L3DEX2: L3DEX2_Init(); break; case S2DEX: S2DEX_Init(); break; case S2DEX2: S2DEX2_Init(); break; case F3DDKR: F3DDKR_Init(); break; case F3DJFG: F3DJFG_Init(); break; case F3DSWSE: F3DSWSE_Init(); break; case F3DWRUS: F3DWRUS_Init(); break; case F3DPD: F3DPD_Init(); break; #ifdef NEW case F3DEX2CBFD:F3DEX2CBFD_Init(); break; case Turbo3D: F3D_Init(); break; case ZSortp: ZSort_Init(); break; #else case F3DEX2CBFD: F3DCBFD_Init(); break; #endif } #ifdef NEW if (current->NoN) { // Disable near and far plane clipping glEnable(GL_DEPTH_CLAMP); // Enable Far clipping plane in vertex shader glEnable(GL_CLIP_DISTANCE0); } else { glDisable(GL_DEPTH_CLAMP); glDisable(GL_CLIP_DISTANCE0); } #endif } #ifdef NEW else if (current->NoN != current->NoN) { if (current->NoN) { // Disable near and far plane clipping glEnable(GL_DEPTH_CLAMP); // Enable Far clipping plane in vertex shader glEnable(GL_CLIP_DISTANCE0); } else { glDisable(GL_DEPTH_CLAMP); glDisable(GL_CLIP_DISTANCE0); } } #endif GBI.current = current; }