Small Changes
This commit is contained in:
parent
e7b0932f60
commit
d289f40a5e
@ -7,10 +7,12 @@
|
|||||||
|
|
||||||
// Change Grass Color
|
// Change Grass Color
|
||||||
static int32_t get_color(LevelSource *level_source, int32_t x, int32_t z) {
|
static int32_t get_color(LevelSource *level_source, int32_t x, int32_t z) {
|
||||||
|
// Get Biome
|
||||||
const Biome *biome = level_source->getBiome(x, z);
|
const Biome *biome = level_source->getBiome(x, z);
|
||||||
if (biome == nullptr) {
|
if (biome == nullptr) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
// Return
|
||||||
return biome->color;
|
return biome->color;
|
||||||
}
|
}
|
||||||
#define BIOME_BLEND_SIZE 7
|
#define BIOME_BLEND_SIZE 7
|
||||||
|
@ -26,7 +26,7 @@ static void Minecraft_tick_injection(const Minecraft *minecraft) {
|
|||||||
|
|
||||||
// Store Texture Sizes
|
// Store Texture Sizes
|
||||||
struct texture_data {
|
struct texture_data {
|
||||||
GLint id;
|
GLuint id;
|
||||||
GLsizei width;
|
GLsizei width;
|
||||||
GLsizei height;
|
GLsizei height;
|
||||||
};
|
};
|
||||||
@ -37,7 +37,7 @@ static std::vector<texture_data> &get_texture_data() {
|
|||||||
HOOK(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)) {
|
HOOK(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)) {
|
||||||
// Store
|
// Store
|
||||||
texture_data data = {};
|
texture_data data = {};
|
||||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &data.id);
|
glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &data.id);
|
||||||
data.width = width;
|
data.width = width;
|
||||||
data.height = height;
|
data.height = height;
|
||||||
get_texture_data().push_back(data);
|
get_texture_data().push_back(data);
|
||||||
@ -48,7 +48,7 @@ HOOK(glTexImage2D, void, (GLenum target, GLint level, GLint internalformat, GLsi
|
|||||||
HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) {
|
HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) {
|
||||||
// Remove Old Data
|
// Remove Old Data
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
const GLint id = textures[i];
|
const GLuint id = textures[i];
|
||||||
std::vector<texture_data>::iterator it = get_texture_data().begin();
|
std::vector<texture_data>::iterator it = get_texture_data().begin();
|
||||||
while (it != get_texture_data().end()) {
|
while (it != get_texture_data().end()) {
|
||||||
const texture_data data = *it;
|
const texture_data data = *it;
|
||||||
@ -63,7 +63,7 @@ HOOK(glDeleteTextures, void, (GLsizei n, const GLuint *textures)) {
|
|||||||
// Call Original Method
|
// Call Original Method
|
||||||
real_glDeleteTextures()(n, textures);
|
real_glDeleteTextures()(n, textures);
|
||||||
}
|
}
|
||||||
static void get_texture_size(const GLint id, GLsizei *width, GLsizei *height) {
|
static void get_texture_size(const GLuint id, GLsizei *width, GLsizei *height) {
|
||||||
// Iterate
|
// Iterate
|
||||||
std::vector<texture_data>::iterator it = get_texture_data().begin();
|
std::vector<texture_data>::iterator it = get_texture_data().begin();
|
||||||
while (it != get_texture_data().end()) {
|
while (it != get_texture_data().end()) {
|
||||||
|
@ -15,6 +15,7 @@ virtual-method float getCreatureProbability() = 0x20;
|
|||||||
|
|
||||||
property int color = 0x2c;
|
property int color = 0x2c;
|
||||||
property int leaf_color = 0x34;
|
property int leaf_color = 0x34;
|
||||||
|
property std::string name = 0x28;
|
||||||
|
|
||||||
// This is a Biome*[64x64], temp x humidity
|
// This is a Biome*[64x64], temp x humidity
|
||||||
static-property Biome *map[4096] = 0x17c970;
|
static-property Biome *map[4096] = 0x17c970;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
method void tick(bool param_1) = 0x531c4;
|
method void tick(bool param_1) = 0x531c4;
|
||||||
method int loadAndBindTexture(const std::string &name) = 0x539cc;
|
method uint loadAndBindTexture(const std::string &name) = 0x539cc;
|
||||||
method int assignTexture(const std::string &name, uchar *data) = 0x5354c;
|
method uint loadTexture(const std::string &name, bool param_1) = 0x53800;
|
||||||
|
method uint assignTexture(const std::string &name, uchar *data) = 0x5354c;
|
||||||
method void addDynamicTexture(DynamicTexture *texture) = 0x534f8;
|
method void addDynamicTexture(DynamicTexture *texture) = 0x534f8;
|
||||||
method Texture *getTemporaryTextureData(uint id) = 0x53168;
|
method Texture *getTemporaryTextureData(uint id) = 0x53168;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user