equal
deleted
inserted
replaced
31 |
31 |
32 SDLNet_TCP_Send(csd, &length , 1); |
32 SDLNet_TCP_Send(csd, &length , 1); |
33 return SDLNet_TCP_Send(csd, [string UTF8String], length); |
33 return SDLNet_TCP_Send(csd, [string UTF8String], length); |
34 } |
34 } |
35 |
35 |
36 -(uint8_t *)engineProtocol:(NSInteger) port { |
36 -(const uint8_t *)engineProtocol:(NSInteger) port { |
37 IPaddress ip; |
37 IPaddress ip; |
38 BOOL serverQuit = NO; |
38 BOOL serverQuit = NO; |
39 uint8_t map[128*32]; |
39 static uint8_t map[128*32]; |
40 |
40 |
41 if (SDLNet_Init() < 0) { |
41 if (SDLNet_Init() < 0) { |
42 NSLog(@"SDLNet_Init: %s", SDLNet_GetError()); |
42 NSLog(@"SDLNet_Init: %s", SDLNet_GetError()); |
43 serverQuit = YES; |
43 serverQuit = YES; |
44 } |
44 } |
91 -(void) drawingThread { |
91 -(void) drawingThread { |
92 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
92 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
93 |
93 |
94 // select the port for IPC and launch the preview generation through engineProtocol: |
94 // select the port for IPC and launch the preview generation through engineProtocol: |
95 int port = randomPort(); |
95 int port = randomPort(); |
96 uint8_t *map = [self engineProtocol:port]; |
96 const uint8_t *map = [self engineProtocol:port]; |
97 uint8_t mapExp[128*32*8]; |
97 uint8_t mapExp[128*32*8]; |
98 |
98 |
99 // draw the buffer (1 pixel per component, 0= transparent 1= color) |
99 // draw the buffer (1 pixel per component, 0= transparent 1= color) |
100 int k = 0; |
100 int k = 0; |
101 for (int i = 0; i < 32*128; i++) { |
101 for (int i = 0; i < 32*128; i++) { |