Skip to content

Commit

Permalink
Don't try to calculate uScale/vScale in Model_SetupState, because thi…
Browse files Browse the repository at this point in the history
…s is done in Model_ApplyTexture
  • Loading branch information
UnknownShadow200 committed Oct 17, 2020
1 parent 851a58d commit 6af0c73
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Model.c
Expand Up @@ -111,20 +111,19 @@ void Model_Render(struct Model* model, struct Entity* e) {

void Model_SetupState(struct Model* model, struct Entity* e) {
PackedCol col;
cc_bool _64x64;
float yawDelta;

model->index = 0;
col = e->VTABLE->GetCol(e);
Models.Cols[0] = col;

_64x64 = e->SkinType != SKIN_64x32;
/* only apply when using humanoid skins */
_64x64 &= model->usesHumanSkin || e->MobTextureId;

Models.uScale = e->uScale * 0.015625f;
Models.vScale = e->vScale * (_64x64 ? 0.015625f : 0.03125f);
/* If a model forgets to call Model_ApplyTexture but still tries to draw,
/* then it is not using the model API properly. */
/* So set uScale/vScale to ridiculous defaults to make it obvious */
/* TODO: Remove setting this eventually */
Models.uScale = 100.0f;
Models.vScale = 100.0f;

Models.Cols[0] = col;
if (!e->NoShade) {
Models.Cols[1] = PackedCol_Scale(col, PACKEDCOL_SHADE_YMIN);
Models.Cols[2] = PackedCol_Scale(col, PACKEDCOL_SHADE_Z);
Expand Down

0 comments on commit 6af0c73

Please sign in to comment.