oldloader.c
changeset 3875 ea2cb07c189e
parent 3792 67c865c9315c
child 4000 4009d092b306
equal deleted inserted replaced
3874:14c8ec348168 3875:ea2cb07c189e
   390 #define REMAP_TOWN_IDX(x) ((x) - (0x0459154 - 0x0458EF0)) / 94
   390 #define REMAP_TOWN_IDX(x) ((x) - (0x0459154 - 0x0458EF0)) / 94
   391 #define REMAP_ORDER_IDX(x) ((x) - (0x045AB08 - 0x0458EF0)) / 2
   391 #define REMAP_ORDER_IDX(x) ((x) - (0x045AB08 - 0x0458EF0)) / 2
   392 
   392 
   393 extern TileIndex _animated_tile_list[256];
   393 extern TileIndex _animated_tile_list[256];
   394 extern char _name_array[512][32];
   394 extern char _name_array[512][32];
   395 extern uint16 _custom_sprites_base;
       
   396 
   395 
   397 static byte   _old_vehicle_multiplier;
   396 static byte   _old_vehicle_multiplier;
   398 static uint8  _old_map3[OLD_MAP_SIZE * 2];
   397 static uint8  _old_map3[OLD_MAP_SIZE * 2];
   399 static bool   _new_ttdpatch_format;
   398 static bool   _new_ttdpatch_format;
   400 static uint32 _old_town_index;
   399 static uint32 _old_town_index;
  1217 
  1216 
  1218 		if (_old_order_ptr != 0 && _old_order_ptr != 0xFFFFFFFF) {
  1217 		if (_old_order_ptr != 0 && _old_order_ptr != 0xFFFFFFFF) {
  1219 			v->orders = GetOrder(REMAP_ORDER_IDX(_old_order_ptr));
  1218 			v->orders = GetOrder(REMAP_ORDER_IDX(_old_order_ptr));
  1220 		}
  1219 		}
  1221 		AssignOrder(&v->current_order, UnpackOldOrder(_old_order));
  1220 		AssignOrder(&v->current_order, UnpackOldOrder(_old_order));
  1222 		/* TTDPatch maps sprites from 0x2000 up. */
       
  1223 		if (v->cur_image >= 0x2000)
       
  1224 			v->cur_image -= 0x2000 - _custom_sprites_base;
       
  1225 
  1221 
  1226 		/* For some reason we need to correct for this */
  1222 		/* For some reason we need to correct for this */
  1227 		switch (v->spritenum) {
  1223 		switch (v->spritenum) {
  1228 			case 0xfd: break;
  1224 			case 0xfd: break;
  1229 			case 0xff: v->spritenum = 0xfe; break;
  1225 			case 0xff: v->spritenum = 0xfe; break;