Night play?
2014-02-23, 11:49 AM (This post was last modified: 2014-02-23, 12:27 PM by rXn.)
#31
RE: Night play?
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)

The C Programming Language: combines the flexibility of assembly language with the power of assembly language.
Post Reply Quote this message in a reply
2014-02-27, 09:07 PM
#32
RE: Night play?
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 )

[Image: cooltext1205184320_zps17f1a4e2.gif]
Post Reply Quote this message in a reply
2014-02-28, 08:58 AM (This post was last modified: 2014-02-28, 09:28 AM by rXn.)
#33
RE: Night play?
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).

The C Programming Language: combines the flexibility of assembly language with the power of assembly language.
Post Reply Quote this message in a reply
2014-02-28, 11:56 AM (This post was last modified: 2014-02-28, 11:57 AM by -{ET}-xdEpicZombie.)
#34
RE: Night play?
Um how should I install it in Windows?

PS @rXn I made You an admin in Armory!

[Image: 3SVsNlV.png]
Post Reply Quote this message in a reply


Forum Jump: