Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

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


    [Solved] Help with animated objects

    Share

    Werewolf-3D
    Wolf3d n00b
    Wolf3d n00b

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

    [Solved] Help with animated objects

    Post by Werewolf-3D on 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
    Bring em' On!
    Bring em' On!

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

    Re: [Solved] Help with animated objects

    Post by Mega Luigi on 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.

    Werewolf-3D
    Wolf3d n00b
    Wolf3d n00b

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

    Re: [Solved] Help with animated objects

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

    Thanks, works perfectly! Smile

    Sponsored content

    Re: [Solved] Help with animated objects

    Post by Sponsored content Today at 3:23 am


      Current date/time is Sat Oct 01, 2016 3:23 am