mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
fix an initialization order fiasco
This commit is contained in:
parent
9c99b9d4c5
commit
05f0ec267e
3 changed files with 10 additions and 3 deletions
|
@ -9,9 +9,14 @@
|
||||||
#include "Input.h"
|
#include "Input.h"
|
||||||
|
|
||||||
namespace controller {
|
namespace controller {
|
||||||
const Input Input::INVALID_INPUT = Input(0x7fffffff);
|
const Input Input::INVALID_INPUT = invalidInput();
|
||||||
const uint16_t Input::INVALID_DEVICE = Input::INVALID_INPUT.device;
|
const uint16_t Input::INVALID_DEVICE = Input::INVALID_INPUT.device;
|
||||||
const uint16_t Input::INVALID_CHANNEL = Input::INVALID_INPUT.channel;
|
const uint16_t Input::INVALID_CHANNEL = Input::INVALID_INPUT.channel;
|
||||||
const uint16_t Input::INVALID_TYPE = Input::INVALID_INPUT.type;
|
const uint16_t Input::INVALID_TYPE = Input::INVALID_INPUT.type;
|
||||||
|
|
||||||
|
const Input& Input::invalidInput() {
|
||||||
|
static const Input INVALID_INPUT = Input(0x7fffffff);
|
||||||
|
return INVALID_INPUT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ struct Input {
|
||||||
|
|
||||||
using NamedPair = QPair<Input, QString>;
|
using NamedPair = QPair<Input, QString>;
|
||||||
using NamedVector = QVector<NamedPair>;
|
using NamedVector = QVector<NamedPair>;
|
||||||
|
|
||||||
|
static const Input& invalidInput();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
namespace controller {
|
namespace controller {
|
||||||
const uint16_t UserInputMapper::STANDARD_DEVICE = 0;
|
const uint16_t UserInputMapper::STANDARD_DEVICE = 0;
|
||||||
const uint16_t UserInputMapper::ACTIONS_DEVICE = Input::INVALID_DEVICE - 0x00FF;
|
const uint16_t UserInputMapper::ACTIONS_DEVICE = Input::invalidInput().device - 0x00FF;
|
||||||
const uint16_t UserInputMapper::STATE_DEVICE = Input::INVALID_DEVICE - 0x0100;
|
const uint16_t UserInputMapper::STATE_DEVICE = Input::invalidInput().device - 0x0100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default contruct allocate the poutput size with the current hardcoded action channels
|
// Default contruct allocate the poutput size with the current hardcoded action channels
|
||||||
|
|
Loading…
Reference in a new issue