mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 09:29:38 +01:00
Force unsigned behaviour for bitfield enums
Some compilers (notably MSVC) were using signed values for bitfield enums. This was causing problems where 2 bits were used to store 4 or less enum values, where they were being treated as negative numbers. This PR explicitly requests these enums to be treated as unsigned values.
This commit is contained in:
parent
8002080311
commit
c0c72eed7b
@ -49,7 +49,7 @@ class Transform;
|
|||||||
|
|
||||||
class TransformInterpolator {
|
class TransformInterpolator {
|
||||||
public:
|
public:
|
||||||
enum Method {
|
enum Method : unsigned int {
|
||||||
INTERP_LERP,
|
INTERP_LERP,
|
||||||
INTERP_SLERP,
|
INTERP_SLERP,
|
||||||
INTERP_SCALED_SLERP,
|
INTERP_SCALED_SLERP,
|
||||||
|
@ -45,14 +45,18 @@ class Node : public Object {
|
|||||||
OBJ_CATEGORY("Nodes");
|
OBJ_CATEGORY("Nodes");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum PauseMode {
|
// N.B. Any enum stored as a bitfield should
|
||||||
|
// be specified as UNSIGNED to work around
|
||||||
|
// some compilers trying to store it as signed,
|
||||||
|
// and requiring 1 more bit than necessary.
|
||||||
|
enum PauseMode : unsigned int {
|
||||||
|
|
||||||
PAUSE_MODE_INHERIT,
|
PAUSE_MODE_INHERIT,
|
||||||
PAUSE_MODE_STOP,
|
PAUSE_MODE_STOP,
|
||||||
PAUSE_MODE_PROCESS
|
PAUSE_MODE_PROCESS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PhysicsInterpolationMode {
|
enum PhysicsInterpolationMode : unsigned int {
|
||||||
|
|
||||||
PHYSICS_INTERPOLATION_MODE_INHERIT,
|
PHYSICS_INTERPOLATION_MODE_INHERIT,
|
||||||
PHYSICS_INTERPOLATION_MODE_OFF,
|
PHYSICS_INTERPOLATION_MODE_OFF,
|
||||||
|
Loading…
Reference in New Issue
Block a user