246 #pragma mark Setting methods |
246 #pragma mark Setting methods |
247 -(const char **)getSettings { |
247 -(const char **)getSettings { |
248 const char **gameArgs = (const char**) malloc(sizeof(char*) * 6); |
248 const char **gameArgs = (const char**) malloc(sizeof(char*) * 6); |
249 NSString *ipcString = [[NSString alloc] initWithFormat:@"%d", ipcPort]; |
249 NSString *ipcString = [[NSString alloc] initWithFormat:@"%d", ipcPort]; |
250 NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt", [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]]; |
250 NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt", [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]]; |
251 |
251 CGRect screenBounds = [[UIScreen mainScreen] bounds]; |
|
252 NSString *wSize = [[[NSString alloc] initWithFormat:@"%d", (int) screenBounds.size.width] autorelease]; |
|
253 NSString *hSize = [[[NSString alloc] initWithFormat:@"%d", (int) screenBounds.size.height] autorelease]; |
|
254 |
252 gameArgs[0] = [[systemSettings objectForKey:@"username"] UTF8String]; //UserNick |
255 gameArgs[0] = [[systemSettings objectForKey:@"username"] UTF8String]; //UserNick |
253 gameArgs[1] = [ipcString UTF8String]; //ipcPort |
256 gameArgs[1] = [ipcString UTF8String]; //ipcPort |
254 gameArgs[2] = [[systemSettings objectForKey:@"sounds"] UTF8String]; //isSoundEnabled |
257 gameArgs[2] = [[systemSettings objectForKey:@"sounds"] UTF8String]; //isSoundEnabled |
255 gameArgs[3] = [[systemSettings objectForKey:@"music"] UTF8String]; //isMusicEnabled |
258 gameArgs[3] = [[systemSettings objectForKey:@"music"] UTF8String]; //isMusicEnabled |
256 gameArgs[4] = [localeString UTF8String]; //cLocaleFName |
259 gameArgs[4] = [localeString UTF8String]; //cLocaleFName |
257 gameArgs[5] = [[systemSettings objectForKey:@"alternate"] UTF8String]; //cAltDamage |
260 gameArgs[5] = [[systemSettings objectForKey:@"alternate"] UTF8String]; //cAltDamage |
258 |
261 gameArgs[6] = [wSize UTF8String]; |
|
262 gameArgs[7] = [hSize UTF8String]; |
|
263 |
259 [localeString release]; |
264 [localeString release]; |
260 [ipcString release]; |
265 [ipcString release]; |
261 return gameArgs; |
266 return gameArgs; |
262 } |
267 } |
263 |
268 |