2016-06-25 00:58:56 +01: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
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../common.h"
|
|
|
|
|
|
2016-06-28 23:24:49 +01:00
|
|
|
#ifdef __cplusplus
|
2016-06-25 00:58:56 +01:00
|
|
|
extern "C"
|
|
|
|
|
{
|
2016-06-28 23:24:49 +01:00
|
|
|
#endif
|
2016-06-25 00:58:56 +01:00
|
|
|
#include "../object.h"
|
2016-06-28 23:24:49 +01:00
|
|
|
#ifdef __cplusplus
|
2016-06-25 00:58:56 +01:00
|
|
|
}
|
2016-06-28 23:24:49 +01:00
|
|
|
#endif
|
2016-06-25 00:58:56 +01:00
|
|
|
|
2016-06-28 23:24:49 +01:00
|
|
|
typedef struct ObjectRepositoryItem
|
2016-06-25 00:58:56 +01:00
|
|
|
{
|
2016-06-29 21:34:59 +01:00
|
|
|
rct_object_entry ObjectEntry;
|
|
|
|
|
utf8 * Path;
|
|
|
|
|
uint32 NumImages;
|
|
|
|
|
utf8 * Name;
|
|
|
|
|
size_t ChunkSize;
|
2016-06-25 00:58:56 +01:00
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
struct
|
|
|
|
|
{
|
2016-06-29 21:34:59 +01:00
|
|
|
uint16 NumThemeObjects;
|
|
|
|
|
rct_object_entry * ThemeObjects;
|
2016-06-25 00:58:56 +01:00
|
|
|
};
|
|
|
|
|
struct
|
|
|
|
|
{
|
|
|
|
|
uint8 RideFlags;
|
|
|
|
|
uint8 RideCategory[2];
|
|
|
|
|
uint8 RideType[3];
|
|
|
|
|
};
|
|
|
|
|
};
|
2016-06-28 23:24:49 +01:00
|
|
|
} ObjectRepositoryItem;
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2016-06-25 00:58:56 +01:00
|
|
|
|
2016-06-29 22:15:38 +01:00
|
|
|
class Object;
|
|
|
|
|
|
2016-06-25 00:58:56 +01:00
|
|
|
interface IObjectRepository
|
|
|
|
|
{
|
|
|
|
|
virtual ~IObjectRepository() { }
|
2016-06-28 23:24:49 +01:00
|
|
|
|
|
|
|
|
virtual const size_t GetNumObjects() const abstract;
|
|
|
|
|
virtual const ObjectRepositoryItem * GetObjects() const abstract;
|
|
|
|
|
virtual const ObjectRepositoryItem * FindObject(const utf8 * name) const abstract;
|
|
|
|
|
virtual const ObjectRepositoryItem * FindObject(const rct_object_entry * objectEntry) const abstract;
|
|
|
|
|
|
2016-06-25 16:34:35 +01:00
|
|
|
virtual Object * LoadObject(const rct_object_entry * objectEntry) abstract;
|
2016-06-26 23:30:44 +01:00
|
|
|
virtual void AddObject(const rct_object_entry * objectEntry,
|
|
|
|
|
const void * data,
|
|
|
|
|
size_t dataSize) abstract;
|
2016-06-25 00:58:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IObjectRepository * GetObjectRepository();
|
2016-06-28 23:24:49 +01:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
size_t object_repository_get_items_count();
|
|
|
|
|
const ObjectRepositoryItem * object_repository_get_items();
|
2016-06-30 21:07:32 +01:00
|
|
|
const ObjectRepositoryItem * object_repository_find_object_by_entry(const rct_object_entry * entry);
|
2016-06-30 21:55:18 +01:00
|
|
|
void * object_repository_load_object(const rct_object_entry * objectEntry);
|
2016-07-02 18:01:51 +01:00
|
|
|
void * object_repository_get_loaded_object(uint8 objectType, uint8 entryIndex);
|
2016-06-29 22:58:38 +01:00
|
|
|
void object_repository_unload(size_t itemIndex);
|
2016-06-28 23:24:49 +01:00
|
|
|
|
2016-06-30 21:55:18 +01:00
|
|
|
void object_delete(void * object);
|
|
|
|
|
const utf8 * object_get_description(const void * object);
|
2016-07-02 10:59:50 +01:00
|
|
|
void object_draw_preview(const void * object, rct_drawpixelinfo * dpi);
|
2016-06-30 21:55:18 +01:00
|
|
|
|
2016-06-28 23:24:49 +01:00
|
|
|
#endif
|