Skip to content

Commit 57a95eb

Browse files
authored
Promote API V0 to V1 (#196)
Based on the discussion in #195.
1 parent 4ea14b6 commit 57a95eb

24 files changed

Lines changed: 368 additions & 359 deletions

include/RED4ext/Api/FileVer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3-
#include <RED4ext/Api/v0/FileVer.hpp>
3+
#include <RED4ext/Api/v1/FileVer.hpp>
44

55
/**
66
* @brief Creates a file version using the latest version info type.
77
*/
8-
#define RED4EXT_FILEVER(major, minor, build, revision) RED4EXT_V0_FILEVER(major, minor, build, revision)
8+
#define RED4EXT_FILEVER(major, minor, build, revision) RED4EXT_V1_FILEVER(major, minor, build, revision)

include/RED4ext/Api/Runtime.hpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
#pragma once
22

3-
#include <RED4ext/Api/v0/Runtime.hpp>
3+
#include <RED4ext/Api/v1/Runtime.hpp>
44

5-
#define RED4EXT_RUNTIME_1_50 RED4EXT_V0_RUNTIME_1_50
6-
#define RED4EXT_RUNTIME_1_50_HOTFIX_1 RED4EXT_V0_RUNTIME_1_50_HOTFIX_1
7-
#define RED4EXT_RUNTIME_1_50_HOTFIX_2 RED4EXT_V0_RUNTIME_1_50_HOTFIX_2
8-
#define RED4EXT_RUNTIME_1_52 RED4EXT_V0_RUNTIME_1_52
9-
#define RED4EXT_RUNTIME_1_52_HOTFIX_1 RED4EXT_V0_RUNTIME_1_52_HOTFIX_1
10-
#define RED4EXT_RUNTIME_1_60 RED4EXT_V0_RUNTIME_1_60
11-
#define RED4EXT_RUNTIME_1_61 RED4EXT_V0_RUNTIME_1_61
12-
#define RED4EXT_RUNTIME_1_61_HOTFIX_1 RED4EXT_V0_RUNTIME_1_61_HOTFIX_1
13-
#define RED4EXT_RUNTIME_1_62 RED4EXT_V0_RUNTIME_1_62
14-
#define RED4EXT_RUNTIME_1_62_HOTFIX_1 RED4EXT_V0_RUNTIME_1_62_HOTFIX_1
15-
#define RED4EXT_RUNTIME_1_63 RED4EXT_V0_RUNTIME_1_63
16-
#define RED4EXT_RUNTIME_1_63_HOTFIX_1 RED4EXT_V0_RUNTIME_1_63_HOTFIX_1
17-
#define RED4EXT_RUNTIME_2_00 RED4EXT_V0_RUNTIME_2_00
18-
#define RED4EXT_RUNTIME_2_01 RED4EXT_V0_RUNTIME_2_01
19-
#define RED4EXT_RUNTIME_2_02 RED4EXT_V0_RUNTIME_2_02
20-
#define RED4EXT_RUNTIME_2_10 RED4EXT_V0_RUNTIME_2_10
21-
#define RED4EXT_RUNTIME_2_11 RED4EXT_V0_RUNTIME_2_11
22-
#define RED4EXT_RUNTIME_2_12 RED4EXT_V0_RUNTIME_2_12
23-
#define RED4EXT_RUNTIME_2_12_HOTFIX_1 RED4EXT_V0_RUNTIME_2_12_HOTFIX_1
24-
#define RED4EXT_RUNTIME_2_13 RED4EXT_V0_RUNTIME_2_13
25-
#define RED4EXT_RUNTIME_2_20 RED4EXT_V0_RUNTIME_2_20
26-
#define RED4EXT_RUNTIME_2_21 RED4EXT_V0_RUNTIME_2_21
27-
#define RED4EXT_RUNTIME_2_30 RED4EXT_V0_RUNTIME_2_30
28-
#define RED4EXT_RUNTIME_2_31 RED4EXT_V0_RUNTIME_2_31
5+
#define RED4EXT_RUNTIME_1_50 RED4EXT_V1_RUNTIME_1_50
6+
#define RED4EXT_RUNTIME_1_50_HOTFIX_1 RED4EXT_V1_RUNTIME_1_50_HOTFIX_1
7+
#define RED4EXT_RUNTIME_1_50_HOTFIX_2 RED4EXT_V1_RUNTIME_1_50_HOTFIX_2
8+
#define RED4EXT_RUNTIME_1_52 RED4EXT_V1_RUNTIME_1_52
9+
#define RED4EXT_RUNTIME_1_52_HOTFIX_1 RED4EXT_V1_RUNTIME_1_52_HOTFIX_1
10+
#define RED4EXT_RUNTIME_1_60 RED4EXT_V1_RUNTIME_1_60
11+
#define RED4EXT_RUNTIME_1_61 RED4EXT_V1_RUNTIME_1_61
12+
#define RED4EXT_RUNTIME_1_61_HOTFIX_1 RED4EXT_V1_RUNTIME_1_61_HOTFIX_1
13+
#define RED4EXT_RUNTIME_1_62 RED4EXT_V1_RUNTIME_1_62
14+
#define RED4EXT_RUNTIME_1_62_HOTFIX_1 RED4EXT_V1_RUNTIME_1_62_HOTFIX_1
15+
#define RED4EXT_RUNTIME_1_63 RED4EXT_V1_RUNTIME_1_63
16+
#define RED4EXT_RUNTIME_1_63_HOTFIX_1 RED4EXT_V1_RUNTIME_1_63_HOTFIX_1
17+
#define RED4EXT_RUNTIME_2_00 RED4EXT_V1_RUNTIME_2_00
18+
#define RED4EXT_RUNTIME_2_01 RED4EXT_V1_RUNTIME_2_01
19+
#define RED4EXT_RUNTIME_2_02 RED4EXT_V1_RUNTIME_2_02
20+
#define RED4EXT_RUNTIME_2_10 RED4EXT_V1_RUNTIME_2_10
21+
#define RED4EXT_RUNTIME_2_11 RED4EXT_V1_RUNTIME_2_11
22+
#define RED4EXT_RUNTIME_2_12 RED4EXT_V1_RUNTIME_2_12
23+
#define RED4EXT_RUNTIME_2_12_HOTFIX_1 RED4EXT_V1_RUNTIME_2_12_HOTFIX_1
24+
#define RED4EXT_RUNTIME_2_13 RED4EXT_V1_RUNTIME_2_13
25+
#define RED4EXT_RUNTIME_2_20 RED4EXT_V1_RUNTIME_2_20
26+
#define RED4EXT_RUNTIME_2_21 RED4EXT_V1_RUNTIME_2_21
27+
#define RED4EXT_RUNTIME_2_30 RED4EXT_V1_RUNTIME_2_30
28+
#define RED4EXT_RUNTIME_2_31 RED4EXT_V1_RUNTIME_2_31
2929

3030
/**
3131
* @brief Supports all game versions.
3232
* @note Only use this if you do not use RED4ext.SDK library, but you want to use RED4ext as a loader only.
3333
*/
34-
#define RED4EXT_RUNTIME_INDEPENDENT RED4EXT_V0_RUNTIME_INDEPENDENT
34+
#define RED4EXT_RUNTIME_INDEPENDENT RED4EXT_V1_RUNTIME_INDEPENDENT
3535

3636
/*
3737
* @brief The latest game version.
3838
*/
39-
#define RED4EXT_RUNTIME_LATEST RED4EXT_V0_RUNTIME_LATEST
39+
#define RED4EXT_RUNTIME_LATEST RED4EXT_V1_RUNTIME_LATEST

include/RED4ext/Api/Sdk.hpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,56 @@
11
#pragma once
22

3-
#include <RED4ext/Api/v0/PluginInfo.hpp>
4-
#include <RED4ext/Api/v0/Sdk.hpp>
3+
#include <RED4ext/Api/v1/PluginInfo.hpp>
4+
#include <RED4ext/Api/v1/Sdk.hpp>
5+
6+
#include <cstdint>
57

68
namespace RED4ext
79
{
810
/**
911
* @brief The latest plugin info type.
1012
*/
11-
using PluginInfo = v0::PluginInfo;
13+
using PluginInfo = v1::PluginInfo;
1214

1315
/**
1416
* @brief The latest version info type.
1517
*/
16-
using SemVer = v0::SemVer;
18+
using SemVer = v1::SemVer;
1719

1820
/**
1921
* @brief The latest version info type.
2022
*/
21-
using FileVer = v0::FileVer;
23+
using FileVer = v1::FileVer;
2224

2325
/**
2426
* @brief The latest RED4ext.
2527
*/
26-
using Sdk = v0::Sdk;
28+
using Sdk = v1::Sdk;
2729

2830
/**
2931
* @brief The latest hooking.
3032
*/
31-
using Logger = v0::Logger;
33+
using Logger = v1::Logger;
3234

3335
/**
3436
* @brief The latest hooking.
3537
*/
36-
using Hooking = v0::Hooking;
38+
using Hooking = v1::Hooking;
3739

3840
/**
3941
* @brief The latest game state type.
4042
*/
41-
using GameStates = v0::GameStates;
43+
using GameStates = v1::GameStates;
4244

4345
/**
4446
* @brief The latest game state type.
4547
*/
46-
using GameState = v0::GameState;
48+
using GameState = v1::GameState;
4749

4850
/**
4951
* @brief The latest game state type.
5052
*/
51-
using Scripts = v0::Scripts;
53+
using Scripts = v1::Scripts;
5254
} // namespace RED4ext
5355

5456
/*
@@ -60,5 +62,5 @@ using Scripts = v0::Scripts;
6062
*/
6163
#ifndef RED4EXT_OFFSET_TO_ADDR
6264
#define RED4EXT_OFFSET_TO_ADDR(offset) \
63-
reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(GetModuleHandle(nullptr)) + offset)
65+
reinterpret_cast<void*>(reinterpret_cast<std::uintptr_t>(GetModuleHandle(nullptr)) + offset)
6466
#endif

