Skip to content

Commit 8e45ca0

Browse files
committed
Support for 1.54
updated some classes to be more correct
1 parent a52b66f commit 8e45ca0

File tree

12 files changed

+296
-124
lines changed

12 files changed

+296
-124
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.54
2+
- Updated to support 1.54
3+
14
## 1.53
25
- Updated to support 1.53
36

dist/ts-fmod-plugin.dll

0 Bytes
Binary file not shown.

ts-fmod-plugin/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace common
44
{
5-
inline const char* plugin_version = "1.53";
6-
constexpr uint32_t supported_game_version = 53;
5+
inline const char* plugin_version = "1.54";
6+
constexpr uint32_t supported_game_version = 54;
77

88
inline FMOD_GUID get_guid(const std::string& s_guid)
99
{

ts-fmod-plugin/dllmain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ SCSAPI_VOID telemetry_tick(const scs_event_t event, const void* const event_info
175175
}
176176
}
177177

178-
const auto* interior = *reinterpret_cast<unk_interior**>(unk_interior_ptr);
178+
const auto* interior = *reinterpret_cast<sound_library_t**>(unk_interior_ptr);
179179

180180
if (interior != nullptr)
181181
{

ts-fmod-plugin/memory_structure.h

Lines changed: 167 additions & 117 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#pragma once
2+
#include <cstdint>
3+
4+
#pragma pack( push, 1 )
5+
namespace ts_fmod_plugin::prism
6+
{
7+
template < class T > class array_t
8+
{
9+
public:
10+
T* value;
11+
uint64_t size;
12+
13+
public:
14+
T& at( uint64_t index ) { return value[ index ]; }
15+
16+
T& operator[]( const uint64_t index ) { return value[ index ]; }
17+
18+
T* begin() { return &value[ 0 ]; }
19+
T* end() { return &value[ size ]; }
20+
21+
private:
22+
virtual void destructor();
23+
};
24+
25+
static_assert( sizeof( array_t< uint64_t > ) == 0x18, "array_t is incorrect in size" );
26+
}
27+
28+
#pragma pack( pop )
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
#include "./array.h"
3+
#include <cstdint>
4+
5+
#pragma pack( push, 1 )
6+
namespace ts_fmod_plugin::prism
7+
{
8+
template < class T > class array_dyn_t : public array_t< T >
9+
{
10+
public:
11+
uint64_t capacity;
12+
};
13+
14+
static_assert( sizeof( array_dyn_t< void* > ) == 0x20, "array_dyn_t is incorrect in size" );
15+
}
16+
#pragma pack( pop )
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#pragma once
2+
#include <cstdint>
3+
4+
#pragma pack( push, 1 )
5+
namespace ts_fmod_plugin::prism
6+
{
7+
// Some of this is a pure guess, but it does seem to work
8+
9+
template < class T > class list_dyn_node_t
10+
{
11+
public:
12+
list_dyn_node_t< T >* next;
13+
list_dyn_node_t< T >* prev;
14+
T item;
15+
};
16+
17+
template < class T > class list_dyn_t // Size: 0x0038
18+
{
19+
public:
20+
uint64_t size; // 0x0008 (0x08)
21+
list_dyn_node_t< T >* begin; // 0x0010 (0x08)
22+
list_dyn_node_t< T >* end; // 0x0018 (0x08)
23+
T* empty_item; // 0x0020 (0x08)
24+
uint64_t capacity; // 0x0028 (0x08)
25+
char pad_0030[ 8 ]; // 0x0030 (0x08)
26+
27+
virtual void destructor();
28+
};
29+
static_assert( sizeof( list_dyn_t< void* > ) == 0x38 );
30+
}
31+
#pragma pack( pop )

ts-fmod-plugin/prism/string.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#pragma once
2+
#include <cstdint>
3+
4+
#pragma pack( push, 1 )
5+
namespace ts_fmod_plugin::prism
6+
{
7+
struct string
8+
{
9+
explicit string( const char* const s ) : m_string( s ) {}
10+
11+
const char* m_string = nullptr;
12+
};
13+
14+
static_assert( sizeof( string ) == 0x08, "string is incorrect in size" );
15+
16+
class string_dyn_t
17+
{
18+
public:
19+
string str;
20+
uint32_t size;
21+
uint32_t capacity;
22+
23+
virtual void destructor();
24+
};
25+
26+
static_assert( sizeof( string_dyn_t ) == 0x018, "string_dyn_t is incorrect in size" );
27+
}
28+
#pragma pack( pop )

ts-fmod-plugin/ts-fmod-plugin.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 1,53,0,0
55-
PRODUCTVERSION 1,53,0,0
54+
FILEVERSION 1,54,0,0
55+
PRODUCTVERSION 1,54,0,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "Dario Wouters"
7171
VALUE "FileDescription", "Sound Plugin for ATS/ETS2"
72-
VALUE "FileVersion", "1.53.0.0"
72+
VALUE "FileVersion", "1.54.0.0"
7373
VALUE "InternalName", "ts-fmod-plugin.dll"
7474
VALUE "LegalCopyright", "Copyright (C) 2023"
7575
VALUE "OriginalFilename", "ts-fmod-plugin.dll"
7676
VALUE "ProductName", "Sound Plugin for ATS/ETS2"
77-
VALUE "ProductVersion", "1.53.0.0"
77+
VALUE "ProductVersion", "1.54.0.0"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

ts-fmod-plugin/ts-fmod-plugin.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@
178178
<ClInclude Include="memory_structure.h" />
179179
<ClInclude Include="nlohmann\json.hpp" />
180180
<ClInclude Include="pch.h" />
181+
<ClInclude Include="prism\collections\array.h" />
182+
<ClInclude Include="prism\collections\array_dyn.h" />
183+
<ClInclude Include="prism\collections\list_dyn.h" />
184+
<ClInclude Include="prism\string.h" />
181185
<ClInclude Include="resource.h" />
182186
<ClInclude Include="sdk_stores.h" />
183187
<ClInclude Include="telemetry_data.h" />

ts-fmod-plugin/ts-fmod-plugin.vcxproj.filters

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
<ClInclude Include="config.h">
4545
<Filter>Header Files</Filter>
4646
</ClInclude>
47+
<ClInclude Include="prism\collections\array.h">
48+
<Filter>Header Files</Filter>
49+
</ClInclude>
50+
<ClInclude Include="prism\collections\array_dyn.h">
51+
<Filter>Header Files</Filter>
52+
</ClInclude>
53+
<ClInclude Include="prism\collections\list_dyn.h">
54+
<Filter>Header Files</Filter>
55+
</ClInclude>
56+
<ClInclude Include="prism\string.h">
57+
<Filter>Header Files</Filter>
58+
</ClInclude>
4759
</ItemGroup>
4860
<ItemGroup>
4961
<ClCompile Include="dllmain.cpp">

0 commit comments

Comments
 (0)