Difference for arch/ogl/gr.c from version 1.6 to 1.7


version 1.6 version 1.7
Line 28
 
Line 28
 GLuint kludgetexture;  GLuint kludgetexture;
 unsigned char *kludgetexturedata=NULL;  unsigned char *kludgetexturedata=NULL;
   
   
 void ogl_init_state(void){  void ogl_init_state(void){
  /* select clearing (background) color   */   /* select clearing (background) color   */
  glClearColor(0.0, 0.0, 0.0, 0.0);   glClearColor(0.0, 0.0, 0.0, 0.0);
Line 53
 
Line 54
                               ky = (32.0/(float)grd_curscreen->sc_h);                                ky = (32.0/(float)grd_curscreen->sc_h);
   
  ogl_init_state();   ogl_init_state();
    glEnable( GL_TEXTURE_2D );
                         for (i=0; i<grd_curscreen->sc_w/32; i++) {                          for (i=0; i<grd_curscreen->sc_w/32; i++) {
                           for (j=0; j<grd_curscreen->sc_h/32; j++) {                            for (j=0; j<grd_curscreen->sc_h/32; j++) {
                         int y,x,c,t;                          int y,x,c,t;
Line 69
 
Line 71
                                 t+=grd_curscreen->sc_w;                                  t+=grd_curscreen->sc_w;
  }   }
   
  glEnable( GL_TEXTURE_2D );  
  // select our current texture   // select our current texture
  glBindTexture( GL_TEXTURE_2D, kludgetexture );   glBindTexture( GL_TEXTURE_2D, kludgetexture );
  glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );   glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
  // when texture area is small, bilinear filter the closest MIP map  
  glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST );   glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST );
  // when texture area is large, bilinear filter the first MIP map  
  glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );   glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
   
  // if wrap is true, the texture wraps over at the edges (repeat)   // if wrap is true, the texture wraps over at the edges (repeat)
  //       ... false, the texture ends at the edges (clamp)   //       ... false, the texture ends at the edges (clamp)
  glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,   glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_CLAMP );
  0 ? GL_REPEAT : GL_CLAMP );   glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_CLAMP );
  glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,  
  0 ? GL_REPEAT : GL_CLAMP );  
                         glTexImage2D( GL_TEXTURE_2D, 0, 3, 32,                          glTexImage2D( GL_TEXTURE_2D, 0, 3, 32,
                                       32, 0, GL_RGB, GL_UNSIGNED_BYTE, kludgetexturedata );                                        32, 0, GL_RGB, GL_UNSIGNED_BYTE, kludgetexturedata );
   
   
  glBegin( GL_QUADS );   glBegin( GL_QUADS );
  glColor3f(1.0,1.0,1.0);   glColor3f(1.0,1.0,1.0);
                         glTexCoord2d(0.0,0.0); glVertex2f(kx*(float)i,ky*(float)j);                          glTexCoord2d(0.0,0.0); glVertex2f(kx*(float)i,ky*(float)j);
Line 94
 
Line 93
                         glTexCoord2d(1.0,1.0); glVertex2f(kx*(float)(i+1),ky*(float)(j+1));                          glTexCoord2d(1.0,1.0); glVertex2f(kx*(float)(i+1),ky*(float)(j+1));
                         glTexCoord2d(0.0,1.0); glVertex2f(kx*(float)i,ky*(float)(j+1));                          glTexCoord2d(0.0,1.0); glVertex2f(kx*(float)i,ky*(float)(j+1));
  glEnd();   glEnd();
  glDisable( GL_TEXTURE_2D );   glDeleteTextures( 1, &kludgetexture );
                         }                          }
                         }                          }
    glDisable( GL_TEXTURE_2D );
   
   
  ogl_swap_buffers();//platform specific code   ogl_swap_buffers();//platform specific code
  glDeleteTextures( 1, &kludgetexture );  
  }   }
 // else  // else
 // ogl_swap_buffers();//platform specific code  // ogl_swap_buffers();//platform specific code
Line 180
 
Line 179
  if (gr_installed==1)   if (gr_installed==1)
  return -1;   return -1;
   
   #ifdef GR_SUPPORTS_FULLSCREEN_TOGGLE
    if (FindArg("-fullscreen"))
    gr_toggle_fullscreen();
   #endif
   
   
  ogl_init();//platform specific initialization   ogl_init();//platform specific initialization
   
  // allocate a texture name   // allocate a texture name
Line 234
 
Line 239
 }  }
   
 // Palette functions follow.  // Palette functions follow.
 ////inline GLfloat PAL2Tr(int c) {return (gr_palette[c*3]+gr_palette_gamma)/63.0;}  //////inline GLfloat PAL2Tr(int c) {return (gr_palette[c*3]+gr_palette_gamma)/63.0;}
 ////inline GLfloat PAL2Tg(int c) {return (gr_palette[c*3+1]+gr_palette_gamma)/63.0;}  //////inline GLfloat PAL2Tg(int c) {return (gr_palette[c*3+1]+gr_palette_gamma)/63.0;}
 ////inline GLfloat PAL2Tb(int c) {return (gr_palette[c*3+2]+gr_palette_gamma)/63.0;}  //////inline GLfloat PAL2Tb(int c) {return (gr_palette[c*3+2]+gr_palette_gamma)/63.0;}
   ////inline GLfloat PAL2Tr(int c) {return (gr_current_pal[c*3]+gr_palette_gamma)/63.0;}
   ////inline GLfloat PAL2Tg(int c) {return (gr_current_pal[c*3+1]+gr_palette_gamma)/63.0;}
   ////inline GLfloat PAL2Tb(int c) {return (gr_current_pal[c*3+2]+gr_palette_gamma)/63.0;}
 //inline GLfloat PAL2Tr(int c) {return (gr_current_pal[c*3]+gr_palette_gamma)/63.0;}  //inline GLfloat PAL2Tr(int c) {return (gr_current_pal[c*3]+gr_palette_gamma)/63.0;}
 //inline GLfloat PAL2Tg(int c) {return (gr_current_pal[c*3+1]+gr_palette_gamma)/63.0;}  //inline GLfloat PAL2Tg(int c) {return (gr_current_pal[c*3+1]+gr_palette_gamma)/63.0;}
 //inline GLfloat PAL2Tb(int c) {return (gr_current_pal[c*3+2]+gr_palette_gamma)/63.0;}  //inline GLfloat PAL2Tb(int c) {return (gr_current_pal[c*3+2]+gr_palette_gamma)/63.0;}
 inline GLfloat PAL2Tr(int c) {return (gr_current_pal[c*3]+gr_palette_gamma)/63.0;}  
 inline GLfloat PAL2Tg(int c) {return (gr_current_pal[c*3+1]+gr_palette_gamma)/63.0;}  
 inline GLfloat PAL2Tb(int c) {return (gr_current_pal[c*3+2]+gr_palette_gamma)/63.0;}  
   
 //static int last_r=0, last_g=0, last_b=0;  //static int last_r=0, last_g=0, last_b=0;
 GLfloat last_r=0, last_g=0, last_b=0;  GLfloat last_r=0, last_g=0, last_b=0;

Legend:
line(s) removed in v.1.6 
line(s) changed
 line(s) added in v.1.7