src/newgrf.cpp
branchNewGRF_ports
changeset 6817 ef4c1d63b69f
parent 6805 2b3ed8e47662
child 6835 0364f49694ea
equal deleted inserted replaced
6816:4b02007a9ed5 6817:ef4c1d63b69f
  2272 				fsmportspec->portFSM->moving_data = MallocT<AirportMovingData>(fsmportspec->portFSM->nofelements);
  2272 				fsmportspec->portFSM->moving_data = MallocT<AirportMovingData>(fsmportspec->portFSM->nofelements);
  2273 				fsmportspec->portFSM->size_x = fsmportspec->size_x[0];
  2273 				fsmportspec->portFSM->size_x = fsmportspec->size_x[0];
  2274 				fsmportspec->portFSM->size_y = fsmportspec->size_y[0];
  2274 				fsmportspec->portFSM->size_y = fsmportspec->size_y[0];
  2275 				for (byte element = 0; element < fsmportspec->portFSM->nofelements; element++)
  2275 				for (byte element = 0; element < fsmportspec->portFSM->nofelements; element++)
  2276 				{
  2276 				{
  2277 					//TODO: this will load into a totally new structure for the FSMport controller to handle generically
       
  2278 					AirportMovingData md;
  2277 					AirportMovingData md;
  2279 					md.x = grf_load_word(&buf);
  2278 					md.x = grf_load_word(&buf);
  2280 					md.y = grf_load_word(&buf);
  2279 					md.y = grf_load_word(&buf);
  2281 					md.z = grf_load_word(&buf);
  2280 					md.z = grf_load_word(&buf);
  2282 					md.state = grf_load_byte(&buf);
  2281 					md.state = grf_load_byte(&buf);
  2384 				{
  2383 				{
  2385 					byte numlayouts = grf_load_byte(&buf);
  2384 					byte numlayouts = grf_load_byte(&buf);
  2386 					fsmportspec->layout_mask = ReallocT(fsmportspec->layout_mask, numlayouts);
  2385 					fsmportspec->layout_mask = ReallocT(fsmportspec->layout_mask, numlayouts);
  2387 					for (uint set = 0; set < numlayouts; set++) {
  2386 					for (uint set = 0; set < numlayouts; set++) {
  2388 						byte orientation = grf_load_byte(&buf);
  2387 						byte orientation = grf_load_byte(&buf);
  2389 						//byte x = fsmportspec->size_x[set];
  2388 						byte x = grf_load_byte(&buf);
  2390 						//byte y = fsmportspec->size_y[set];
       
  2391 						byte x = grf_load_byte(&buf);  //could use either, but it helps nforenum if x&y embedded here
       
  2392 						byte y = grf_load_byte(&buf);
  2389 						byte y = grf_load_byte(&buf);
  2393 
  2390 
  2394 						FSMportsLayout layout;
  2391 						FSMportsLayout layout;
  2395 						layout = MallocT<byte>((x * y) + 2);
  2392 						layout = MallocT<byte>((x * y) + 2);
  2396 						layout[0] = orientation;
  2393 						layout[0] = orientation;