[AStyle]
This commit is contained in:
parent
72e97ebe40
commit
f50cc657be
5 changed files with 13 additions and 13 deletions
src
|
@ -67,9 +67,9 @@ void AiCheckMagic()
|
|||
// Check if we can cast this spell. SpellIsAvailable checks for upgrades.
|
||||
if (unit.Type->CanCastSpell[j] && SpellIsAvailable(player, j)
|
||||
&& SpellTypeTable[j]->AICast) {
|
||||
if (AutoCastSpell(unit, *SpellTypeTable[j])) {
|
||||
return; // cast only one spell per time
|
||||
}
|
||||
if (AutoCastSpell(unit, *SpellTypeTable[j])) {
|
||||
return; // cast only one spell per time
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -528,7 +528,8 @@ int SocketSet::Select(int timeout)
|
|||
} while (retval == -1 && errno == EINTR);
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i != this->Sockets.size(); ++i) {
|
||||
for (size_t i = 0; i != this->Sockets.size(); ++i)
|
||||
{
|
||||
this->SocketReady[i] = FD_ISSET(this->Sockets[i], &mask);
|
||||
}
|
||||
return retval;
|
||||
|
|
|
@ -85,7 +85,7 @@ int serialize8(unsigned char *buf, int8_t data)
|
|||
return sizeof(data);
|
||||
}
|
||||
template <int N>
|
||||
int serialize(unsigned char *buf, const char (&data)[N])
|
||||
int serialize(unsigned char *buf, const char(&data)[N])
|
||||
{
|
||||
if (buf) {
|
||||
memcpy(buf, data, N);
|
||||
|
@ -124,7 +124,7 @@ int deserialize8(const unsigned char *buf, int8_t *data)
|
|||
return sizeof(*data);
|
||||
}
|
||||
template <int N>
|
||||
int deserialize(const unsigned char *buf, char (&data)[N])
|
||||
int deserialize(const unsigned char *buf, char(&data)[N])
|
||||
{
|
||||
memcpy(data, buf, N);
|
||||
return N;
|
||||
|
|
|
@ -257,8 +257,7 @@ public:
|
|||
/**
|
||||
** Network Selection Info
|
||||
*/
|
||||
struct NetworkSelectionHeader
|
||||
{
|
||||
struct NetworkSelectionHeader {
|
||||
unsigned char Type[MaxNetworkCommands]; /// Command
|
||||
unsigned NumberSent : 6; /// New Number Selected
|
||||
unsigned Add : 1; /// Adding to Selection
|
||||
|
@ -1188,7 +1187,7 @@ void NetworkRecover()
|
|||
continue;
|
||||
}
|
||||
int secs = (FrameCounter - NetworkLastFrame[Hosts[i].PlyNr]) /
|
||||
(FRAMES_PER_SECOND * VideoSyncSpeed / 100);
|
||||
(FRAMES_PER_SECOND * VideoSyncSpeed / 100);
|
||||
// FIXME: display a menu while we wait
|
||||
if (secs >= 3 && secs < NetworkTimeout) {
|
||||
if (FrameCounter % FRAMES_PER_SECOND < (unsigned long)NetworkUpdates) {
|
||||
|
|
|
@ -723,14 +723,14 @@ void CGraphic::Load(bool grayscale)
|
|||
break;
|
||||
}
|
||||
case 4: {
|
||||
Uint32* p;
|
||||
Uint32 *p;
|
||||
for (int i = 0; i < Height; ++i) {
|
||||
for (int j = 0; j < Width; ++j) {
|
||||
p = (Uint32 *)(Surface->pixels) + i * Width + j * bpp;
|
||||
const Uint32 gray = ((Uint8)((*p) * redGray) >> f->Rshift) +
|
||||
((Uint8)(*(p + 1) * greenGray) >> f->Gshift) +
|
||||
((Uint8)(*(p + 2) * blueGray) >> f->Bshift) +
|
||||
((Uint8)(*(p + 3)) >> f->Ashift);
|
||||
((Uint8)(*(p + 1) * greenGray) >> f->Gshift) +
|
||||
((Uint8)(*(p + 2) * blueGray) >> f->Bshift) +
|
||||
((Uint8)(*(p + 3)) >> f->Ashift);
|
||||
*p = gray;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue