Dynamic number of models per frame ( > 4)

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image

Dynamic number of models per frame ( > 4)

Postby Cherno » Tue Feb 09, 2021 10:50 am

Pull Request

I finally managed to do this. Using TArrays, MODELDEF entries can now have an unlimited number of models per actor frame, instead of just four. TArrays have been used for this because the number of their elements can be changed dynamically. surfaceSkin was a two-dimensional array. It's now a one-dimensional TArray as well, and due to the neccessary changes in accessing it, a number of additional files besides model.h and models.cpp needed the be changed.

Tested to work with multiple SurfaceSkin properties per model, animations, and animated voxels.

I created a simple pk3 for testing (use with doom2.wad). In MAP01, it contains a sample actor that uses seven models per frame, is animated, and also has multiple SurfaceSkin properties for one of it's models. Right of the actor is clip that is replaced by a voxel, and to the left is a blue, animated voxel torch.

multimodel.pk3
You do not have the required permissions to view the files attached to this post.
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Dynamic number of models per frame ( > 4)

Postby Cherno » Tue Feb 09, 2021 1:35 pm

Update: I think I managed to squash the last of the compiling/debugging errors. As far as I am concerned, this one is good to go 8-) .
User avatar
Cherno
 
Joined: 06 Dec 2016


Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 0 guests