mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
add a firstPersonArm flag for each CustomModelPart, remove hideFirstPersonArm (#681)
This commit is contained in:
parent
e0fe8f702b
commit
e95f7767d4
@ -642,14 +642,13 @@ static void CustomModel_GetPickingBounds(struct Entity* e) {
|
||||
static void CustomModel_DrawArm(struct Entity* e) {
|
||||
int i;
|
||||
struct CustomModel* cm = (struct CustomModel*)Models.Active;
|
||||
if (cm->hideFirstPersonArm) return;
|
||||
|
||||
Models.uScale = 1.0f / cm->uScale;
|
||||
Models.vScale = 1.0f / cm->vScale;
|
||||
|
||||
for (i = 0; i < cm->numParts; i++) {
|
||||
struct CustomModelPart* part = &cm->parts[i];
|
||||
if (part->anim == CustomModelAnim_RightArm) {
|
||||
if (part->firstPersonArm) {
|
||||
Model_DrawArmPart(&part->modelPart);
|
||||
}
|
||||
}
|
||||
|
@ -249,6 +249,7 @@ struct CustomModelPart {
|
||||
cc_uint8 anim;
|
||||
|
||||
cc_bool fullbright;
|
||||
cc_bool firstPersonArm;
|
||||
};
|
||||
|
||||
struct CustomModel {
|
||||
@ -256,7 +257,6 @@ struct CustomModel {
|
||||
struct ModelVertex* vertices;
|
||||
|
||||
char name[STRING_SIZE + 1];
|
||||
cc_bool hideFirstPersonArm;
|
||||
|
||||
float nameY;
|
||||
float eyeY;
|
||||
|
@ -1425,7 +1425,6 @@ static void CPE_DefineModel(cc_uint8* data) {
|
||||
customModel->model.pushes = (flags >> 1) & 1;
|
||||
customModel->model.usesHumanSkin = (flags >> 2) & 1;
|
||||
customModel->model.calcHumanAnims = (flags >> 3) & 1;
|
||||
customModel->hideFirstPersonArm = (flags >> 4) & 1;
|
||||
|
||||
/* read nameY, eyeY */
|
||||
customModel->nameY = ReadFloat(data);
|
||||
@ -1561,6 +1560,7 @@ static void CPE_DefineModelPart(cc_uint8* data) {
|
||||
/* read bool flags */
|
||||
flags = *data++;
|
||||
part->fullbright = (flags >> 0) & 1;
|
||||
part->firstPersonArm = (flags >> 1) & 1;
|
||||
|
||||
if (customModel->curPartIndex == customModel->numParts) {
|
||||
/* we're the last part, so register our model */
|
||||
|
Loading…
x
Reference in New Issue
Block a user