~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to src/multiplay.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2008-12-04 01:13:26 UTC
  • mfrom: (1.1.7 upstream) (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081204011326-be9aos1swwhq2agu
Tags: 2.1.0~1.rc2-1
* New upstream release candidate
* Remove Linas Žvirblis from uploaders since he hasn't been
  heard from for a very long time.
* Improve the cross-build support slightly

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
BOOL                                            bSendingMap                                     = false;        // map broadcasting.
82
82
 
83
 
char                                            tempString[12];
84
83
char                                            beaconReceiveMsg[MAX_PLAYERS][MAX_CONSOLE_STRING_LENGTH];       //beacon msg for each player
85
84
char                                                            playerName[MAX_PLAYERS][MAX_STR_LENGTH];        //Array to store all player names (humans and AIs)
86
85
BOOL                                            bPlayerReadyGUI[MAX_PLAYERS] = {false};
433
432
 
434
433
// ////////////////////////////////////////////////////////////////////////////
435
434
// return a players name.
436
 
char *getPlayerName(UDWORD player)
 
435
const char* getPlayerName(unsigned int player)
437
436
{
438
437
        UDWORD i;
439
438
 
455
454
                                return getPlayerColourName(player);
456
455
                        }
457
456
 
458
 
                        return (char*)&NetPlay.players[i].name;
 
457
                        return NetPlay.players[i].name;
459
458
                }
460
459
        }
461
460
 
1903
1902
        return addBeaconBlip(locX, locY, receiver, sender, beaconReceiveMsg[sender]);
1904
1903
}
1905
1904
 
1906
 
static const char* playerColors[] =
1907
 
{
1908
 
        N_("Green"),
1909
 
        N_("Orange"),
1910
 
        N_("Grey"),
1911
 
        N_("Black"),
1912
 
        N_("Red"),
1913
 
        N_("Blue"),
1914
 
        N_("Pink"),
1915
 
        N_("Cyan")
1916
 
};
1917
 
 
1918
 
char *getPlayerColourName(SDWORD player)
1919
 
{
1920
 
        static const unsigned int end = sizeof(playerColors) / sizeof(const char*);
1921
 
 
1922
 
        ASSERT(player < end,
1923
 
               "getPlayerColourName: player number (%d) exceeds maximum (%d)\n", player, end - 1);
1924
 
 
1925
 
        if (player < end)
1926
 
        {
1927
 
                strcpy(tempString, _(playerColors[ getPlayerColour(player) ]));
1928
 
        }
1929
 
        else
1930
 
        {
1931
 
                tempString[0] = '0';
1932
 
        }
1933
 
 
1934
 
        return tempString;
 
1905
const char* getPlayerColourName(unsigned int player)
 
1906
{
 
1907
        static const char* playerColors[] =
 
1908
        {
 
1909
                N_("Green"),
 
1910
                N_("Orange"),
 
1911
                N_("Grey"),
 
1912
                N_("Black"),
 
1913
                N_("Red"),
 
1914
                N_("Blue"),
 
1915
                N_("Pink"),
 
1916
                N_("Cyan")
 
1917
        };
 
1918
 
 
1919
        ASSERT(player < ARRAY_SIZE(playerColors), "player number (%d) exceeds maximum (%zu)", player, ARRAY_SIZE(playerColors));
 
1920
 
 
1921
        if (player >= ARRAY_SIZE(playerColors))
 
1922
        {
 
1923
                return "";
 
1924
        }
 
1925
 
 
1926
        return gettext(playerColors[getPlayerColour(player)]);
1935
1927
}
1936
1928
 
1937
1929
/*