Skip to content

Commit

Permalink
Some reordering of struct/class members to pack items tighter or with…
Browse files Browse the repository at this point in the history
… better alignment
  • Loading branch information
kaffeewolf committed Feb 13, 2024
1 parent ba47327 commit 9e6db1a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
3 changes: 1 addition & 2 deletions code/foundation/core/refcounted.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ class RefCounted
static ThreadLocal bool isInCreate;
static Threading::CriticalSection criticalSection;
private:
bool destroyed;
static RefCountedList list;
RefCountedList::Iterator listIterator;
bool destroyed;

public:
/// register debug name
void SetDebugName(const Util::String& name);
Expand Down
2 changes: 1 addition & 1 deletion code/foundation/core/rtti.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Rtti
Util::String name;
const Core::Rtti* parent;
Util::FourCC fourCC;
SizeT instanceSize;
Creator creator;
ArrayCreator arrayCreator;
SizeT instanceSize;
};

//------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions code/foundation/io/binaryreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ class BinaryReader : public StreamReader
void ReadRawData(void* ptr, SizeT numBytes);

public:
bool enableMapping;
bool isMapped;
System::ByteOrder byteOrder;
unsigned char* mapCursor;
unsigned char* mapEnd;
bool enableMapping;
bool isMapped;
};

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion code/foundation/util/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class String

enum
{
LocalStringSize = 20,
LocalStringSize = 16,
};
char* heapBuffer;
char localBuffer[LocalStringSize];
Expand Down
20 changes: 10 additions & 10 deletions code/physics/physics/physxstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ class PhysxState : public physx::PxSimulationEventCallback
physx::PxPhysics * physics;
physx::PxPvd *pvd;
physx::PxPvdTransport *transport;
Util::Delegate<void(ActorId*, SizeT)> onSleepCallback;
Util::Delegate<void(ActorId*, SizeT)> onWakeCallback;
Physics::Allocator allocator;
Physics::ErrorCallback errorCallback;
Physics::Material FallbackMaterial;
Util::Set<Ids::Id32> awakeActors;

Util::Dictionary<Util::StringAtom, IndexT> materialNameTable;

Util::StackArray<Physics::Scene, 8> activeScenes;
Util::StackArray<Physics::Material, 16> materials;
Util::Dictionary<Util::StringAtom, IndexT> materialNameTable;

Util::StackArray<IndexT, 8> activeSceneIds;
Util::StackArray<IndexT, 8> deadSceneIds;

Physics::Material FallbackMaterial;

Util::Set<Ids::Id32> awakeActors;

Physics::Allocator allocator;
Physics::ErrorCallback errorCallback;
physx::PxOverlapHit overlapBuffer[MAX_SHAPE_OVERLAPS];

Util::Delegate<void(ActorId*, SizeT)> onSleepCallback;
Util::Delegate<void(ActorId*, SizeT)> onWakeCallback;

///
PhysxState();
/// Setup Px subsystems
Expand Down
3 changes: 2 additions & 1 deletion code/physics/physics/streamactorpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ struct ActorInfo
Util::Array<float> densities;
Util::Array<Util::String> colliders;
SizeT instanceCount;
CollisionFeedback feedbackFlag;
uint16_t collisionGroup;
CollisionFeedback feedbackFlag;

#ifdef NEBULA_DEBUG
Util::Array<Util::String> shapeDebugNames;
#endif
Expand Down

0 comments on commit 9e6db1a

Please sign in to comment.