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...


2 posters

    [Solved] Help with animated objects

    avatar
    Werewolf-3D
    Wolf3d n00b
    Wolf3d n00b


    Number of posts : 5
    Age : 32
    Registration date : 2016-09-16

    [Solved] Help with animated objects Empty [Solved] Help with animated objects

    Post by Werewolf-3D Fri Sep 16, 2016 11:44 pm

    Hi. I'm trying to get this code written by WSJ on the DHW forums to work. It's meant to animate static objects but when tested in-game on said objects, there are no visible effects. I've read and re-read the code and even tried some changes but no dice. I am trying to do this with the Wolf4SDL code. Any ideas?

    Open WL_DRAW.C and look for these lines:

    Code:
    //
    // place static objects
    //

      for (statptr = &statobjlist[0] ; statptr !=laststatobj ; statptr++)
      {
       if ((visptr->shapenum = statptr->shapenum) == -1)
       continue;                  // object has been deleted

       if (!*statptr->visspot)
       continue;                  // not visable



    Beneath that, add this:

    Code:
    switch (statptr->shapenum)
    {
    case SPR_STAT_0:
      visptr->shapenum+=(frameon>>4)%2; // slow animation with 2 frames
      break;
    case SPR_STAT_29:
      visptr->shapenum+=(frameon>>2)%4; // fast animation with 4 frames
      break;
    }


    Last edited by Werewolf-3D on Sat Sep 17, 2016 4:05 pm; edited 1 time in total
    Mega Luigi
    Mega Luigi
    Bring em' On!
    Bring em' On!


    Number of posts : 160
    Age : 13
    Registration date : 2012-11-01

    [Solved] Help with animated objects Empty Re: [Solved] Help with animated objects

    Post by Mega Luigi Sat Sep 17, 2016 9:46 am

    One idea, actually.

    Did you add

    Code:
    frameon++;

    at some point in your code?

    If not, then add it anywhere in your ThreeDRefresh function in WL_DRAW.
    avatar
    Werewolf-3D
    Wolf3d n00b
    Wolf3d n00b


    Number of posts : 5
    Age : 32
    Registration date : 2016-09-16

    [Solved] Help with animated objects Empty Re: [Solved] Help with animated objects

    Post by Werewolf-3D Sat Sep 17, 2016 4:04 pm

    Thanks, works perfectly! Smile

    Sponsored content


    [Solved] Help with animated objects Empty Re: [Solved] Help with animated objects

    Post by Sponsored content


      Current date/time is Thu Mar 28, 2024 8:01 am