File gamedata.hpp

Defines

RPGPP_DRAW_MULTIPLIER
RPGPP_CALLBACK_MAX

Typedefs

typedef std::vector<std::string> StringVector
typedef std::variant<int, bool, std::string, Rectangle, Color, FontRef, ImageRef, VerticalAlignment, HorizontalAlignment, UIElementRef, NPatchInfo, InputC, StringVector> ElementProperty

Enums

enum TextAlignment

Values:

enumerator TEXT_ALIGN_LEFT
enumerator TEXT_ALIGN_TOP
enumerator TEXT_ALIGN_CENTRE
enumerator TEXT_ALIGN_MIDDLE
enumerator TEXT_ALIGN_RIGHT
enumerator TEXT_ALIGN_BOTTOM
enum ElementPropertyType

Values:

enumerator UI_PROP_INT
enumerator UI_PROP_BOOL
enumerator UI_PROP_STRING
enumerator UI_PROP_RECT
enumerator UI_PROP_COLOR
enumerator UI_PROP_FONT
enumerator UI_PROP_IMAGE
enumerator UI_PROP_REF
enumerator UI_PROP_NPATCHINFO
enumerator UI_PROP_INPUT

Functions

void serializeDataToFile(std::string fileName, GameData data)
GameData deserializeFile(std::string fileName)
template<class Archive>
void serialize(Archive &a, Rectangle &b)
template<class Archive>
void serialize(Archive &a, Color &b)
template<class Archive>
void serialize(Archive &a, UIElementRef &b)
template<class Archive>
void serialize(Archive &a, ImageRef &b)
template<class Archive>
void serialize(Archive &a, FontRef &b)
template<class Archive>
void serialize(Archive &a, HorizontalAlignment &b)
template<class Archive>
void serialize(Archive &a, VerticalAlignment &b)
template<class Archive>
void serialize(Archive &a, NPatchInfo &b)
template<class Archive>
void serialize(Archive &a, InputC &b)
template<class Archive>
void serialize(Archive &a, CallbacksArray &b)
template<class Archive>
void serialize(Archive &a, UIElementBin &b)
template<class Archive>
void serialize(Archive &a, InterfaceViewBin &b)

Variables

const std::string CALLBACK_TRIGGER = "callback_trigger"
const std::string CALLBACK_FOCUSED = "callback_focused"
const std::string CALLBACK_UNFOCUSED = "callback_unfocused"
struct IVector
#include <gamedata.hpp>

Public Functions

inline bool operator==(const IVector &other) const
inline bool operator<(const IVector &other) const
IVector() = default
inline IVector(int x, int y)
inline IVector(const Vector2 &from)

Public Members

int x
int y
struct IRect
#include <gamedata.hpp>

Public Members

int x
int y
int width
int height
struct UIElementRef
#include <gamedata.hpp>

Public Members

std::string title = ""
uint8_t entityId = 255
struct FontRef
#include <gamedata.hpp>

Public Members

std::string path = ""
Font font
int fontSize = 13
struct ImageRef
#include <gamedata.hpp>

Public Functions

inline void scaleImage(int newScale)

Public Members

std::string path = ""
Texture texture
int scale = 1
struct CallbacksArray
#include <gamedata.hpp>

Public Members

std::unordered_map<std::string, std::string> funcNames = {{CALLBACK_TRIGGER, ""}, {CALLBACK_UNFOCUSED, ""}, {CALLBACK_FOCUSED, ""}}
struct InputC
#include <gamedata.hpp>

Public Members

UIElementRef upButton
UIElementRef downButton
UIElementRef leftButton
UIElementRef rightButton
CallbacksArray funcNames
struct VerticalAlignment
#include <gamedata.hpp>

Public Members

TextAlignment val = TEXT_ALIGN_TOP
struct HorizontalAlignment
#include <gamedata.hpp>

Public Members

TextAlignment val = TEXT_ALIGN_LEFT
struct Event
#include <gamedata.hpp>

