fix build issues on linux
This commit is contained in:
parent
8e1405a023
commit
b3b3f87cfb
6 changed files with 26 additions and 29 deletions
src
|
@ -298,7 +298,7 @@ static int WriteMapPresentation(const std::string &mapname, CMap &map, Vec2i new
|
|||
--topplayer;
|
||||
}
|
||||
for (int i = 0; i <= topplayer; ++i) {
|
||||
f->printf("%s\"%s\"", (i ? ", " : ""), PlayerTypeNames[static_cast<int>(map.Info.PlayerType[i])]);
|
||||
f->printf("%s\"%s\"", (i ? ", " : ""), PlayerTypeNames[static_cast<int>(map.Info.PlayerType[i])].c_str());
|
||||
if (map.Info.PlayerType[i] == PlayerTypes::PlayerPerson) {
|
||||
++numplayers;
|
||||
}
|
||||
|
|
|
@ -269,25 +269,25 @@ size_t CServerSetup::Serialize(unsigned char *buf) const
|
|||
size_t CServerSetup::Deserialize(const unsigned char *p)
|
||||
{
|
||||
const unsigned char *buf = p;
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.DefeatReveal));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.Difficulty));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.FoV));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.GameType));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.DefeatReveal));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.Difficulty));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.FoV));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.GameType));
|
||||
// Inside is part of the bitfield
|
||||
// NetGameType is not needed
|
||||
// NoFogOfWar is part of the bitfield
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.NumUnits));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.Opponents));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.Resources));
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.RevealMap));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.NumUnits));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.Opponents));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.Resources));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.RevealMap));
|
||||
// The bitfield contains Inside and NoFogOfWar, as well as game-defined settings
|
||||
p += deserialize32(p, &static_cast<uint32_t>(this->ServerGameSettings._Bitfield));
|
||||
p += deserialize32(p, reinterpret_cast<uint32_t*>(&this->ServerGameSettings._Bitfield));
|
||||
|
||||
for (int i = 0; i < PlayerMax; ++i) {
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->ServerGameSettings.Presets[i].Race));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->ServerGameSettings.Presets[i].Race));
|
||||
}
|
||||
for (int i = 0; i < PlayerMax; ++i) {
|
||||
p += deserialize8(p, &static_cast<int8_t>(this->CompOpt[i]));
|
||||
p += deserialize8(p, reinterpret_cast<int8_t*>(&this->CompOpt[i]));
|
||||
}
|
||||
for (int i = 0; i < PlayerMax; ++i) {
|
||||
p += deserialize8(p, &this->Ready[i]);
|
||||
|
|
|
@ -1750,7 +1750,7 @@ void NetworkServerStartGame()
|
|||
#ifdef DEBUG
|
||||
printf("INITIAL ServerSetupState:\n");
|
||||
for (int i = 0; i < PlayerMax - 1; ++i) {
|
||||
printf("%02d: CO: %d Race: %d Host: ", i, ServerSetupState.CompOpt[i], ServerSetupState.ServerGameSettings.Presets[i].Race);
|
||||
printf("%02d: CO: %d Race: %d Host: ", i, (int)ServerSetupState.CompOpt[i], ServerSetupState.ServerGameSettings.Presets[i].Race);
|
||||
if (ServerSetupState.CompOpt[i] == SlotOption::Available) {
|
||||
const std::string hostStr = CHost(Hosts[i].Host, Hosts[i].Port).toString();
|
||||
printf(" %s %s", hostStr.c_str(), Hosts[i].PlyName);
|
||||
|
@ -2039,7 +2039,7 @@ void NetworkGamePrepareGameSettings()
|
|||
|
||||
#ifdef DEBUG
|
||||
for (int i = 0; i < PlayerMax - 1; i++) {
|
||||
printf("%02d: CO: %d Race: %d Name: ", i, ServerSetupState.CompOpt[i], ServerSetupState.ServerGameSettings.Presets[i].Race);
|
||||
printf("%02d: CO: %d Race: %d Name: ", i, (int)ServerSetupState.CompOpt[i], ServerSetupState.ServerGameSettings.Presets[i].Race);
|
||||
if (ServerSetupState.CompOpt[i] == SlotOption::Available) {
|
||||
for (int h = 0; h != HostsCount; ++h) {
|
||||
if (Hosts[h].PlyNr == i) {
|
||||
|
@ -2070,14 +2070,14 @@ void NetworkGamePrepareGameSettings()
|
|||
for (int i = 0; i < h; i++) {
|
||||
GameSettings.Presets[num[i]].Race = ServerSetupState.ServerGameSettings.Presets[num[i]].Race;
|
||||
switch (ServerSetupState.CompOpt[num[i]]) {
|
||||
case 0: {
|
||||
case SlotOption::Available: {
|
||||
GameSettings.Presets[num[i]].Type = PlayerTypes::PlayerPerson;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case SlotOption::Computer:
|
||||
GameSettings.Presets[num[i]].Type = PlayerTypes::PlayerComputer;
|
||||
break;
|
||||
case 2:
|
||||
case SlotOption::Closed:
|
||||
GameSettings.Presets[num[i]].Type = PlayerTypes::PlayerNobody;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -1054,8 +1054,6 @@ public:
|
|||
game_settings |= 0x400;
|
||||
}
|
||||
switch (GameSettings.Resources) {
|
||||
case -1:
|
||||
break;
|
||||
case 1:
|
||||
game_settings |= 0x1000;
|
||||
break;
|
||||
|
|
|
@ -452,7 +452,7 @@ void CPlayer::Save(CFile &file) const
|
|||
case PlayerTypes::PlayerPerson: file.printf("\"person\","); break;
|
||||
case PlayerTypes::PlayerRescuePassive: file.printf("\"rescue-passive\","); break;
|
||||
case PlayerTypes::PlayerRescueActive: file.printf("\"rescue-active\","); break;
|
||||
default: file.printf("%d,", p.Type); break;
|
||||
default: file.printf("%d,", (int)p.Type); break;
|
||||
}
|
||||
file.printf(" \"race\", \"%s\",", PlayerRaces.Name[p.Race].c_str());
|
||||
file.printf(" \"ai-name\", \"%s\",\n", p.AiName.c_str());
|
||||
|
@ -1291,14 +1291,13 @@ void DebugPlayers()
|
|||
const char *playertype;
|
||||
|
||||
switch (Players[i].Type) {
|
||||
case 0: playertype = "Don't know 0"; break;
|
||||
case 1: playertype = "Don't know 1"; break;
|
||||
case 2: playertype = "neutral "; break;
|
||||
case 3: playertype = "nobody "; break;
|
||||
case 4: playertype = "computer "; break;
|
||||
case 5: playertype = "person "; break;
|
||||
case 6: playertype = "rescue pas. "; break;
|
||||
case 7: playertype = "rescue akt. "; break;
|
||||
case PlayerTypes::Unset: playertype = "unset "; break;
|
||||
case PlayerTypes::PlayerNeutral: playertype = "neutral "; break;
|
||||
case PlayerTypes::PlayerNobody: playertype = "nobody "; break;
|
||||
case PlayerTypes::PlayerComputer: playertype = "computer "; break;
|
||||
case PlayerTypes::PlayerPerson: playertype = "person "; break;
|
||||
case PlayerTypes::PlayerRescuePassive: playertype = "rescue pas. "; break;
|
||||
case PlayerTypes::PlayerRescueActive: playertype = "rescue akt. "; break;
|
||||
default : playertype = "?unknown? "; break;
|
||||
}
|
||||
DebugPrint("%2d: %8.8s %c %-8.8s %s %7s %s\n" _C_ i _C_ PlayerColorNames[i].c_str() _C_
|
||||
|
|
|
@ -2188,7 +2188,7 @@ static int CclRestartStratagus(lua_State *l)
|
|||
#endif
|
||||
}
|
||||
if (insertRestartArgument) {
|
||||
argv[newArgc - 2] = "-r";
|
||||
argv[newArgc - 2] = (char*)"-r";
|
||||
}
|
||||
argv[newArgc - 1] = (char *)0;
|
||||
#ifdef WIN32
|
||||
|
|
Loading…
Add table
Reference in a new issue