src/video/SDL_renderer_gles.c
changeset 3393 fe2f10481878
parent 3389 3fe2248fde37
child 3520 83518f8fcd61
     1.1 --- a/src/video/SDL_renderer_gles.c	Tue Oct 13 06:49:29 2009 +0000
     1.2 +++ b/src/video/SDL_renderer_gles.c	Tue Oct 13 06:51:20 2009 +0000
     1.3 @@ -611,7 +611,7 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -GLES_SetBlendMode(GLES_RenderData * data, int blendMode)
     1.8 +GLES_SetBlendMode(GLES_RenderData * data, int blendMode, int isprimitive)
     1.9  {
    1.10      if (blendMode != data->blendMode) {
    1.11          switch (blendMode) {
    1.12 @@ -620,6 +620,14 @@
    1.13              data->glDisable(GL_BLEND);
    1.14              break;
    1.15          case SDL_BLENDMODE_MASK:
    1.16 +            if (isprimitive) {
    1.17 +                data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    1.18 +                data->glDisable(GL_BLEND);
    1.19 +                /* The same as SDL_BLENDMODE_NONE */
    1.20 +                blendMode = SDL_BLENDMODE_NONE;
    1.21 +                break;
    1.22 +            }
    1.23 +            /* fall through */
    1.24          case SDL_BLENDMODE_BLEND:
    1.25              data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    1.26              data->glEnable(GL_BLEND);
    1.27 @@ -645,7 +653,7 @@
    1.28  {
    1.29      GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
    1.30  
    1.31 -    GLES_SetBlendMode(data, renderer->blendMode);
    1.32 +    GLES_SetBlendMode(data, renderer->blendMode, 1);
    1.33  
    1.34      data->glColor4f((GLfloat) renderer->r * inv255f,
    1.35                      (GLfloat) renderer->g * inv255f,
    1.36 @@ -669,7 +677,7 @@
    1.37  {
    1.38      GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
    1.39  
    1.40 -    GLES_SetBlendMode(data, renderer->blendMode);
    1.41 +    GLES_SetBlendMode(data, renderer->blendMode, 1);
    1.42  
    1.43      data->glColor4f((GLfloat) renderer->r * inv255f,
    1.44                      (GLfloat) renderer->g * inv255f,
    1.45 @@ -695,7 +703,7 @@
    1.46  {
    1.47      GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
    1.48  
    1.49 -    GLES_SetBlendMode(data, renderer->blendMode);
    1.50 +    GLES_SetBlendMode(data, renderer->blendMode, 1);
    1.51  
    1.52      data->glColor4f((GLfloat) renderer->r * inv255f,
    1.53                      (GLfloat) renderer->g * inv255f,
    1.54 @@ -789,7 +797,7 @@
    1.55          data->glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    1.56      }
    1.57  
    1.58 -    GLES_SetBlendMode(data, texture->blendMode);
    1.59 +    GLES_SetBlendMode(data, texture->blendMode, 0);
    1.60  
    1.61      switch (texture->scaleMode) {
    1.62      case SDL_TEXTURESCALEMODE_NONE: