2016-05-04 19:24:41 +02:00
|
|
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
|
|
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
|
|
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
|
|
|
*****************************************************************************/
|
|
|
|
#pragma endregion
|
|
|
|
|
2016-04-17 16:21:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../common.h"
|
|
|
|
#include "../core/List.hpp"
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#include "../rct1.h"
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class to import RollerCoaster Tycoon 1 scenarios (*.SC4) and saved games (*.SV4).
|
|
|
|
*/
|
|
|
|
class S4Importer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void LoadSavedGame(const utf8 * path);
|
|
|
|
void LoadScenario(const utf8 * path);
|
|
|
|
void Import();
|
|
|
|
|
|
|
|
private:
|
|
|
|
const utf8 * _s4Path;
|
|
|
|
rct1_s4 _s4;
|
|
|
|
uint8 _gameVersion;
|
|
|
|
|
|
|
|
// Lists of dynamic object entries
|
|
|
|
List<const char *> _rideEntries;
|
|
|
|
List<const char *> _smallSceneryEntries;
|
|
|
|
List<const char *> _largeSceneryEntries;
|
|
|
|
List<const char *> _wallEntries;
|
2016-04-19 02:11:16 +02:00
|
|
|
List<const char *> _pathEntries;
|
2016-04-18 01:30:28 +02:00
|
|
|
List<const char *> _pathAdditionEntries;
|
2016-04-17 16:21:35 +02:00
|
|
|
List<const char *> _sceneryGroupEntries;
|
|
|
|
|
|
|
|
// Lookup tables for converting from RCT1 hard coded types to the new dynamic object entries
|
|
|
|
uint8 _rideTypeToRideEntryMap[96];
|
|
|
|
uint8 _vehicleTypeToRideEntryMap[96];
|
2016-04-17 23:37:20 +02:00
|
|
|
uint8 _smallSceneryTypeToEntryMap[256];
|
|
|
|
uint8 _largeSceneryTypeToEntryMap[256];
|
|
|
|
uint8 _wallTypeToEntryMap[256];
|
2016-08-31 18:58:58 +02:00
|
|
|
uint8 _pathTypeToEntryMap[24];
|
2016-04-18 01:30:28 +02:00
|
|
|
uint8 _pathAdditionTypeToEntryMap[16];
|
2016-04-17 16:21:35 +02:00
|
|
|
uint8 _sceneryThemeTypeToEntryMap[24];
|
|
|
|
|
|
|
|
// Research
|
|
|
|
uint8 _researchRideEntryUsed[128];
|
|
|
|
uint8 _researchRideTypeUsed[128];
|
|
|
|
|
|
|
|
void Initialise();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scans the map and research list for all the object types used and builds lists and
|
|
|
|
* lookup tables for converting from hard coded RCT1 object types to dynamic object entries.
|
|
|
|
*/
|
|
|
|
void CreateAvailableObjectMappings();
|
2016-04-20 00:51:57 +02:00
|
|
|
void AddDefaultEntries();
|
2016-04-17 16:21:35 +02:00
|
|
|
void AddAvailableEntriesFromResearchList();
|
|
|
|
void AddAvailableEntriesFromMap();
|
|
|
|
void AddAvailableEntriesFromRides();
|
2016-04-19 19:42:18 +02:00
|
|
|
void AddAvailableEntriesFromSceneryGroups();
|
2016-04-17 16:21:35 +02:00
|
|
|
|
|
|
|
void AddEntryForRideType(uint8 rideType);
|
|
|
|
void AddEntryForVehicleType(uint8 rideType, uint8 vehicleType);
|
|
|
|
void AddEntryForSmallScenery(uint8 smallSceneryType);
|
|
|
|
void AddEntryForLargeScenery(uint8 largeSceneryType);
|
|
|
|
void AddEntryForWall(uint8 wallType);
|
2016-04-19 02:11:16 +02:00
|
|
|
void AddEntryForPath(uint8 pathType);
|
2016-04-18 01:30:28 +02:00
|
|
|
void AddEntryForPathAddition(uint8 pathAdditionType);
|
2016-04-17 16:21:35 +02:00
|
|
|
void AddEntriesForSceneryTheme(uint8 sceneryThemeType);
|
|
|
|
|
|
|
|
void LoadObjects();
|
|
|
|
void LoadObjects(uint8 objectType, List<const char *> entries);
|
|
|
|
|
|
|
|
void ImportMapElements();
|
|
|
|
void ImportRides();
|
|
|
|
void ImportRide(rct_ride * dst, rct1_ride * src);
|
|
|
|
void ImportRideMeasurements();
|
|
|
|
void ImportRideMeasurement(rct_ride_measurement * dst, rct_ride_measurement * src);
|
|
|
|
void ImportPeepSpawns();
|
|
|
|
void ImportMapAnimations();
|
|
|
|
void ImportFinance();
|
|
|
|
void ImportResearch();
|
|
|
|
void InsertResearchVehicle(const rct1_research_item * researchItem, bool researched);
|
|
|
|
void ImportParkName();
|
2016-04-17 17:57:49 +02:00
|
|
|
void ImportParkFlags();
|
2016-04-21 01:04:16 +02:00
|
|
|
void ImportClimate();
|
2016-04-17 16:21:35 +02:00
|
|
|
void ImportScenarioNameDetails();
|
|
|
|
void ImportScenarioObjective();
|
|
|
|
void ImportSavedView();
|
|
|
|
|
|
|
|
void ClearExtraTileEntries();
|
|
|
|
void FixColours();
|
|
|
|
void FixZ();
|
|
|
|
void FixPaths();
|
|
|
|
void FixWalls();
|
|
|
|
void ConvertWall(int * type, int * colourA, int * colourB, int * colourC);
|
|
|
|
void FixBanners();
|
|
|
|
void ImportBanner(rct_banner * dst, rct_banner * src);
|
|
|
|
void FixTerrain();
|
|
|
|
void FixEntrancePositions();
|
|
|
|
void FixMapElementEntryTypes();
|
|
|
|
|
2016-04-17 19:53:22 +02:00
|
|
|
List<const char *> * GetEntryList(uint8 objectType);
|
2016-04-17 16:21:35 +02:00
|
|
|
const rct1_research_item * GetResearchList(size_t * count);
|
|
|
|
int GetSCNumber();
|
|
|
|
const char * GetUserString(rct_string_id stringId);
|
|
|
|
};
|