Blake
2003.10.17, 02:03 AM
here is my code
if( ChangingAreas ) {
if( NextArea != NULL ) {
ChangingScreenAlphaChannel += 0.025f; }
else {
ChangingScreenAlphaChannel -= 0.025f; }
if( ChangingScreenAlphaChannel > 1.25f ) {
[ self SwitchMapArea:[ NextArea GetNewAreaName ] ];
[ ControlableObject SetX:[ NextArea GetNewX ] ];
[ ControlableObject SetY:[ NextArea GetNewY ] ];
[ ControlableObject SetZ:[ NextArea GetNewZ ] ];
NextArea = NULL; }
if( ChangingScreenAlphaChannel < 0.0f ) {
ChangingAreas= FALSE; }
glLoadIdentity();
glTranslatef( 0.0, 0.0, -0.5 );
if( ChangingScreenAlphaChannel < 1.0f ) {
glEnable( GL_BLEND );
glColor4d( 0.0, 0.0, 0.0, ChangingScreenAlphaChannel ); }
else {
glColor3d( 0.0, 0.0, 0.0 ); }
glBegin( GL_QUADS );
glVertex2d( -1.0f, -0.5f );
glVertex2d( 1.0, -0.5f );
glVertex2d( 1.0, 0.5f );
glVertex2d( -1.0f, 0.5f );
glEnd();
glDisable( GL_BLEND ); }
now my problem is that when the black is fading the screen looks normal, only when the alpha channel gets above 1 ( I only have it go to 1.5 to give the game some time to set everything up for the next area ) i dont use blend, any ideas why it doesnt blend the black before 1?
if( ChangingAreas ) {
if( NextArea != NULL ) {
ChangingScreenAlphaChannel += 0.025f; }
else {
ChangingScreenAlphaChannel -= 0.025f; }
if( ChangingScreenAlphaChannel > 1.25f ) {
[ self SwitchMapArea:[ NextArea GetNewAreaName ] ];
[ ControlableObject SetX:[ NextArea GetNewX ] ];
[ ControlableObject SetY:[ NextArea GetNewY ] ];
[ ControlableObject SetZ:[ NextArea GetNewZ ] ];
NextArea = NULL; }
if( ChangingScreenAlphaChannel < 0.0f ) {
ChangingAreas= FALSE; }
glLoadIdentity();
glTranslatef( 0.0, 0.0, -0.5 );
if( ChangingScreenAlphaChannel < 1.0f ) {
glEnable( GL_BLEND );
glColor4d( 0.0, 0.0, 0.0, ChangingScreenAlphaChannel ); }
else {
glColor3d( 0.0, 0.0, 0.0 ); }
glBegin( GL_QUADS );
glVertex2d( -1.0f, -0.5f );
glVertex2d( 1.0, -0.5f );
glVertex2d( 1.0, 0.5f );
glVertex2d( -1.0f, 0.5f );
glEnd();
glDisable( GL_BLEND ); }
now my problem is that when the black is fading the screen looks normal, only when the alpha channel gets above 1 ( I only have it go to 1.5 to give the game some time to set everything up for the next area ) i dont use blend, any ideas why it doesnt blend the black before 1?