Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
Progress on unit and the data files
Browse files Browse the repository at this point in the history
- The format for the data file that Helldivers 2 uses probably is unique to Helldivers 2 (0x11, 0x00, 0x00, 0xF0)
    - Other games use 0x07, 0x00, 0x00, 0xF0 or even smaller.
    - Might have to implement those eventually.
  • Loading branch information
Xaymar committed Mar 1, 2024
1 parent 45e64af commit 2a72b2e
Show file tree
Hide file tree
Showing 23 changed files with 240 additions and 167 deletions.
48 changes: 48 additions & 0 deletions extra/010 Editor/common.bt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ typedef byte int8_t;
typedef float single;
typedef hfloat half;

// Int8 Vectors
typedef int8_t s8vec1_t;
struct s8vec2_t { int8_t _; int8_t _; };
struct s8vec3_t { int8_t _; int8_t _; int8_t _; };
Expand All @@ -32,6 +33,7 @@ struct u8vec2_t { uint8_t _; uint8_t _; };
struct u8vec3_t { uint8_t _; uint8_t _; uint8_t _; };
struct u8vec4_t { uint8_t _; uint8_t _; uint8_t _; uint8_t _; };

// Int16 Vectors
typedef int16_t s16vec1_t;
struct s16vec2_t { int16_t _; int16_t _; };
struct s16vec3_t { int16_t _; int16_t _; int16_t _; };
Expand All @@ -41,6 +43,7 @@ struct u16vec2_t { uint16_t _; uint16_t _; };
struct u16vec3_t { uint16_t _; uint16_t _; uint16_t _; };
struct u16vec4_t { uint16_t _; uint16_t _; uint16_t _; uint16_t _; };

// Int32 Vectors
typedef int32_t s32vec1_t;
struct s32vec2_t { int32_t _; int32_t _; int32_t _; };
struct s32vec3_t { int32_t _; int32_t _; int32_t _; };
Expand All @@ -50,6 +53,7 @@ struct u32vec2_t { uint32_t _; uint32_t _; };
struct u32vec3_t { uint32_t _; uint32_t _; uint32_t _; };
struct u32vec4_t { uint32_t _; uint32_t _; uint32_t _; uint32_t _; };

// Int64 Vectors
typedef int64_t s64vec1_t;
struct s64vec2_t { int64_t _; int64_t _; };
struct s64vec3_t { int64_t _; int64_t _; int64_t _; };
Expand All @@ -59,6 +63,7 @@ struct u64vec2_t { uint64_t _; uint64_t _; };
struct u64vec3_t { uint64_t _; uint64_t _; uint64_t _; };
struct u64vec4_t { uint64_t _; uint64_t _; uint64_t _; uint64_t _; };

// Float16 Vectors & Matrices
typedef half f16vec1_t;
struct f16vec2_t { half _; half _; };
struct f16vec3_t { half _; half _; half _; };
Expand All @@ -76,6 +81,7 @@ struct f16mat4x2_t { f16vec4_t _; f16vec4_t _; };
struct f16mat4x3_t { f16vec4_t _; f16vec4_t _; f16vec4_t _; };
struct f16mat4x4_t { f16vec4_t _; f16vec4_t _; f16vec4_t _; f16vec4_t _; };

// Float32 Vectors & Matrices
typedef single f32vec1_t;
struct f32vec2_t { single _; single _; };
struct f32vec3_t { single _; single _; single _; };
Expand All @@ -93,6 +99,7 @@ struct f32mat4x2_t { f32vec4_t _; f32vec4_t _; };
struct f32mat4x3_t { f32vec4_t _; f32vec4_t _; f32vec4_t _; };
struct f32mat4x4_t { f32vec4_t _; f32vec4_t _; f32vec4_t _; f32vec4_t _; };

// Float64 Vectors & Matrices
typedef double f64vec1_t;
struct f64vec2_t { double _; double _; };
struct f64vec3_t { double _; double _; double _; };
Expand All @@ -110,4 +117,45 @@ struct f64mat4x2_t { f64vec4_t _; f64vec4_t _; };
struct f64mat4x3_t { f64vec4_t _; f64vec4_t _; f64vec4_t _; };
struct f64mat4x4_t { f64vec4_t _; f64vec4_t _; f64vec4_t _; f64vec4_t _; };

// Float8 Vectors
//- Signed
struct f8vec1s_t {
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
};
struct f8vec2s_t {
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
};
struct f8vec3s_t {
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
};
struct f8vec4s_t {
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
ubyte _<read=Str("%f", 2.0 * ((this / 255.0) - 0.5))>;
};
//- Unsigned
struct f8vec1u_t {
ubyte _<read=Str("%f", (this / 255.0))>;
};
struct f8vec2u_t {
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
};
struct f8vec3u_t {
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
};
struct f8vec4u_t {
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
ubyte _<read=Str("%f", (this / 255.0))>;
};

#endif

Loading

0 comments on commit 2a72b2e

Please sign in to comment.