AssaultCube Reloaded Forums

Full Version: Night play?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Here's the final texture load code:
Code:
//somewhere outside the function
static void change_nv = 0;
//...
//In gl_drawhud()
     if(nightvision) {
        glEnable(GL_TEXTURE_2D);
        static Texture *nvtex = textureload("packages/misc/nv1.png", 3);
        static Texture *nvtex2 = textureload("packages/misc/nv2.png", 3);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        if((lastmillis - change_nv) < 50) {
            glBindTexture(GL_TEXTURE_2D, nvtex->id);
        } else {
            change_nv = lastmillis;
            glBindTexture(GL_TEXTURE_2D, nvtex2->id);
        }
        glColor4f(1, 1, 1,1);
        glBegin(GL_QUADS);
            glTexCoord2f(0, 0); glVertex2f(0, 0);
            glTexCoord2f(1, 0); glVertex2f(VIRTW, 0);
            glTexCoord2f(1, 1); glVertex2f(VIRTW, VIRTH);
            glTexCoord2f(0, 1); glVertex2f(0, VIRTH);
        glEnd();
     }
and the fog code:
Code:
//Best in gl_drawframe() behind the water stuff, but put it whereever you want.
    if(nightvision) {

        glFogfv(GL_FOG_COLOR, nfogc);
        glFogi(GL_FOG_START, 0);
        glFogi(GL_FOG_END, 30);
    }

For now it is flickering quite fast and I am not responsible for any monitor damage or mental diseases that might result of it...

Here are the images nv1.png and nv2.png:
[Image: GeEK49P.png]
[Image: Vvz7LiH.png]

They are basically the same, but one is moved one pixel up so when they are loaded one by one they flicker nicely (insanely? Tongue)
Sounds awesome! Thanks for the work on that! When I get a chance, I'll test it out (if I can figure out how to Tongue )
I'll upload a compilable version, wait a second...

It is uploaded to http://armory.icyboards.net/showthread.php?tid=7. To install extract in your ACR folder and recompile (Linux/gcc: make client && make install).
Um how should I install it in Windows?

PS @rXn I made You an admin in Armory!
Pages: 1 2 3 4