mirror of
https://github.com/huderlem/porymap.git
synced 2026-03-21 17:45:44 -05:00
Compatibility fixes for older compilers
This commit is contained in:
parent
ea8de4df76
commit
e02ec2b695
|
|
@ -9,15 +9,23 @@
|
|||
|
||||
struct MetatileSelectionItem
|
||||
{
|
||||
bool enabled = false;
|
||||
uint16_t metatileId = 0;
|
||||
bool enabled;
|
||||
uint16_t metatileId;
|
||||
|
||||
// Default values + compatibility with older compilers
|
||||
MetatileSelectionItem(bool enabled_ = false, uint16_t metatileId_ = 0)
|
||||
: enabled(enabled_), metatileId(metatileId_) {}
|
||||
};
|
||||
|
||||
struct CollisionSelectionItem
|
||||
{
|
||||
bool enabled = false;
|
||||
uint16_t collision = 0;
|
||||
uint16_t elevation = 0;
|
||||
bool enabled;
|
||||
uint16_t collision;
|
||||
uint16_t elevation;
|
||||
|
||||
// Default values + compatibility with older compilers
|
||||
CollisionSelectionItem(bool enabled_ = false, uint16_t collision_ = 0, uint16_t elevation_ = 0)
|
||||
: enabled(enabled_), collision(collision_), elevation(elevation_) {}
|
||||
};
|
||||
|
||||
struct MetatileSelection
|
||||
|
|
|
|||
|
|
@ -3175,15 +3175,19 @@ bool Project::readEventGraphics() {
|
|||
|
||||
QPixmap Project::getEventPixmap(const QString &gfxName, const QString &movementName) {
|
||||
struct FrameData {
|
||||
int index = 0;
|
||||
bool hFlip = false;
|
||||
int index;
|
||||
bool hFlip;
|
||||
|
||||
// Default values + compatibility with older compilers
|
||||
FrameData(int index_ = 0, bool hFlip_ = false)
|
||||
: index(index_), hFlip(hFlip_) {}
|
||||
};
|
||||
// TODO: Expose as a setting to users
|
||||
static const QMap<QString, FrameData> directionToFrameData = {
|
||||
{"DIR_SOUTH", { .index = 0, .hFlip = false }},
|
||||
{"DIR_NORTH", { .index = 1, .hFlip = false }},
|
||||
{"DIR_WEST", { .index = 2, .hFlip = false }},
|
||||
{"DIR_EAST", { .index = 2, .hFlip = true }}, // East-facing sprite is just the West-facing sprite mirrored
|
||||
{"DIR_SOUTH", { 0, false }},
|
||||
{"DIR_NORTH", { 1, false }},
|
||||
{"DIR_WEST", { 2, false }},
|
||||
{"DIR_EAST", { 2, true }}, // East-facing sprite is just the West-facing sprite mirrored
|
||||
};
|
||||
const QString direction = this->facingDirections.value(movementName, "DIR_SOUTH");
|
||||
auto frameData = directionToFrameData.value(direction);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ QSize FlowLayout::sizeHint() const {
|
|||
|
||||
QSize FlowLayout::minimumSize() const {
|
||||
QSize size;
|
||||
for (const QLayoutItem *item : std::as_const(itemList))
|
||||
for (const QLayoutItem *item : this->itemList)
|
||||
size = size.expandedTo(item->minimumSize());
|
||||
|
||||
const QMargins margins = contentsMargins();
|
||||
|
|
@ -97,7 +97,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const {
|
|||
int y = effectiveRect.y();
|
||||
int lineHeight = 0;
|
||||
|
||||
for (QLayoutItem *item : std::as_const(itemList)) {
|
||||
for (QLayoutItem *item : this->itemList) {
|
||||
const QWidget *wid = item->widget();
|
||||
int spaceX = horizontalSpacing();
|
||||
if (spaceX == -1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user