include/RED4ext/Api/SemVer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3-
#include <RED4ext/Api/v0/SemVer.hpp>
3+
#include <RED4ext/Api/v1/SemVer.hpp>
44

55
/**
66
* @brief Creates a semantic version using the latest version info type.
77
*/
88
#define RED4EXT_SEMVER_EX(major, minor, patch, prereleaseType, prereleaseNumber) \
9-
RED4EXT_V0_SEMVER_EX(major, minor, patch, prereleaseType, prereleaseNumber)
9+
RED4EXT_V1_SEMVER_EX(major, minor, patch, prereleaseType, prereleaseNumber)
1010

1111
/**
1212
* @brief Creates a semantic version using the latest version info type.
1313
*/
14-
#define RED4EXT_SEMVER(major, minor, patch) RED4EXT_V0_SEMVER(major, minor, patch)
14+
#define RED4EXT_SEMVER(major, minor, patch) RED4EXT_V1_SEMVER(major, minor, patch)

include/RED4ext/Api/Version.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <RED4ext/Api/v0/Version.hpp>
3+
#include <RED4ext/Api/v1/Version.hpp>
44

55
/*
66
* The SDK is using only one API version, the reason behind that is that multiple versions for every structure is
@@ -14,18 +14,18 @@
1414
* backward compatible.
1515
*/
1616

