Skip to content

Commit

Permalink
Update and rename Range.hpp to Span.hpp (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mozz3d authored Jul 10, 2024
1 parent f172089 commit 5492034
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions include/RED4ext/Package.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <RED4ext/Common.hpp>
#include <RED4ext/NativeTypes.hpp>
#include <RED4ext/Range.hpp>
#include <RED4ext/ResourceLoader.hpp>
#include <RED4ext/Span.hpp>

namespace RED4ext
{
Expand Down Expand Up @@ -36,10 +36,10 @@ struct PackageHeader
uint8_t version; // 00
uint8_t unk01; // 01
uint16_t unk02; // 02
Range<Chunk> root; // 08
Range<Chunk> chunks; // 18
Range<Name> names; // 28
Range<Import> imports; // 38
Span<Chunk> root; // 08
Span<Chunk> chunks; // 18
Span<Name> names; // 28
Span<Import> imports; // 38
void* buffer; // 48
uint32_t size; // 50
};
Expand Down Expand Up @@ -76,7 +76,7 @@ struct ObjectPackageHeader
[[nodiscard]] bool IsEmpty() const;

int16_t rootIndex; // 00 - Set to 0 if package contains root Entity, otherwise -1
Range<CRUID> cruids; // 08
Span<CRUID> cruids; // 08
PackageHeader package; // 18
};
RED4EXT_ASSERT_SIZE(ObjectPackageHeader, 0x70);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include <RED4ext/Common.hpp>
#include <RED4ext/DynArray.hpp>
#include <RED4ext/NativeTypes.hpp>
#include <RED4ext/Range.hpp>
#include <RED4ext/Scripting/Natives/AnimBufferState.hpp>
#include <RED4ext/Scripting/Natives/AnimKeyFrames.hpp>
#include <RED4ext/Scripting/Natives/Generated/anim/AnimDataAddress.hpp>
#include <RED4ext/Scripting/Natives/Generated/anim/IAnimationBuffer.hpp>
#include <RED4ext/Span.hpp>
#include <cstdint>

namespace RED4ext
Expand Down Expand Up @@ -39,11 +39,11 @@ struct AnimationBufferCompressed : anim::IAnimationBuffer
DataBuffer inplaceCompressedBuffer; // C8
DynArray<CName> extraDataNames; // F0
uint8_t unk100[0x110 - 0x100]; // 100
Range<KeyFrameCompressed> animKeysCompressed; // 110
Range<KeyFrameRaw> animKeysRaw; // 120
Range<KeyFrameConst> constAnimKeys; // 130
Range<TrackKey> trackKeys; // 140
Range<TrackKeyConst> constTrackKeys; // 150
Span<KeyFrameCompressed> animKeysCompressed; // 110
Span<KeyFrameRaw> animKeysRaw; // 120
Span<KeyFrameConst> constAnimKeys; // 130
Span<TrackKey> trackKeys; // 140
Span<TrackKeyConst> constTrackKeys; // 150
AnimBufferState dataState; // 160
uint64_t unk180; // 180
};
Expand Down
10 changes: 5 additions & 5 deletions include/RED4ext/Range.hpp → include/RED4ext/Span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
namespace RED4ext
{
template<typename T>
struct Range
struct Span
{
Range()
Span()
: beginPtr(nullptr)
, endPtr(nullptr)
{
Expand Down Expand Up @@ -43,7 +43,7 @@ struct Range
T* beginPtr; // 00
T* endPtr; // 08
};
RED4EXT_ASSERT_SIZE(Range<int32_t>, 0x10);
RED4EXT_ASSERT_OFFSET(Range<int32_t>, beginPtr, 0x0);
RED4EXT_ASSERT_OFFSET(Range<int32_t>, endPtr, 0x8);
RED4EXT_ASSERT_SIZE(Span<int32_t>, 0x10);
RED4EXT_ASSERT_OFFSET(Span<int32_t>, beginPtr, 0x0);
RED4EXT_ASSERT_OFFSET(Span<int32_t>, endPtr, 0x8);
} // namespace RED4ext

0 comments on commit 5492034

Please sign in to comment.