Skip to content

Commit 2092b8c

Browse files
Upd IV
1 parent 02b897e commit 2092b8c

File tree

8 files changed

+36
-1
lines changed

8 files changed

+36
-1
lines changed

plugin_IV/game_IV/CCam.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
#include "CCam.h"
88

9+
bool& CCam::bBlockCam = *gpatternt(bool, "80 3D ? ? ? ? ? 0F 85 ? ? ? ? 80 7C 24 ? ? 8B 86", 2);
10+
11+
912
void CCam::SetAsCurrent() {
1013
plugin::CallMethodDyn(gpattern("80 89 ? ? ? ? ? 8B 89"), this);
1114
}

plugin_IV/game_IV/CCam.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ class CCam {
126126
uint32_t field_448;
127127
uint8_t field_500[810];
128128

129+
public:
130+
static bool& bBlockCam;
131+
129132
public:
130133
virtual ~CCam() { plugin::CallVirtualMethod<0>(this, 0); }
131134
virtual void Update() { plugin::CallVirtualMethod<1>(this); }

plugin_IV/game_IV/CCamFollowVehicle.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
Do not delete this comment block. Respect others' work!
66
*/
77
#include "CCamFollowVehicle.h"
8+
9+
bool& CCamFollowVehicle::bProstituteCam = *gpatternt(bool, "80 3D ? ? ? ? ? F3 0F 10 44 24 ? F3 0F 11 05", 2);

plugin_IV/game_IV/CCamFollowVehicle.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
#include "CCam.h"
1010

1111
class CCamFollowVehicle : public CCam {
12-
12+
public:
13+
static bool& bProstituteCam;
1314
};

plugin_IV/game_IV/CHud.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ CSprite2d* CHud::Sprites = gpatternt(CSprite2d, "8D 8E ? ? ? ? E8 ? ? ? ? 83 C6
1010
CHudComponent** CHud::Components = gpatternt(CHudComponent*, "8B 3C B5 ? ? ? ? 85 FF 74 20", 3); // [67]
1111
int32_t& CHud::NumComponents = *gpatternt(int32_t, "C7 05 ? ? ? ? ? ? ? ? C7 05 ? ? ? ? ? ? ? ? E8 ? ? ? ? E9 ? ? ? ? CC CC CC", 2);
1212
bool& CHud::HideAllComponents = *gpatternt(bool, "80 3D ? ? ? ? ? 75 18 6A 00", 2);
13+
bool& CHud::HideAllComponentsThisFrame = *gpatternt(bool, "C6 05 ? ? ? ? ? C3 CC CC CC CC CC CC CC CC E9", 2);
1314
bool& CHud::DisplayAreaName = *gpatternt(bool, "C6 05 ? ? ? ? ? C6 05 ? ? ? ? ? C6 05 ? ? ? ? ? C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? E8", 2);

plugin_IV/game_IV/CHud.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class CHud {
5757
static CHudComponent** Components;
5858
static int32_t& NumComponents;
5959
static bool& HideAllComponents;
60+
static bool& HideAllComponentsThisFrame;
6061
static bool& DisplayAreaName;
6162

6263
public:

shared/Other.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,29 @@ bool plugin::CreateImageFromFile(std::string const& path, plugin::Image*& img) {
8181
return false;
8282
}
8383

84+
bool plugin::CreateImageFromMemory(std::string const& name, void* data, unsigned long size, class Image*& img) {
85+
int32_t w, h, c;
86+
uint8_t* p = stbi_load_from_memory(
87+
reinterpret_cast<unsigned char*>(data),
88+
size,
89+
&w, &h, &c, 4
90+
);
91+
92+
if (p) {
93+
if (!img)
94+
img = new plugin::Image();
95+
96+
img->width = w;
97+
img->height = h;
98+
img->channels = c;
99+
img->pixels = p;
100+
101+
return true;
102+
}
103+
104+
return false;
105+
}
106+
84107
#if _HAS_CXX17
85108
std::vector<std::string> plugin::GetAllFilesInFolder(std::string const& path, std::string const& ext, bool includePath) {
86109
std::vector<std::string> files = {};

shared/Other.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ namespace plugin {
7171
std::string WtoA(std::wstring const &str);
7272

7373
bool CreateImageFromFile(std::string const& path, class Image*& img);
74+
bool CreateImageFromMemory(std::string const& name, void* data, unsigned long size, class Image*& img);
7475

7576
#if _HAS_CXX17
7677
std::vector<std::string> GetAllFilesInFolder(std::string const& path, std::string const& ext, bool includePath = false);

0 commit comments

Comments
 (0)