Run newer version of clang-format
FossilOrigin-Name: cc7ebd7f79185bc5f0a595af12d4de9ca8ad89c57858d96aaa7c0b8f9802d59f
This commit is contained in:
parent
20d8cfc364
commit
c7ee55e1e3
12 changed files with 31 additions and 40 deletions
20
src/Cube.m
20
src/Cube.m
|
@ -84,14 +84,12 @@ VARP(minmillis, 0, 5, 1000);
|
|||
_userDataIRI =
|
||||
[OFFileManager.defaultManager currentDirectoryIRI];
|
||||
|
||||
[OFFileManager.defaultManager
|
||||
createDirectoryAtIRI:
|
||||
[OFFileManager.defaultManager createDirectoryAtIRI:
|
||||
[_userDataIRI IRIByAppendingPathComponent:@"demos"]
|
||||
createParents:true];
|
||||
[OFFileManager.defaultManager
|
||||
createDirectoryAtIRI:
|
||||
createParents:true];
|
||||
[OFFileManager.defaultManager createDirectoryAtIRI:
|
||||
[_userDataIRI IRIByAppendingPathComponent:@"savegames"]
|
||||
createParents:true];
|
||||
createParents:true];
|
||||
|
||||
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | par) < 0)
|
||||
fatal(@"Unable to initialize SDL");
|
||||
|
@ -153,23 +151,23 @@ VARP(minmillis, 0, 5, 1000);
|
|||
&xs, &ys, false) ||
|
||||
!installtex(3,
|
||||
[_gameDataIRI IRIByAppendingPathComponent:
|
||||
@"data/martin/base.png"],
|
||||
@"data/martin/base.png"],
|
||||
&xs, &ys, false) ||
|
||||
!installtex(6,
|
||||
[_gameDataIRI IRIByAppendingPathComponent:
|
||||
@"data/martin/ball1.png"],
|
||||
@"data/martin/ball1.png"],
|
||||
&xs, &ys, false) ||
|
||||
!installtex(7,
|
||||
[_gameDataIRI IRIByAppendingPathComponent:
|
||||
@"data/martin/smoke.png"],
|
||||
@"data/martin/smoke.png"],
|
||||
&xs, &ys, false) ||
|
||||
!installtex(8,
|
||||
[_gameDataIRI IRIByAppendingPathComponent:
|
||||
@"data/martin/ball2.png"],
|
||||
@"data/martin/ball2.png"],
|
||||
&xs, &ys, false) ||
|
||||
!installtex(9,
|
||||
[_gameDataIRI IRIByAppendingPathComponent:
|
||||
@"data/martin/ball3.png"],
|
||||
@"data/martin/ball3.png"],
|
||||
&xs, &ys, false) ||
|
||||
!installtex(4,
|
||||
[_gameDataIRI
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
@interface
|
||||
OFString (Cube)
|
||||
@interface OFString (Cube)
|
||||
@property (readonly, nonatomic) int cube_intValue;
|
||||
|
||||
- (int)cube_intValueWithBase:(unsigned char)base;
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#include "cube.h"
|
||||
|
||||
@implementation
|
||||
OFString (Cube)
|
||||
@implementation OFString (Cube)
|
||||
- (int)cube_intValue
|
||||
{
|
||||
@try {
|
||||
|
|
|
@ -114,10 +114,9 @@ renderscore(Player *d)
|
|||
{
|
||||
OFString *lag = [OFString stringWithFormat:@"%d", d.lag];
|
||||
OFString *name = [OFString stringWithFormat:@"(%@)", d.name];
|
||||
OFString *line =
|
||||
[OFString stringWithFormat:@"%d\t%@\t%d\t%@\t%@", d.frags,
|
||||
(d.state == CS_LAGGED ? @"LAG" : lag), d.ping, d.team,
|
||||
(d.state == CS_DEAD ? name : d.name)];
|
||||
OFString *line = [OFString stringWithFormat:@"%d\t%@\t%d\t%@\t%@",
|
||||
d.frags, (d.state == CS_LAGGED ? @"LAG" : lag), d.ping, d.team,
|
||||
(d.state == CS_DEAD ? name : d.name)];
|
||||
|
||||
if (scoreLines == nil)
|
||||
scoreLines = [[OFMutableArray alloc] init];
|
||||
|
@ -171,7 +170,7 @@ renderscores()
|
|||
OFMutableString *teamScores = [OFMutableString string];
|
||||
for (size_t j = 0; j < teamsUsed; j++)
|
||||
[teamScores appendFormat:@"[ %@: %d ]", teamName[j],
|
||||
teamScore[j]];
|
||||
teamScore[j]];
|
||||
menumanual(0, scoreLines.count, @"");
|
||||
menumanual(0, scoreLines.count + 1, teamScores);
|
||||
}
|
||||
|
@ -208,7 +207,7 @@ COMMAND(sendmap, ARG_1STR, (^(OFString *mapname) {
|
|||
OFString *msg =
|
||||
[OFString stringWithFormat:@"[map %@ uploaded to server, "
|
||||
@"\"getmap\" to receive it]",
|
||||
mapname];
|
||||
mapname];
|
||||
toserver(msg);
|
||||
}))
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void
|
|||
writeclientinfo(OFStream *stream)
|
||||
{
|
||||
[stream writeFormat:@"name \"%@\"\nteam \"%@\"\n", Player.player1.name,
|
||||
Player.player1.team];
|
||||
Player.player1.team];
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -353,7 +353,7 @@ writecfg()
|
|||
return;
|
||||
|
||||
[stream writeFormat:@"%@ %d\n", identifier.name,
|
||||
*[identifier storage]];
|
||||
*[identifier storage]];
|
||||
}];
|
||||
[stream writeString:@"\n"];
|
||||
|
||||
|
@ -367,7 +367,7 @@ writecfg()
|
|||
return;
|
||||
|
||||
[stream writeFormat:@"alias \"%@\" [%@]\n", identifier.name,
|
||||
[identifier action]];
|
||||
[identifier action]];
|
||||
}];
|
||||
|
||||
[stream close];
|
||||
|
|
|
@ -184,8 +184,7 @@ keypress(int code, bool isDown)
|
|||
case SDLK_BACKSPACE:
|
||||
case SDLK_LEFT:
|
||||
if (commandbuf.length > 0)
|
||||
[commandbuf
|
||||
deleteCharactersInRange:
|
||||
[commandbuf deleteCharactersInRange:
|
||||
OFMakeRange(
|
||||
commandbuf.length - 1, 1)];
|
||||
|
||||
|
@ -277,5 +276,5 @@ writebinds(OFStream *stream)
|
|||
for (KeyMapping *mapping in keyMappings)
|
||||
if (mapping.action.length > 0)
|
||||
[stream writeFormat:@"bind \"%@\" [%@]\n", mapping.name,
|
||||
mapping.action];
|
||||
mapping.action];
|
||||
}
|
||||
|
|
|
@ -199,8 +199,8 @@ renderents()
|
|||
closeent =
|
||||
[OFString stringWithFormat:@"closest entity = %@ (%d, %d, "
|
||||
@"%d, %d), selection = (%d, %d)",
|
||||
entnames[c.type], c.attr1, c.attr2, c.attr3,
|
||||
c.attr4, getvar(@"selxs"), getvar(@"selys")];
|
||||
entnames[c.type], c.attr1, c.attr2, c.attr3, c.attr4,
|
||||
getvar(@"selxs"), getvar(@"selys")];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ void
|
|||
disconnect_client(int n, OFString *reason)
|
||||
{
|
||||
[OFStdOut writeFormat:@"disconnecting client (%@) [%@]\n",
|
||||
clients[n].hostname, reason];
|
||||
clients[n].hostname, reason];
|
||||
enet_peer_disconnect(clients[n].peer);
|
||||
clients[n].type = ST_EMPTY;
|
||||
send2(true, -1, SV_CDIS, n);
|
||||
|
@ -490,7 +490,7 @@ serverslice(int seconds,
|
|||
if ((intptr_t)event.peer->data < 0)
|
||||
break;
|
||||
[OFStdOut writeFormat:@"disconnected client (%@)\n",
|
||||
clients[(size_t)event.peer->data].hostname];
|
||||
clients[(size_t)event.peer->data].hostname];
|
||||
clients[(size_t)event.peer->data].type = ST_EMPTY;
|
||||
send2(true, -1, SV_CDIS, (intptr_t)event.peer->data);
|
||||
event.peer->data = (void *)-1;
|
||||
|
|
|
@ -221,8 +221,7 @@ refreshservers()
|
|||
ServerInfo *si, size_t i, bool *stop) {
|
||||
if (si.address.host != ENET_HOST_ANY && si.ping != 9999) {
|
||||
if (si.protocol != PROTOCOL_VERSION)
|
||||
si.full = [OFString
|
||||
stringWithFormat:
|
||||
si.full = [OFString stringWithFormat:
|
||||
@"%@ [different cube protocol]",
|
||||
si.name];
|
||||
else
|
||||
|
@ -232,8 +231,7 @@ refreshservers()
|
|||
si.map.length > 0 ? si.map : @"[unknown]",
|
||||
modestr(si.mode), si.name, si.sdesc];
|
||||
} else
|
||||
si.full = [OFString
|
||||
stringWithFormat:
|
||||
si.full = [OFString stringWithFormat:
|
||||
(si.address.host != ENET_HOST_ANY
|
||||
? @"%@ [waiting for server response]"
|
||||
: @"%@ [unknown host]\t"),
|
||||
|
|
|
@ -30,7 +30,7 @@ httpgetsend(ENetAddress *ad, OFString *hostname, OFString *req, OFString *ref,
|
|||
@"Host: %@\n"
|
||||
@"Referer: %@\n"
|
||||
@"User-Agent: %@\n\n",
|
||||
req, hostname, ref, agent];
|
||||
req, hostname, ref, agent];
|
||||
buf.data = (void *)httpget.UTF8String;
|
||||
buf.dataLength = httpget.UTF8StringLength;
|
||||
[OFStdOut writeFormat:@"sending request to %@...\n", hostname];
|
||||
|
@ -140,9 +140,8 @@ serverms(int mode, int numplayers, int minremain, OFString *smapname,
|
|||
putint(&p, mode);
|
||||
putint(&p, numplayers);
|
||||
putint(&p, minremain);
|
||||
OFString *mname =
|
||||
[OFString stringWithFormat:@"%@%@",
|
||||
(isfull ? @"[FULL] " : @""), smapname];
|
||||
OFString *mname = [OFString stringWithFormat:@"%@%@",
|
||||
(isfull ? @"[FULL] " : @""), smapname];
|
||||
sendstring(mname, &p);
|
||||
sendstring(serverdesc, &p);
|
||||
buf.dataLength = p - pong;
|
||||
|
|
|
@ -40,7 +40,7 @@ setnames(OFString *name)
|
|||
cgzname = [[OFString alloc]
|
||||
initWithFormat:@"packages/%@/%@.cgz", pakname, mapname];
|
||||
bakname = [[OFString alloc] initWithFormat:@"packages/%@/%@_%d.BAK",
|
||||
pakname, mapname, lastmillis];
|
||||
pakname, mapname, lastmillis];
|
||||
pcfname = [[OFString alloc]
|
||||
initWithFormat:@"packages/%@/package.cfg", pakname];
|
||||
mcfname = [[OFString alloc]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue