2024-06-17 09:30:16 +00: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
|
|
|
|
|
2024-11-17 17:54:55 +00:00
|
|
|
#include "IImage.h"
|
|
|
|
|
2024-06-17 09:30:16 +00:00
|
|
|
#include "../../lib/filesystem/ResourcePath.h"
|
2024-07-25 10:38:48 +00:00
|
|
|
#include "../../lib/constants/EntityIdentifiers.h"
|
2024-06-17 09:30:16 +00:00
|
|
|
|
2025-01-15 17:05:45 +00:00
|
|
|
struct SharedImageLocator
|
2024-06-17 09:30:16 +00:00
|
|
|
{
|
|
|
|
std::optional<ImagePath> image;
|
|
|
|
std::optional<AnimationPath> defFile;
|
|
|
|
int defFrame = -1;
|
|
|
|
int defGroup = -1;
|
2025-01-15 17:05:45 +00:00
|
|
|
EImageBlitMode layer = EImageBlitMode::OPAQUE;
|
|
|
|
|
|
|
|
SharedImageLocator() = default;
|
|
|
|
SharedImageLocator(const AnimationPath & path, int frame, int group, EImageBlitMode layer);
|
|
|
|
SharedImageLocator(const JsonNode & config, EImageBlitMode layer);
|
|
|
|
SharedImageLocator(const ImagePath & path, EImageBlitMode layer);
|
|
|
|
|
|
|
|
bool operator < (const SharedImageLocator & other) const;
|
|
|
|
};
|
2024-06-17 09:30:16 +00:00
|
|
|
|
2025-01-15 17:05:45 +00:00
|
|
|
struct ImageLocator : SharedImageLocator
|
|
|
|
{
|
|
|
|
PlayerColor playerColored = PlayerColor::CANNOT_DETERMINE;
|
2024-08-27 19:44:11 +00:00
|
|
|
|
2024-06-17 09:30:16 +00:00
|
|
|
bool verticalFlip = false;
|
|
|
|
bool horizontalFlip = false;
|
2024-09-12 14:26:05 +00:00
|
|
|
int8_t scalingFactor = 0; // 0 = auto / use default scaling
|
2024-06-17 09:30:16 +00:00
|
|
|
|
2025-01-15 17:05:45 +00:00
|
|
|
using SharedImageLocator::SharedImageLocator;
|
|
|
|
ImageLocator(const JsonNode & config, EImageBlitMode layer);
|
2024-07-16 19:51:00 +00:00
|
|
|
|
|
|
|
bool empty() const;
|
2024-06-17 09:30:16 +00:00
|
|
|
};
|