17-
#define RED4EXT_API_VERSION_0 0
18-
#define RED4EXT_API_VERSION_LATEST RED4EXT_API_VERSION_0
17+
#define RED4EXT_API_VERSION_1 1
18+
#define RED4EXT_API_VERSION_LATEST RED4EXT_API_VERSION_1
1919

2020
/*
2121
* The SDK version, it is maninly used to reject loading plugin that are using a broken SDK version, while API version
2222
* is 0, it is used to load only plugins using the latest SDK version.
2323
*/
2424

25-
#define RED4EXT_SDK_0_1_0 RED4EXT_V0_SDK_0_1_0
26-
#define RED4EXT_SDK_0_2_0 RED4EXT_V0_SDK_0_2_0
27-
#define RED4EXT_SDK_0_3_0 RED4EXT_V0_SDK_0_3_0
28-
#define RED4EXT_SDK_0_4_0 RED4EXT_V0_SDK_0_4_0
29-
#define RED4EXT_SDK_0_5_0 RED4EXT_V0_SDK_0_5_0
25+
#define RED4EXT_SDK_0_1_0 RED4EXT_V1_SDK_0_1_0
26+
#define RED4EXT_SDK_0_2_0 RED4EXT_V1_SDK_0_2_0
27+
#define RED4EXT_SDK_0_3_0 RED4EXT_V1_SDK_0_3_0
28+
#define RED4EXT_SDK_0_4_0 RED4EXT_V1_SDK_0_4_0
29+
#define RED4EXT_SDK_0_5_0 RED4EXT_V1_SDK_0_5_0
3030

31-
#define RED4EXT_SDK_LATEST RED4EXT_V0_SDK_LATEST
31+
#define RED4EXT_SDK_LATEST RED4EXT_V1_SDK_LATEST

include/RED4ext/Api/v0/FileVer.hpp

Lines changed: 0 additions & 70 deletions
This file was deleted.

include/RED4ext/Api/v0/Runtime.hpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)