Subversion Repositories eduke32

Rev

Rev 885 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 885 Rev 886
Line 177... Line 177...
177
// line of sight checks before mddraw()
177
// line of sight checks before mddraw()
178
int r_cullobstructedmodels = 0;
178
int r_cullobstructedmodels = 0;
179
#define CULL_DELAY 5
179
#define CULL_DELAY 5
180
180
181
// fullbright cvar
181
// fullbright cvar
182
int r_fullbright = 1;
182
int r_fullbrights = 1;
183
183
184
static float fogresult, fogcol[4];
184
static float fogresult, fogcol[4];
185
185
186
// making this a macro should speed things up at the expense of code size
186
// making this a macro should speed things up at the expense of code size
187
#define fogcalc(shade, vis, pal) \
187
#define fogcalc(shade, vis, pal) \
Line 580... Line 580...
580
            bglBindTexture(GL_TEXTURE_2D,pth->glpic);
580
            bglBindTexture(GL_TEXTURE_2D,pth->glpic);
581
            bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
581
            bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
582
            bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
582
            bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
583
            if (glinfo.maxanisotropy > 1.0)
583
            if (glinfo.maxanisotropy > 1.0)
584
                bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
584
                bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
585
            if (r_fullbright && pth->flags & 16)
585
            if (r_fullbrights && pth->flags & 16)
586
            {
586
            {
587
                bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic);
587
                bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic);
588
                bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
588
                bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
589
                bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
589
                bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
590
                if (glinfo.maxanisotropy > 1.0)
590
                if (glinfo.maxanisotropy > 1.0)
Line 1815... Line 1815...
1815
        float hackscx, hackscy;
1815
        float hackscx, hackscy;
1816
1816
1817
        if (skyclamphack) method |= 4;
1817
        if (skyclamphack) method |= 4;
1818
        pth = gltexcache(globalpicnum,globalpal,method&(~3));
1818
        pth = gltexcache(globalpicnum,globalpal,method&(~3));
1819
1819
1820
        if (r_fullbright && pth->flags & 16)
1820
        if (r_fullbrights && pth->flags & 16)
1821
            if (indrawroomsandmasks)
1821
            if (indrawroomsandmasks)
1822
            {
1822
            {
1823
                if (!fullbrightdrawingpass)
1823
                if (!fullbrightdrawingpass)
1824
                    fullbrightdrawingpass = 1;
1824
                    fullbrightdrawingpass = 1;
1825
                else if (fullbrightdrawingpass == 2)
1825
                else if (fullbrightdrawingpass == 2)
Line 4512... Line 4512...
4512
                do // this is so gay
4512
                do // this is so gay
4513
                {
4513
                {
4514
                    if (totalclock < lastcullcheck[tspr->owner])
4514
                    if (totalclock < lastcullcheck[tspr->owner])
4515
                        break;
4515
                        break;
4516
                    cullmodel[tspr->owner] = 1;
4516
                    cullmodel[tspr->owner] = 1;
4517
                    if (tspr->statnum == 99)
4517
                    if (tspr->statnum == STAT_NOCULL)
4518
                        { cullmodel[tspr->owner] = 0; break; }
4518
                        { cullmodel[tspr->owner] = 0; break; }
4519
/*                    if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum,
4519
/*                    if (cansee(globalposx, globalposy, sector[globalcursectnum].ceilingz, globalcursectnum,
4520
                               tspr->x, tspr->y, tspr->z, tspr->sectnum))
4520
                               tspr->x, tspr->y, tspr->z, tspr->sectnum))
4521
                        { cullmodel[tspr->owner] = 0; break; }
4521
                        { cullmodel[tspr->owner] = 0; break; }
4522
                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4522
                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4523
                               tspr->x, tspr->y, tspr->z-((tilesizy[tspr->picnum]*tspr->yrepeat)<<2),tspr->sectnum))
4523
                               tspr->x, tspr->y, tspr->z-((tilesizy[tspr->picnum]*tspr->yrepeat)<<2),tspr->sectnum))
4524
                        { cullmodel[tspr->owner] = 0; break; } */
4524
                        { cullmodel[tspr->owner] = 0; break; } */
4525
                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4525
                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4526
                               tspr->x, tspr->y, tspr->z,tspr->sectnum))
4526
                               tspr->x, tspr->y, tspr->z,tspr->sectnum))
4527
                        { cullmodel[tspr->owner] = 0; break; }
4527
                        { cullmodel[tspr->owner] = 0; break; }
4528
                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4528
/*                    if (cansee(globalposx, globalposy, globalposz, globalcursectnum,
4529
                               tspr->x, tspr->y, globalposz,tspr->sectnum))
4529
                               tspr->x, tspr->y, globalposz,tspr->sectnum))
4530
                        { cullmodel[tspr->owner] = 0; break; }
4530
                        { cullmodel[tspr->owner] = 0; break; } */
4531
/*                    if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum,
4531
/*                    if (cansee(globalposx, globalposy, sector[globalcursectnum].floorz, globalcursectnum,
4532
                               tspr->x, tspr->y, tspr->z, tspr->sectnum))
4532
                               tspr->x, tspr->y, tspr->z, tspr->sectnum))
4533
                        { cullmodel[tspr->owner] = 0; break; } */
4533
                        { cullmodel[tspr->owner] = 0; break; } */
4534
4534
4535
                    if (polymost_checkcoordinates(0, 0, tspr))
4535
                    if (polymost_checkcoordinates(0, 0, tspr))
4536
                        { cullmodel[tspr->owner] = 0; break; }
4536
                        { cullmodel[tspr->owner] = 0; break; }
4537
4537
4538
                    i = 640;
