2024-06-17 11:30:16 +02:00
|
|
|
/*
|
|
|
|
* ImageLocator.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../lib/filesystem/ResourcePath.h"
|
2024-07-25 12:38:48 +02:00
|
|
|
#include "../../lib/constants/EntityIdentifiers.h"
|
2024-06-17 11:30:16 +02:00
|
|
|
|
|
|
|
struct ImageLocator
|
|
|
|
{
|
|
|
|
std::optional<ImagePath> image;
|
|
|
|
std::optional<AnimationPath> defFile;
|
|
|
|
int defFrame = -1;
|
|
|
|
int defGroup = -1;
|
|
|
|
|
|
|
|
bool verticalFlip = false;
|
|
|
|
bool horizontalFlip = false;
|
2024-07-25 12:38:48 +02:00
|
|
|
int8_t scalingFactor = 1;
|
|
|
|
PlayerColor playerColored = PlayerColor::CANNOT_DETERMINE;
|
|
|
|
bool layerShadow = false;
|
|
|
|
bool layerBody = true;
|
|
|
|
bool layerOverlay = false;
|
2024-06-17 11:30:16 +02:00
|
|
|
|
|
|
|
ImageLocator() = default;
|
|
|
|
ImageLocator(const AnimationPath & path, int frame, int group);
|
2024-07-16 21:51:00 +02:00
|
|
|
explicit ImageLocator(const JsonNode & config);
|
|
|
|
explicit ImageLocator(const ImagePath & path);
|
|
|
|
|
2024-06-17 11:30:16 +02:00
|
|
|
bool operator < (const ImageLocator & other) const;
|
2024-07-16 21:51:00 +02:00
|
|
|
bool empty() const;
|
2024-07-25 12:38:48 +02:00
|
|
|
|
|
|
|
ImageLocator copyFile() const;
|
|
|
|
ImageLocator copyFileTransform() const;
|
|
|
|
ImageLocator copyFileTransformScale() const;
|
2024-06-17 11:30:16 +02:00
|
|
|
};
|