Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    (help) Screenlock problem

    Officer-Michael John
    Officer-Michael John
    Seasoned Wolfer
    Seasoned Wolfer


    Male
    Number of posts : 332
    Age : 26
    Hobbie : Video and Wolf 3D mode making
    Registration date : 2014-08-04

    (help) Screenlock problem Empty (help) Screenlock problem

    Post by Officer-Michael John Wed Mar 30, 2016 3:18 am

    I probaly adding a Screenlock function as in Shadow Genesis,but not work. 

    WL_DEF.H:

    Code:
    //---------------
    //
    // gamestate structure
    //
    //---------------

    typedef struct
    {
        short      difficulty;
        short      mapon;
        int32_t    oldscore,score,nextextra;
        short      lives;
        short      health;
        short      ammo;
        short      keys;
        weapontype  bestweapon,weapon,chosenweapon;

        short      faceframe;
        short      attackframe,attackcount,weaponframe;

        short      episode,secretcount,treasurecount,killcount,
                    secrettotal,treasuretotal,killtotal;
        int32_t    TimeCount;
        int32_t    killx,killy;
        boolean    danger;
        boolean    danger1;
        boolean    danger2;
        boolean    danger3;
        boolean    victoryflag;            // set during victory animations
    } gametype;

    void    KillActor (objtype *ob);
    void    DamageActor (objtype *ob, unsigned damage);
    void    Danger (objtype *ob);

    WL_MAIN.CPP:

    Code:
    /*
    =====================
    =
    = NewGame
    =
    = Set up new game to start from the beginning
    =
    =====================
    */

    void NewGame (int difficulty,int episode)
    {
        memset (&gamestate,0,sizeof(gamestate));
        gamestate.difficulty = difficulty;
        gamestate.weapon = gamestate.bestweapon
                = gamestate.chosenweapon = wp_pistol;
        gamestate.health = 100;
        gamestate.ammo = STARTAMMO;
        gamestate.lives = 3;
        gamestate.nextextra = EXTRAPOINTS;
        gamestate.episode=episode;
        gamestate.danger = true;

        startgame = true;
    }

    WL_GAME.CPP:

    Code:
        gamestate.lives--;

        if (gamestate.lives > -1)
        {
            gamestate.health = 100;
            gamestate.weapon = gamestate.bestweapon
                = gamestate.chosenweapon = wp_pistol;
            gamestate.ammo = STARTAMMO;
            gamestate.keys = 0;
            pwallstate = pwallpos = 0;
            gamestate.attackframe = gamestate.attackcount =
                gamestate.weaponframe = 0;
            gamestate.danger = true;

            if(viewsize != 21)
            {
                DrawKeys ();
                DrawWeapon ();
                DrawAmmo ();
                DrawHealth ();
                DrawFace ();
                DrawLives ();
            }
        }
    }

    WL_STATE.CPP:

    Code:
    /*
    ===============
    =
    = Danger
    =
    ===============
    */

    void StatusDrawPic2 (unsigned x, unsigned y, unsigned picnum)
    {
        LatchDrawPicScaledCoord ((screenWidth-scaleFactor*320)/16 + scaleFactor*x,
            screenHeight-scaleFactor*(STATUSLINES-y),picnum);
    }

    void Danger (objtype *ob)
    {   
        gamestate.danger;
        {               
        FirstSighting (ob);                   
        gamestate.danger = false;
        }
        {
        }     
        gamestate.danger1;
        {               
        FirstSighting (ob);                   
        gamestate.danger = true;
        if(viewsize == 21 && ingame) return;
        StatusDrawPic2 (3,4,GOLDKEYPIC+gamestate.danger1);
        }
        {
        }     
        gamestate.danger2;
        {               
        FirstSighting (ob);                   
        gamestate.danger = true;
        if(viewsize == 21 && ingame) return;
        StatusDrawPic2 (3,4,SILVERKEYPIC+gamestate.danger2);
        }
        {
        }     
        gamestate.danger3;
        {               
        FirstSighting (ob);                   
        gamestate.danger = true;
        if(viewsize == 21 && ingame) return;
        StatusDrawPic2 (3,4,NOKEYPIC+gamestate.danger3);
             
    }
    }

      Current date/time is Wed Oct 30, 2024 7:06 am