1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

(svn r8969) -Codechange: rework of the player face bits.

- introduce a new format (with backward compatability) that is more clear and needs a much simpler face drawer
 - replace tons of ifs/switches/magic numbers by table lookups
This commit is contained in:
rubidium
2007-03-02 01:17:11 +00:00
parent 89d8f5f7b5
commit ea319b78f8
13 changed files with 287 additions and 127 deletions

View File

@@ -14,6 +14,7 @@
#include "network/network.h"
#include "variables.h"
#include "livery.h"
#include "player_face.h"
/** Change the player's face.
* @param tile unused
@@ -22,8 +23,12 @@
*/
int32 CmdSetPlayerFace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
PlayerFace pf = (PlayerFace)p2;
if (!IsValidPlayerFace(pf)) return CMD_ERROR;
if (flags & DC_EXEC) {
GetPlayer(_current_player)->face = p2;
GetPlayer(_current_player)->face = pf;
MarkWholeScreenDirty();
}
return 0;