4538
                    i = 256;
4539
                    if (polymost_checkcoordinates(-i, 0, tspr))
4539
                    if (polymost_checkcoordinates(-i, 0, tspr))
4540
                        { cullmodel[tspr->owner] = 0; break; }
4540
                        { cullmodel[tspr->owner] = 0; break; }
4541
                    if (polymost_checkcoordinates(-i, -i, tspr))
4541
                    if (polymost_checkcoordinates(-i, -i, tspr))
4542
                        { cullmodel[tspr->owner] = 0; break; }
4542
                        { cullmodel[tspr->owner] = 0; break; }
4543
                    if (polymost_checkcoordinates(0, -i, tspr))
4543
                    if (polymost_checkcoordinates(0, -i, tspr))
Line 5962... Line 5962...
5962
    {
5962
    {
5963
        if (showval) { OSD_Printf("r_cullobstructedmodels is %d\n", r_cullobstructedmodels); }
5963
        if (showval) { OSD_Printf("r_cullobstructedmodels is %d\n", r_cullobstructedmodels); }
5964
        else r_cullobstructedmodels = (val != 0);
5964
        else r_cullobstructedmodels = (val != 0);
5965
        return OSDCMD_OK;
5965
        return OSDCMD_OK;
5966
    }
5966
    }
5967
    else if (!Bstrcasecmp(parm->name, "r_fullbright"))
5967
    else if (!Bstrcasecmp(parm->name, "r_fullbrights"))
5968
    {
5968
    {
5969
        if (showval) { OSD_Printf("r_fullbright is %d\n", r_fullbright); }
5969
        if (showval) { OSD_Printf("r_fullbrights is %d\n", r_fullbrights); }
5970
        else r_fullbright = (val != 0);
5970
        else r_fullbrights = (val != 0);
5971
        return OSDCMD_OK;
5971
        return OSDCMD_OK;
5972
    }
5972
    }
5973
#endif
5973
#endif
5974
    return OSDCMD_SHOWHELP;
5974
    return OSDCMD_SHOWHELP;
5975
}
5975
}
Line 6010... Line 6010...
6010
    OSD_RegisterFunction("r_animsmoothing","r_animsmoothing: enable/disable model animation smoothing",osdcmd_polymostvars);
6010
    OSD_RegisterFunction("r_animsmoothing","r_animsmoothing: enable/disable model animation smoothing",osdcmd_polymostvars);
6011
    OSD_RegisterFunction("r_cullobstructedmodels","r_cullobstructedmodels: enable/disable hack to cull \"obstructed\" models",osdcmd_polymostvars);
6011
    OSD_RegisterFunction("r_cullobstructedmodels","r_cullobstructedmodels: enable/disable hack to cull \"obstructed\" models",osdcmd_polymostvars);
6012
    OSD_RegisterFunction("r_curpeel","r_curpeel: allows to display one depth layer at a time (for development purposes)",osdcmd_polymostvars);
6012
    OSD_RegisterFunction("r_curpeel","r_curpeel: allows to display one depth layer at a time (for development purposes)",osdcmd_polymostvars);
6013
    OSD_RegisterFunction("r_depthpeeling","r_depthpeeling: enable/disable order-independant transparency",osdcmd_polymostvars);
6013
    OSD_RegisterFunction("r_depthpeeling","r_depthpeeling: enable/disable order-independant transparency",osdcmd_polymostvars);
6014
    OSD_RegisterFunction("r_detailmapping","r_detailmapping: enable/disable detail mapping",osdcmd_polymostvars);
6014
    OSD_RegisterFunction("r_detailmapping","r_detailmapping: enable/disable detail mapping",osdcmd_polymostvars);
6015
    OSD_RegisterFunction("r_fullbright","r_fullbright: enable/disable fullbright textures",osdcmd_polymostvars);
6015
    OSD_RegisterFunction("r_fullbrights","r_fullbrights: enable/disable fullbright textures",osdcmd_polymostvars);
6016
    OSD_RegisterFunction("r_glowmapping","r_glowmapping: enable/disable glow mapping",osdcmd_polymostvars);
6016
    OSD_RegisterFunction("r_glowmapping","r_glowmapping: enable/disable glow mapping",osdcmd_polymostvars);
6017
    OSD_RegisterFunction("r_multisample","r_multisample: sets the number of samples used for antialiasing (0 = off)",osdcmd_polymostvars);
6017
    OSD_RegisterFunction("r_multisample","r_multisample: sets the number of samples used for antialiasing (0 = off)",osdcmd_polymostvars);
6018
    OSD_RegisterFunction("r_nvmultisamplehint","r_nvmultisamplehint: enable/disable Nvidia multisampling hinting",osdcmd_polymostvars);
6018
    OSD_RegisterFunction("r_nvmultisamplehint","r_nvmultisamplehint: enable/disable Nvidia multisampling hinting",osdcmd_polymostvars);
6019
    OSD_RegisterFunction("r_parallaxskyclamping","r_parallaxskyclamping: enable/disable parallaxed floor/ceiling sky texture clamping",osdcmd_polymostvars);
6019
    OSD_RegisterFunction("r_parallaxskyclamping","r_parallaxskyclamping: enable/disable parallaxed floor/ceiling sky texture clamping",osdcmd_polymostvars);
6020
    OSD_RegisterFunction("r_parallaxskypanning","r_parallaxskypanning: enable/disable parallaxed floor/ceiling panning when drawing a parallaxed sky",osdcmd_polymostvars);
6020
    OSD_RegisterFunction("r_parallaxskypanning","r_parallaxskypanning: enable/disable parallaxed floor/ceiling panning when drawing a parallaxed sky",osdcmd_polymostvars);