Public Members

KeyboardKey key
bool hold = false
struct ActorBin
#include <gamedata.hpp>

Public Members

std::string name
std::string tileSetName
IRect collision
std::array<std::vector<IVector>, 8> animations
struct ActorInRoomBin
#include <gamedata.hpp>

Public Members

std::string name
std::string source
IVector tilePos
std::string intType
std::vector<std::uint8_t> propsCbor
struct TileBin
#include <gamedata.hpp>

Public Members

IVector atlasPos
IVector worldPos
struct InteractableBin
#include <gamedata.hpp>

Public Members

std::string typeName
std::string scriptPath
std::vector<std::uint8_t> props
struct ScriptBin
#include <gamedata.hpp>

Public Members

std::string bytecode
struct InteractableInRoomBin
#include <gamedata.hpp>

Public Members

int x
int y
bool onTouch
std::string type
std::vector<std::uint8_t> propsCbor
struct PropInRoomBin
#include <gamedata.hpp>

Public Members

std::string name
IVector tilePos
bool onTouch
std::vector<std::uint8_t> propsCbor
struct TileSetBin
#include <gamedata.hpp>

Public Members

std::string name
std::string extension
IVector tileSize
std::vector<unsigned char> image
int dataSize
struct FontBin
#include <gamedata.hpp>

Public Members

std::vector<unsigned char> data
int dataSize
std::string ext
struct ImageBin
#include <gamedata.hpp>

Public Members

std::vector<unsigned char> data
int dataSize
std::string ext
struct MusicBin
#include <gamedata.hpp>

Public Members

std::string relativePath
bool isSound
std::vector<unsigned char> fileData
std::string fileExt
struct PropBin
#include <gamedata.hpp>

Public Members

std::string name
IRect atlasRect
IRect collisionRect
std::string imagePath
bool hasInteractable
std::string intType
struct RoomBin
#include <gamedata.hpp>

Public Members

std::string name
std::string tileSetName
int width
int height
IVector startPoint
std::vector<IVector> collisions
std::vector<InteractableInRoomBin> interactables
std::vector<PropInRoomBin> props
std::vector<ActorInRoomBin> actors
std::vector<std::vector<TileBin>> tiles
std::string musicSource
struct UIElementBin
#include <gamedata.hpp>

Public Members

std::string type = ""
std::unordered_map<std::string, ElementProperty> props
struct InterfaceViewBin
#include <gamedata.hpp>

Public Members

std::string scriptSource = ""
std::unordered_map<std::string, std::vector<std::uint8_t>> entites
std::unordered_map<std::string, UIElementBin> elements = {}
struct ProjectProgramSettings
#include <gamedata.hpp>

Public Members

std::string projectTitle
std::string projectVersion
IVector windowSize = {640, 480}
std::string programIconPath = ""
bool windowResizeableFlag = false
int targetFPS = 60
int windowStateFlag = 0
struct ProjectGameSettings
#include <gamedata.hpp>

Public Members

std::string defaultLoadingPath
bool isLoadUi
std::string playerActorPath
int tileSize = 16
bool debugDraw = false
std::vector<int> exportImageScales = {1}
std::vector<int> exportFontSizes = {13}
struct GameData
#include <gamedata.hpp>

Public Members

std::string title
ProjectProgramSettings programSet
ProjectGameSettings gameSet
std::map<std::string, FontBin> fonts
std::map<std::string, ImageBin> images
std::map<std::string, TileSetBin> tilesets
std::map<std::string, InteractableBin> interactables
std::vector<RoomBin> rooms
std::map<std::string, ActorBin> actors
std::vector<PropBin> props
std::map<std::string, InterfaceViewBin> interfaceViews
std::map<std::string, DialogueBin> dialogues
std::map<std::string, MusicBin> music
std::map<std::string, ScriptBin> scripts
struct DataSerialization
#include <gamedata.hpp>

Public Members

std::vector<uint8_t> bytes
int count