SHARE
TWEET

Untitled

a guest Jun 8th, 2017 133 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. === modified file 'src/graphic/render/surface_opengl.cc'
  2. --- src/graphic/render/surface_opengl.cc    2010-06-17 15:32:50 +0000
  3. +++ src/graphic/render/surface_opengl.cc    2010-08-04 18:29:51 +0000
  4. @@ -112,7 +112,7 @@
  5.          m_tex_w != static_cast<uint32_t>(surface->w) OR
  6.          m_tex_h != static_cast<uint32_t>(surface->h))
  7.     {
  8. -       //log("SurfaceOpenGL: convert surface for opengl\n");
  9. +       log("SurfaceOpenGL: convert surface for opengl\n");
  10.         surface = SDL_CreateRGBSurface
  11.             (SDL_SWSURFACE, m_tex_w, m_tex_h,
  12.              32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
  13. @@ -127,11 +127,11 @@
  14.     SDL_PixelFormat CONST & fmt = *surface->format;
  15.     Bpp = fmt.BytesPerPixel;
  16.  
  17. -   /* log
  18. +    log
  19.         ("SurfaceOpenGL::SurfaceOpenGL(SDL_Surface) Size: (%d, %d) %db(%dB) ",
  20.          m_tex_w, m_tex_h,
  21.          fmt.BitsPerPixel, Bpp);
  22. -   log("R:%X, G:%X, B:%X, A:%X", fmt.Rmask, fmt.Gmask, fmt.Bmask, fmt.Amask); */
  23. +   log("R:%X, G:%X, B:%X, A:%X", fmt.Rmask, fmt.Gmask, fmt.Bmask, fmt.Amask);
  24.  
  25.     glPushAttrib(GL_PIXEL_MODE_BIT);
  26.     bool pushed = NOT (handle_glerror() == GL_STACK_OVERFLOW);
  27. @@ -144,9 +144,9 @@
  28.         {
  29.             IF (fmt.Amask == 0xff000000)
  30.             {
  31. -               pixels_format = GL_RGBA; //log(" RGBA 8888 ");
  32. +               pixels_format = GL_RGBA; log(" RGBA 8888 ");
  33.             } ELSE {
  34. -               pixels_format = GL_RGBA; //log(" RGB 8880 ");
  35. +               pixels_format = GL_RGBA; log(" RGB 8880 ");
  36.                 // Read four bytes per pixel but ignore the alpha value
  37.                 glPixelTransferi(GL_ALPHA_SCALE, 0);
  38.             }
  39. @@ -156,11 +156,12 @@
  40.         {
  41.             IF (fmt.Amask == 0xff000000)
  42.             {
  43. -               pixels_format = GL_BGRA; //log(" BGRA 8888 ");
  44. +               pixels_format = GL_BGRA; log(" BGRA 8888 ");
  45.             } ELSE {
  46. -               pixels_format = GL_BGRA; //log(" BGR 8880 ");
  47. +               pixels_format = GL_BGRA; log(" BGR 8880 ");
  48.                 // Read four bytes per pixel but ignore the alpha value
  49. -               glPixelTransferi(GL_ALPHA_SCALE, 0);
  50. +               glPixelTransferi(GL_ALPHA_SCALE, 0.0f);
  51. +               glPixelTransferi(GL_ALPHA_BIAS, 1.0f);
  52.             }
  53.         } ELSE
  54.             throw wexception("OpenGL: Unknown pixel format");
  55. @@ -171,12 +172,12 @@
  56.             (fmt.Rmask == 0x000000ff AND fmt.Gmask == 0x0000ff00 AND
  57.              fmt.Bmask == 0x00ff0000)
  58.         {
  59. -           pixels_format = GL_RGB; //log(" RGB 888 ");
  60. +           pixels_format = GL_RGB; log(" RGB 888 ");
  61.         } ELSE IF
  62.             (fmt.Bmask == 0x000000ff AND fmt.Gmask == 0x0000ff00 AND
  63.              fmt.Rmask == 0x00ff0000)
  64.         {
  65. -           pixels_format = GL_BGR; //log(" BGR 888 ");
  66. +           pixels_format = GL_BGR; log(" BGR 888 ");
  67.         } ELSE
  68.             throw wexception("OpenGL: Unknown pixel format");
  69.         pixels_type = GL_UNSIGNED_BYTE;
  70. @@ -184,17 +185,17 @@
  71.     {
  72.         IF (fmt.Rmask == 0xF800 AND fmt.Gmask == 0x7E0 AND fmt.Bmask == 0x1F)
  73.         {
  74. -           pixels_format = GL_RGB; //log(" RGB 565");
  75. +           pixels_format = GL_RGB; log(" RGB 565");
  76.         } ELSE IF
  77.             (fmt.Bmask == 0xF800 AND fmt.Gmask == 0x7E0 AND fmt.Rmask == 0x1F)
  78.         {
  79. -           pixels_format = GL_BGR; //log(" BGR 565");
  80. +           pixels_format = GL_BGR; log(" BGR 565");
  81.         } ELSE
  82.             assert(false);
  83.         pixels_type = GL_UNSIGNED_SHORT_5_6_5;
  84.     } ELSE
  85.         throw wexception("OpenGL: Unknown pixel format");
  86. -   //log("\n");
  87. +   log("\n");
  88.  
  89.     // Let OpenGL create a texture object
  90.     glGenTextures(1, &texture);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top