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


    [Tutorial] Adding floor/ceiling tiles with ID 256 and higher (SDL)

    Share

    WLHack
    Senior Member
    Senior Member

    Male
    Number of posts : 792
    Age : 27
    Location : Finland
    Registration date : 2007-03-26

    [Tutorial] Adding floor/ceiling tiles with ID 256 and higher (SDL)

    Post by WLHack on Tue Feb 26, 2013 1:57 am

    If you have lots of walls in your vswap so that your floor/ceiling tiles have an ID of 256 or larger,
    using only the third plane to store the floor/ceiling values becomes unavailable.
    Fortunately you don't need to enable another plane to get the floor/ceiling values right...

    Open the wl_floorceiling.cpp and search for this line:
    Code:

    unsigned curtoptex = curtex >> 8;
    Now add this line under it:
    Code:

    if(curtoptex > 0 && curtoptex < 64) curtoptex += 255;  //Note: change the 64 to match your last wall texture


    Then search for this line (should be only few lines below):
    Code:

    unsigned curbottex = curtex & 0xff;
    And add this line under it:
    Code:

    if(curbottex > 0 && curbottex < 64) curbottex += 255; //Note: change the 64 to match your last wall texture


    Now using the wall textures 1-63 as the floor/ceiling will change the floor/ceiling value to 256-318.
    So basically now you can have as many floor/ceiling textures with id over 255 as you have walls
    in your vswap (remember to change the 64 as the last wall texture you are using).



    Hammer: I can see it now: you and the moon - wear a necktie so I'll know you.
    Building a new webpage...

      Current date/time is Tue Sep 27, 2016 10:08 pm