summaryrefslogtreecommitdiff
path: root/players.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-14 19:48:04 +0000
committertron <tron@openttd.org>2005-11-14 19:48:04 +0000
commitf7abff5f963cddfdd134ac52ffd8e72e3ed88f0c (patch)
treea9ba5d4f3c5c47ab3857060c5f95ed482530ed97 /players.c
parentd8b56c123eab7f7b48f2af3579130e366f6106ab (diff)
downloadopenttd-f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c.tar.xz
(svn r3181) -Bracing
-Indentation -Whitespace -DeMorgan's Law -Test with NULL or 0 for non-booleans -'\0' instead of 0 for chars -Remove redundantly redundant comments (like DoFoo(); // Do foo) -Join multiple short lines with a single statement -Split single lines with multiple statements -Avoid assignments in if
Diffstat (limited to 'players.c')
-rw-r--r--players.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/players.c b/players.c
index 15a53aba5..766bd07d4 100644
--- a/players.c
+++ b/players.c
@@ -135,17 +135,17 @@ void DrawPlayerFace(uint32 face, int color, int x, int y)
/* draw the hair */
{
uint val = GB(face, 16, 4);
- if (!(flag&2)) {
- if (!(flag&1)) {
- DrawSprite(0x382 + (val*9>>4), x, y);
+ if (flag & 2) {
+ if (flag & 1) {
+ DrawSprite(0x3D9 + (val * 5 >> 4), x, y);
} else {
- DrawSprite(0x38B + (val*5>>4), x, y);
+ DrawSprite(0x3D4 + (val * 5 >> 4), x, y);
}
} else {
- if (!(flag&1)) {
- DrawSprite(0x3D4 + (val*5>>4), x, y);
+ if (flag & 1) {
+ DrawSprite(0x38B + (val * 5 >> 4), x, y);
} else {
- DrawSprite(0x3D9 + (val*5>>4), x, y);
+ DrawSprite(0x382 + (val * 9 >> 4), x, y);
}
}
}
@@ -163,9 +163,7 @@ void DrawPlayerFace(uint32 face, int color, int x, int y)
DrawSprite(0x37B + (GB(val, 2, 2) * 4 >> 2), x, y);
val >>= 4;
- if (val < 3) {
- DrawSprite((flag&2 ? 0x3D1 : 0x37F) + val, x, y);
- }
+ if (val < 3) DrawSprite((flag & 2 ? 0x3D1 : 0x37F) + val, x, y);
}
}
@@ -173,14 +171,10 @@ void DrawPlayerFace(uint32 face, int color, int x, int y)
{
uint val = GB(face, 28, 3);
- if (!(flag&2)) {
- if (val<=1) {
- DrawSprite(0x347 + val, x, y);
- }
+ if (flag & 2) {
+ if (val <= 1) DrawSprite(0x3AE + val, x, y);
} else {
- if (val<=1) {
- DrawSprite(0x3AE + val, x, y);
- }
+ if (val <= 1) DrawSprite(0x347 + val, x, y);
}
}
}