* Minor cleanups.

* Add preprocessor macros for resolving member field offsets in a standard, easy to read way.
This commit is contained in:
Robert MacGregor 2019-07-14 17:00:46 -07:00
parent fc39b03ffb
commit 0410000234
12 changed files with 88 additions and 69 deletions

View file

@ -11,11 +11,6 @@ namespace DX
public:
Player(unsigned int obj);
//! Object Name
const char *name;
//! Object ID
const unsigned int &id;
//! Player Object Jetting State (readonly, writing it doesn't do anything)
const bool &is_jetting;
//! Player Object Jumping State (readonly, writing it doesn't do anything)

View file

@ -1,5 +1,9 @@
#pragma once
#define MEMBER_POINTER(obj, type, offset) (type*)(obj + offset)
#define MEMBER_FIELD(obj, type, offset) *(type*)(obj + offset)
#define MEMBER_POINT3F(obj, offset, spacing) MEMBER_FIELD(obj, float, offset), MEMBER_FIELD(obj, float, offset + spacing), MEMBER_FIELD(obj, float, offset + (spacing * 2))
namespace DX
{
class SimObject