2024-03-29 07:48:52 +02:00
|
|
|
/*
|
|
|
|
* StdInc.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
|
|
|
|
*
|
|
|
|
*/
|
2023-10-19 16:19:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../Global.h"
|
|
|
|
|
|
|
|
#define VCMI_EDITOR_NAME "VCMI Map Editor"
|
|
|
|
|
|
|
|
#include <QtWidgets>
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QVector>
|
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
|
|
|
#include <QFile>
|
|
|
|
|
2024-10-07 07:47:00 +02:00
|
|
|
#include "../vcmiqt/convpathqstring.h"
|
|
|
|
|
2023-10-19 16:19:09 +02:00
|
|
|
VCMI_LIB_USING_NAMESPACE
|
|
|
|
|
2024-03-02 13:48:17 +02:00
|
|
|
using NumericPointer = typename std::conditional_t<sizeof(void *) == sizeof(unsigned long long),
|
|
|
|
unsigned long long, unsigned int>;
|
2023-10-19 16:19:09 +02:00
|
|
|
|
|
|
|
template<class Type>
|
|
|
|
NumericPointer data_cast(Type * _pointer)
|
|
|
|
{
|
|
|
|
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
|
|
|
"Cannot compile for that architecture, see NumericPointer definition");
|
|
|
|
|
|
|
|
return reinterpret_cast<NumericPointer>(_pointer);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class Type>
|
|
|
|
Type * data_cast(NumericPointer _numeric)
|
|
|
|
{
|
|
|
|
static_assert(sizeof(Type *) == sizeof(NumericPointer),
|
|
|
|
"Cannot compile for that architecture, see NumericPointer definition");
|
|
|
|
|
|
|
|
return reinterpret_cast<Type *>(_numeric);
|
|
|
|
}
|