aboutsummaryrefslogtreecommitdiff
path: root/src/Person.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-07-02 18:09:30 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-07-02 18:16:49 +0700
commite66408c93548f5bb189f1b2606331cbd80ebfc44 (patch)
treee0e880cccda390293b9535af70843848079cf42e /src/Person.cpp
parentede447355a91abc64352039be4d30743fef69376 (diff)
downloadblackshades-e66408c93548f5bb189f1b2606331cbd80ebfc44.tar.gz
Fix black shades drawing
Diffstat (limited to 'src/Person.cpp')
-rw-r--r--src/Person.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Person.cpp b/src/Person.cpp
index f7066b2..b431b02 100644
--- a/src/Person.cpp
+++ b/src/Person.cpp
@@ -782,13 +782,13 @@ float* determine_color(int model, int who, int whichcostume)
{
switch (model) {
case 0:
- if (who || thirdperson)
+ if (who != 0 || thirdperson)
return costume[whichcostume].headcolor;
- else if (!who && thirdperson)
- return nullptr;
+ break;
case 1:
- if (who || thirdperson)
+ if (who != 0 || thirdperson)
return costume[whichcostume].chestcolor;
+ break;
case 2:
return costume[whichcostume].abdomencolor;
case 3:
@@ -803,9 +803,8 @@ float* determine_color(int model, int who, int whichcostume)
return costume[whichcostume].lowerlegcolor;
case 8:
return costume[whichcostume].footcolor;
- default:
- return nullptr;
}
+ return nullptr;
}
void draw_joint(Joint& joint, int who, int whichcostume)
@@ -824,7 +823,7 @@ void draw_joint(Joint& joint, int who, int whichcostume)
auto& model = joint.modelnum;
if (auto color = determine_color(model, who, whichcostume))
skeletonmodels[model].draw(*color, color[1], color[2]);
- else
+ if (model == 0 && who == 0 && thirdperson)
skeletonmodels[9].draw();
glPopMatrix();
}
@@ -846,7 +845,7 @@ void draw_muscle(Muscle& mus, int who, int whichcostume)
auto& model = mus.parent1->modelnum;
if (auto color = determine_color(model, who, whichcostume))
skeletonmodels[model].draw(*color, color[1], color[2]);
- else
+ if (model == 0 && who == 0 && thirdperson)
skeletonmodels[9].draw();
glPopMatrix();
}