]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
clarifications about the format of svc_fog
[xonotic/darkplaces.git] / gl_draw.c
index fc666f6f478c18da5bd3195b25d9644dda26e89d..bad2c8c711cfe2db24a1a25a11e985f59a88b4c3 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -25,8 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #define GL_COLOR_INDEX8_EXT     0x80E5
 
-extern unsigned char d_15to8table[65536];
-
 cvar_t         qsg_version = {"qsg_version", "1"};
 cvar_t         scr_conalpha = {"scr_conalpha", "1"};
 
@@ -54,6 +52,7 @@ int                   conbacktexnum;
 =============================================================================
 */
 
+/*
 #define        MAX_SCRAPS              2
 #define        BLOCK_WIDTH             256
 #define        BLOCK_HEIGHT    256
@@ -117,6 +116,7 @@ void Scrap_Upload (void)
                scraptexnum[texnum] = GL_LoadTexture (va("scrapslot%d", texnum), BLOCK_WIDTH, BLOCK_HEIGHT, scrap_texels[texnum], false, true, 1);
        scrap_dirty = false;
 }
+*/
 
 //=============================================================================
 /* Support Routines */
@@ -137,7 +137,7 @@ byte                menuplyr_pixels[4096];
 int            pic_texels;
 int            pic_count;
 
-int GL_LoadPicTexture (qpic_t *pic);
+extern int GL_LoadPicTexture (qpic_t *pic);
 
 qpic_t *Draw_PicFromWad (char *name)
 {
@@ -148,6 +148,7 @@ qpic_t *Draw_PicFromWad (char *name)
        gl = (glpic_t *)p->data;
 
        // load little ones into the scrap
+       /*
        if (p->width < 64 && p->height < 64)
        {
                int             x, y;
@@ -173,12 +174,13 @@ qpic_t *Draw_PicFromWad (char *name)
        }
        else
        {
+       */
                gl->texnum = GL_LoadPicTexture (p);
                gl->sl = 0;
                gl->sh = 1;
                gl->tl = 0;
                gl->th = 1;
-       }
+       //}
        return p;
 }
 
@@ -222,7 +224,9 @@ qpic_t      *Draw_CachePic (char *path)
        pic->pic.height = dat->height;
 
        gl = (glpic_t *)pic->pic.data;
-       gl->texnum = GL_LoadPicTexture (dat);
+       gl->texnum = loadtextureimage(path, 0, 0, false, false);
+       if (!gl->texnum)
+               gl->texnum = GL_LoadPicTexture (dat);
        gl->sl = 0;
        gl->sh = 1;
        gl->tl = 0;
@@ -233,8 +237,6 @@ qpic_t      *Draw_CachePic (char *path)
 
 extern void LoadSky_f(void);
 
-extern char *QSG_EXTENSIONS;
-
 /*
 ===============
 Draw_Init
@@ -261,7 +263,7 @@ void gl_draw_start()
 
        conbacktexnum = loadtextureimage("gfx/conback", 0, 0, false, false);
 
-       memset(scraptexnum, 0, sizeof(scraptexnum));
+//     memset(scraptexnum, 0, sizeof(scraptexnum));
 
        // get the other pics we need
        draw_disc = Draw_PicFromWad ("disc");
@@ -283,22 +285,12 @@ void GL_Draw_Init (void)
 
        Cmd_AddCommand ("loadsky", &LoadSky_f);
 
-#ifdef NEHAHRA
-#if defined(__linux__)
-       sprintf (engineversion, "DPNehahra Linux   GL %.2f build %3i", (float) VERSION, buildnumber);
-#elif defined(WIN32)
-       sprintf (engineversion, "DPNehahra Windows GL %.2f build %3i", (float) VERSION, buildnumber);
-#else
-       sprintf (engineversion, "DPNehahra Unknown GL %.2f build %3i", (float) VERSION, buildnumber);
-#endif
-#else
 #if defined(__linux__)
        sprintf (engineversion, "DarkPlaces Linux   GL %.2f build %3i", (float) VERSION, buildnumber);
 #elif defined(WIN32)
        sprintf (engineversion, "DarkPlaces Windows GL %.2f build %3i", (float) VERSION, buildnumber);
 #else
        sprintf (engineversion, "DarkPlaces Unknown GL %.2f build %3i", (float) VERSION, buildnumber);
-#endif
 #endif
        for (i = 0;i < 40 && engineversion[i];i++)
                engineversion[i] += 0x80; // shift to orange
@@ -342,7 +334,7 @@ void Draw_Character (int x, int y, int num)
                return;
        glBindTexture(GL_TEXTURE_2D, char_texture);
        // LordHavoc: NEAREST mode on text if not scaling up
-       if ((int) vid.width < glwidth)
+       if (glwidth < (int) vid.width)
        {
                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -386,7 +378,7 @@ void Draw_String (int x, int y, char *str, int maxlen)
        glBindTexture(GL_TEXTURE_2D, char_texture);
 
        // LordHavoc: NEAREST mode on text if not scaling up
-       if ((int) vid.width < glwidth)
+       if (glwidth < (int) vid.width)
        {
                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -437,8 +429,8 @@ void Draw_AlphaPic (int x, int y, qpic_t *pic, float alpha)
 {
        glpic_t                 *gl;
 
-       if (scrap_dirty)
-               Scrap_Upload ();
+//     if (scrap_dirty)
+//             Scrap_Upload ();
        gl = (glpic_t *)pic->data;
        if (!r_render.value)
                return;
@@ -462,8 +454,8 @@ void Draw_Pic (int x, int y, qpic_t *pic)
 {
        glpic_t                 *gl;
 
-       if (scrap_dirty)
-               Scrap_Upload ();
+//     if (scrap_dirty)
+//             Scrap_Upload ();
        gl = (glpic_t *)pic->data;
        if (!r_render.value)
                return;