2017-06-01 21:55:10 +02:00
|
|
|
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
2014-10-05 16:23:52 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
2016-05-04 19:24:41 +02:00
|
|
|
* 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
|
2014-10-05 16:23:52 +02:00
|
|
|
*
|
|
|
|
* 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.
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
|
|
|
* A full copy of the GNU General Public License can be found in licence.txt
|
2014-10-05 16:23:52 +02:00
|
|
|
*****************************************************************************/
|
2016-05-04 19:24:41 +02:00
|
|
|
#pragma endregion
|
2014-10-05 16:23:52 +02:00
|
|
|
|
2017-10-11 21:38:26 +02:00
|
|
|
#pragma once
|
2014-10-05 16:23:52 +02:00
|
|
|
|
2014-10-07 20:10:16 +02:00
|
|
|
#include "../common.h"
|
2018-01-02 20:31:48 +01:00
|
|
|
#include "../object/ObjectLimits.h"
|
|
|
|
#include "../ride/Ride.h"
|
2017-10-19 10:01:05 +02:00
|
|
|
|
|
|
|
typedef struct rct_ride_entry rct_ride_entry;
|
2014-10-07 20:10:16 +02:00
|
|
|
|
2016-06-02 23:22:08 +02:00
|
|
|
#pragma pack(push, 1)
|
2018-01-04 16:43:55 +01:00
|
|
|
typedef struct rct_research_item
|
|
|
|
{
|
2017-06-06 23:24:18 +02:00
|
|
|
// Bit 16 (0: scenery entry, 1: ride entry)
|
2018-01-04 16:43:55 +01:00
|
|
|
union
|
|
|
|
{
|
|
|
|
sint32 rawValue;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint8 entryIndex;
|
|
|
|
uint8 baseRideType;
|
|
|
|
uint8 type; // 0: scenery entry, 1: ride entry
|
|
|
|
uint8 flags;
|
|
|
|
};
|
|
|
|
};
|
2017-06-06 23:24:18 +02:00
|
|
|
uint8 category;
|
2016-06-02 23:22:08 +02:00
|
|
|
} rct_research_item;
|
2016-06-03 10:54:44 +02:00
|
|
|
assert_struct_size(rct_research_item, 5);
|
2016-06-02 23:22:08 +02:00
|
|
|
#pragma pack(pop)
|
2014-10-08 00:42:17 +02:00
|
|
|
|
2018-01-04 16:43:55 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
RESEARCH_ENTRY_TYPE_SCENERY = 0,
|
|
|
|
RESEARCH_ENTRY_TYPE_RIDE = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RESEARCH_ENTRY_FLAG_SCENERY_SET_ALWAYS_RESEARCHED = (1 << 5),
|
|
|
|
RESEARCH_ENTRY_FLAG_RIDE_ALWAYS_RESEARCHED = (1 << 6),
|
2015-06-06 21:07:27 +02:00
|
|
|
};
|
|
|
|
|
2015-06-06 14:25:26 +02:00
|
|
|
// Everything before this point has been researched
|
2015-06-24 12:41:19 +02:00
|
|
|
#define RESEARCHED_ITEMS_SEPARATOR -1
|
|
|
|
// Everything before this point and after separator still requires research
|
2014-10-08 23:11:50 +02:00
|
|
|
#define RESEARCHED_ITEMS_END -2
|
2015-06-06 14:25:26 +02:00
|
|
|
// Extra end of list entry. Unsure why?
|
2014-12-16 02:24:13 +01:00
|
|
|
#define RESEARCHED_ITEMS_END_2 -3
|
2014-10-08 00:42:17 +02:00
|
|
|
|
2017-10-05 16:22:37 +02:00
|
|
|
#define MAX_RESEARCH_ITEMS 500
|
2018-01-10 11:03:48 +01:00
|
|
|
#define MAX_RESEARCHED_SCENERY_ITEMS 56 // Actually 56 * 32 = 1792
|
2017-10-05 16:22:37 +02:00
|
|
|
#define MAX_RESEARCHED_TRACK_TYPES 128
|
2017-06-03 23:21:47 +02:00
|
|
|
|
2017-09-28 12:31:24 +02:00
|
|
|
#define RESEARCH_ENTRY_RIDE_MASK 0x10000
|
|
|
|
|
2014-10-05 18:53:08 +02:00
|
|
|
enum {
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_FUNDING_NONE,
|
|
|
|
RESEARCH_FUNDING_MINIMUM,
|
|
|
|
RESEARCH_FUNDING_NORMAL,
|
2017-10-06 22:37:06 +02:00
|
|
|
RESEARCH_FUNDING_MAXIMUM,
|
|
|
|
|
|
|
|
RESEARCH_FUNDING_COUNT
|
2014-10-05 18:53:08 +02:00
|
|
|
};
|
|
|
|
|
2014-10-05 16:23:52 +02:00
|
|
|
enum {
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_STAGE_INITIAL_RESEARCH,
|
|
|
|
RESEARCH_STAGE_DESIGNING,
|
|
|
|
RESEARCH_STAGE_COMPLETING_DESIGN,
|
|
|
|
RESEARCH_STAGE_UNKNOWN,
|
|
|
|
RESEARCH_STAGE_FINISHED_ALL
|
2014-10-05 16:23:52 +02:00
|
|
|
};
|
|
|
|
|
2015-03-31 18:09:16 +02:00
|
|
|
enum {
|
2017-06-06 23:24:18 +02:00
|
|
|
RESEARCH_CATEGORY_TRANSPORT,
|
|
|
|
RESEARCH_CATEGORY_GENTLE,
|
|
|
|
RESEARCH_CATEGORY_ROLLERCOASTER,
|
|
|
|
RESEARCH_CATEGORY_THRILL,
|
|
|
|
RESEARCH_CATEGORY_WATER,
|
|
|
|
RESEARCH_CATEGORY_SHOP,
|
|
|
|
RESEARCH_CATEGORY_SCENERYSET
|
2015-03-31 18:09:16 +02:00
|
|
|
};
|
|
|
|
|
2017-09-18 17:05:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-08-14 17:16:54 +02:00
|
|
|
extern uint8 gResearchFundingLevel;
|
|
|
|
extern uint8 gResearchPriorities;
|
|
|
|
extern uint16 gResearchProgress;
|
|
|
|
extern uint8 gResearchProgressStage;
|
|
|
|
extern uint8 gResearchExpectedMonth;
|
|
|
|
extern uint8 gResearchExpectedDay;
|
|
|
|
extern uint8 gResearchNextCategory;
|
2018-01-09 16:48:43 +01:00
|
|
|
extern rct_research_item gResearchLastItem;
|
2018-01-04 16:43:55 +01:00
|
|
|
extern rct_research_item gResearchNextItem;
|
2016-04-26 00:26:26 +02:00
|
|
|
|
2017-06-03 23:21:47 +02:00
|
|
|
extern rct_research_item gResearchItems[MAX_RESEARCH_ITEMS];
|
2014-10-05 20:18:36 +02:00
|
|
|
extern uint8 gResearchUncompletedCategories;
|
2018-01-02 20:31:48 +01:00
|
|
|
extern bool gResearchedRideTypes[RIDE_TYPE_COUNT];
|
|
|
|
extern bool gResearchedRideEntries[MAX_RIDE_OBJECTS];
|
2017-06-03 23:21:47 +02:00
|
|
|
extern uint32 gResearchedSceneryItems[MAX_RESEARCHED_SCENERY_ITEMS];
|
2015-05-23 20:56:54 +02:00
|
|
|
extern bool gSilentResearch;
|
2014-10-05 20:18:36 +02:00
|
|
|
|
2014-10-08 23:11:50 +02:00
|
|
|
void research_reset_items();
|
2014-10-05 20:18:36 +02:00
|
|
|
void research_update_uncompleted_types();
|
2014-10-05 16:23:52 +02:00
|
|
|
void research_update();
|
2017-06-02 02:40:17 +02:00
|
|
|
void research_reset_current_item();
|
2015-03-31 18:09:16 +02:00
|
|
|
void research_populate_list_random();
|
2015-05-23 20:56:54 +02:00
|
|
|
void research_populate_list_researched();
|
2014-10-05 16:23:52 +02:00
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
void research_set_funding(sint32 amount);
|
|
|
|
void research_set_priority(sint32 activeCategories);
|
|
|
|
void game_command_set_research_funding(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp);
|
2018-01-04 16:43:55 +01:00
|
|
|
void research_finish_item(rct_research_item * researchItem);
|
2017-01-04 22:17:08 +01:00
|
|
|
void research_insert(sint32 researched, sint32 entryIndex, sint32 category);
|
2018-01-04 16:43:55 +01:00
|
|
|
void research_remove(rct_research_item * researchItem);
|
2015-01-24 19:41:55 +01:00
|
|
|
|
2016-04-17 00:56:09 +02:00
|
|
|
void research_insert_ride_entry(uint8 entryIndex, bool researched);
|
|
|
|
void research_insert_scenery_group_entry(uint8 entryIndex, bool researched);
|
|
|
|
|
2017-01-04 22:17:08 +01:00
|
|
|
bool ride_type_is_invented(sint32 rideType);
|
|
|
|
bool ride_entry_is_invented(sint32 rideEntryIndex);
|
2017-05-16 19:11:51 +02:00
|
|
|
bool track_piece_is_available_for_ride_type(uint8 rideType, sint32 trackType);
|
2017-11-19 21:39:13 +01:00
|
|
|
bool scenery_group_is_invented(sint32 sgIndex);
|
2016-07-09 22:06:54 +02:00
|
|
|
bool scenery_is_invented(uint16 sceneryItem);
|
2018-01-02 20:31:48 +01:00
|
|
|
void set_all_scenery_items_invented();
|
|
|
|
void set_every_ride_entry_invented();
|
|
|
|
void set_every_ride_entry_not_invented();
|
2018-01-04 16:43:55 +01:00
|
|
|
rct_string_id research_item_get_name(rct_research_item * researchItem);
|
2017-09-19 12:18:17 +02:00
|
|
|
rct_string_id research_get_friendly_base_ride_type_name(uint8 trackType, rct_ride_entry * rideEntry);
|
2017-09-28 12:31:24 +02:00
|
|
|
void research_remove_flags();
|
2018-01-02 19:40:08 +01:00
|
|
|
void research_fix();
|
2016-05-10 01:00:59 +02:00
|
|
|
|
2017-09-18 17:05:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|