Due to undefined downconversion rules from double to int, there is no way to safely downcast the return from MSTimef, meaning the function is completely useless for retrieving integral time stamps.
The old version is essential for these cases and must be kept around.
* Emit a warning when relational comparisons are made between signed and unsigned ints.
* Handle shift operators so that they do not fail for constant definitions.
* changed return type of Array::Size() to signed int as most code out there is using it this way and would otherwise drown in warnings.
* fixed a few deprecation warnings.
- To really take advantage of this function, I thought it would be useful to be able to add additional models if the user wants to. Let's say you got a player model at index 0. Your gun model has the same frames, but you don't want to duplicate the modeldef data. With generator index, you don't need to duplicate the data, just tell generator index to clone frame data from index 0.
- Implemented a little something to check if a negative skin or model index were passed, and prevent modders from pulling that off.
- Made it so when rendering a model, it clones an smf to use so that data isn't overwritten
- Reimplemented the skin index property. This changes the behavior of this index if CMDL_USESURFACESKIN is activated
- Let's fill the holes of serialized data so it can properly be removed instead of leaving undefined behavior behind.
- Added CMDL_HIDEMODEL flag. This makes a model index invisible.
- Made the 2 TArrays into a class called DActorModelData.
- Removed the skinindex and now just uses one index
- Replaced a bunch of nullptr for modelDef checking with NAME_None
- Added some garbage cleanup to A_ChangeModel itself, as well as removing memory of modelData that is no longer needed
- Attempted serialize code, putting up for review
-Added A_ChangeModelDef
A_ChangeModel(modeldef, modelpath, model, modelindex, skinpath, skin, skinid, flags)
This can change the modeldef, model and skins of an actor.
Currently, modelindex and skinindex accept indices from 0-15.
An actor MUST have a modeldef in order to use this function, either defined from modeldef, or given one through the modeldef parameter. You can pass "" to use the same modeldef. Likewise, passing "" for model or skin will just revert to the default model.
Available flags:
CMDL_WEAPONTOPLAYER - If used on a weapon, this instead change's the model on the player instead.
One issue I am aware of right now is that clearing a model by "" sort of works but is buggy. For now you can just manually set the model back using the names explicitly. However, I am stumped and I think getting more eyes on it would help.