File diff r2139:6871d2a8acac → r2140:efb49af98a17
players.c
Show inline comments
 
@@ -42,23 +42,23 @@ void DrawPlayerFace(uint32 face, int col
 
	/* draw the cheeks */
 
	DrawSprite(cheeks_table[flag&3], x, y);
 

	
 
	/* draw the chin */
 
	/* FIXME: real code uses -2 in zoomlevel 1 */
 
	{
 
		uint val = (face >> 4) & 3;
 
		uint val = GB(face, 4, 2);
 
		if (!(flag & 2)) {
 
			DrawSprite(0x327 + (flag&1?0:val), x, y);
 
		} else {
 
			DrawSprite((flag&1?0x3B1:0x391) + (val>>1), x, y);
 
		}
 
	}
 
	/* draw the eyes */
 
	{
 
		uint val1 = (face >> 6)&15;
 
		uint val2 = (face >> 20)&7;
 
		uint val1 = GB(face,  6, 4);
 
		uint val2 = GB(face, 20, 3);
 
		uint32 high = 0x314<<16;
 

	
 
		if (val2 >= 6) {
 
			high = 0x30F<<16;
 
			if (val2 != 6)
 
				high = 0x30D<<16;
 
@@ -78,13 +78,13 @@ void DrawPlayerFace(uint32 face, int col
 
			}
 
		}
 
	}
 

	
 
	/* draw the mouth */
 
	{
 
		uint val = (face >> 10) & 63;
 
		uint val = GB(face, 10, 6);
 
		uint val2;
 

	
 
		if (!(flag&1)) {
 
			val2 = ((val&0xF) * 15 >> 4);
 

	
 
			if (val2 < 3) {
 
@@ -124,13 +124,13 @@ void DrawPlayerFace(uint32 face, int col
 
		skip_mouth:;
 
	}
 

	
 

	
 
	/* draw the hair */
 
	{
 
		uint val = (face >> 16) & 15;
 
		uint val = GB(face, 16, 4);
 
		if (!(flag&2)) {
 
			if (!(flag&1)) {
 
				DrawSprite(0x382 + (val*9>>4), x, y);
 
			} else {
 
				DrawSprite(0x38B + (val*5>>4), x, y);
 
			}
 
@@ -142,13 +142,13 @@ void DrawPlayerFace(uint32 face, int col
 
			}
 
		}
 
	}
 

	
 
	/* draw the tie */
 
	{
 
		uint val = (face >> 20) & 0xFF;
 
		uint val = GB(face, 20, 8);
 

	
 
		if (!(flag&1)) {
 
			DrawSprite(0x36B + ((val&3)*3>>2), x, y);
 
			DrawSprite(0x36E + ((val>>2)&3), x, y);
 
			DrawSprite(0x372 + ((val>>4)*6>>4), x, y);
 
		} else {
 
@@ -161,13 +161,13 @@ void DrawPlayerFace(uint32 face, int col
 
			}
 
		}
 
	}
 

	
 
	/* draw the glasses */
 
	{
 
		uint val = (face >> 28) & 7;
 
		uint val = GB(face, 28, 3);
 

	
 
		if (!(flag&2)) {
 
			if (val<=1) {
 
				DrawSprite(0x347 + val, x, y);
 
			}
 
		} else {
 
@@ -368,13 +368,13 @@ static byte GeneratePlayerColor(void)
 
		colors[i] = i;
 

	
 
	// And randomize it
 
	n = 100;
 
	do {
 
		r = Random();
 
		COLOR_SWAP(r & 0xF, (r >> 4) & 0xF);
 
		COLOR_SWAP(GB(r, 0, 4), GB(r, 4, 4));
 
	} while (--n);
 

	
 
	// Bubble sort it according to the values in table 1
 
	i = 16;
 
	do {
 
		for(j=0; j!=15; j++) {
 
@@ -751,14 +751,14 @@ int32 CmdPlayerCtrl(int x, int y, uint32
 
			p->money64 = p->player_money = 100000000; // XXX - wtf?
 
			p->is_active = false;
 
		}
 
	} break;
 

	
 
	case 3: { /* Merge a company (#1) into another company (#2), elimination company #1 */
 
		PlayerID pid_old = p2 & 0xFFFF;
 
		PlayerID pid_new = (p2 >> 16) & 0xFFFF;
 
		PlayerID pid_old = GB(p2,  0, 16);
 
		PlayerID pid_new = GB(p2, 16, 16);
 

	
 
		if (pid_old >= MAX_PLAYERS || pid_new >= MAX_PLAYERS) return CMD_ERROR;
 

	
 
		if (!(flags & DC_EXEC)) return CMD_ERROR;
 

	
 
		ChangeOwnershipOfPlayerItems(pid_old, pid_new);